TYPO3 CMS  TYPO3_6-2
adodb-errorpear.inc.php
Go to the documentation of this file.
1 <?php
13 include_once('PEAR.php');
14 
15 if (!defined('ADODB_ERROR_HANDLER')) define('ADODB_ERROR_HANDLER','ADODB_Error_PEAR');
16 
17 /*
18 * Enabled the following if you want to terminate scripts when an error occurs
19 */
20 //PEAR::setErrorHandling (PEAR_ERROR_DIE);
21 
22 /*
23 * Name of the PEAR_Error derived class to call.
24 */
25 if (!defined('ADODB_PEAR_ERROR_CLASS')) define('ADODB_PEAR_ERROR_CLASS','PEAR_Error');
26 
27 /*
28 * Store the last PEAR_Error object here
29 */
30 global $ADODB_Last_PEAR_Error; $ADODB_Last_PEAR_Error = false;
31 
42 function ADODB_Error_PEAR($dbms, $fn, $errno, $errmsg, $p1=false, $p2=false)
43 {
45 
46  if (error_reporting() == 0) return; // obey @ protocol
47  switch($fn) {
48  case 'EXECUTE':
49  $sql = $p1;
50  $inputparams = $p2;
51 
52  $s = "$dbms error: [$errno: $errmsg] in $fn(\"$sql\")";
53  break;
54 
55  case 'PCONNECT':
56  case 'CONNECT':
57  $host = $p1;
58  $database = $p2;
59 
60  $s = "$dbms error: [$errno: $errmsg] in $fn('$host', ?, ?, '$database')";
61  break;
62 
63  default:
64  $s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)";
65  break;
66  }
67 
68  $class = ADODB_PEAR_ERROR_CLASS;
69  $ADODB_Last_PEAR_Error = new $class($s, $errno,
70  $GLOBALS['_PEAR_default_error_mode'],
71  $GLOBALS['_PEAR_default_error_options'],
72  $errmsg);
73 
74  //print "<p>!$s</p>";
75 }
76 
81 function ADODB_PEAR_Error()
82 {
84 
86 }
$sql
Definition: server.php:82
ADODB_PEAR_Error()
$host
Definition: server.php:35
$database
Definition: server.php:38
global $ADODB_Last_PEAR_Error
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
ADODB_Error_PEAR($dbms, $fn, $errno, $errmsg, $p1=false, $p2=false)