install - install a package

Introduction

The install command is used to install packages and accepts a list of package names to install as arguments. Unlike upgrade, the install command will only install new packages.

Install recognizes several different ways of specifying a package:

Ways of specifying a package for installation
Package type Local/Remote Example
package.xml file Local php pyrus.phar install /path/to/package.xml
Package release archive Local php pyrus.phar install /path/to/PackageName-1.2.3.tgz
Static url Remote php pyrus.phar install http://example.com/PackageName-1.2.3.tgz
Abstract package Remote php pyrus.phar install PackageName

Abstract Packages are documented here.

--optionaldeps

By default, required package dependencies are also installed. To also automatically install optional dependencies (not dependency groups, but dependencies specified using the <optional> tag in package.xml), pass the -o or --optionaldeps option to the install command:

php pyrus.phar install -o PackageName

--plugin

Plugins (documented here) must be explicitly installed with the -p or --plugin option. Plugins are installed into the location specified by the plugins_dir configuration variable, which defaults to the same location that the user configuration file is located ($HOME/.pear in unix, <My Documents>\pear on windows).

php pyrus.phar install -p PEAR2_Pyrus_Developer

--packagingroot

Developers packaging RPMs or other forms of distribution for OS vendors should use the -r or --packagingroot option to install a package into a subdirectory for creating the RPM.

php pyrus.phar install -r /home/myuser/package PackageName

For the example above, if the default Pyrus installation is in /usr/local/lib/pear, all files will be installed into /home/myuser/package/usr/local/lib/pear. Another way of understanding this is that the packagingroot option instructs Pyrus to treat /home/myuser/package as if it were the root directory /.

Developers packaging RPMs or other forms of distribution for OS vendors should use the -r or --packagingroot option to install a package into a subdirectory for creating the RPM.

php pyrus.phar install -r /home/myuser/package PackageName

--force

The --force or -f option can be used to force installation if there are errors. For instance, this can be used to override problems in dependency validation, or to force installation of a package that is not stable enough. As such, it should be used sparingly if at all. Better is to request a specific version for installation.