cvs: pear /LiveUser/docs/examples/example4 conf.php
| From: | Lukas Smith | Date: | Thu, 23 Dec 2004 15:53:29 +0000 |
| Subject: | cvs: pear /LiveUser/docs/examples/example4 conf.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-27790@lists.php.net to get a copy of this message | ||
lsmith Thu Dec 23 10:53:29 2004 EDT
Modified files:
/pear/LiveUser/docs/examples/example4 conf.php
Log:
- fixed php5 issues with the php error handler
http://cvs.php.net/diff.php/pear/LiveUser/docs/examples/example4/conf.php?r1=1.7&r2=1.8&ty=u
Index: pear/LiveUser/docs/examples/example4/conf.php
diff -u pear/LiveUser/docs/examples/example4/conf.php:1.7
pear/LiveUser/docs/examples/example4/conf.php:1.8
--- pear/LiveUser/docs/examples/example4/conf.php:1.7 Mon Dec 20 07:54:10 2004
+++ pear/LiveUser/docs/examples/example4/conf.php Thu Dec 23 10:53:29 2004
@@ -8,21 +8,24 @@
error_reporting(E_ALL);
+require_once 'PEAR.php';
+include_once 'HTML/Template/IT.php';
+require_once 'DB.php';
+
function php_error_handler($errno, $errstr, $errfile, $errline)
{
- include_once 'HTML/Template/IT.php';
- $tpl = new HTML_Template_IT();
- $tpl->loadTemplatefile('error-page.tpl.php', false, false);
-
- $tpl->setVariable('error_msg', "<b>$errfile ($errline)</b><br
/>$errstr");
- $tpl->show();
- exit();
+ if ($errno && $errno != 2048) {
+ $tpl = new HTML_Template_IT();
+ $tpl->loadTemplatefile('error-page.tpl.php', false, false);
+
+ $tpl->setVariable('error_msg', "<b>$errfile
($errline)</b><br />$errstr");
+ $tpl->show();
+ exit();
+ }
}
set_error_handler('php_error_handler');
-require_once 'PEAR.php';
-
function pear_error_handler($err_obj)
{
$error_string = $err_obj->getMessage() . '<br />' .
$err_obj->getUserInfo();
@@ -31,8 +34,6 @@
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'pear_error_handler');
-require_once 'DB.php';
-
// Data Source Name (DSN)
//$dsn = '{dbtype}://{user}:{passwd}@{dbhost}/{dbname}';
$dsn = 'mysql://root:@localhost/liveuser_test';
@@ -41,7 +42,6 @@
$db->setFetchMode(DB_FETCHMODE_ASSOC);
-require_once 'HTML/Template/IT.php';
$tpl = new HTML_Template_IT();
$LUOptions = array(
@@ -92,7 +92,6 @@
function showLoginForm(&$liveUserObj)
{
- include_once 'HTML/Template/IT.php';
$tpl = new HTML_Template_IT();
$tpl->loadTemplatefile('loginform.tpl.php');