Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 months 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 (over 1 year ago)
- Last Synced: 2024-10-01T14:25:06.593Z (3 months 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: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[![Stable Version](https://poser.pugx.org/raoptimus/yii2-openstack/v/stable)](https://packagist.org/packages/raoptimus/yii2-openstack)
[![Untable Version](https://poser.pugx.org/raoptimus/yii2-openstack/v/unstable)](https://packagist.org/packages/raoptimus/yii2-openstack)
[![License](https://poser.pugx.org/raoptimus/yii2-openstack/license)](https://packagist.org/packages/raoptimus/yii2-openstack)
[![Total Downloads](https://poser.pugx.org/raoptimus/yii2-openstack/downloads)](https://packagist.org/packages/raoptimus/yii2-openstack)
[![Build Status](https://travis-ci.com/raoptimus/yii2-openstack.svg?branch=master)](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);
```