Advertisement
gemba

Untitled

Mar 19th, 2013
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.48 KB | None | 0 0
  1. <?php
  2. /**
  3.  * A2S3 class
  4.  *
  5.  * A wrapper class to the Amazon S3 storage client
  6.  *
  7.  * @author Antonio Ramirez <amigo.cobos@gmail.com>
  8.  * @copyright Copyright &copy; 2amigos.us 2013-
  9.  * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
  10.  * @package A2.amazon.components
  11.  */
  12. /**
  13.  * Client to interact with Amazon Simple Storage Service
  14.  *
  15.  * @method Model abortMultipartUpload(array $args = array()) {@command S3 AbortMultipartUpload}
  16.  * @method Model completeMultipartUpload(array $args = array()) {@command S3 CompleteMultipartUpload}
  17.  * @method Model copyObject(array $args = array()) {@command S3 CopyObject}
  18.  * @method Model createBucket(array $args = array()) {@command S3 CreateBucket}
  19.  * @method Model createMultipartUpload(array $args = array()) {@command S3 CreateMultipartUpload}
  20.  * @method Model deleteBucket(array $args = array()) {@command S3 DeleteBucket}
  21.  * @method Model deleteBucketCors(array $args = array()) {@command S3 DeleteBucketCors}
  22.  * @method Model deleteBucketLifecycle(array $args = array()) {@command S3 DeleteBucketLifecycle}
  23.  * @method Model deleteBucketPolicy(array $args = array()) {@command S3 DeleteBucketPolicy}
  24.  * @method Model deleteBucketTagging(array $args = array()) {@command S3 DeleteBucketTagging}
  25.  * @method Model deleteBucketWebsite(array $args = array()) {@command S3 DeleteBucketWebsite}
  26.  * @method Model deleteObject(array $args = array()) {@command S3 DeleteObject}
  27.  * @method Model deleteObjects(array $args = array()) {@command S3 DeleteObjects}
  28.  * @method Model getBucketAcl(array $args = array()) {@command S3 GetBucketAcl}
  29.  * @method Model getBucketCors(array $args = array()) {@command S3 GetBucketCors}
  30.  * @method Model getBucketLifecycle(array $args = array()) {@command S3 GetBucketLifecycle}
  31.  * @method Model getBucketLocation(array $args = array()) {@command S3 GetBucketLocation}
  32.  * @method Model getBucketLogging(array $args = array()) {@command S3 GetBucketLogging}
  33.  * @method Model getBucketNotification(array $args = array()) {@command S3 GetBucketNotification}
  34.  * @method Model getBucketPolicy(array $args = array()) {@command S3 GetBucketPolicy}
  35.  * @method Model getBucketRequestPayment(array $args = array()) {@command S3 GetBucketRequestPayment}
  36.  * @method Model getBucketTagging(array $args = array()) {@command S3 GetBucketTagging}
  37.  * @method Model getBucketVersioning(array $args = array()) {@command S3 GetBucketVersioning}
  38.  * @method Model getBucketWebsite(array $args = array()) {@command S3 GetBucketWebsite}
  39.  * @method Model getObject(array $args = array()) {@command S3 GetObject}
  40.  * @method Model getObjectAcl(array $args = array()) {@command S3 GetObjectAcl}
  41.  * @method Model getObjectTorrent(array $args = array()) {@command S3 GetObjectTorrent}
  42.  * @method Model headBucket(array $args = array()) {@command S3 HeadBucket}
  43.  * @method Model headObject(array $args = array()) {@command S3 HeadObject}
  44.  * @method Model listBuckets(array $args = array()) {@command S3 ListBuckets}
  45.  * @method Model listMultipartUploads(array $args = array()) {@command S3 ListMultipartUploads}
  46.  * @method Model listObjectVersions(array $args = array()) {@command S3 ListObjectVersions}
  47.  * @method Model listObjects(array $args = array()) {@command S3 ListObjects}
  48.  * @method Model listParts(array $args = array()) {@command S3 ListParts}
  49.  * @method Model putBucketAcl(array $args = array()) {@command S3 PutBucketAcl}
  50.  * @method Model putBucketCors(array $args = array()) {@command S3 PutBucketCors}
  51.  * @method Model putBucketLifecycle(array $args = array()) {@command S3 PutBucketLifecycle}
  52.  * @method Model putBucketLogging(array $args = array()) {@command S3 PutBucketLogging}
  53.  * @method Model putBucketNotification(array $args = array()) {@command S3 PutBucketNotification}
  54.  * @method Model putBucketPolicy(array $args = array()) {@command S3 PutBucketPolicy}
  55.  * @method Model putBucketRequestPayment(array $args = array()) {@command S3 PutBucketRequestPayment}
  56.  * @method Model putBucketTagging(array $args = array()) {@command S3 PutBucketTagging}
  57.  * @method Model putBucketVersioning(array $args = array()) {@command S3 PutBucketVersioning}
  58.  * @method Model putBucketWebsite(array $args = array()) {@command S3 PutBucketWebsite}
  59.  * @method Model putObject(array $args = array()) {@command S3 PutObject}
  60.  * @method Model putObjectAcl(array $args = array()) {@command S3 PutObjectAcl}
  61.  * @method Model restoreObject(array $args = array()) {@command S3 RestoreObject}
  62.  * @method Model uploadPart(array $args = array()) {@command S3 UploadPart}
  63.  * @method Model uploadPartCopy(array $args = array()) {@command S3 UploadPartCopy}
  64.  * @method waitUntilBucketExists(array $input) Wait until a bucket exists. The input array uses the parameters of the HeadBucket operation and waiter specific settings
  65.  * @method waitUntilBucketNotExists(array $input) Wait until a bucket does not exist. The input array uses the parameters of the HeadBucket operation and waiter specific settings
  66.  * @method waitUntilObjectExists(array $input) Wait until an object exists. The input array uses the parameters of the HeadObject operation and waiter specific settings
  67.  */
  68.  
  69. class A2S3 extends A2Base
  70. {
  71.  
  72.  
  73.     /**
  74.      * Set the desired config
  75.      * @param string config-name
  76.      */
  77.     public function __construct($config)
  78.     {
  79.         $this->_refConfig=$config;
  80.     }
  81.    
  82.    
  83.     /**
  84.      * @return Aws\S3\S3Client
  85.      */
  86.     public function getClient()
  87.     {
  88.         if(null === $this->_client)
  89.         {
  90.             $this->_client = $this->getAws()->get($this->_refConfig);
  91.         }
  92.         return $this->_client;
  93.     }
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement