MAMPのPEARにServices_Amazonをインストール
MAMP上に、PEARのServices_Amazonを入れました。
PHP×WebサービスAPIコネクションズの一発目がAmazonでしたので。
うーんしかし、CakePHPのいいところはライブラリ非依存ってところなのですがねぇ・・・。
外部ライブラリを使わないCakePHPのAmazonコンポーネントを作ってみてもいいかも。
MAMP上のPEARにパッケージをインストールするには、
/Applications/MAMP/bin/php4/bin/ /Applications/MAMP/bin/php5/bin/
のpearを使えば良いです。
MAMPのPHP5環境のPEARにインストールしてみました。
$ pwd
/Applications/MAMP/bin/php5/bin
$ ./pear list
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.1 stable
Console_Getopt 1.2 stable
PEAR 1.4.9 stable
インストール。
$ ./pear install -a Services_Amazon
Failed to download pear/Services_Amazon within preferred state "stable", latest release is version 0.7.0, stability "beta", use "channel://pear.php.net/Services_Amazon-0.7.0" to install
Cannot initialize 'Services_Amazon', invalid or missing package file
Package "Services_Amazon" is not valid
install failed
“Services_Amazonはまだβなので、バージョンを指定しないとインストールできないよ” と。
バージョン指定してもう一回。
$ ./pear install -a Services_Amazon-0.7.0
WARNING: channel "pear.php.net" has updated its protocols, use "channel-update pear.php.net" to update
Failed to download pear/XML_Serializer, version "0.17.0", latest release is version 0.18.0, stability "beta", use "channel://pear.php.net/XML_Serializer-0.18.0" to install
pear/Services_Amazon requires package "pear/XML_Serializer" (version >= 0.17.0)
downloading HTTP_Request-1.4.0.tgz ...
Starting to download HTTP_Request-1.4.0.tgz (15,262 bytes)
.....done: 15,262 bytes
downloading Cache-1.5.4.tgz ...
Starting to download Cache-1.5.4.tgz (30,690 bytes)
...done: 30,690 bytes
downloading Net_URL-1.0.14.tgz ...
Starting to download Net_URL-1.0.14.tgz (5,173 bytes)
...done: 5,173 bytes
downloading Net_Socket-1.0.6.tgz ...
Starting to download Net_Socket-1.0.6.tgz (4,623 bytes)
...done: 4,623 bytes
install ok: channel://pear.php.net/Net_Socket-1.0.6
install ok: channel://pear.php.net/Net_URL-1.0.14
install ok: channel://pear.php.net/Cache-1.5.4
install ok: channel://pear.php.net/HTTP_Request-1.4.0
$ ./pear list
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.1 stable
Cache 1.5.4 stable
Console_Getopt 1.2 stable
HTTP_Request 1.4.0 stable
Net_Socket 1.0.6 stable
Net_URL 1.0.14 stable
PEAR 1.4.9 stable
“Services_Amazonが依存しているXML_Serializerはβなので、こいつもバージョン指定しないとインストールできないよ” と。
他のはインストールされています。
チャンネルのWarningが出ているので、とりあえず更新しておきます。
$ ./pear channel-update pear.php.net
Retrieving channel.xml from remote server
Update of Channel "pear.php.net" succeeded
XML_Serializerを、バージョン指定してインストール。
$ ./pear install -a XML_Serializer-0.18.0
downloading XML_Serializer-0.18.0.tgz ...
Starting to download XML_Serializer-0.18.0.tgz (23,230 bytes)
........done: 23,230 bytes
downloading XML_Util-1.1.4.tgz ...
Starting to download XML_Util-1.1.4.tgz (8,576 bytes)
...done: 8,576 bytes
downloading XML_Parser-1.2.8.tgz ...
Starting to download XML_Parser-1.2.8.tgz (13,476 bytes)
...done: 13,476 bytes
install ok: channel://pear.php.net/XML_Parser-1.2.8
install ok: channel://pear.php.net/XML_Util-1.1.4
install ok: channel://pear.php.net/XML_Serializer-0.18.0
最後に、Services_Amazonをインストール。
$ ./pear install -a Services_Amazon-0.7.0
downloading Services_Amazon-0.7.0.tgz ...
Starting to download Services_Amazon-0.7.0.tgz (17,491 bytes)
......done: 17,491 bytes
install ok: channel://pear.php.net/Services_Amazon-0.7.0
$ ./pear list
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.1 stable
Cache 1.5.4 stable
Console_Getopt 1.2 stable
HTTP_Request 1.4.0 stable
Net_Socket 1.0.6 stable
Net_URL 1.0.14 stable
PEAR 1.4.9 stable
Services_Amazon 0.7.0 beta
XML_Parser 1.2.8 stable
XML_Serializer 0.18.0 beta
XML_Util 1.1.4 stable
以上をインストールすると、
/Applications/MAMP/bin/php5/lib/php の中身はこんな感じになります。

この中身を、CakePHPのvendorsにぶっ込めばいいかなと。
あるいは、コンポーネントにパッケージングできるのかもしれない。
勉強ネタはつきない・・・。




2007年4月18日(水曜日) at 7時14分
Thank You