use SpacesAPI\Spaces;
$spaces = new Spaces('api-key', 'api-secret');
$space = $spaces->space('space-name');
API docs for \SpacesAPI\Spaces
$spaces = new Spaces('api-key', 'api-secret');
$space = $spaces->create('new-space-name');
$space = new Spaces('api-key', 'api-secret')->space('my-space-name');
$files = $space->listFiles();
foreach ($files['files'] as $file) {
echo "{$file->filename}\n";
}
$space = new Spaces('api-key', 'api-secret')->space('my-space-name');
$file = $space->uploadFile('./localfile.txt', 'remote-filename.txt');
$space = new Spaces('api-key', 'api-secret')->space('my-space-name');
$file = $space->uploadText('Lorem ipsum', 'remote-filename.txt');
$space = new Spaces('api-key', 'api-secret')->space('my-space-name');
$space->file('filename.txt')->download('./localfile.txt');
API docs for downloading a file
$space = new Spaces('api-key', 'api-secret')->space('my-space-name');
echo $space->file('filename.txt')->getContents();
API docs for getting the contents of a file
$space = new Spaces('api-key', 'api-secret')->space('my-space-name');
$space->file('filename.txt')->delete();
$space = new Spaces('api-key', 'api-secret')->space('my-space-name');
$space->file('filename.txt')->getURL();
API docs for getting the public URL
$space = new Spaces('api-key', 'api-secret')->space('my-space-name');
$space->file('filename.txt')->getSignedURL("1 day");
API docs for getting a signed URL
$space = new Spaces('api-key', 'api-secret')->space('my-space-name');
$space->file('filename.txt')->makePublic();