Installation
Getting up and running with Sherlock is simple, although there are a few requirements:
- PHP version >= 5.3.0
- Composer
- ElasticSearch (no surprise here!)
Installation via Composer
The recommended installation method for Sherlock is through Composer.
- Add
polyfractal/sherlock
as a dependency in your project'scomposer.json
file:
{ "require": { "polyfractal/sherlock": "0.1.*" } }
- Download and install Composer (if you don't have it installed already):
curl -s http://getcomposer.org/installer | php
- Install Sherlock and various dependencies. This will create a /vendor/ directory with Sherlock and associated libraries:
php composer.phar install
-
Require Composer's autoloader
Composer also prepares an autoload file that's capable of autoloading all of the classes in any of the libraries that it downloads. To use it, just add the following line to your code's bootstrap process:
require 'vendor/autoload.php';
Manual Installation
Sherlock can be installed even if you don't use Composer. Download Sherlock and include the following in your index.php or equivalent
<?php
require 'Sherlock/Sherlock.php';
\Sherlock\Sherlock::registerAutoloader();
All done!
Once you have Sherlock installed, head over to the Quickstart Guide to get a crashcourse in how Sherlock works. Alternatively, check out the Full Documentation to get a feel for the entire library.