raoptimus / yii2-openstack
Openstack/swift client for Yii2 Framework
Installs: 440
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 1
Open Issues: 3
Type:yii2-extension
Requires
- php: >=7.1.0
- ext-fileinfo: *
- guzzlehttp/guzzle: ~6.0
- yiisoft/yii2: ^2.0.14
Requires (Dev)
- phpunit/phpunit: 7.*
- roave/security-advisories: dev-master
This package is auto-updated.
Last update: 2025-01-19 23:42:04 UTC
README
yii2-openstack
Openstack / swift client for Yii2 Framework
Installation
Install with composer:
composer require raoptimus/yii2-openstack
Usage samples
Configuration
$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');
Use connection
$swift = \Yii::$app->get('swift'); $container = $swift->getContainer('name of container');
Push file to swift storage
$container->pushObject($source, $target);
Pull file from swift storage
$container->pullObject($source, $target);
Get stat of file from swift storage
$container->getObject($filename);
Exists file in swift storage
$container->existsObject($filename);
Delete file from swift storage
$container->deleteObject($filename);