akbaraditamasp / cloudpro-php
PHP Library for CloudPRO Storage System
v1.0.7
2023-07-12 09:14 UTC
Requires
- guzzlehttp/guzzle: ^7.5
README
This library is the abstraction of CloudPRO API for access from applications written with PHP.
Installation
composer require akbaraditamasp/cloudpro-php
Usage
Create Box
Before creating a box, make sure you have created and obtained an access key from the app.
$response = CloudPRO::begin()->useAppAccess("YOUR ACCESS KEY")->storeBox("Box Name");
Create Folder
Use the box token that you got when you made the box.
$response = CloudPRO::begin()->useBoxToken("BOX TOKEN")->storeFolder("FOLDER NAME", $options);
Store File
$response = CloudPRO::begin()->useBoxToken("BOX TOKEN")->storeFile("FILE NAME", "PATH", $options);
Show Node
If the node key is a folder, then you will get a response detailing the folder and its childrens. But if the node key is a file, then you will get a file url response.
$response = CloudPRO::begin()->useBoxToken("BOX TOKEN")->showNode("NODE KEY");
Rename Node
$response = CloudPRO::begin()->useBoxToken("BOX TOKEN")->renameNode("NODE KEY","NEW NAME");
Move Node
$response = CloudPRO::begin()->useBoxToken("BOX TOKEN")->moveNode("NODE KEY","PARENT KEY");
Copy Node
$response = CloudPRO::begin()->useBoxToken("BOX TOKEN")->copyNode("NODE KEY","PARENT KEY");
Delete Node
$response = CloudPRO::begin()->useBoxToken("BOX TOKEN")->deleteNode("NODE KEY");