Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AWS SDK触ってみる。

jaxx2104
November 29, 2013

AWS SDK触ってみる。

AWS SDK for PHP2 を使って S3 に画像をアップしてみます。

jaxx2104

November 29, 2013

Transcript

7 slides
  1. class SampleAws { // Amazon SDKのインスタンス private $obj = null;

    /** * AWS にアクセスする際の鍵 * @return {object} instance */ public function getInstance() { if (is_null($this->obj)) { $this->obj = Aws::factory(array( 'key' => 'XXXXXXXXXXXXX', 'secret' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'region' => 'ap-northeast-1' ))->get('s3'); } return $this->obj; } /** * s3に画像を保存 * @return {object} EndpointArns 全てのエンドポイント */ public function putObjectTest($tempFileName){ $this->getInstance()->putObject(array( 'Bucket' => 'jaxx2104', 'Key' => $tempFileName, TBNQMF 13೥11݄29೔༵ۚ೔

More Decks by jaxx2104

Other Decks in Programming