This Fuel PHP package adds Solarium to your application.
-
In the root of your fuel application, run
git submodule add git://github.com/bgrimes/fuelphp-solarium.git fuel/packages/solarium
-
Open
composer.json
from the root of your fuel application and add this line to therequire
section:"solarium/solarium": "[desired-version-id]"
Where
[desired-version-id]
is whichever version you want to install from Packagist. As an example, the current latest stable version as of this writing (October 10, 2013), would be3.2.0-RC1
. -
In the root of your fuel application, run
php composer.phar update
This wrapper loads the Solarium library into your project so that you can either autoload the package in your config file
'packages' => array(
'parser',
'solarium',
),
...
'config' => array(
'solarium',
),
or load it on the fly
// Load the config from packages/solarium/config/solarium.php
\Config::load('solarium', true);
\Package::load('solarium');
The config file is currently used to store connection information, but you can of course tweak it to suit your needs for dealing with Solarium.
After the package is loaded you can use it as defined on the Solarium website, for example:
$config = \Config::get('solarium');
// Create a client instance
$client = new \Solarium\Client($config);
...