ona  18.1.1
About: OpenNetAdmin provides a database managed inventory of your IP network (with Web and CLI interface).
  Fossies Dox: ona-18.1.1.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

adodb-errorhandler.inc.php
Go to the documentation of this file.
1 <?php
17 // added Claudio Bustos clbustos#entelchile.net
18 if (!defined('ADODB_ERROR_HANDLER_TYPE')) define('ADODB_ERROR_HANDLER_TYPE',E_USER_ERROR);
19 
20 if (!defined('ADODB_ERROR_HANDLER')) define('ADODB_ERROR_HANDLER','ADODB_Error_Handler');
21 
33 function ADODB_Error_Handler($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnection)
34 {
35  if (error_reporting() == 0) return; // obey @ protocol
36  switch($fn) {
37  case 'EXECUTE':
38  $sql = $p1;
39  $inputparams = $p2;
40 
41  $s = "$dbms error: [$errno: $errmsg] in $fn(\"$sql\")\n";
42  break;
43 
44  case 'PCONNECT':
45  case 'CONNECT':
46  $host = $p1;
47  $database = $p2;
48 
49  $s = "$dbms error: [$errno: $errmsg] in $fn($host, '****', '****', $database)\n";
50  break;
51  default:
52  $s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)\n";
53  break;
54  }
55  /*
56  * Log connection error somewhere
57  * 0 message is sent to PHP's system logger, using the Operating System's system
58  * logging mechanism or a file, depending on what the error_log configuration
59  * directive is set to.
60  * 1 message is sent by email to the address in the destination parameter.
61  * This is the only message type where the fourth parameter, extra_headers is used.
62  * This message type uses the same internal function as mail() does.
63  * 2 message is sent through the PHP debugging connection.
64  * This option is only available if remote debugging has been enabled.
65  * In this case, the destination parameter specifies the host name or IP address
66  * and optionally, port number, of the socket receiving the debug information.
67  * 3 message is appended to the file destination
68  */
69  if (defined('ADODB_ERROR_LOG_TYPE')) {
70  $t = date('Y-m-d H:i:s');
71  if (defined('ADODB_ERROR_LOG_DEST'))
72  error_log("($t) $s", ADODB_ERROR_LOG_TYPE, ADODB_ERROR_LOG_DEST);
73  else
74  error_log("($t) $s", ADODB_ERROR_LOG_TYPE);
75  }
76 
77 
78  //print "<p>$s</p>";
79  trigger_error($s,ADODB_ERROR_HANDLER_TYPE);
80 }
$errmsg
$errmsg
Definition: dcm.php:47
ADODB_Error_Handler
ADODB_Error_Handler($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnection)
Definition: adodb-errorhandler.inc.php:33
$sql
$sql
Definition: server.php:84
$database
$database
Definition: collate-convert.php:18
$host
$host
Definition: collate-convert.php:19
E_USER_ERROR
if(!defined('ADODB_ERROR_HANDLER_TYPE')) define('ADODB_ERROR_HANDLER_TYPE' E_USER_ERROR
Definition: adodb-errorhandler.inc.php:18