2017 © Pedro Peláez
 

library spaces-api

An API wrapper for DigitalOcean's Spaces object storage designed for easy use.

image

sociallydev/spaces-api

An API wrapper for DigitalOcean's Spaces object storage designed for easy use.

  • Tuesday, July 31, 2018
  • by SociallyDev
  • Repository
  • 12 Watchers
  • 41 Stars
  • 252 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 16 Forks
  • 1 Open issues
  • 1 Versions
  • 180 % Grown

The README.md

This library is deprecated

We recommend using the official SDK or the Laravel package, (*1)

All issues will be closed and new PRs will not be accepted, (*2)

Installation

Install via composer, (*3)

composer require sociallydev/spaces-api

Quick start

Obtain API keys from the Digital Ocean Applications & API dashboard, (*4)

use SpacesAPI\Spaces;

// Connect to a space
$spaces = new Spaces('api-key', 'api-secret');
$space = $spaces->space('space-name');

// Download a file
$file = $space->file('remote-file-1.txt');
$file->download('local/file/path/file.txt');

// Upload text to a file
$file2 = $space->uploadText("Lorem ipsum","remote-file-2.txt");

// Get a signed public link, valid for 2 hours
$file2url = $file2->getSignedURL("2 hours");

// Make a copy
$file3 = $file2->copy('remote-file-3.txt');

// Move or rename a file
$file2->move('new-filename.txt')

// Make a file public and get the URL
$file3->makePublic();
$file3url = $file3->getURL();

See more examples in docs/Examples.md, (*5)

Upgrading?

Version 3 has many changes over version 2, so we have written a migration guide, (*6)

API reference

The Versions

31/07 2018

dev-master

9999999-dev

An API wrapper for DigitalOcean's Spaces object storage designed for easy use.

  Sources   Download

MIT

The Requires

 

by Devang Srivastava