ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
Factory.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Cache\Adaptor
;
22
23
use
ILIAS\Cache\Config
;
24
28
class
Factory
29
{
30
public
function
getSpecific
(
string
$adaptor,
Config
$config):
Adaptor
31
{
32
$adaptor_implementation = match ($adaptor) {
33
Config::APCU
=>
new
APCu
($config),
34
Config::PHPSTATIC
=>
new
PHPStatic
($config),
35
Config::MEMCACHED
=>
new
Memcached
($config),
36
default
=>
new
PHPStatic
($config),
37
};
38
39
return
$adaptor_implementation->
isAvailable
() ? $adaptor_implementation :
new
PHPStatic
($config);
40
}
41
42
public
function
getWithConfig
(
Config
$config):
Adaptor
43
{
44
return
$this->
getSpecific
($config->
getAdaptorName
(), $config);
45
}
46
}
ILIAS\Cache\Adaptor\Adaptor\Adaptor
Definition:
Adaptor.php:28
ILIAS\Cache\Adaptor\PHPStatic
Definition:
PHPStatic.php:28
ILIAS\Cache\Adaptor
Definition:
Adaptor.php:21
ILIAS\Cache\Config\getAdaptorName
getAdaptorName()
Definition:
Config.php:48
ILIAS\Cache\Config
Definition:
Config.php:29
ILIAS\Cache\Adaptor\Factory
Definition:
Factory.php:28
ILIAS\Cache\Adaptor\APCu
Definition:
APCu.php:26
ILIAS\Cache\Adaptor\Factory\getSpecific
getSpecific(string $adaptor, Config $config)
Definition:
Factory.php:30
ILIAS\Cache\Adaptor\Factory\getWithConfig
getWithConfig(Config $config)
Definition:
Factory.php:42
ILIAS\Cache\Adaptor\Memcached
Definition:
Memcached.php:28
ILIAS\Cache\Config\MEMCACHED
const MEMCACHED
Definition:
Config.php:34
Config
ILIAS\Cache\Adaptor\PHPStatic\isAvailable
isAvailable()
Definition:
PHPStatic.php:36
ILIAS\Cache\Config\APCU
const APCU
Definition:
Config.php:32
ILIAS\Cache\Config\PHPSTATIC
const PHPSTATIC
Definition:
Config.php:33
components
ILIAS
Cache
src
Adaptor
Factory.php
Generated on Sun Aug 31 2025 23:01:50 for ILIAS by
1.8.13 (using
Doxyfile
)