Browse Source

Allow to use Xcache from CLI.

chinpei215 10 years ago
parent
commit
8a5b3bc591

+ 1 - 1
src/Cache/Engine/XcacheEngine.php

@@ -58,7 +58,7 @@ class XcacheEngine extends CacheEngine
      */
      */
     public function init(array $config = [])
     public function init(array $config = [])
     {
     {
-        if ((PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') || !extension_loaded('xcache')) {
+        if (!extension_loaded('xcache')) {
             return false;
             return false;
         }
         }
 
 

+ 1 - 4
tests/TestCase/Cache/Engine/XcacheEngineTest.php

@@ -35,10 +35,7 @@ class XcacheEngineTest extends TestCase
     public function setUp()
     public function setUp()
     {
     {
         parent::setUp();
         parent::setUp();
-        if ((PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg')) {
-            $this->markTestSkipped('Xcache is not available for the CLI.');
-        }
-        if (!function_exists('xcache_set')) {
+        if (!extension_loaded('xcache')) {
             $this->markTestSkipped('Xcache is not installed or configured properly');
             $this->markTestSkipped('Xcache is not installed or configured properly');
         }
         }
         Cache::enable();
         Cache::enable();