2017 © Pedro Peláez
 

library remote-storage

Remote storage service client

image

treinetic/remote-storage

Remote storage service client

  • Monday, March 19, 2018
  • by imalhasaranga
  • Repository
  • 2 Watchers
  • 1 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Treinetic Remote Storage - PHP SDK

Treinetic remote storage (TRS) is a highly available cloud storage services. We provide 99.9% up time and multi regional backups. TRS provide sophisticated security compliances and it is optimized for high speed data delivery. For more details contact us via info@treinetic.com, (*1)

Installing

composer require treinetic/remote-storage

Usage

Initialization

Import StorageClient into your .php file, (*2)

use Treinetic\RStorage\StorageClient;

Then initialize the StorageClient. StorageClient's constructor accept 3 arguments. - URL endpoint of the remote server - accessKey enpoint access key - secretKey enpoint secret key, (*3)

$storageClient = new \Treinetic\RStorage\StorageClient($server,
                                                       $accessKey,
                                                       $secretKey);

Make Directory

$storageClient->makeDirectory("dirName");

Store files

$storageClient->put('./test/img.jpg', 'user/profile', 'my.jpg');
  • 1st parameeter is the local file path
  • 2nd parameter is the remote directory. (It will create a directory if not exists)
  • 3rd prarameter is the file name for remote file

Get Files

$response = $storageClient->get('user/profile/my.jpg');
file_put_contents('img.jpg', $response);

Copy Files

$storageClient->copy('user/profile/my.jpg', 'user/profile/copy.jpg');
  • 1st parameter is the source file
  • 2nd parameter is the destination file

Move Files

$storageClient->move('user/profile/my.jpg', 'user/profile/move.jpg');
  • 1st parameter is the source file
  • 2nd parameter is the destination file

Check if exists

$result = $storageClient->exists('user/profile/my.jpg');
var_dump($result); // true or false

Delete Files

$storageClient->delete('user/profile/my.jpg');

The Versions

19/03 2018

dev-master

9999999-dev

Remote storage service client

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Hasitha Mapalagama

19/03 2018

v0.1

0.1.0.0

Remote storage service client

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Hasitha Mapalagama