mirror of
https://github.com/flextype/flextype.git
synced 2025-08-09 06:36:52 +02:00
refactor(dependencies): update code according to coding doctrine coding standard
This commit is contained in:
@@ -106,19 +106,7 @@ flextype()->container()['slugify'] = static function () {
|
||||
flextype()->container()['cache'] = static function () {
|
||||
$driver_name = flextype('registry')->get('flextype.settings.cache.driver');
|
||||
|
||||
if (! $driver_name || $driver_name === 'auto') {
|
||||
if (extension_loaded('apcu')) {
|
||||
$driver_name = 'apcu';
|
||||
} elseif (extension_loaded('wincache')) {
|
||||
$driver_name = 'wincache';
|
||||
} else {
|
||||
$driver_name = 'files';
|
||||
}
|
||||
}
|
||||
|
||||
if (flextype('registry')->get('flextype.settings.cache.enabled') === false) {
|
||||
$driver_name = 'devnull';
|
||||
}
|
||||
$config = [];
|
||||
|
||||
function getDriverConfig(string $driver_name): array
|
||||
{
|
||||
@@ -135,6 +123,20 @@ flextype()->container()['cache'] = static function () {
|
||||
return $config;
|
||||
}
|
||||
|
||||
if (! $driver_name || $driver_name === 'auto') {
|
||||
if (extension_loaded('apcu')) {
|
||||
$driver_name = 'apcu';
|
||||
} elseif (extension_loaded('wincache')) {
|
||||
$driver_name = 'wincache';
|
||||
} else {
|
||||
$driver_name = 'files';
|
||||
}
|
||||
}
|
||||
|
||||
if (flextype('registry')->get('flextype.settings.cache.enabled') === false) {
|
||||
$driver_name = 'devnull';
|
||||
}
|
||||
|
||||
switch ($driver_name) {
|
||||
case 'apcu':
|
||||
$config = new Config(getDriverConfig($driver_name));
|
||||
|
Reference in New Issue
Block a user