Skip to content

Instantly share code, notes, and snippets.

@adri
Last active February 15, 2017 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adri/0b065067905cdb7e3fb1181496a80841 to your computer and use it in GitHub Desktop.
Save adri/0b065067905cdb7e3fb1181496a80841 to your computer and use it in GitHub Desktop.
Cache Doctrine metadata via opcache using DoctrineCacheBridge
framework:
cache:
pools:
app.cache.doctrine_metadata:
adapter: cache.adapter.php_files
doctrine:
orm:
entity_managers:
default:
metadata_cache_driver:
type: service
id: app.cache.metadata_cache
<service id="app.cache.metadata_cache" class="Cache\Bridge\DoctrineCacheBridge">
<argument type="service" id="app.cache.doctrine_metadata" />
</service>
<service id="cache.adapter.php_files" class="Symfony\Component\Cache\Adapter\PhpFilesAdapter" abstract="true">
<tag name="cache.pool" clearer="cache.default_clearer" />
<tag name="monolog.logger" channel="cache" />
<argument /> <!-- namespace -->
<argument>0</argument> <!-- default lifetime -->
<argument>%kernel.cache_dir%/pools</argument>
<call method="setLogger">
<argument type="service" id="logger" on-invalid="ignore" />
</call>
</service>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment