eAccelerator is dead

This commit is contained in:
slawkens 2024-01-30 23:13:57 +01:00
parent 13a2570ad0
commit 1bb6e61583
3 changed files with 1 additions and 63 deletions

View File

@ -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,

View File

@ -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';

View File

@ -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;
}
}