Skip to content

Commit

Permalink
Use scope in cache bootstrap.
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuswilms committed Feb 4, 2014
1 parent eb5467e commit 34f4844
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions app/config/bootstrap/cache.php
Expand Up @@ -34,7 +34,8 @@
Cache::config(array(
'default' => array(
'adapter' => $apc ? 'Apc' : 'File',
'strategies' => $apc ? array() : array('Serializer')
'strategies' => $apc ? array() : array('Serializer'),
'scope' => $apc ? null : md5(LITHIUM_APP_PATH)
)
));

Expand All @@ -52,13 +53,8 @@
if (!Environment::is('production')) {
return;
}
$cacheScope = md5(LITHIUM_APP_PATH);

/**
* Caches paths for auto-loaded and service-located classes when in production.
*/
Dispatcher::applyFilter('run', function($self, $params, $chain) use ($cacheScope) {
$cacheKey = "{$cacheScope}.core.libraries";
Dispatcher::applyFilter('run', function($self, $params, $chain) {
$cacheKey = 'core.libraries';

if ($cached = Cache::read('default', $cacheKey)) {
$cached = (array) $cached + Libraries::cache();
Expand Down

0 comments on commit 34f4844

Please sign in to comment.