forked from KeyAuth/KeyAuth-Source-Code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathredis.php
More file actions
15 lines (11 loc) · 634 Bytes
/
redis.php
File metadata and controls
15 lines (11 loc) · 634 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
include_once (($_SERVER['DOCUMENT_ROOT'] == "/usr/share/nginx/html/panel" || $_SERVER['DOCUMENT_ROOT'] == "/usr/share/nginx/html/api") ? "/usr/share/nginx/html" : $_SERVER['DOCUMENT_ROOT']) . '/includes/credentials.php'; // reference credentials
if (!class_exists('Redis')) {
die('Redis isn\'t installed. You must install Redis server and Redis PHP extension.<br><br>Or if your configuration can\'t install Redis, remove code containing Redis from /includes/misc/cache.php');
}
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
global $redisPass;
if(!empty($redisPass)) {
$redis->auth($redisPass);
}