PHP code example of raoptimus / yii2-openstack

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

    

raoptimus / yii2-openstack example snippets


$swift = new raoptimus\openstack\Connection(
    new raoptimus\openstack\Options(
        [
            'authUrl' => 'https://somedomain.com:5000/v2.0',
            'username' => '',
            'apiKey' => '',
            'tenant' => '',
            'domain' => '',
            'domainId' => '',
        ]
    )
);
$container = $swift->getContainer('name of container');

$swift = \Yii::$app->get('swift');
$container = $swift->getContainer('name of container');

$container->pushObject($source, $target);

$container->pullObject($source, $target);

$container->getObject($filename);

$container->existsObject($filename);

$container->deleteObject($filename);