default exception handler added, Client-Options for connections added

This commit is contained in:
Frank Agerholm 2018-12-27 16:25:15 +01:00
commit 29a0861780

View file

@ -1,6 +1,14 @@
<?php <?php
require 'Predis/Autoloader.php'; require 'Predis/Autoloader.php';
Predis\Autoloader::register(); Predis\Autoloader::register();
require_once('./config.php');
function exception_handler($exception) {
$msg = "Nicht aufgefangene Exception: " . $exception->getMessage();
trigger_error($msg,E_USER_ERROR);
}
set_exception_handler('exception_handler');
function getrand() { function getrand() {
$fd = fopen("/dev/urandom","r"); $fd = fopen("/dev/urandom","r");
@ -37,9 +45,10 @@ function loadUserInfo($userid) {
function redisLink() { function redisLink() {
static $r = false; static $r = false;
global $redis_options;
if ($r) return $r; if ($r) return $r;
$r = new Predis\Client(); $r = new Predis\Client($redis_options);
return $r; return $r;
} }