LoginSignup
16
16

More than 5 years have passed since last update.

FuelPHPのComposerでPEARを使う

Posted at

少しハマったので個人的なメモ
phpenvの5.5なFuelPHP環境でPEARを使おうとしたらコマンドが無いとか叱られたしPyrusかと思ったけどなんかメンドイ。
ならFuelPHPにあるComposer使えばいいんじゃないとかそんな風に思ったのでやってみた。

JSONファイルの更新とか

  • リポジトリを追加
  • Requireリストに追加
fuelphp/composer.json

"repositories":[
{
"type":"pear",
"url":"http://pear.php.net"
}
],
"require": {
"php": ">=5.3.3",
"monolog/monolog": "1.5.*",
"fuelphp/upload": "2.0",
"pear-pear/HTTP_Request2":"2.1.*"
},

HTTP_Request2を使いたかったので追加した感じです。

インストール・更新

普通ならここで下記のコマンドからインストールすれば良いみたい

Command
php ./composer.phar install

今回は以前調べた時にこのコマンド叩いており、

`・・)つphp ./composer.phar install   
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Nothing to install or update
Generating autoload files

と言われてしまった。
なのでこんな( php ./composer.phar update )感じで
やればいいようだ

`・・)つphp ./composer.phar update
Loading composer repositories with package information
Initializing PEAR repository http://pear.php.net
Updating dependencies (including require-dev)
  - Installing pear-pear.php.net/xml_util (1.2.1)
    Downloading: 100%
  - Installing pear-pear.php.net/console_getopt (1.3.1)
    Downloading: 100%
  - Installing pear-pear.php.net/structures_graph (1.0.4)
    Downloading: 100%
  - Installing pear-pear.php.net/archive_tar (1.3.11)
    Downloading: 100%
  - Installing pear-pear.php.net/pear (1.9.4)
    Downloading: 100%
  - Installing pear-pear.php.net/net_url2 (2.0.0)
    Downloading: 100%
  - Installing pear-pear.php.net/http_request2 (2.1.1)
    Downloading: 100%
Writing lock file
Generating autoload files

なるほど、良い感じ。
これはハマリますわー

16
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
16