Skip to content

Commit

Permalink
Xcache is not available for php-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
fiblan committed Jun 8, 2012
1 parent 5270721 commit d2ac734
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions lib/Cake/Cache/Engine/XcacheEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit d2ac734

Please sign in to comment.