PHP code example of axelpal / selectel-storage

1. Go to this page and download the library: Download axelpal/selectel-storage library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

axelpal / selectel-storage example snippets




    
orage = new axelpal\selectel\storage\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',["Content-Type: text/html"]);

$fileInfo = $container->getFileInfo('example.php');

$file = $container->getFile($fileList[0]);

$copyRes = $container->copy('example.php', 'php/test/Examples_copy.php');

$copyRes = $container->createLink('links/example.php', 'example.php');

$deleteRes = $container->delete('example.php');

$format = null;
$timeoutInMilliseconds = 5000;
$selectelStorage = new axelpal\selectel\storage\SelectelStorage("user", "pass", $format, $timeoutInMilliseconds);