mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
eAccelerator is dead
This commit is contained in:
parent
13a2570ad0
commit
1bb6e61583
@ -189,7 +189,7 @@ return [
|
||||
'cache_engine' => [
|
||||
'name' => 'Cache Engine',
|
||||
'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',
|
||||
'default' => 'auto',
|
||||
'is_config' => true,
|
||||
|
@ -56,10 +56,6 @@ class Cache
|
||||
self::$instance = new APCu($prefix);
|
||||
break;
|
||||
|
||||
case 'eaccelerator':
|
||||
self::$instance = new eAccelerator($prefix);
|
||||
break;
|
||||
|
||||
case 'xcache':
|
||||
self::$instance = new XCache($prefix);
|
||||
break;
|
||||
@ -93,8 +89,6 @@ class Cache
|
||||
return 'apc';
|
||||
else if (function_exists('apcu_fetch'))
|
||||
return 'apcu';
|
||||
else if (function_exists('eaccelerator_get'))
|
||||
return 'eaccelerator';
|
||||
else if (function_exists('xcache_get') && ini_get('xcache.var_size'))
|
||||
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