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