mirror of
https://github.com/flextype/flextype.git
synced 2025-08-11 23:54:06 +02:00
Flextype Core: Cache - code fixes according Scrutinizer Tests.
The class Doctrine\Common\Cache\XcacheCache has been deprecated. The class Doctrine\Common\Cache\MemcacheCache has been deprecated.
This commit is contained in:
@@ -121,8 +121,6 @@ class Cache
|
||||
if (!$driver_name || $driver_name == 'auto') {
|
||||
if (extension_loaded('apcu')) {
|
||||
$driver_name = 'apcu';
|
||||
} elseif (extension_loaded('apc')) {
|
||||
$driver_name = 'apc';
|
||||
} elseif (extension_loaded('wincache')) {
|
||||
$driver_name = 'wincache';
|
||||
} elseif (extension_loaded('xcache')) {
|
||||
@@ -133,11 +131,6 @@ class Cache
|
||||
}
|
||||
|
||||
switch ($driver_name) {
|
||||
// The ApcCache driver uses the apc_fetch, apc_exists, etc. functions
|
||||
// that come with PHP so no additional setup is required in order to use it.
|
||||
case 'apc':
|
||||
$driver = new DoctrineCache\ApcCache();
|
||||
break;
|
||||
// The ApcuCache driver uses the apcu_fetch, apcu_exists, etc. functions
|
||||
// that come with PHP so no additional setup is required in order to use it.
|
||||
case 'apcu':
|
||||
@@ -159,16 +152,6 @@ class Cache
|
||||
case 'xcache':
|
||||
$driver = new DoctrineCache\XcacheCache();
|
||||
break;
|
||||
// The MemcacheCache drivers stores the cache data in Memcache.
|
||||
case 'memcache':
|
||||
$memcache = new \Memcache();
|
||||
$memcache->connect(
|
||||
Registry::get('settings.cache.memcache.server', 'localhost'),
|
||||
Registry::get('settings.cache.memcache.port', 11211)
|
||||
);
|
||||
$driver = new DoctrineCache\MemcacheCache();
|
||||
$driver->setMemcache($memcache);
|
||||
break;
|
||||
// The MemcachedCache drivers stores the cache data in Memcached.
|
||||
case 'memcached':
|
||||
$memcached = new \Memcached();
|
||||
|
@@ -86,11 +86,9 @@ class SettingsManager
|
||||
|
||||
$cache_driver = ['auto' => 'Auto Detect',
|
||||
'file' => 'File',
|
||||
'apc' => 'APC',
|
||||
'apcu' => 'APCu',
|
||||
'wincache' => 'WinCache',
|
||||
'xcache' => 'Xcache',
|
||||
'memcache' => 'Memcache',
|
||||
'memcached' => 'Memcached',
|
||||
'redis' => 'Redis',
|
||||
'sqlite3' => 'SQLite3',
|
||||
|
@@ -196,16 +196,6 @@ Themes::view('admin/views/partials/content-start')->display();
|
||||
<?= Form::input('cache[lifetime]', $settings['cache']['lifetime'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCacheLifetime', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('cache[memcache][server]', __('admin_memcache_server'), ['for' => 'systemSettingsSystemCacheMemcacheServer']) ?>
|
||||
<?= Form::input('cache[memcache][server]', $settings['cache']['memcache']['server'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCacheMemcacheServer', 'required']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('cache[memcache][port]', __('admin_memcache_port'), ['for' => 'systemSettingsSystemCacheMemcachePort']) ?>
|
||||
<?= Form::input('cache[memcache][port]', $settings['cache']['memcache']['port'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCacheMemcachePort', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('cache[memcached][server]', __('admin_memcached_server'), ['for' => 'systemSettingsSystemCacheMemcachedServer']) ?>
|
||||
|
Reference in New Issue
Block a user