Before you begin, ensure that you have at least PHP 5.3.0 installed.
PEAR
PHP_CompatInfo should be installed using the PEAR Installer. This installer is the backbone of PEAR, which provides a distribution system for PHP packages, and is shipped with every release of PHP since version 4.3.0.
Registering the channel:
$ pear channel-discover bartlett.laurent-laville.org
Installing the latest version available:
$ pear install bartlett/PHP_CompatInfo
Installing a specific version:
$ pear install bartlett/PHP_CompatInfo-2.26.0
PHP Archive (PHAR)
wget http://bartlett.laurent-laville.org/get/phpcompatinfo.phar chmod +x phpcompatinfo.phar
Composer
Install Composer in your root project with this command:
$ curl -s http://getcomposer.org/installer | php
Or download composer.phar in your root project.
Put a file named composer.json
at the root of your project, containing the dependency:
{ "require": { "pear-bartlett/PHP_CompatInfo": "2.26.*" }, "repositories": [ { "type": "pear", "url": "http://pear.php.net" }, { "type": "pear", "url": "http://bartlett.laurent-laville.org" } ] }
And install this dependency with the following command:
$ php composer.phar install
Include Composer’s autoloader, and use the PHP_CompatInfo
class
<?php
require_once 'vendor/autoload.php';
GNU/Linux RPM
PHP_CompatInfo could be installed as RPM, using the package installer.
In Fedora, from official repository.
In Enterprise Linux (RHEL, CentOS, Scientific Linux, Oracle Linux, …), from the EPEL repository.
# yum install php-bartlett-PHP-CompatInfo
Git
You can also clone the project.
$ git clone git://github.com/llaville/php-compat-info.git && cd php-compat-info
Copy the PHP
sub-folder in a Bartlett
directory
accessible by your include_path
.
When include_path is equals to .:/php/includes
$ mkdir /php/includes/Bartlett && cp PHP/* /php/includes/Bartlett
PHP_Reflect
, Console_CommandLine
.Check that it works. Run the local phpcompatinfo command.
$ php scripts/phpci --version
That should give expected result:
phpcompatinfo version DEV.