Subversion-Projekte lars-tiefland.openvz_admin

Revision

Revision 12 | Revision 109 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 12 Revision 69
Zeile 1... Zeile 1...
1
<?
1
<?
2
	//$Id: functions.php 12 2007-09-30 12:07:16Z lars $
2
	//$Id: functions.php 69 2007-10-26 07:00:45Z lars $
3
	$dir=dirname($_SERVER["PHP_SELF"]);
3
	$dir=dirname($_SERVER["PHP_SELF"]);
4
	$host="http://".$_SERVER["SERVER_NAME"];
4
	$host="http://".$_SERVER["SERVER_NAME"];
5
	$url=$host.$dir;
5
	$url=$host.$dir;
6
	$pear_logger=&create_pear_logger();
6
	$pear_logger=&create_pear_logger();
7
/*	$php_logger=&create_php_logger();
7
	$php_logger=&create_php_logger();
8
	set_error_handler('errorHandler_PHP');
8
	set_error_handler('errorHandler_PHP');
9
	PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'errorHandler');*/
9
	PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'errorHandler');
10
	$u=null;
10
	$u=null;
11
	$a=null;
11
	$a=null;
12
	$username=(isset($_POST["username"]))?$_POST["username"]:"";
12
	$username=(isset($_POST["username"]))?$_POST["username"]:"";
Zeile 13... Zeile 13...
13
 
13
 
Zeile 28... Zeile 28...
28
			case E_USER_ERROR:
28
			case E_USER_ERROR:
29
				$priority = PEAR_LOG_ERR;
29
				$priority = PEAR_LOG_ERR;
30
				break;
30
				break;
31
			default:
31
			default:
32
				$priotity = PEAR_LOG_INFO;
32
				$priotity = PEAR_LOG_INFO;
-
 
33
				break;
-
 
34
		}
-
 
35
		switch ($code) {
-
 
36
			case E_WARNING:
-
 
37
			case E_USER_WARNING:
-
 
38
			case E_NOTICE:
-
 
39
			case E_USER_NOTICE:
-
 
40
			case E_ERROR:
-
 
41
			case E_USER_ERROR:
-
 
42
				$php_logger->log($message . ' in ' . $file . ' in Zeile ' . $line, $priority);
-
 
43
				break;
33
		}
44
		}
34
		$php_logger->log($message . ' in ' . $file . ' in Zeile ' . $line, $priority);
-
 
35
	}
45
	}
Zeile 36... Zeile 46...
36
 
46
 
37
	function errorHandler($error)
47
	function errorHandler($error)
38
	{
48
	{
Zeile 66... Zeile 76...
66
		global $url;
76
		global $url;
67
		$file_params["mode"]="666";
77
		$file_params["mode"]="666";
68
    		$file_params["lineFormat"] = '%1$s %2$s [%3$s] %4$s %5$s %6$s %7$s';
78
    		$file_params["lineFormat"] = '%1$s %2$s [%3$s] %4$s %5$s %6$s %7$s';
69
		$mail_params["from"]="Lars Tiefland <webmaster@lars-tiefland.de>";
79
		$mail_params["from"]="Lars Tiefland <webmaster@lars-tiefland.de>";
70
		$mail_params["subject"]="PHP Fehler auf $url";
80
		$mail_params["subject"]="PHP Fehler auf $url";
71
		$l1=&Log::factory("file","php_errors.log","fifa_php",$file_params);
81
		$l1=&Log::factory("file","logs/php_errors.log","fifa_php",$file_params);
72
		$l2=&Log::factory("mail","ltiefland@gmail.com","fifa_php",$mail_params);
82
		$l2=&Log::factory("mail","ltiefland@gmail.com","fifa_php",$mail_params);
73
		$l3=&Log::factory("composite");
83
		$l3=&Log::factory("composite");
74
		$c1=$l3->addChild($l1);
84
		$c1=$l3->addChild($l1);
75
		$c2=$l3->addChild($l2);
85
		$c2=$l3->addChild($l2);
76
		return $l3;
86
		return $l3;
Zeile 81... Zeile 91...
81
		global $url;
91
		global $url;
82
		$file_params["mode"]="666";
92
		$file_params["mode"]="666";
83
    		$file_params["lineFormat"] = '%1$s %2$s [%3$s] %4$s %5$s %6$s %7$s';
93
    		$file_params["lineFormat"] = '%1$s %2$s [%3$s] %4$s %5$s %6$s %7$s';
84
		$mail_params["from"]="Lars Tiefland <webmaster@lars-tiefland.de>";
94
		$mail_params["from"]="Lars Tiefland <webmaster@lars-tiefland.de>";
85
		$mail_params["subject"]="PEAR Fehler auf $url";
95
		$mail_params["subject"]="PEAR Fehler auf $url";
86
		$l1=&Log::factory("file","pear_errors.log","fifa_pear",$file_params);
96
		$l1=&Log::factory("file","logs/pear_errors.log","fifa_pear",$file_params);
87
		$l2=&Log::factory("mail","ltiefland@gmail.com","fifa_pear",$mail_params);
97
		$l2=&Log::factory("mail","ltiefland@gmail.com","fifa_pear",$mail_params);
88
		$l3=&Log::factory("composite");
98
		$l3=&Log::factory("composite");
89
		$c1=$l3->addChild($l1);
99
		$c1=$l3->addChild($l1);
90
		$c2=$l3->addChild($l2);
100
		$c2=$l3->addChild($l2);
91
		return $l3;
101
		return $l3;