Skip to content

question : how to set redis options ? #73

@davidbarre

Description

@davidbarre

Hi,

I try to set this redis option in my provider declaration :

  • host
  • port
  • password
    but It doesn't work, I got this error

Uncaught exception 'RuntimeException' with message 'Host and port options need to be specified for redis cache'

Where I have to set this option ?
Thanks for your answers.

I try this :

$app->register(new DoctrineOrmServiceProvider(), array(
    'orm.proxies_dir' => __DIR__."/../../cache/doctrineProxies",
    'orm.proxies_namespace' => $app['env'],
    'orm.auto_generate_proxies' => $app['debug'],
    'orm.default_cache' => getenv('REDIS_CACHE') ? 'redis' : 'array',
    'host' => getenv('REDIS_HOST'),
    'port' => getenv('REDIS_PORT'),
    'password' => getenv('REDIS_PASSWORD'),
    'orm.em.options' => array(
        'cache_namespace' => $app['env'].'_',
        'mappings' => array(
            array(
                'type' => 'annotation',
                'namespace' => 'Models',
                'path' => '',
            ),
        ),
    ),
));

also this

$app->register(new DoctrineOrmServiceProvider(), array(
    'orm.proxies_dir' => __DIR__."/../../cache/doctrineProxies",
    'orm.proxies_namespace' => $app['env'],
    'orm.auto_generate_proxies' => $app['debug'],
    'orm.default_cache' => getenv('REDIS_CACHE') ? 'redis' : 'array',
    'orm.em.options' => array(
        'cache_namespace' => $app['env'].'_',
        'host' => getenv('REDIS_HOST'),
        'port' => getenv('REDIS_PORT'),
        'password' => getenv('REDIS_PASSWORD'),
        'mappings' => array(
            array(
                'type' => 'annotation',
                'namespace' => 'Models',
                'path' => '',
            ),
        ),
    ),
));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions