PHP Objects, Patterns and Practice (3rd edition)

(Barry) #1
CHAPTER 15 ■ AN INTRODUCTION TO PEAR AND PYRUS

Pyrus version 2.0.0a1 SHA-1: 27EB8EB427EA50C05691185B41BBA0F0666058D0
Pyrus: No user configuration file detected
It appears you have not used Pyrus before, welcome! Initialize install?
...


As you can see, Pyrus will offer you configuration options on first run. You’ll need to tell it where to
save a configuration file, and where you want it to save packages. You should decide whether you want
to use PEAR or Pyrus for your development. While they will both install PEAR packages, their installation
locations are not entirely compatible.
At the time of this writing, Pyrus requires PHP 5.3.1, so it’s pretty new. That means you may
experience usage issues at times (the current version seems incapable of uninstalling packages, for
example). You may be stuck with PHP 5.2 for a while yet. If that’s the case, you’ll need to stick with PEAR.
Third-party tools that work with PEAR may not yet be ready for Pyrus. On the other hand, Pyrus is the
future. Migrating now may work out cheaper in the long run.
Because there are good reasons to go either way, I’ll try to steer a path between both PEAR and
Pyrus in this chapter.
So, to bring you up to date, Pyrus does not support a config-get command. It does, however support
config-show.


$ php pyrus.phar config-show


Pyrus version 2.0.0a1 SHA-1: 27EB8EB427EA50C05691185B41BBA0F0666058D0
Using PEAR installation found at /usr/share/pear2
System paths:
php_dir => /usr/share/pear2/php
ext_dir => /usr/lib/php/modules
...


■Note Although Pyrus will run out of the box with a standard PHP build, once again, the PHP installed by some


Linux distributions may not provide everything you need. Pyrus requires the extensions phar, simplexml, libxml2,


spl, and pcre. In order to make Pyrus runnable, Fedora 12 required an additional install:


yum install php-xml


Your favorite distribution may have its own installation issues. Remember also that you need at least PHP 5.3.1 to


be in this game.


Although both PEAR and Pyrus support many subcommands, you will probably get the most use out
of one in particular. install is used for installing PEAR packages.

Free download pdf