Welcome to Phive’s documentation!

Installation

Initial Installation

Installation of PHIVE is easy and about the last time you have to do anything phar related manually. Grab your copy of PHIVE from the releases section at our GitHub page or follow these simple steps:

wget https://phar.io/releases/phive.phar
wget https://phar.io/releases/phive.phar.asc
gpg --keyserver hkps.pool.sks-keyservers.net --recv-keys 0x9D8A98B29B2D5D79
gpg --verify phive.phar.asc phive.phar
chmod +x phive.phar
sudo mv phive.phar /usr/bin/phive

Updating an existing Installation

If you already have a running installation of Phive, simply run phive selfupdate to obtain the latest version.

Internally, updating the Phive PHAR works the same way as installing any other PHAR.

Usage

Installing a PHAR

Install latest version of PHPUnit:

phive install phpunit

Install PHPDox, copy PHAR into the project instead of symlinking it:

phive install --copy phpdox

Install PHPDox, using a filename for the symlink

phive install phpdox bin/phpdox

Install a PHAR directly from an URL

phive install https://phar.phpunit.de/phpunit-4.8.6.phar

Install PHPUnit, do not add entry to phive.xml

phive install --temporary phpunit@~5.0

Updating a PHAR

Update all tools listed in phive.xml to the newest versions matching their version constraints

phive update

Update all tools listed in phive.xml to the newest versions matching their version constraints, only using locally stored PHARs if possible

phive update --prefer-offline

Update only PHPUnit to the newest version matching its version constraints

phive update phpunit

Removing a PHAR

Remove PHPUnit from the project

phive remove phpunit

Configuration

phive.xml

The Phive XML configuration file holds the list of installed PHARs as well as project-specific configuration.

<configuration>

<phar>

Attribute Function
name alias of the PHAR, e.g. phpunit
version version constraint, e.g. ^5.0
installed [optional] locked version to be installed when running phive install
location the filename of the symlink or copied PHAR
copy indicates whether the PHAR is to be symlinked or copied into the project. Possible values: true, false
url [optional] the source URL of the PHAR. Only used when PHAR was installed directly from a URL

Indices and tables