API > eden > amazon > s3.php
View Source

class Eden_Amazon_S3

Amazon S3

Constants

  • ACL_PRIVATE: private
  • ACL_PUBLIC_READ: public-read
  • ACL_PUBLIC_READ_WRITE: public-read-write
  • ACL_AUTHENTICATED_READ: authenticated-read
  • GET: GET
  • PUT: PUT
  • DELETE: DELETE
  • HEAD: HEAD

Public Methods

public function addBucket($bucket, $location = false)

Put a bucket

Arguments

  1. string Bucket name
  2. string Set as "EU" to create buckets hosted in Europe

Returns boolean

public function addFile($bucket, $path, $data, $permission = self::ACL_PRIVATE, $metaData = array())

Put an object

Arguments

  1. string Bucket name
  2. string Object URI
  3. string
  4. string
  5. array

Returns array

public function deleteBucket($bucket)

Delete an empty bucket

Arguments

  1. string Bucket name

Returns array

public function deleteFile($bucket, $path)

Delete an object

Arguments

  1. string Bucket name
  2. string Object URI

Returns array

public function deleteFolder($bucket, $path)

Delete an object

Arguments

  1. string Bucket name
  2. string Object URI

Returns boolean

public function getBucket($name, $prefix = NULL, $marker = NULL, $maxKeys = NULL, $delimiter = NULL)

Get contents for a bucket. If maxKeys is NULL this method will loop through truncated result sets

Arguments

  1. string Bucket name
  2. string Prefix
  3. string Marker (last file listed)
  4. string Max keys (maximum number of keys to return)
  5. string Delimiter

Returns array

public function getBuckets()

Get a list of buckets

Returns array

public function getFile($bucket, $path)

Get an object

Arguments

  1. string $bucket Bucket name
  2. string $uri Object URI
  3. mixed $saveTo Filename or resource to write to

Returns array

public function getFileInfo($bucket, $path)

Get object information

Arguments

  1. string Bucket name
  2. string Object URI

Returns array

public function getFiles($bucket, $path = NULL, $prefix = NULL, $marker = NULL, $maxKeys = NULL, $delimiter = NULL)

Get files for a bucket given a path If maxKeys is NULL this method will loop through truncated result sets

Arguments

  1. string Bucket name
  2. string Prefix
  3. string Marker (last file listed)
  4. string Max keys (maximum number of keys to return)
  5. string Delimiter
  6. boolean Set to true to return CommonPrefixes

Returns array

public function getFolders($bucket, $path = NULL, $prefix = NULL, $marker = NULL, $maxKeys = NULL, $delimiter = NULL)

Get folders given a path If maxKeys is NULL this method will loop through truncated result sets

Arguments

  1. string Bucket name
  2. string path
  3. string Prefix
  4. string Marker (last file listed)
  5. string Max keys (maximum number of keys to return)
  6. string Delimiter
  7. boolean Set to true to return CommonPrefixes

Returns array

public function getFolderSize($bucket, $path)

Gets the size of a folder

Arguments

  1. string $bucket Bucket name
  2. string $uri Object URI

Returns boolean

public function getMeta($key = NULL)

Returns the meta of the last call

Returns array

public function getPermissions($bucket, $path = '/')

Get object or bucket Access Control Policy

Arguments

  1. string Bucket name
  2. string Object URI

Returns array

public function setPermissions($bucket, $path = '/', array $acp = array())

Set object or bucket Access Control Policy

Arguments

  1. string Bucket name
  2. string Object URI
  3. array Access Control Policy Data (same as the data returned from getAccessControlPolicy)

Returns boolean


© 2012 Openovate Labs. All rights reserved.