Skip to content
Snippets Groups Projects
Commit 1977fa14 authored by Demian Katz's avatar Demian Katz
Browse files

More config cache tweaking.

parent 4625d7c3
No related merge requests found
...@@ -19,7 +19,8 @@ if ($localModules = getenv('VUFIND_LOCAL_MODULES')) { ...@@ -19,7 +19,8 @@ if ($localModules = getenv('VUFIND_LOCAL_MODULES')) {
} }
} }
// Set up cache directory (be sure to keep separate cache for CLI vs. web): // Set up cache directory (be sure to keep separate cache for CLI vs. web and
// to account for potentially variant environment settings):
$baseDir = ($local = getenv('VUFIND_LOCAL_DIR')) ? $local : 'data'; $baseDir = ($local = getenv('VUFIND_LOCAL_DIR')) ? $local : 'data';
if (PHP_SAPI == 'cli') { if (PHP_SAPI == 'cli') {
$cacheDir = $baseDir . '/cache/cli'; $cacheDir = $baseDir . '/cache/cli';
...@@ -33,6 +34,15 @@ if (PHP_SAPI == 'cli') { ...@@ -33,6 +34,15 @@ if (PHP_SAPI == 'cli') {
if (!is_dir($cacheDir)) { if (!is_dir($cacheDir)) {
mkdir($cacheDir); mkdir($cacheDir);
} }
$cacheHash = md5(
APPLICATION_ENV
. (defined('VUFIND_LOCAL_DIR') ? VUFIND_LOCAL_DIR : '')
. implode(',', $modules)
);
$cacheDir .= '/' . $cacheHash;
if (!is_dir($cacheDir)) {
mkdir($cacheDir);
}
// Enable caching unless in dev mode or running tests: // Enable caching unless in dev mode or running tests:
$useCache = APPLICATION_ENV != 'development' && !defined('VUFIND_PHPUNIT_RUNNING'); $useCache = APPLICATION_ENV != 'development' && !defined('VUFIND_PHPUNIT_RUNNING');
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment