SlideShare une entreprise Scribd logo
1  sur  54
Télécharger pour lire hors ligne
Composer
@slywalker(YasuoHarada)
のインストールなら
AWSSDKforPHP
でしょ!
aboutme
大阪で
AWS+PHP(CakePHP)
+MySQLを主に使って開発を
行っています。
@slywalker
@slywalkerfollowme!
github.com/slywalker
github.com/slywalker
forkme!
PHPエンジニア
養成読本
PHPエンジニア
養成読本
buynow!
Composerを使ったほうがいいのか?
なぜ?
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日現在
インストール方法は
いくつかある
AWSSDKforPHP
ZiporPhar
Pear
Composer&
Packagist
ZiporPhar
バージョン管理は目視、手動
バグフィックスなど追いかける手間
呼び出しは、ファイルをrequire
ZiporPhar
救い?CUIでの操作が不要
どこでも好きなところに設置OK
だがそれが不幸の原因に!?
ZiporPhar
なにもかもが手動
ZiporPhar
安宅船
なにもかもが手動
ZiporPhar
安宅船
なにもかもが手動
手
漕
ぎ
!!
バージョン管理OK
でも、依存性解消までは無理
呼び出しは、pearのディレクトリを
include_pathに設定
いままで本当にありがとう!
Pear
1サーバ=1バージョン
ひとつの環境上で複数アプリを違った
バージョンで運用できない
複数運用しようとZipへ逆戻り…
いままで本当にありがとう!
Pear
華々しい戦績も…
Pear
重巡愛宕
華々しい戦績も…
Pear
重巡愛宕
華々しい戦績も…
轟
沈
!!Pear
バージョン管理OK
アプリごとに別バージョンOK
依存性解消OK
呼び出しは、autoloader
Composer&Packagist
Composer&Packagist
最新鋭
護衛艦あたご
Composer&Packagist
最新鋭
操作 バージョン管理 インストール先 呼び出し
GUI なし アプリ require
CUI
あり
(依存性解消なし)
環境 include_path
CUI
あり
(依存性解消あり)
アプリ autoloader
Onemorething...
どうしてこうなった…
gitcloneorgitsubmodule
どうしてこうなった…
gitcloneorgitsubmodule
どうしてこうなった…
gitcloneorgitsubmodule
何
こ
れ
!!
Composer依存性解消のしくみ
実録
$ vim composer.json
{
"require": {
"aws/aws-sdk-php": "2.*"
}
}
$ php composer.phar install
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
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
依存関係にある
パッケージが
インストールされる
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)
$ vim composer.json
{
"require": {
"aws/aws-sdk-php": "2.*",
"guzzle/guzzle": "3.6.*"
}
}
$ php composer.phar update
アプリがguzzle(3.6)までの対応だった場合
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
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
設定された
バージョンの範囲内で
インストールされる
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)
$ vim composer.json
{
"require": {
"aws/aws-sdk-php": "2.4.*",
"guzzle/guzzle": "3.6.*"
}
}
$ php composer.phar update
バージョンの組み合わせが存在しない場合
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].
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].
頑張って組み合わせをさがしてみた結果
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].
頑張って組み合わせをさがしてみた結果
インストール
失敗
$ vim composer.json
{
"require": {
"aws/aws-sdk-php": "2.*",
"guzzle/guzzle": "2.*"
}
}
$ php composer.phar update
バージョンの組み合わせの範囲が広いと…
Loading composer repositories with package information
Updating dependencies (including require-dev)
Loading composer repositories with package information
Updating dependencies (including require-dev)
なかなか終わらない…
{
"require": {
"aws/aws-sdk-php": "2.4.*",
"guzzle/guzzle": "3.7.*"
}
}
開発で使用するときは
マイナーバージョンまで
指定しておいたほうがいいかも
Composer使うべき最大の理由?!
そして
公式ドキュメント
http://docs.aws.amazon.com/aws-sdk-php-2/guide/latest/installation.html
冒頭で解説!!
Composer
amazon様が
使えと!!
Composer
ありがとうございます

Contenu connexe

En vedette

[AWSマイスターシリーズ] AWS Billingについて
[AWSマイスターシリーズ] AWS Billingについて[AWSマイスターシリーズ] AWS Billingについて
[AWSマイスターシリーズ] AWS Billingについて
Amazon Web Services Japan
 
セキュリティを捉えてクラウドを使うためのポイント
セキュリティを捉えてクラウドを使うためのポイントセキュリティを捉えてクラウドを使うためのポイント
セキュリティを捉えてクラウドを使うためのポイント
Yasuhiro Araki, Ph.D
 

En vedette (20)

Mastering the AWS SDK for PHP (TLS306) | AWS re:Invent 2013
Mastering the AWS SDK for PHP (TLS306) | AWS re:Invent 2013Mastering the AWS SDK for PHP (TLS306) | AWS re:Invent 2013
Mastering the AWS SDK for PHP (TLS306) | AWS re:Invent 2013
 
CodeIgniterのライセンスについて
CodeIgniterのライセンスについてCodeIgniterのライセンスについて
CodeIgniterのライセンスについて
 
Apache Drill で見る Twitter の世界
Apache Drill で見る Twitter の世界Apache Drill で見る Twitter の世界
Apache Drill で見る Twitter の世界
 
【 ITベンチャーを支えるテクノロジー 】チャットワークを支える技術|Chatwork株式会社
【 ITベンチャーを支えるテクノロジー 】チャットワークを支える技術|Chatwork株式会社【 ITベンチャーを支えるテクノロジー 】チャットワークを支える技術|Chatwork株式会社
【 ITベンチャーを支えるテクノロジー 】チャットワークを支える技術|Chatwork株式会社
 
Composer並列化プラグイン #phpblt
Composer並列化プラグイン #phpblt Composer並列化プラグイン #phpblt
Composer並列化プラグイン #phpblt
 
最近、僕がハマったFuelPHPの紹介
最近、僕がハマったFuelPHPの紹介最近、僕がハマったFuelPHPの紹介
最近、僕がハマったFuelPHPの紹介
 
F.O.Xを支える技術
F.O.Xを支える技術F.O.Xを支える技術
F.O.Xを支える技術
 
AWSのおはなし at ChatWork
AWSのおはなし at ChatWorkAWSのおはなし at ChatWork
AWSのおはなし at ChatWork
 
あなたのScalaを爆速にする7つの方法
あなたのScalaを爆速にする7つの方法あなたのScalaを爆速にする7つの方法
あなたのScalaを爆速にする7つの方法
 
はじめてのAWS - ビギナー編 -
はじめてのAWS - ビギナー編 - はじめてのAWS - ビギナー編 -
はじめてのAWS - ビギナー編 -
 
サイバーエージェント様 発表「OpenStackのNWと物理の話」
サイバーエージェント様 発表「OpenStackのNWと物理の話」サイバーエージェント様 発表「OpenStackのNWと物理の話」
サイバーエージェント様 発表「OpenStackのNWと物理の話」
 
Ironicを運用して半年が経過しました - OpenStack最新情報セミナー(2016年7月)
Ironicを運用して半年が経過しました  - OpenStack最新情報セミナー(2016年7月)Ironicを運用して半年が経過しました  - OpenStack最新情報セミナー(2016年7月)
Ironicを運用して半年が経過しました - OpenStack最新情報セミナー(2016年7月)
 
AWSとGCPを使用したインフラ環境
AWSとGCPを使用したインフラ環境AWSとGCPを使用したインフラ環境
AWSとGCPを使用したインフラ環境
 
GKEで半年運用してみた
GKEで半年運用してみたGKEで半年運用してみた
GKEで半年運用してみた
 
Wowzaを用いた配信基盤 Takusuta tech conf01
Wowzaを用いた配信基盤 Takusuta tech conf01Wowzaを用いた配信基盤 Takusuta tech conf01
Wowzaを用いた配信基盤 Takusuta tech conf01
 
サービスをつくりなおす決断をするとき
サービスをつくりなおす決断をするときサービスをつくりなおす決断をするとき
サービスをつくりなおす決断をするとき
 
[社内勉強会]ELBとALBと数万スパイク負荷テスト
[社内勉強会]ELBとALBと数万スパイク負荷テスト[社内勉強会]ELBとALBと数万スパイク負荷テスト
[社内勉強会]ELBとALBと数万スパイク負荷テスト
 
AWS Black Belt Techシリーズ Amazon SNS モバイルプッシュ
AWS Black Belt Techシリーズ Amazon SNS モバイルプッシュAWS Black Belt Techシリーズ Amazon SNS モバイルプッシュ
AWS Black Belt Techシリーズ Amazon SNS モバイルプッシュ
 
[AWSマイスターシリーズ] AWS Billingについて
[AWSマイスターシリーズ] AWS Billingについて[AWSマイスターシリーズ] AWS Billingについて
[AWSマイスターシリーズ] AWS Billingについて
 
セキュリティを捉えてクラウドを使うためのポイント
セキュリティを捉えてクラウドを使うためのポイントセキュリティを捉えてクラウドを使うためのポイント
セキュリティを捉えてクラウドを使うためのポイント
 

Plus de Yasuo Harada

Plus de Yasuo Harada (7)

PHP Conference Kansai 2015
PHP Conference Kansai 2015PHP Conference Kansai 2015
PHP Conference Kansai 2015
 
CakePHP - The point of upgrade
CakePHP - The point of upgradeCakePHP - The point of upgrade
CakePHP - The point of upgrade
 
フレームワークの選び方・付き合い方
フレームワークの選び方・付き合い方フレームワークの選び方・付き合い方
フレームワークの選び方・付き合い方
 
Babylon system found in the web
Babylon system found in the webBabylon system found in the web
Babylon system found in the web
 
Quality Use Of Plugin
Quality Use Of PluginQuality Use Of Plugin
Quality Use Of Plugin
 
究極のコントローラを目指す
究極のコントローラを目指す究極のコントローラを目指す
究極のコントローラを目指す
 
CakePHP Kansai 2008-12-12
CakePHP Kansai 2008-12-12CakePHP Kansai 2008-12-12
CakePHP Kansai 2008-12-12
 

Dernier

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Dernier (20)

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

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