AWS SDK for PHPをインストールするならComposerでしょ!

  • 5,207 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
5,207
On Slideshare
0
From Embeds
0
Number of Embeds
13

Actions

Shares
Downloads
2
Comments
0
Likes
6

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Composer @slywalker(YasuoHarada) のインストールなら AWSSDKforPHP でしょ!
  • 2. aboutme
  • 3. 大阪で AWS+PHP(CakePHP) +MySQLを主に使って開発を 行っています。
  • 4. @slywalker
  • 5. @slywalkerfollowme!
  • 6. github.com/slywalker
  • 7. github.com/slywalker forkme!
  • 8. PHPエンジニア 養成読本
  • 9. PHPエンジニア 養成読本 buynow!
  • 10. Composerを使ったほうがいいのか? なぜ?
  • 11. AWS SDK for PHP 2 を使用して、AWS の使用を迅 速に開始します。 この SDK は、Amazon S3、Amazon Glacier、 DynamoDB、CloudFront など、多くの AWS サービ ス向けの Ruby クラスを提供するため、コーディン グの複雑さが軽減されます。 ダウンロード可能な 1 つのパッケージに、AWS PHP ライブラリとドキュメントが含まれます。 AWSSDKforPHPhttp://aws.amazon.com/jp/sdkforphp/ より引用(原文まま) 2013年9月27日現在
  • 12. インストール方法は いくつかある AWSSDKforPHP
  • 13. ZiporPhar Pear Composer& Packagist
  • 14. ZiporPhar バージョン管理は目視、手動 バグフィックスなど追いかける手間 呼び出しは、ファイルをrequire
  • 15. ZiporPhar 救い?CUIでの操作が不要 どこでも好きなところに設置OK だがそれが不幸の原因に!?
  • 16. ZiporPhar なにもかもが手動
  • 17. ZiporPhar 安宅船 なにもかもが手動
  • 18. ZiporPhar 安宅船 なにもかもが手動 手 漕 ぎ !!
  • 19. バージョン管理OK でも、依存性解消までは無理 呼び出しは、pearのディレクトリを include_pathに設定 いままで本当にありがとう! Pear
  • 20. 1サーバ=1バージョン ひとつの環境上で複数アプリを違った バージョンで運用できない 複数運用しようとZipへ逆戻り… いままで本当にありがとう! Pear
  • 21. 華々しい戦績も… Pear
  • 22. 重巡愛宕 華々しい戦績も… Pear
  • 23. 重巡愛宕 華々しい戦績も… 轟 沈 !!Pear
  • 24. バージョン管理OK アプリごとに別バージョンOK 依存性解消OK 呼び出しは、autoloader Composer&Packagist
  • 25. Composer&Packagist 最新鋭
  • 26. 護衛艦あたご Composer&Packagist 最新鋭
  • 27. 操作 バージョン管理 インストール先 呼び出し GUI なし アプリ require CUI あり (依存性解消なし) 環境 include_path CUI あり (依存性解消あり) アプリ autoloader
  • 28. Onemorething...
  • 29. どうしてこうなった… gitcloneorgitsubmodule
  • 30. どうしてこうなった… gitcloneorgitsubmodule
  • 31. どうしてこうなった… gitcloneorgitsubmodule 何 こ れ !!
  • 32. Composer依存性解消のしくみ 実録
  • 33. $ vim composer.json { "require": { "aws/aws-sdk-php": "2.*" } } $ php composer.phar install
  • 34. Loading composer repositories with package information Installing dependencies (including require-dev) - Installing symfony/event-dispatcher (v2.3.5) Downloading: 100% - Installing guzzle/guzzle (v3.7.3) Loading from cache - Installing aws/aws-sdk-php (2.4.6) Loading from cache symfony/event-dispatcher suggests installing symfony/dependency-injection () symfony/event-dispatcher suggests installing symfony/http-kernel () aws/aws-sdk-php suggests installing doctrine/cache (Adds support for caching of credentials and responses) aws/aws-sdk-php suggests installing monolog/monolog (Adds support for logging HTTP requests and responses) aws/aws-sdk-php suggests installing symfony/yaml (Eases the ability to write manifests for creating jobs in AWS Import/Export) Writing lock file Generating autoload files
  • 35. Loading composer repositories with package information Installing dependencies (including require-dev) - Installing symfony/event-dispatcher (v2.3.5) Downloading: 100% - Installing guzzle/guzzle (v3.7.3) Loading from cache - Installing aws/aws-sdk-php (2.4.6) Loading from cache symfony/event-dispatcher suggests installing symfony/dependency-injection () symfony/event-dispatcher suggests installing symfony/http-kernel () aws/aws-sdk-php suggests installing doctrine/cache (Adds support for caching of credentials and responses) aws/aws-sdk-php suggests installing monolog/monolog (Adds support for logging HTTP requests and responses) aws/aws-sdk-php suggests installing symfony/yaml (Eases the ability to write manifests for creating jobs in AWS Import/Export) Writing lock file Generating autoload files 依存関係にある パッケージが インストールされる
  • 36. Loading composer repositories with package information Installing dependencies (including require-dev) - Installing symfony/event-dispatcher (v2.3.5) Downloading: 100% - Installing guzzle/guzzle (v3.7.3) Loading from cache - Installing aws/aws-sdk-php (2.4.6) Loading from cache symfony/event-dispatcher suggests installing symfony/dependency-injection () symfony/event-dispatcher suggests installing symfony/http-kernel () aws/aws-sdk-php suggests installing doctrine/cache (Adds support for caching of credentials and responses) aws/aws-sdk-php suggests installing monolog/monolog (Adds support for logging HTTP requests and responses) aws/aws-sdk-php suggests installing symfony/yaml (Eases the ability to write manifests for creating jobs in AWS Import/Export) Writing lock file Generating autoload files 依存関係にある パッケージが インストールされる aws-sdk-php (2.4.6) guzzle(3.7.3)
  • 37. $ vim composer.json { "require": { "aws/aws-sdk-php": "2.*", "guzzle/guzzle": "3.6.*" } } $ php composer.phar update アプリがguzzle(3.6)までの対応だった場合
  • 38. Loading composer repositories with package information Updating dependencies (including require-dev) - Removing guzzle/guzzle (v3.7.3) - Installing guzzle/guzzle (v3.6.0) Loading from cache - Removing aws/aws-sdk-php (2.4.6) - Installing aws/aws-sdk-php (2.3.4) Loading from cache Writing lock file Generating autoload files
  • 39. Loading composer repositories with package information Updating dependencies (including require-dev) - Removing guzzle/guzzle (v3.7.3) - Installing guzzle/guzzle (v3.6.0) Loading from cache - Removing aws/aws-sdk-php (2.4.6) - Installing aws/aws-sdk-php (2.3.4) Loading from cache Writing lock file Generating autoload files 設定された バージョンの範囲内で インストールされる
  • 40. Loading composer repositories with package information Updating dependencies (including require-dev) - Removing guzzle/guzzle (v3.7.3) - Installing guzzle/guzzle (v3.6.0) Loading from cache - Removing aws/aws-sdk-php (2.4.6) - Installing aws/aws-sdk-php (2.3.4) Loading from cache Writing lock file Generating autoload files 設定された バージョンの範囲内で インストールされる aws-sdk-php (2.3.4) guzzle(3.6.0)
  • 41. $ vim composer.json { "require": { "aws/aws-sdk-php": "2.4.*", "guzzle/guzzle": "3.6.*" } } $ php composer.phar update バージョンの組み合わせが存在しない場合
  • 42. Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - Conclusion: don't install aws/aws-sdk-php 2.4.6 - Conclusion: don't install aws/aws-sdk-php 2.4.5 - Conclusion: don't install aws/aws-sdk-php 2.4.4 - Conclusion: don't install aws/aws-sdk-php 2.4.3 - Conclusion: don't install aws/aws-sdk-php 2.4.2 - Conclusion: don't install aws/aws-sdk-php 2.4.1 - Conclusion: don't install guzzle/guzzle v3.7.3 - Installation request for aws/aws-sdk-php 2.4.* -> satisfiable by aws/ aws-sdk-php[2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6]. - Conclusion: remove guzzle/guzzle v3.6.0 - aws/aws-sdk-php 2.4.0 requires guzzle/guzzle ~3.7.0 -> satisfiable by guzzle/guzzle[v3.7.0, v3.7.1, v3.7.2, v3.7.3]. - Can only install one of: guzzle/guzzle[v3.7.0, v3.6.0]. - Can only install one of: guzzle/guzzle[v3.7.1, v3.6.0]. - Can only install one of: guzzle/guzzle[v3.7.2, v3.6.0]. - Installation request for guzzle/guzzle 3.6.* -> satisfiable by guzzle/ guzzle[v3.6.0].
  • 43. Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - Conclusion: don't install aws/aws-sdk-php 2.4.6 - Conclusion: don't install aws/aws-sdk-php 2.4.5 - Conclusion: don't install aws/aws-sdk-php 2.4.4 - Conclusion: don't install aws/aws-sdk-php 2.4.3 - Conclusion: don't install aws/aws-sdk-php 2.4.2 - Conclusion: don't install aws/aws-sdk-php 2.4.1 - Conclusion: don't install guzzle/guzzle v3.7.3 - Installation request for aws/aws-sdk-php 2.4.* -> satisfiable by aws/ aws-sdk-php[2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6]. - Conclusion: remove guzzle/guzzle v3.6.0 - aws/aws-sdk-php 2.4.0 requires guzzle/guzzle ~3.7.0 -> satisfiable by guzzle/guzzle[v3.7.0, v3.7.1, v3.7.2, v3.7.3]. - Can only install one of: guzzle/guzzle[v3.7.0, v3.6.0]. - Can only install one of: guzzle/guzzle[v3.7.1, v3.6.0]. - Can only install one of: guzzle/guzzle[v3.7.2, v3.6.0]. - Installation request for guzzle/guzzle 3.6.* -> satisfiable by guzzle/ guzzle[v3.6.0]. 頑張って組み合わせをさがしてみた結果
  • 44. Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - Conclusion: don't install aws/aws-sdk-php 2.4.6 - Conclusion: don't install aws/aws-sdk-php 2.4.5 - Conclusion: don't install aws/aws-sdk-php 2.4.4 - Conclusion: don't install aws/aws-sdk-php 2.4.3 - Conclusion: don't install aws/aws-sdk-php 2.4.2 - Conclusion: don't install aws/aws-sdk-php 2.4.1 - Conclusion: don't install guzzle/guzzle v3.7.3 - Installation request for aws/aws-sdk-php 2.4.* -> satisfiable by aws/ aws-sdk-php[2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6]. - Conclusion: remove guzzle/guzzle v3.6.0 - aws/aws-sdk-php 2.4.0 requires guzzle/guzzle ~3.7.0 -> satisfiable by guzzle/guzzle[v3.7.0, v3.7.1, v3.7.2, v3.7.3]. - Can only install one of: guzzle/guzzle[v3.7.0, v3.6.0]. - Can only install one of: guzzle/guzzle[v3.7.1, v3.6.0]. - Can only install one of: guzzle/guzzle[v3.7.2, v3.6.0]. - Installation request for guzzle/guzzle 3.6.* -> satisfiable by guzzle/ guzzle[v3.6.0]. 頑張って組み合わせをさがしてみた結果 インストール 失敗
  • 45. $ vim composer.json { "require": { "aws/aws-sdk-php": "2.*", "guzzle/guzzle": "2.*" } } $ php composer.phar update バージョンの組み合わせの範囲が広いと…
  • 46. Loading composer repositories with package information Updating dependencies (including require-dev)
  • 47. Loading composer repositories with package information Updating dependencies (including require-dev) なかなか終わらない…
  • 48. { "require": { "aws/aws-sdk-php": "2.4.*", "guzzle/guzzle": "3.7.*" } } 開発で使用するときは マイナーバージョンまで 指定しておいたほうがいいかも
  • 49. Composer使うべき最大の理由?! そして
  • 50. 公式ドキュメント http://docs.aws.amazon.com/aws-sdk-php-2/guide/latest/installation.html
  • 51. 冒頭で解説!! Composer
  • 52. amazon様が 使えと!! Composer
  • 53. ありがとうございます