Skip to content

Commit 04af3dc

Browse files
committed
Cache: disable library caching, unless in production. This also ensures that the test suite works as expected, even when libraries/tests are added/removed. Fixes #116 in UnionOfRAD/lithium
1 parent d735927 commit 04af3dc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/config/bootstrap/cache.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313
use lithium\storage\Cache;
1414
use lithium\core\Libraries;
15+
use lithium\core\Environment;
1516
use lithium\action\Dispatcher;
1617
use lithium\storage\cache\adapter\Apc;
1718

@@ -45,6 +46,9 @@
4546
* Caches paths for auto-loaded and service-located classes.
4647
*/
4748
Dispatcher::applyFilter('run', function($self, $params, $chain) {
49+
if (!Environment::get('production')) {
50+
return $chain->next($self, $params, $chain);
51+
}
4852
$key = md5(LITHIUM_APP_PATH) . '.core.libraries';
4953

5054
if ($cache = Cache::read('default', $key)) {

0 commit comments

Comments
 (0)