Skip to content

magium/mcm-redis-factory

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
etc
 
 
lib
 
 
 
 
 
 

MCM Redis Factory

This is a simple library that allows you to configure a Redis adapter using the Magium Configuration Manager.

Setup

Using it is really easy.

First install via composer

composer require magium/redis-factory

Then wire your application to use MCM.

$factory = new \Magium\Configuration\MagiumConfigurationFactory();
$config = $factory->getManager()->getConfiguration(getenv('ENVIRONMENT'));

$redis = \Magium\RedisFactory\Factory::factory($config);

To Change Settings

Use the MCM configuration manager to change settings. For example, if you are going to use the CLI to make changes you have the following options:

[kschroeder@dev ~]$ vendor/configuration-manager magium:configuration:list-keys
Valid configuration keys
magium/redis/host (default: localhost)
        (Hostname for the redis machine)

magium/redis/port (default: 6379)
        (Port for the server)

magium/redis/timeout (default: 2.5)
        (Connection timeout)

magium/redis/persistent (default: off)
        (Should the connection use a persistent connection?)

magium/redis/database
        (The default database number for the connection)

If you need to change the configuration to something else:

[kschroeder@dev ~]$ vendor/magium-configuration magium:configuration:set magium/redis/host hostname

Voila! You're done. No deployment necessary.

About

A factory for Redis for use with the Magium Configuration Manager

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages