Documentation TYPO3 par Ameos

adodb-errorhandler.inc.php

00001 <?php
00015 // added Claudio Bustos  clbustos#entelchile.net
00016 if (!defined('ADODB_ERROR_HANDLER_TYPE')) define('ADODB_ERROR_HANDLER_TYPE',E_USER_ERROR); 
00017 
00018 if (!defined('ADODB_ERROR_HANDLER')) define('ADODB_ERROR_HANDLER','ADODB_Error_Handler');
00019 
00031 function ADODB_Error_Handler($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnection)
00032 {
00033         if (error_reporting() == 0) return; // obey @ protocol
00034         switch($fn) {
00035         case 'EXECUTE':
00036                 $sql = $p1;
00037                 $inputparams = $p2;
00038 
00039                 $s = "$dbms error: [$errno: $errmsg] in $fn(\"$sql\")\n";
00040                 break;
00041 
00042         case 'PCONNECT':
00043         case 'CONNECT':
00044                 $host = $p1;
00045                 $database = $p2;
00046 
00047                 $s = "$dbms error: [$errno: $errmsg] in $fn($host, '****', '****', $database)\n";
00048                 break;
00049         default:
00050                 $s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)\n";
00051                 break;
00052         }
00053         /*
00054         * Log connection error somewhere
00055         *       0 message is sent to PHP's system logger, using the Operating System's system
00056         *               logging mechanism or a file, depending on what the error_log configuration
00057         *               directive is set to.
00058         *       1 message is sent by email to the address in the destination parameter.
00059         *               This is the only message type where the fourth parameter, extra_headers is used.
00060         *               This message type uses the same internal function as mail() does.
00061         *       2 message is sent through the PHP debugging connection.
00062         *               This option is only available if remote debugging has been enabled.
00063         *               In this case, the destination parameter specifies the host name or IP address
00064         *               and optionally, port number, of the socket receiving the debug information.
00065         *       3 message is appended to the file destination
00066         */
00067         if (defined('ADODB_ERROR_LOG_TYPE')) {
00068                 $t = date('Y-m-d H:i:s');
00069                 if (defined('ADODB_ERROR_LOG_DEST'))
00070                         error_log("($t) $s", ADODB_ERROR_LOG_TYPE, ADODB_ERROR_LOG_DEST);
00071                 else
00072                         error_log("($t) $s", ADODB_ERROR_LOG_TYPE);
00073         }
00074 
00075 
00076         //print "<p>$s</p>";
00077         trigger_error($s,ADODB_ERROR_HANDLER_TYPE); 
00078 }
00079 ?>


Généré par Le spécialiste TYPO3 avec  doxygen 1.4.6