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