default exception handler added, Client-Options for connections added
This commit is contained in:
parent
2128fb4dba
commit
29a0861780
1 changed files with 10 additions and 1 deletions
11
retwis.php
11
retwis.php
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue