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

New configuration to optimize production performance.

parent f285760c
No related merge requests found
<?php <?php
$config = array(
'modules' => array( // Set up modules:
'VuFindHttp', 'VuFindTheme', 'VuFindSearch', 'VuFind', 'VuFindAdmin' $modules = array(
), 'VuFindHttp', 'VuFindTheme', 'VuFindSearch', 'VuFind', 'VuFindAdmin'
);
if (PHP_SAPI == 'cli' && !defined('VUFIND_PHPUNIT_RUNNING')) {
$modules[] = 'VuFindConsole';
}
if (APPLICATION_ENV == 'development') {
$modules[] = 'VuFindDevTools';
}
if ($localModules = getenv('VUFIND_LOCAL_MODULES')) {
$localModules = array_map('trim', explode(',', $localModules));
foreach ($localModules as $current) {
if (!empty($current)) {
$modules[] = $current;
}
}
}
// Set up cache directory:
$baseDir = ($local = getenv('VUFIND_LOCAL_DIR')) ? $local : 'data';
$cacheDir = $baseDir . '/cache/configs';
if (!is_dir($cacheDir)) {
mkdir($cacheDir);
}
// Build configuration:
return array(
'modules' => array_unique($modules),
'module_listener_options' => array( 'module_listener_options' => array(
'config_glob_paths' => array( 'config_glob_paths' => array(
'config/autoload/{,*.}{global,local}.php', 'config/autoload/{,*.}{global,local}.php',
), ),
'config_cache_enabled' => false, 'config_cache_enabled' => (APPLICATION_ENV != 'development'),
'cache_dir' => 'data/cache', 'module_map_cache_enabled' => (APPLICATION_ENV != 'development'),
'check_dependencies' => (APPLICATION_ENV == 'development'),
'cache_dir' => $cacheDir,
'module_paths' => array( 'module_paths' => array(
'./module', './module',
'./vendor', './vendor',
...@@ -19,19 +47,4 @@ $config = array( ...@@ -19,19 +47,4 @@ $config = array(
'factories' => array( 'factories' => array(
), ),
), ),
); );
if (PHP_SAPI == 'cli' && !defined('VUFIND_PHPUNIT_RUNNING')) { \ No newline at end of file
$config['modules'][] = 'VuFindConsole';
}
if (APPLICATION_ENV == 'development') {
$config['modules'][] = 'VuFindDevTools';
}
if ($localModules = getenv('VUFIND_LOCAL_MODULES')) {
$localModules = array_map('trim', explode(',', $localModules));
foreach ($localModules as $current) {
if (!empty($current) && !in_array($current, $config['modules'])) {
$config['modules'][] = $current;
}
}
}
return $config;
...@@ -89,7 +89,7 @@ class Manager ...@@ -89,7 +89,7 @@ class Manager
$cacheBase = $this->getCacheDir(); $cacheBase = $this->getCacheDir();
// Set up standard file-based caches: // Set up standard file-based caches:
foreach (array('cover', 'language', 'object') as $cache) { foreach (array('config', 'cover', 'language', 'object') as $cache) {
$this->createFileCache($cache, $cacheBase . $cache . 's'); $this->createFileCache($cache, $cacheBase . $cache . 's');
} }
......
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