2017 © Pedro Peláez
 

library selectel

Laravel Package for Selectel API cloud storage (selectel.com)

image

chipk4/selectel

Laravel Package for Selectel API cloud storage (selectel.com)

  • Sunday, March 26, 2017
  • by chipk4
  • Repository
  • 3 Watchers
  • 4 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 11 % Grown

The README.md

Selectel cloud storage API (selectel.com) for Laravel 5

GitHub release Software License, (*1)

This package provides an easy way to integrate Selectel Cloud Storage API with Laravel 5. Here are some examples of what you can do with the package:, (*2)


SelectelApi::storageInfo(); //You may use virtual folders like 'newFolder/newFileName.jpg' SelectelApi::storeFile('container', 'filePath/1243.jpg', 'newFileName.jpg') SelectelApi::containerInfo('your_container') SelectelApi::storageContainerList() /* * You can use private or public container type * Public container present by default * For private container use */ SelectelApi::getFile('container', 'fileName', true); //For public container SelectelApi::getFile('container', 'fileName'); SelectelApi::containerFileList('container_name'); //If you want to do something else, you can get an instance of the underlying API: SelectelApi::getApi();

Installation

You can install this package via Composer using:, (*3)

composer require chipk4/selectel

You must also install this service provider., (*4)

// config/app.php
'providers' => [
    ...
    Chipk4\Selectel\SelectelApiServiceProvider::class,
    ...
];

If you want to make use of the facade you must install it as well., (*5)

// config/app.php
'aliases' => [
    ..
    'SelectelApi' => Chipk4\Selectel\SelectelApiFacade::class,
];

To publish the config file to app/config/selectel-api.php run:, (*6)

php artisan vendor:publish --provider="Chipk4\Selectel\SelectelApiServiceProvider"

This will publish a file selectel-api.php in your config directory with the following contents:, (*7)

return [
    /*
     * This is agreement number from system
     */
    'authUser' => env('SELECTEL_LOGIN'),

    /*
     * Password for cloud storage service.
     * Note: it's different with account password
     */
    'authKey' => env('SELECTEL_PASSWORD'),

    /*
     * API url
     */
    'apiUrl' => 'https://auth.selcdn.ru/',

    /*
     * Default value for request timeout
     */
    'timeout' => 10,

    /*
     * Default storage url
     */
    'storageUrl' => env('SELECTEL_STORAGE_URL', ''),

    /*
     * Response view
     * Can be in json or xml
     */
    'returnView' => env('SELECTEL_RETURN_VIEW', 'json'),

];

Usage

With Facade

  use SelectelApi;

  SelectelApi::getFile('container', 'fileName');

With Service Container

    use Chipk4\Selectel\CloudStorage;

    public function test(CloudStorage $storage) 
    {
        $storage->getFile('container', 'fileName');
    }

License

The MIT License (MIT). Please see License File for more information., (*8)

The Versions

26/03 2017

dev-master

9999999-dev https://github.com/chipk4/selectel-cloud-storage

Laravel Package for Selectel API cloud storage (selectel.com)

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

by Andrew Chirskiy

laravel selectel

26/03 2017

v0.4

0.4.0.0 https://github.com/chipk4/selectel-cloud-storage

Laravel Package for Selectel API cloud storage (selectel.com)

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

by Andrew Chirskiy

laravel selectel

24/03 2017

v0.3

0.3.0.0 https://github.com/chipk4/selectel-cloud-storage

Laravel Package for Selectel API cloud storage (selectel.com)

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

by Andrew Chirskiy

laravel selectel

22/03 2017

v0.2

0.2.0.0 https://github.com/chipk4/selectel-cloud-storage

Laravel Package for Selectel API cloud storage (selectel.com)

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

by Andrew Chirskiy

laravel selectel

22/03 2017

v0.2-beta

0.2.0.0-beta https://github.com/chipk4/selectel-cloud-storage

Laravel Package for Selectel API cloud storage (selectel.com)

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

by Andrew Chirskiy

laravel selectel

22/03 2017

v0.1

0.1.0.0 https://github.com/chipk4/selectel-cloud-storage

Package for Selectel API cloud storage (selectel.com)

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

by Andrew Chirskiy

laravel selectel