mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Xcache is not available for php-cli
This commit is contained in:
parent
5270721ade
commit
d2ac734da6
1 changed files with 11 additions and 8 deletions
|
@ -45,14 +45,17 @@ class XcacheEngine extends CacheEngine {
|
|||
* @return boolean True if the engine has been successfully initialized, false if not
|
||||
*/
|
||||
public function init($settings = array()) {
|
||||
parent::init(array_merge(array(
|
||||
'engine' => 'Xcache',
|
||||
'prefix' => Inflector::slug(APP_DIR) . '_',
|
||||
'PHP_AUTH_USER' => 'user',
|
||||
'PHP_AUTH_PW' => 'password'
|
||||
), $settings)
|
||||
);
|
||||
return function_exists('xcache_info');
|
||||
if ( php_sapi_name() !== 'cli' ){
|
||||
parent::init(array_merge(array(
|
||||
'engine' => 'Xcache',
|
||||
'prefix' => Inflector::slug(APP_DIR) . '_',
|
||||
'PHP_AUTH_USER' => 'user',
|
||||
'PHP_AUTH_PW' => 'password'
|
||||
), $settings)
|
||||
);
|
||||
return function_exists('xcache_info');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue