Installation

There are a few different ways to install Proem for use. The first and easiest is to simply download the phar archive and include it where you need it, the second is to install via composer, and the third is to download (or clone) the repository.

Which one you choose really depends on what your going to do with Proem. If your planing on developing an application, I would recommend the composer approach, if you want to help out with Proem development, obviously you'll need to clone the repository (see Contributing). The phar archive is an easy install, but not very flexible using an archive actually incurs quite a bit of overhead.

Dependencies

Proem was developed from the ground up to take advantage of some of the newer features available in PHP5.4. As such it requires PHP5.4 to run.

Other than the PHP5.4 dependency there are currently no other hard requirements to use Proem. If you want to help develop Proem, you will need to download the code (not the phar) and a few dependencies, all of which can be installed via composer by running composer.phar dev-install from the root of the project.

The APC extension is highly recommended as it improves the performance of the autoloading mechanism considerably.

Using composer

The preferred method of starting a new project depending on Proem is to use composer to install it.

Make a directory to house your project, then within that directory create a composer.json file with the following content:

    {
      require: {
        "proem/proem": "0.7.0"
      }
    }
  

Now, install using composer: composer.phar install. This will create a vendor directory containing Proem and it's dependencies.

Proem is now ready to use.

    include 'vendor/proem/proem/lib/Proem/Util/Autoloader.php';

    (new \Proem\Util\Autoloader)->register();
    (new \Proem\Proem)->init();
  

It is preferred to use Proem's autoloader (instead of composer's) as it takes advantage of APC being installed, though you could just as easily use composer's.

Using the phar archive

The phar archive route is by far the easiest to get up and running with. Simply download the latest phar archive and include it into your bootstrap.php file for use.

    include 'phar://proem.phar';

    (new \Proem\Proem)->init();
  

Getting the code

You can get Proem's source by either downloading the latest package from Github or by cloning the project from Github. git clone git://github.com/proem/proem.git

Once you have the source code, just include the Autoloader.

    require_once '/path/to/proem/lib/Proem/Util/Autoloader.php';

    (new \Proem\AutoLoader)->register();
    (new \Proem\Proem)->init();
  

Enable rewrite rules in Apache

In order for all the necessary requests to your server to be processed by Proem you need to rewrite these requests to your bootstrap (index.php) file.

Using the Apache HTTP Server you can do this by defining a simple rewrite rule:
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php