https://github.com/raoptimus/yii2-openstack
Openstack / swift client for Yii2 Framework
https://github.com/raoptimus/yii2-openstack
php swift-client swift-storage yii2 yii2-extension yii2-openstack yii2-openstack-client yii2-swift yii2-swift-client
Last synced: about 1 month ago
JSON representation
Openstack / swift client for Yii2 Framework
- Host: GitHub
- URL: https://github.com/raoptimus/yii2-openstack
- Owner: raoptimus
- License: bsd-3-clause
- Created: 2018-10-07T18:56:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-19T19:20:45.000Z (about 2 years ago)
- Last Synced: 2025-04-12T22:55:22.282Z (about 1 month ago)
- Topics: php, swift-client, swift-storage, yii2, yii2-extension, yii2-openstack, yii2-openstack-client, yii2-swift, yii2-swift-client
- Language: PHP
- Homepage:
- Size: 102 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://packagist.org/packages/raoptimus/yii2-openstack)
[](https://packagist.org/packages/raoptimus/yii2-openstack)
[](https://packagist.org/packages/raoptimus/yii2-openstack)
[](https://packagist.org/packages/raoptimus/yii2-openstack)
[](https://travis-ci.com/raoptimus/yii2-openstack)# yii2-openstack
Openstack / swift client for Yii2 Framework## Installation
Install with composer:
```bash
composer require raoptimus/yii2-openstack
```## Usage samples
Configuration
```php
$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
```php
$swift = \Yii::$app->get('swift');
$container = $swift->getContainer('name of container');
```Push file to swift storage
```php
$container->pushObject($source, $target);
```Pull file from swift storage
```php
$container->pullObject($source, $target);
```Get stat of file from swift storage
```php
$container->getObject($filename);
```Exists file in swift storage
```php
$container->existsObject($filename);
```Delete file from swift storage
```php
$container->deleteObject($filename);
```