PHP code example of easmith / selectel-storage

1. Go to this page and download the library: Download easmith/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/ */

    

easmith / selectel-storage example snippets




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

$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');