Skip to content

Commit 05fd0fc

Browse files
committed
Merge branch 'hotfix/en'
2 parents 1dabb61 + 6bf8fb4 commit 05fd0fc

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

Readme.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
Обработчик сессий через Redis с механизмом блокировки
2-
=====================================================
1+
Redis session handler through a locking mechanism
2+
=================================================
33

44

5-
Описание
6-
---------
7-
Используется для хранения сессий php в редисе.
5+
Description
6+
-----------
7+
Used to store php sessions radishes.
88

9-
Добавлен механизм блокировок: пока один процесс работает с сессией, второй процесс ожидает.
9+
The mechanism locks: one is the process of working with the session, the second process is waiting.
1010

11-
Установка
12-
---------
11+
12+
Installation
13+
------------
1314

1415
```
1516
composer require dmitry-suffi/redis-session-handler
1617
```
1718

18-
Использование
19-
-------------
19+
Using
20+
-----
2021

2122
```php
2223

@@ -29,5 +30,4 @@ if ($redis->connect('11.111.111.11', 6379) && $redis->select(0)) {
2930

3031
session_start();
3132

32-
```
33-
33+
```

src/RedisSessionHandler.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,49 @@
99
class RedisSessionHandler implements \SessionHandlerInterface
1010
{
1111
/**
12-
* Инстанс редиса
12+
* instance Redis
1313
* @var \Redis
1414
*/
1515
protected $redis;
1616

1717
/**
18-
* Время жизни сессии
18+
* The lifetime of the session
1919
* @var int
2020
*/
2121
protected $ttl;
2222

2323
/**
24-
* Префикс
24+
* Prefix
2525
* @var string
2626
*/
2727
protected $prefix;
2828

2929
/**
30-
* Флаг блокировки
30+
* lock flag
3131
* @var bool
3232
*/
3333
protected $locked;
3434

3535
/**
36-
* Ключ блокировки
36+
* key lock
3737
* @var string
3838
*/
3939
private $lockKey;
4040

4141
/**
42-
* Токен блокировки
42+
* token locking
4343
* @var string
4444
*/
4545
private $token;
4646

4747
/**
48-
* Время между попытками разблокировки
48+
* The time between attempts to unlock
4949
* @var int
5050
*/
5151
private $spinLockWait;
5252

5353
/**
54-
* Максимальное время ожидания разблокировки
54+
* Maximum waiting time unlock
5555
* @var int
5656
*/
5757
private $lockMaxWait;
@@ -99,7 +99,7 @@ protected function lockSession($sessionId)
9999
$this->getRedisKey($this->lockKey),
100100
$this->token,
101101
[
102-
'NX', //Установить ключ только, если он уже не существует.
102+
'NX',
103103
]
104104
);
105105
if ($success) {
@@ -112,7 +112,7 @@ protected function lockSession($sessionId)
112112
}
113113

114114
/**
115-
* Снятие блокировки сессии
115+
* Unlock Session
116116
*/
117117
private function unlockSession()
118118
{
@@ -190,7 +190,7 @@ public function gc($lifetime)
190190
}
191191

192192
/**
193-
* Установка времени жизни сессии
193+
* Setting Time session life
194194
* @param int $ttl
195195
*/
196196
public function setTtl($ttl)
@@ -199,7 +199,7 @@ public function setTtl($ttl)
199199
}
200200

201201
/**
202-
* Максимальное время ожидания разблокировки
202+
* Maximum waiting time unlock
203203
* @return int
204204
*/
205205
public function getLockMaxWait()
@@ -208,7 +208,7 @@ public function getLockMaxWait()
208208
}
209209

210210
/**
211-
* Максимальное время ожидания разблокировки
211+
* Setting maximum waiting time unlock
212212
* @param int $lockMaxWait
213213
*/
214214
public function setLockMaxWait($lockMaxWait)
@@ -217,7 +217,7 @@ public function setLockMaxWait($lockMaxWait)
217217
}
218218

219219
/**
220-
* Подготовка ключа
220+
* Preparation key
221221
* @param string $key key
222222
* @return string prefixed key
223223
*/

tests/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Запуск тестов
1+
Running tests
22
=============
33

44
```

0 commit comments

Comments
 (0)