-
-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathServerCommandsTrait.php
62 lines (54 loc) · 1.54 KB
/
ServerCommandsTrait.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
* This file is part of RedisClient.
* git: https://github.com/cheprasov/php-redis-client
*
* (C) Alexander Cheprasov <acheprasov84@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace RedisClient\Command\Traits\Version5x0;
use RedisClient\Command\Traits\Version3x2\ServerCommandsTrait as ServerCommandsTraitVersion3x2;
/**
* Server Commands
* @link http://redis.io/commands#server
*/
trait ServerCommandsTrait {
use ServerCommandsTraitVersion3x2;
/**
* LOLWUT
* Available since 5.0.0.
* @link http://antirez.com/news/123
*
* @param number|null $param1
* @param number|null $param2
* @param number|null $param3
* @return bool
*/
public function lolwut($param1 = null, $param2 = null, $param3 = null) {
$params = [];
if (isset($param1)) {
$params[] = $param1;
if (isset($param2)) {
$params[] = $param2;
if (isset($param3)) {
$params[] = $param3;
}
}
}
return $this->returnCommand(['LOLWUT'], null, $params ? $params : null);
}
/**
* REPLICAOF host port
* Available since 5.0.0.
* @link https://redis.io/commands/replicaof
*
* @param string $host
* @param int $port
* @return bool
*/
public function replicaof($host, $port) {
return $this->returnCommand(['REPLICAOF'], null, [$host, $port]);
}
}