dflydev / dflydev-doctrine-orm-service-provider

Doctrine ORM Service Provider
MIT License
209 stars 59 forks source link

Allow for setting a cache namespace #17

Closed simensen closed 11 years ago

simensen commented 11 years ago

If cache_namespace is set, setNamespace will be called on the resulting cache instance if it is a Doctrine CacheProvider instance. Doctrine's CacheProvider will take care of normalizing this call for various backends based on its own rules.

$app->register(
    new Dflydev\Silex\Provider\DoctrineOrm\DoctrineOrmServiceProvider,
    array(
        'orm.em.options' => array(
            'cache_namespace' => 'appname_',
            'metadata_cache' => 'apc',
            'query_cache'    => 'apc',
            'mappings' => array(
                array(),
            ),
        ),
    )
);

Thanks to @asiermarques for this work.

Closes #15 Closes #16

asiermarques commented 11 years ago

@simensen It works very well for me, thanks to you!

simensen commented 11 years ago

Alright, I merged it. You can start using it with @dev and let me know if it still works OK. I'll see if I can create a new stable tag soon. Feel free to remind me in a bit if you don't see a stable tag soon enough. :)