Download the PHP package bag/digitalocean-spaces-helpers without Composer

On this page you can find all versions of the php package bag/digitalocean-spaces-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package digitalocean-spaces-helpers

DigitalOcean Spaces Helpers

Helper classes to interact with DigitalOcean spaces object storage using the AWS S3 SDK and Symfony HttpClient.

This library provides common functionality in regards to creating, deleting, and listing Spaces and objects. This library will also facilitate uploading and downloading objects.

This library is fairly new and the api for various methods could change in the upcoming future. I will do my best to document all changes and not introduce breaking changes without notice.

Requirements

Installation

To run the test suite from a source checkout:

Upcoming

Classes

BAG\Spaces\Client

Main client class that can be used to manage spaces and objects.

Constants

Name Type Optional Description
$key string false Spaces api key
$secret string false Spaces api secret
$region string false Spaces region, eg. nyc1

Create space.

Returns true if space was created, false if it already existed and on failure.

Name Type Optional Description
$name string false Name of space

Delete space.

Returns true if the space was deleted, false otherwise.

Name Type Optional Description
$name string true Name of space

Get list of spaces.

Returns array of available spaces.

Name Type Optional Description
$names bool true Return names only

Check if space exists.

Returns true if space exists, false otherwise.

Name Type Optional Description
$space string false Name of space

Get one page of objects. This method preserves the original API and performs a single ListObjectsV2 request; it does not traverse additional pages.

Returns array of objects, false on failure.

Name Type Optional Description
$space string false Name of space
$keys bool true Return keys only
$arguments array true Additional api arguments

Get one cursor-addressable page of objects. This uses legacy ListObjects and its Marker cursor because DigitalOcean documents ListObjectsV2 pagination as unsupported. Pass the returned nextCursor to the next call.

Returns an array with items, isTruncated, and nextCursor, or false on request failure.

Lazily iterate over object pages using legacy marker pagination. maxItems and maxPages provide hard limits; a missing or repeated continuation marker throws RuntimeException instead of looping indefinitely.

listFoldersPage() and iterateFolders() provide the equivalent behavior for folder prefixes. See DigitalOcean's Spaces limits documentation for the compatibility note.

Get exact object metadata using HeadObject.

Returns an array, null if not found, or false on another request failure. The array includes Key and Size compatibility fields in addition to the metadata returned by HeadObject.

Name Type Optional Description
$space string false Name of space
$key string false Object key
$arguments array true Additional api arguments

Check if object exists.

Returns true if object exists, false otherwise.

Name Type Optional Description
$space string false Name of space
$key string false Object key

Get an objects ACL.

Return string or false on failure.

Name Type Optional Description
$space string false Name of space
$key string false Object key

Set an objects ACL.

Returns true or false on failure.

Name Type Optional Description
$space string false Name of space
$key string false Object key
$acl string false ACL value

Upload content.

Return key as string if successful or false on failure.

Name Type Optional Description
$space string false Name of space
$key string false Object key
$content string
resource
Psr\Http\Message\StreamInterface
false Content to add
$public bool true Object is public
$arguments array true Additional api arguments

Upload file.

Return key as string if successful or false on failure.

Name Type Optional Description
$space string false Name of space
$key string false Object key
$file string false File path on disk
$public bool true Object is public
$arguments array true Additional api arguments

Multipart file upload.

Return key as string if successful or false on failure.

Name Type Optional Description
$space string false Name of space
$key string false Object key
$file string false File path on disk
$public bool true Object is public
$arguments array true Additional api arguments

Downloads a file locally.

Returns true if file downloaded successfully or false on failure.

Name Type Optional Description
$space string false Name of space
$key string false Object key
$destination string false File destination

Get object public URL.

Returns a URL string.

Name Type Optional Description
$space string false Name of space
$key string false Object key

Generate a presigned download URL.

Returns presigned download URL as a string.

Name Type Optional Description
$space string false Name of space
$key string false Object key
$duration string true Length of time URL is valid, eg. '+5 minutes'

Generate a presigned upload URL.

Returns presigned upload URL as a string.

Name Type Optional Description
$space string false Name of space
$key string false Object key
$duration string true Length of time URL is valid, eg. '+5 minutes'
$contentType string null true Content type that the upload request must use

Delete object.

Returns true on success, false on failure.

Name Type Optional Description
$space string false Name of space
$key string false Object key

Get base key. Similar to PHP dirname().

Returns string.

Name Type Optional Description
$key string false Object key

Verify HTTP result has particular property.

Name Type Optional Description
&$request object false Api result
$key string false Value key
$default mixed true Default value

Create an authorization signature header.

Returns an array. First item being an array of headers use for api authorization, second item is the headers compiled to a string.

Name Type Optional Description
$arguments array false Arguments required to construct signature

Get S3Client instance.

Returns S3Client.

static

Create S3Client.

Returns S3Client instance.

Name Type Optional Description
$key string false Spaces api key
$secret string false Spaces api secret
$endpoint string false Api endpoint

static

Create Spaces Client.

Returns Client instance.

Name Type Optional Description
$key string false Spaces api key
$secret string false Spaces api secret
$region string false Spaces region, eg. nyc1

BAG\Spaces\Space

Space class that can be used to manage a single space and its objects.

Constants

Name Type Optional Description
$space string false Name of space
$key string false Spaces api key
$secret string false Spaces api secret
$region string false Spaces region, eg. nyc1
$create string true Create space if non-existent

Get one page of objects. This method does not traverse additional pages.

Returns array of objects, false on failure.

Name Type Optional Description
$keys bool true Return keys only
$arguments array true Additional api arguments

Get one page using legacy marker pagination. Returns items, isTruncated, and nextCursor, or false on failure.

Lazily iterate over object pages with explicit item and page safety limits. listFoldersPage() and iterateFolders() provide the same behavior for folder prefixes.

Get exact object metadata using HeadObject.

Returns an array, null if not found, or false on another request failure.

Name Type Optional Description
$key string false Object key
$arguments array true Additional api arguments

Check if object exists.

Returns true if object exists, false otherwise.

Name Type Optional Description
$key string false Object key

Get an objects ACL.

Return string or false on failure.

Name Type Optional Description
$key string false Object key

Set an objects ACL.

Returns true or false on failure.

Name Type Optional Description
$key string false Object key
$acl string false ACL value

Upload content.

Return key as string if successful or false on failure.

Name Type Optional Description
$key string false Object key
$content string
resource
Psr\Http\Message\StreamInterface
false Content to add
$public bool true Object is public
$arguments array true Additional api arguments

Upload file.

Return key as string if successful or false on failure.

Name Type Optional Description
$key string false Object key
$file string false File path on disk
$public bool true Object is public
$arguments array true Additional api arguments

Multipart file upload.

Return key as string if successful or false on failure.

Name Type Optional Description
$key string false Object key
$file string false File path on disk
$public bool true Object is public
$arguments array true Additional api arguments

Downloads a file locally.

Returns true if file downloaded successfully or false on failure.

Name Type Optional Description
$key string false Object key
$destination string false File destination

Get object public URL.

Returns a URL string.

Name Type Optional Description
$key string false Object key

Generate a presigned download URL.

Returns presigned download URL as a string.

Name Type Optional Description
$key string false Object key
$duration string true Length of time URL is valid, eg. '+5 minutes'

Generate a presigned upload URL.

Returns presigned upload URL as a string.

Name Type Optional Description
$key string false Object key
$type string false Content type that the upload request must use
$duration string true Length of time URL is valid, eg. '+5 minutes'

Delete object.

Returns true on success, false on failure.

Name Type Optional Description
$key string false Object key

Get base key. Similar to PHP dirname().

Returns string.

Name Type Optional Description
$key string false Object key

Get Client instance.

Returns Client.

BAG\Spaces\Authorization

Class that assists with generating http authorization headers.

Name Type Optional Description
$key string false Spaces api key
$secret string false Spaces api secret

Create authorization headers and return full set of headers generated.

Returns an array. First item being an array of headers use for api authorization, second item is the headers compiled to a string.

Name Type Optional Description
$arguments array false Request arguments

All versions of digitalocean-spaces-helpers with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
aws/aws-sdk-php Version ^3.222
symfony/http-client Version ^5.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bag/digitalocean-spaces-helpers contains the following files

Loading the files please wait ...