Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 6849 | Rev 6898 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 6849 Rev 6866
Línea 2... Línea 2...
2
 
2
 
Línea 3... Línea 3...
3
declare(strict_types=1);
3
declare(strict_types=1);
Línea -... Línea 4...
-
 
4
 
-
 
5
namespace LeadersLinked\Cache;
-
 
6
 
4
 
7
use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
5
namespace LeadersLinked\Cache;
8
 
Línea 6... Línea 9...
6
 
9
 
Línea 7... Línea 10...
7
class CacheImpl implements CacheInterface
10
class CacheImpl implements CacheInterface
8
{
-
 
9
    
-
 
10
    private $memcached;
-
 
11
    
-
 
12
    
-
 
13
    /**
-
 
14
     *
-
 
15
     * @var CacheInterface
11
{
16
     */
12
    
17
    private static $_instance;
13
    private $memcached;
18
    
14
    
Línea 34... Línea 30...
34
    /**
30
    /**
35
     *
31
     *
36
     * @var int
32
     * @var int
37
     */
33
     */
38
    private $port;
34
    private $port;
39
    
-
 
40
    
35
 
41
    /**
-
 
42
     *
-
 
43
     * @param Array $config
-
 
44
     * @return CacheImpl
-
 
45
     */
-
 
46
    public static function getInstance($config)
-
 
47
    {
-
 
48
        if(self::$_instance == null) {
-
 
49
            self::$_instance = new CacheImpl($config);
-
 
50
        }
-
 
51
        return self::$_instance;
-
 
52
    }
-
 
53
    
-
 
54
    /**
36
    /**
55
     *
37
     *
56
     * @param Array $config
38
     * @param Array $config
57
     */
39
     */
58
    private function __construct($config)
40
    public function __construct($config)
59
    {
41
    {
60
        $this->ttl    = intval($config['leaderslinked.memcache.ttl'], 10);
42
        $this->ttl    = intval($config['leaderslinked.memcache.ttl'], 10);
61
        $this->host   = strval($config['leaderslinked.memcache.host']);
43
        $this->host   = strval($config['leaderslinked.memcache.host']);
62
        $this->port   = intval($config['leaderslinked.memcache.port'], 10);
44
        $this->port   = intval($config['leaderslinked.memcache.port'], 10);