= Install Guide
:description: PHP_CompatInfo may be installed in several ways, choose your favorite.
include::revision.txt[]
include::attributes.txt[]


[role="lead"]
Before you begin, ensure that you have at least
http://www.php.net[PHP] 5.3.0 installed.

== PEAR

PHP_CompatInfo should be installed using the http://pear.php.net/[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.24.0
----

== PHP Archive (PHAR)

----
wget http://bartlett.laurent-laville.org/get/phpcompatinfo.phar
chmod +x phpcompatinfo.phar
----

== Composer

Install http://getcomposer.org[Composer] in your root project with this command:
----
$ curl -s http://getcomposer.org/installer | php
----

Or http://getcomposer.org/composer.phar[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.24.*"
    },
    "repositories": [
        {
            "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
[source,php]
----
<?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 http://fedoraproject.org/wiki/EPEL[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 [label]#include_path# is equals to [label]#.:/php/includes#
====
----
$ mkdir /php/includes/Bartlett && cp PHP/* /php/includes/Bartlett
----
====

WARNING: Don't forget to install also all others required dependencies:
`PHP_Reflect`, `Console_CommandLine`.

Check that it works. Run the local [label label-inverse]#phpcompatinfo# command.
----
$ php scripts/phpci --version
----
That should give expected result:
====
phpcompatinfo version DEV.
====
