Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Predis service provider for the Silex microframework
PHP
tag: v0.1.0

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib/Predis/Silex
.gitignore
LICENSE
README.markdown
VERSION

README.markdown

PredisExtension

This extension for the Silex microframework enables developers to easily use Predis in their applications to connect to Redis.

Getting started

Starting to use this extension is quite easy. Supposing that you already have the scheleton of your Silex application ready, you just need to register the Predis\Silex namespace to point to the path of where the source code of the extension has been placed and then add an instance to the application object:

<?php
/* ... */
$app['autoloader']->registerNamespaces(array(
    'Predis\Silex' => __DIR__.'/../vendor/PredisExtension/lib',
));

$app->register(new Predis\Silex\PredisExtension(), array(
    'predis.class_path' => __DIR__.'/../vendor/Predis/lib',
    'predis.parameters' => 'tcp://127.0.0.1:6379/',
    'predis.options'    => array('profile' => '2.2'),
));
/* ... */

The predis.class_path option lets you specify where to look for Predis. Both predis.parameters and predis.options are optional and they accept the same values of the constructor method of Predis\Client.

If you are looking for simple but complete examples of how to use this extension you can have a look at the examples directory that is included in the repository.

Dependencies

  • PHP >= 5.3.2
  • Predis >= 0.7.0

Project links

Author

License

The code for PredisExtension is distributed under the terms of the MIT license (see LICENSE).

Something went wrong with that request. Please try again.