easmith / selectel-storage
Selectel Storage API php wrapper
Installs: 42 705
Dependents: 1
Suggesters: 0
Security: 0
Stars: 44
Watchers: 9
Forks: 17
Open Issues: 4
Requires
- php: >=5.4
This package is auto-updated.
Last update: 2024-11-04 23:24:30 UTC
README
composer.json
"require": { "easmith/selectel-storage": "~1.0", }
<?php require_once("vendor/autoload.php"); $selectelStorage = new SelectelStorage("User", "Pass");
Create Container
$container = $selectelStorage->createContainer('selectel', array("X-Container-Meta-Type: public")); // get container info $container->getInfo()
Containers list
$containerList = $selectelStorage->listContainers();
Create directory
$container->createDirectory('php/test')
List
$dirList = $container->listFiles($limit = 10000, $marker = null, $prefix = null, $path = ""); // files $fileList = $container->listFiles($limit = 10000, $marker = null, $prefix = null, $path = 'php/');
Put File
$res = $container->putFile(__FILE__, 'example.php',["Content-Type: text/html"]);
File info
$fileInfo = $container->getFileInfo('example.php');
Get file
$file = $container->getFile($fileList[0]);
Copy file
$copyRes = $container->copy('example.php', 'php/test/Examples_copy.php5');
Delete
$deleteRes = $container->delete('example.php');