mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 01:39:22 +02:00
eAccelerator is dead
This commit is contained in:
parent
13a2570ad0
commit
1bb6e61583
@ -189,7 +189,7 @@ return [
|
|||||||
'cache_engine' => [
|
'cache_engine' => [
|
||||||
'name' => 'Cache Engine',
|
'name' => 'Cache Engine',
|
||||||
'type' => 'options',
|
'type' => 'options',
|
||||||
'options' => ['auto' => 'Auto', 'file' => 'Files', 'apc' => 'APC', 'apcu' => 'APCu', 'eaccelerator' => 'eAccelerator', 'disable' => 'Disable'],
|
'options' => ['auto' => 'Auto', 'file' => 'Files', 'apc' => 'APC', 'apcu' => 'APCu', 'disable' => 'Disable'],
|
||||||
'desc' => 'Auto is most reasonable. It will detect the best cache engine',
|
'desc' => 'Auto is most reasonable. It will detect the best cache engine',
|
||||||
'default' => 'auto',
|
'default' => 'auto',
|
||||||
'is_config' => true,
|
'is_config' => true,
|
||||||
|
@ -56,10 +56,6 @@ class Cache
|
|||||||
self::$instance = new APCu($prefix);
|
self::$instance = new APCu($prefix);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'eaccelerator':
|
|
||||||
self::$instance = new eAccelerator($prefix);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'xcache':
|
case 'xcache':
|
||||||
self::$instance = new XCache($prefix);
|
self::$instance = new XCache($prefix);
|
||||||
break;
|
break;
|
||||||
@ -93,8 +89,6 @@ class Cache
|
|||||||
return 'apc';
|
return 'apc';
|
||||||
else if (function_exists('apcu_fetch'))
|
else if (function_exists('apcu_fetch'))
|
||||||
return 'apcu';
|
return 'apcu';
|
||||||
else if (function_exists('eaccelerator_get'))
|
|
||||||
return 'eaccelerator';
|
|
||||||
else if (function_exists('xcache_get') && ini_get('xcache.var_size'))
|
else if (function_exists('xcache_get') && ini_get('xcache.var_size'))
|
||||||
return 'xcache';
|
return 'xcache';
|
||||||
|
|
||||||
|
@ -1,56 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Cache eAccelerator class
|
|
||||||
*
|
|
||||||
* @package MyAAC
|
|
||||||
* @author Slawkens <slawkens@gmail.com>
|
|
||||||
* @author Mark Samman (Talaturen) <marksamman@gmail.com>
|
|
||||||
* @copyright 2019 MyAAC
|
|
||||||
* @link https://my-aac.org
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace MyAAC\Cache;
|
|
||||||
|
|
||||||
class EAccelerator
|
|
||||||
{
|
|
||||||
private $prefix;
|
|
||||||
private $enabled;
|
|
||||||
|
|
||||||
public function __construct($prefix = '')
|
|
||||||
{
|
|
||||||
$this->prefix = $prefix;
|
|
||||||
$this->enabled = function_exists('eaccelerator_get');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function set($key, $var, $ttl = 0)
|
|
||||||
{
|
|
||||||
$key = $this->prefix . $key;
|
|
||||||
eaccelerator_rm($key);
|
|
||||||
eaccelerator_put($key, $var, $ttl);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function get($key)
|
|
||||||
{
|
|
||||||
$tmp = '';
|
|
||||||
if ($this->fetch($this->prefix . $key, $tmp)) {
|
|
||||||
return $tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function fetch($key, &$var)
|
|
||||||
{
|
|
||||||
return ($var = eaccelerator_get($this->prefix . $key)) !== null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function delete($key)
|
|
||||||
{
|
|
||||||
eaccelerator_rm($this->prefix . $key);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function enabled()
|
|
||||||
{
|
|
||||||
return $this->enabled;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user