Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
memcachedconnection.php
1
<?php
9
namespace
Bitrix\Main\Data
;
10
17
class
MemcachedConnection
extends
NosqlConnection
18
{
19
protected
Configurator\MemcachedConnectionConfigurator
$configurator
;
20
21
public
function
__construct
(array
$configuration
)
22
{
23
parent::__construct(
$configuration
);
24
$this->configurator =
new
Configurator\MemcachedConnectionConfigurator
($this->
getConfiguration
());
25
}
26
27
protected
function
connectInternal
()
28
{
29
$this->resource = $this->configurator->createConnection();
30
$this->
isConnected
= (bool)$this->resource;
31
}
32
33
protected
function
disconnectInternal
()
34
{
35
if
($this->
isConnected
())
36
{
37
$this->resource->quit();
38
$this->resource =
null
;
39
$this->
isConnected
=
false
;
40
}
41
}
42
43
public
function
get
($key)
44
{
45
if
(!$this->
isConnected
())
46
{
47
$this->
connect
();
48
}
49
50
return
$this->resource->get($key);
51
}
52
53
public
function
set
($key, $value)
54
{
55
if
(!$this->
isConnected
())
56
{
57
$this->
connect
();
58
}
59
60
return
$this->resource->set($key, $value);
61
}
62
}
Bitrix\Main\Data\Configurator\MemcachedConnectionConfigurator
Definition
memcachedconnectionconfigurator.php:9
Bitrix\Main\Data\Connection\connect
connect()
Definition
connection.php:31
Bitrix\Main\Data\Connection\$configuration
$configuration
Definition
connection.php:21
Bitrix\Main\Data\Connection\getConfiguration
getConfiguration()
Definition
connection.php:75
Bitrix\Main\Data\Connection\isConnected
isConnected()
Definition
connection.php:62
Bitrix\Main\Data\MemcachedConnection
Definition
memcachedconnection.php:18
Bitrix\Main\Data\MemcachedConnection\connectInternal
connectInternal()
Definition
memcachedconnection.php:27
Bitrix\Main\Data\MemcachedConnection\disconnectInternal
disconnectInternal()
Definition
memcachedconnection.php:33
Bitrix\Main\Data\MemcachedConnection\$configurator
Configurator MemcachedConnectionConfigurator $configurator
Definition
memcachedconnection.php:19
Bitrix\Main\Data\MemcachedConnection\__construct
__construct(array $configuration)
Definition
memcachedconnection.php:21
Bitrix\Main\Data\NosqlConnection
Definition
nosqlconnection.php:12
Bitrix\Main\Data
Definition
aliases.php:105
modules
main
lib
data
memcachedconnection.php
Создано системой
1.10.0