14/04
2016
Selectel Storage API php wrapper
composer.json, (*1)
"require": { "slowprog/selectel-storage": "~1.0", }
<?php require_once("vendor/autoload.php"); $selectelStorage = new SelectelStorage("User", "Pass");
$container = $selectelStorage->createContainer('selectel', array("X-Container-Meta-Type: public")); // get container info $container->getInfo()
$containerList = $selectelStorage->listContainers();
$container->createDirectory('php/test')
$dirList = $container->listFiles($limit = 10000, $marker = null, $prefix = null, $path = ""); // files $fileList = $container->listFiles($limit = 10000, $marker = null, $prefix = null, $path = 'php/');
$res = $container->putFile(__FILE__, 'example.php');
$fileInfo = $container->getFileInfo('example.php');
$file = $container->getFile($fileList[0]);
$copyRes = $container->copy('example.php', 'php/test/Examples_copy.php5');
$deleteRes = $container->delete('example.php');