2017 © Pedro Peláez
 

library service-provider

Predis service provider for the Silex microframework

image

predis/service-provider

Predis service provider for the Silex microframework

  • Monday, November 28, 2016
  • by nrk
  • Repository
  • 4 Watchers
  • 67 Stars
  • 198,741 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 19 Forks
  • 1 Open issues
  • 13 Versions
  • 5 % Grown

The README.md

Predis ServiceProvider

Latest Stable Version Total Downloads License Build Status HHVM Status, (*1)

This service provider for Silex allows developers to easily configure and expose Predis enabling them to use Redis in their applications., (*2)

Getting started

Supposing that the skeleton of your application is ready, you simply need to register this service provider by specifying the parameters and options needed to access Redis:, (*3)

$app->register(new Predis\Silex\ClientServiceProvider(), [
    'predis.parameters' => 'tcp://127.0.0.1:6379',
    'predis.options'    => [
        'prefix'  => 'silex:',
        'profile' => '3.0',
    ],
]);

This will register one instance of Predis\Client accessible from anywhere in your application by using $app['predis']. Both predis.parameters and predis.options are optional and they accept the same values accepted by the constructor of Predis\Client (see the documentation of Predis)., (*4)

Certain applications might need more than one client to reach different servers or configured with different options. In such cases you must use Predis\Silex\ClientsServiceProvider providing a list of clients with their own parameters and options using predis.clients:, (*5)

$app->register(new Predis\Silex\ClientsServiceProvider(), [
    'predis.clients' => [
        'client1' => 'tcp://127.0.0.1:6379',
        'client2' => [
            'host' => '127.0.0.1',
            'port' => 6380,
        ],
        'client3' => [
            'parameters' => 'tcp://127.0.0.1:6381',
            'options' => [
                'profile' => 'dev',
                'prefix'  => 'silex:',
            ],
        ],
    ),
]);

Clients will be exposed to your application using $app['predis'][$alias] where $alias is the key used to populate the items of predis.clients. Optionally, it is possible to set a default client by specifying its alias in predis.default_client making it accessible simply by invoking methods of Predis\Client directly against $app['predis']. Client instances are lazily initialized upon the first access., (*6)

NOTE: this is not the same as using a cluster of nodes or replication as it will only create and set up independent client instances. Cluster and replication thus work with both single and multiple client configurations, you just need to provide the needed parameters and options for each instance of Predis\Client., (*7)

You can find more details on how to use this provider in the examples directory or the test suite., (*8)

Reporting bugs and contributing code

Contributions are highly appreciated either in the form of pull requests for new features, bug fixes or just bug reports. We only ask you to adhere to a basic set of rules before submitting your changes or filing bugs on the issue tracker to make it easier for everyone to stay consistent while working on the project., (*9)

Author

Contributors

License

The code for Predis ServiceProvider is distributed under the terms of the MIT license., (*10)

The Versions

28/11 2016

v2.0.x-dev

2.0.9999999.9999999-dev https://github.com/nrk/PredisServiceProvider

Predis service provider for the Silex microframework

  Sources   Download

MIT

The Requires

 

The Development Requires

silex redis predis

28/11 2016

dev-master

9999999-dev https://github.com/nrk/PredisServiceProvider

Predis service provider for the Silex microframework

  Sources   Download

MIT

The Requires

 

The Development Requires

silex redis predis

28/11 2016

v2.0.0

2.0.0.0 https://github.com/nrk/PredisServiceProvider

Predis service provider for the Silex microframework

  Sources   Download

MIT

The Requires

 

The Development Requires

silex redis predis

06/08 2014

v1.0.x-dev

1.0.9999999.9999999-dev https://github.com/nrk/PredisServiceProvider

Predis service provider for the Silex microframework

  Sources   Download

MIT

The Requires

 

The Development Requires

silex redis predis

06/08 2014

v1.0.0

1.0.0.0 https://github.com/nrk/PredisServiceProvider

Predis service provider for the Silex microframework

  Sources   Download

MIT

The Requires

 

The Development Requires

silex redis predis

18/10 2013

v0.4.2

0.4.2.0 https://github.com/nrk/PredisServiceProvider

Predis service provider for the Silex microframework

  Sources   Download

MIT

The Requires

 

silex redis predis

19/03 2013

v0.4.1

0.4.1.0 https://github.com/nrk/PredisServiceProvider

Predis service provider for the Silex microframework

  Sources   Download

MIT

The Requires

 

silex redis predis

03/02 2013

v0.4.0

0.4.0.0 https://github.com/nrk/PredisServiceProvider

Predis service provider for the Silex microframework

  Sources   Download

MIT

The Requires

 

silex redis predis

14/07 2012

v0.3.0

0.3.0.0 https://github.com/nrk/PredisServiceProvider

Predis service provider for the Silex microframework

  Sources   Download

MIT

The Requires

 

silex redis predis

01/06 2012

v0.2.4

0.2.4.0 https://github.com/nrk/PredisServiceProvider

Predis service provider for the Silex microframework

  Sources   Download

MIT

The Requires

 

silex redis predis

11/12 2011

v0.2.3

0.2.3.0 https://github.com/nrk/PredisServiceProvider

Predis service provider for the Silex microframework

  Sources   Download

MIT

The Requires

 

silex redis

13/11 2011

0.2.2

0.2.2.0 https://github.com/nrk/PredisServiceProvider

Predis service provider for the Silex microframework

  Sources   Download

MIT

The Requires

 

silex redis

02/10 2011

0.2.1

0.2.1.0 https://github.com/nrk/PredisServiceProvider

Predis service provider for the Silex microframework

  Sources   Download

MIT

The Requires

 

silex redis