PHP code example of okashoi / laravel5-conoha-object-handler

1. Go to this page and download the library: Download okashoi/laravel5-conoha-object-handler 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/ */

    

okashoi / laravel5-conoha-object-handler example snippets


    'providers' => [
        // ...
        Okashoi\Laravel5ConohaObjectHandler\ConohaObjectServiceProvider::class,
    ]

use Okashoi\Laravel5ConohaObjectHandler\ObjectHandler;
 
$handler = new ObjectHandler();

use Okashoi\Laravel5ConohaObjectHandler\ObjectHandler;
 
// cache the auth token with key 'conoha_token'
$handler = new ObjectHandler('conoha_token');
  
$objects = $handler->getList('container_name');
  
$handler->upload('container_name', 'object_name.txt', '/path/to/file/to/upload.txt', 'text/plain');
  
$response = $handler->download('container_name', 'object_name.txt');

echo $response->getBody();
      
$response = $handler->download('container_name', 'object_name.txt');
 
return reponse($response->getBody())->header('Content-Type', $response->getHeader('Content-Type'));

$handler->delete('container_name', 'object_name.txt');
sh
php artisan vendor:publish --provider="Okashoi\Laravel5ConohaObjectHandler\ConohaObjectServiceProvider"