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