-
Notifications
You must be signed in to change notification settings - Fork 34
/
Sentinel.php
36 lines (29 loc) · 1014 Bytes
/
Sentinel.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
<?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\QueuedTracking\Queue\Backend;
use Piwik\Plugins\QueuedTracking\Queue\Backend;
use Piwik\Tracker;
include_once PIWIK_INCLUDE_PATH . '/plugins/QueuedTracking/libs/credis/Client.php';
include_once PIWIK_INCLUDE_PATH . '/plugins/QueuedTracking/libs/credis/Cluster.php';
include_once PIWIK_INCLUDE_PATH . '/plugins/QueuedTracking/libs/credis/Sentinel.php';
class Sentinel extends Redis
{
protected function connect()
{
$client = new \Credis_Client($this->host, $this->port, $this->timeout, $persistent = false, $this->database, $this->password);
$this->redis = new \Credis_Sentinel($client);
$client->connect();
$this->redis = $client;
return true;
}
protected function evalScript($script, $keys, $args)
{
return $this->redis->eval($script, $keys, $args);
}
}