Property | Type | Description | |
---|---|---|---|
$defDelimiter | string | Default delimiter to be used, for example while getBucket(). | |
$endpoint | string | AWS URI | |
$proxy | null | array | Proxy information | |
$sslCACert | string | SSL CA cert (only required if you are having problems with your system CA cert) | |
$sslCert | string | SSL client certfificate | |
$sslKey | boolean | SSL client key | |
$useExceptions | boolean | Use PHP exceptions? | |
$useSSL | boolean | Connect using SSL? | |
$useSSLValidation | boolean | Use SSL validation? | |
$useSSLVersion | const | Use SSL version |
Method | Description | |
---|---|---|
__construct ( string $accessKey = null, string $secretKey = null, boolean $useSSL = false, string $endpoint = 's3.amazonaws.com' ) : void | Constructor - if you're not using the class statically | |
__getSignature ( string $string ) : string | Generate the auth string: "AWS AccessKey:Signature" | |
__getTime ( ) : integer | Get the current time | |
copyObject ( string $srcBucket, string $srcUri, string $bucket, string $uri, constant $acl = self::ACL_PRIVATE, array $metaHeaders = [], array $requestHeaders = [], constant $storageClass = self::STORAGE_CLASS_STANDARD ) : mixed | false | Copy an object | |
createDistribution ( string $bucket, boolean $enabled = true, array $cnames = [], string $comment = null, string $defaultRootObject = null, string $originAccessIdentity = null, array $trustedSigners = [] ) : array | false | Create a CloudFront distribution | |
deleteBucket ( string $bucket ) : boolean | Delete an empty bucket | |
deleteDistribution ( array $dist ) : boolean | Delete a CloudFront distribution | |
deleteObject ( string $bucket, string $uri ) : boolean | Delete an object | |
disableBucketLogging ( string $bucket ) : boolean | Disable bucket logging | |
freeSigningKey ( ) : void | Free signing key from memory, MUST be called if you are using setSigningKey() | |
getAccessControlPolicy ( string $bucket, string $uri = '' ) : mixed | false | Get object or bucket Access Control Policy | |
getAuthenticatedURL ( string $bucket, string $uri, integer $lifetime, boolean $hostBucket = false, boolean $https = false ) : string | Get a query string authenticated URL | |
getBucket ( string $bucket, string $prefix = null, string $marker = null, string $maxKeys = null, string $delimiter = null, boolean $returnCommonPrefixes = false ) : array | false | Get contents for a bucket | |
getBucketLocation ( string $bucket ) : string | false | Get a bucket's location | |
getBucketLogging ( string $bucket ) : array | false | Get logging status for a bucket | |
getDistribution ( string $distributionId ) : array | false | Get CloudFront distribution info | |
getDistributionInvalidationList ( string $distributionId ) : array | List your invalidation batches for invalidateDistribution() in a CloudFront distribution | |
getHttpUploadPostParams ( string $bucket, string $uriPrefix = '', constant $acl = self::ACL_PRIVATE, integer $lifetime = 3600, integer $maxFileSize = 5242880, string $successRedirect = "201", array $amzHeaders = [], array $headers = [], boolean $flashVars = false ) : object | Get upload POST parameters for form uploads | |
getObject ( string $bucket, string $uri, mixed $saveTo = false ) : mixed | Get an object | |
getObjectInfo ( string $bucket, string $uri, boolean $returnInfo = true ) : mixed | false | Get object information | |
getSignedCannedURL ( string $url, integer $lifetime ) : string | Get a CloudFront canned policy URL | |
getSignedPolicyURL ( array $policy ) : string | Get a CloudFront signed policy URL | |
hasAuth ( ) : boolean | Check if AWS keys have been set | |
inputFile ( string $file, mixed $md5sum = true ) : array | false | Create input info array for putObject() | |
inputResource ( string &$resource, integer $bufferSize = false, string $md5sum = '' ) : array | false | Create input array info for putObject() with a resource | |
invalidateDistribution ( string $distributionId, array $paths ) : boolean | Invalidate objects in a CloudFront distribution | |
listBuckets ( boolean $detailed = false ) : array | false | Get a list of buckets | |
listDistributions ( ) : array | Get a list of CloudFront distributions | |
listOriginAccessIdentities ( ) : array | List CloudFront Origin Access Identities | |
putBucket ( string $bucket, constant $acl = self::ACL_PRIVATE, string $location = false ) : boolean | Put a bucket | |
putObject ( mixed $input, string $bucket, string $uri, constant $acl = self::ACL_PRIVATE, array $metaHeaders = [], array $requestHeaders = [], constant $storageClass = self::STORAGE_CLASS_STANDARD, constant $serverSideEncryption = self::SSE_NONE ) : boolean | Put an object | |
putObjectFile ( string $file, string $bucket, string $uri, constant $acl = self::ACL_PRIVATE, array $metaHeaders = [], string $contentType = null ) : boolean | Put an object from a file (legacy function) | |
putObjectString ( string $string, string $bucket, string $uri, constant $acl = self::ACL_PRIVATE, array $metaHeaders = [], string $contentType = 'text/plain' ) : boolean | Put an object from a string (legacy function) | |
setAccessControlPolicy ( string $bucket, string $uri = '', array $acp = [] ) : boolean | Set object or bucket Access Control Policy | |
setAuth ( string $accessKey, string $secretKey ) : void | Set AWS access key and secret key | |
setBucketLogging ( string $bucket, string $targetBucket, string $targetPrefix = null ) : boolean | Set logging for a bucket | |
setBucketRedirect ( string $bucket = NULL, string $location = NULL ) : boolean | Set up a bucket redirection | |
setEndpoint ( string $host ) : void | Set the service endpoint | |
setExceptions ( boolean $enabled = true ) : void | Set the error mode to exceptions | |
setProxy ( string $host, string $user = null, string $pass = null, constant $type = CURLPROXY_SOCKS5 ) : void | Set proxy information | |
setSSL ( boolean $enabled, boolean $validate = true ) : void | Set SSL on or off | |
setSSLAuth ( string $sslCert = null, string $sslKey = null, string $sslCACert = null ) : void | Set SSL client certificates (experimental) | |
setSigningKey ( string $keyPairId, string $signingKey, boolean $isFile = true ) : boolean | Set signing key | |
setTimeCorrectionOffset ( string $offset ) : void | Set AWS time correction offset (use carefully) | |
updateDistribution ( array $dist ) : array | false | Update a CloudFront distribution |
Method | Description | |
---|---|---|
__getCloudFrontDistributionConfigXML ( string $bucket, boolean $enabled, string $comment, string $callerReference = '0', array $cnames = [], string $defaultRootObject = null, string $originAccessIdentity = null, array $trustedSigners = [] ) : string | Get a DistributionConfig DOMDocument | |
__getCloudFrontInvalidationBatchXML ( array $paths, integer $callerReference = '0' ) : string | Get a InvalidationBatch DOMDocument | |
__getCloudFrontResponse ( &$rest ) : object | Grab CloudFront response | |
__getHash ( string $string ) : string | Creates a HMAC-SHA1 hash | |
__getMIMEType ( &$file ) : string | Get MIME type for file | |
__parseCloudFrontDistributionConfig ( &$node ) : array | Parse a CloudFront distribution config | |
__triggerError ( string $message, string $file, integer $line, integer $code ) : void | Internal error handler |
public static __getSignature ( string $string ) : string | ||
$string | string | String to sign |
return | string |
public static copyObject ( string $srcBucket, string $srcUri, string $bucket, string $uri, constant $acl = self::ACL_PRIVATE, array $metaHeaders = [], array $requestHeaders = [], constant $storageClass = self::STORAGE_CLASS_STANDARD ) : mixed | false | ||
$srcBucket | string | Source bucket name |
$srcUri | string | Source object URI |
$bucket | string | Destination bucket name |
$uri | string | Destination object URI |
$acl | constant | ACL constant |
$metaHeaders | array | Optional array of x-amz-meta-* headers |
$requestHeaders | array | Optional array of request headers (content type, disposition, etc.) |
$storageClass | constant | Storage class constant |
return | mixed | false | | false |
public static createDistribution ( string $bucket, boolean $enabled = true, array $cnames = [], string $comment = null, string $defaultRootObject = null, string $originAccessIdentity = null, array $trustedSigners = [] ) : array | false | ||
$bucket | string | Bucket name |
$enabled | boolean | Enabled (true/false) |
$cnames | array | Array containing CNAME aliases |
$comment | string | Use the bucket name as the hostname |
$defaultRootObject | string | Default root object |
$originAccessIdentity | string | Origin access identity |
$trustedSigners | array | Array of trusted signers |
return | array | false | | false |
public static deleteBucket ( string $bucket ) : boolean | ||
$bucket | string | Bucket name |
return | boolean |
public static deleteDistribution ( array $dist ) : boolean | ||
$dist | array | Distribution array info identical to output of getDistribution() |
return | boolean |
public static disableBucketLogging ( string $bucket ) : boolean | ||
$bucket | string | Bucket name |
return | boolean |
public static freeSigningKey ( ) : void | ||
return | void |
public static getAuthenticatedURL ( string $bucket, string $uri, integer $lifetime, boolean $hostBucket = false, boolean $https = false ) : string | ||
$bucket | string | Bucket name |
$uri | string | Object URI |
$lifetime | integer | Lifetime in seconds |
$hostBucket | boolean | Use the bucket name as the hostname |
$https | boolean | Use HTTPS ($hostBucket should be false for SSL verification) |
return | string |
public static getBucket ( string $bucket, string $prefix = null, string $marker = null, string $maxKeys = null, string $delimiter = null, boolean $returnCommonPrefixes = false ) : array | false | ||
$bucket | string | Bucket name |
$prefix | string | Prefix |
$marker | string | Marker (last file listed) |
$maxKeys | string | Max keys (maximum number of keys to return) |
$delimiter | string | Delimiter |
$returnCommonPrefixes | boolean | Set to true to return CommonPrefixes |
return | array | false | | false |
public static getBucketLocation ( string $bucket ) : string | false | ||
$bucket | string | Bucket name |
return | string | false | | false |
public static getBucketLogging ( string $bucket ) : array | false | ||
$bucket | string | Bucket name |
return | array | false | | false |
public static getDistribution ( string $distributionId ) : array | false | ||
$distributionId | string | Distribution ID from listDistributions() |
return | array | false | | false |
public static getDistributionInvalidationList ( string $distributionId ) : array | ||
$distributionId | string | Distribution ID from listDistributions() |
return | array |
public static getHttpUploadPostParams ( string $bucket, string $uriPrefix = '', constant $acl = self::ACL_PRIVATE, integer $lifetime = 3600, integer $maxFileSize = 5242880, string $successRedirect = "201", array $amzHeaders = [], array $headers = [], boolean $flashVars = false ) : object | ||
$bucket | string | Bucket name |
$uriPrefix | string | Object URI prefix |
$acl | constant | ACL constant |
$lifetime | integer | Lifetime in seconds |
$maxFileSize | integer | Maximum filesize in bytes (default 5MB) |
$successRedirect | string | Redirect URL or 200 / 201 status code |
$amzHeaders | array | Array of x-amz-meta-* headers |
$headers | array | Array of request headers or content type as a string |
$flashVars | boolean | Includes additional "Filename" variable posted by Flash |
return | object |
public static getSignedPolicyURL ( array $policy ) : string | ||
$policy | array | Policy |
return | string |
public static listBuckets ( boolean $detailed = false ) : array | false | ||
$detailed | boolean | Returns detailed bucket list when true |
return | array | false | | false |
public static listDistributions ( ) : array | ||
return | array |
public static listOriginAccessIdentities ( ) : array | ||
return | array |
public static putObject ( mixed $input, string $bucket, string $uri, constant $acl = self::ACL_PRIVATE, array $metaHeaders = [], array $requestHeaders = [], constant $storageClass = self::STORAGE_CLASS_STANDARD, constant $serverSideEncryption = self::SSE_NONE ) : boolean | ||
$input | mixed | Input data |
$bucket | string | Bucket name |
$uri | string | Object URI |
$acl | constant | ACL constant |
$metaHeaders | array | Array of x-amz-meta-* headers |
$requestHeaders | array | Array of request headers or content type as a string |
$storageClass | constant | Storage class constant |
$serverSideEncryption | constant | Server-side encryption |
return | boolean |
public static putObjectFile ( string $file, string $bucket, string $uri, constant $acl = self::ACL_PRIVATE, array $metaHeaders = [], string $contentType = null ) : boolean | ||
$file | string | Input file path |
$bucket | string | Bucket name |
$uri | string | Object URI |
$acl | constant | ACL constant |
$metaHeaders | array | Array of x-amz-meta-* headers |
$contentType | string | Content type |
return | boolean |
public static putObjectString ( string $string, string $bucket, string $uri, constant $acl = self::ACL_PRIVATE, array $metaHeaders = [], string $contentType = 'text/plain' ) : boolean | ||
$string | string | Input data |
$bucket | string | Bucket name |
$uri | string | Object URI |
$acl | constant | ACL constant |
$metaHeaders | array | Array of x-amz-meta-* headers |
$contentType | string | Content type |
return | boolean |
public setEndpoint ( string $host ) : void | ||
$host | string | Hostname |
return | void |
public static setExceptions ( boolean $enabled = true ) : void | ||
$enabled | boolean | Enable exceptions |
return | void |
public static setTimeCorrectionOffset ( string $offset ) : void | ||
$offset | string | Time offset (set to zero to use AWS server time) |
return | void |
public static updateDistribution ( array $dist ) : array | false | ||
$dist | array | Distribution array info identical to output of getDistribution() |
return | array | false | | false |
public static string $defDelimiter | ||
return | string |
public static string $sslCACert | ||
return | string |
public static string $sslCert | ||
return | string |
public static bool $useExceptions | ||
return | boolean |
public static bool $useSSLValidation | ||
return | boolean |