apc is disabled on the cli by default

Therefore, on the cli if the extension is loaded - it's necessary to
check if it's also enabled. Otherwise on the cli there will be no cache.
This commit is contained in:
AD7six 2011-04-17 11:42:04 +02:00
parent 3f4f9d0890
commit 65121a4292

View file

@ -284,9 +284,13 @@
*
*/
// Pick the caching engine to use. If APC is enabled use it.
/**
* Pick the caching engine to use. If APC is enabled use it.
* If running via cli - apc is disabled by default. ensure it's avaiable and enabled in this case
*
*/
$engine = 'File';
if (extension_loaded('apc')) {
if (extension_loaded('apc') && (php_sapi_name() !== 'cli' || ini_get('apc.enable_cli'))) {
$engine = 'Apc';
}