Commit df492c3e authored by mose's avatar mose

merged adodb 4.61 to from tiki 1.9 to 1.10

parent c0532b33
......@@ -10,36 +10,9 @@ _adodb/adodb-lib.inc.php -text
_adodb/adodb-pager.inc.php -text
_adodb/adodb-pear.inc.php -text
_adodb/adodb-perf.inc.php -text
_adodb/adodb-perf.inc.php.#.LENS-03-09-05 -text
_adodb/adodb-php4.inc.php -text
_adodb/adodb-time.inc.php -text
_adodb/adodb-time.zip -text
_adodb/adodb-xmlschema.inc.php -text
_adodb/adodb.inc.php -text
_adodb/contrib/toxmlrpc.inc.php -text
_adodb/cute_icons_for_site/adodb.gif -text
_adodb/cute_icons_for_site/adodb2.gif -text
_adodb/datadict/datadict-access.inc.php -text
_adodb/datadict/datadict-db2.inc.php -text
_adodb/datadict/datadict-firebird.inc.php -text
_adodb/datadict/datadict-generic.inc.php -text
_adodb/datadict/datadict-ibase.inc.php -text
_adodb/datadict/datadict-informix.inc.php -text
_adodb/datadict/datadict-mssql.inc.php -text
_adodb/datadict/datadict-mysql.inc.php -text
_adodb/datadict/datadict-oci8.inc.php -text
_adodb/datadict/datadict-postgres.inc.php -text
_adodb/datadict/datadict-sapdb.inc.php -text
_adodb/datadict/datadict-sybase.inc.php -text
_adodb/docs/docs-adodb.htm -text
_adodb/docs/docs-datadict.htm -text
_adodb/docs/docs-oracle.htm -text
_adodb/docs/docs-perf.htm -text
_adodb/docs/docs-session.htm -text
_adodb/docs/old-changelog.htm -text
_adodb/docs/readme.htm -text
_adodb/docs/tips_portable_sql.htm -text
_adodb/docs/tute.htm -text
_adodb/drivers/adodb-access.inc.php -text
_adodb/drivers/adodb-ado.inc.php -text
_adodb/drivers/adodb-ado5.inc.php -text
......@@ -73,12 +46,14 @@ _adodb/drivers/adodb-pdo.inc.php -text
_adodb/drivers/adodb-postgres.inc.php -text
_adodb/drivers/adodb-postgres64.inc.php -text
_adodb/drivers/adodb-postgres7.inc.php -text
_adodb/drivers/adodb-postgres8.inc.php -text
_adodb/drivers/adodb-proxy.inc.php -text
_adodb/drivers/adodb-sapdb.inc.php -text
_adodb/drivers/adodb-sqlanywhere.inc.php -text
_adodb/drivers/adodb-sqlite.inc.php -text
_adodb/drivers/adodb-sqlitepo.inc.php -text
_adodb/drivers/adodb-sybase.inc.php -text
_adodb/drivers/adodb-sybase_ase.inc.php -text
_adodb/drivers/adodb-vfp.inc.php -text
_adodb/lang/adodb-ar.inc.php -text
_adodb/lang/adodb-bg.inc.php -text
......@@ -86,9 +61,11 @@ _adodb/lang/adodb-bgutf8.inc.php -text
_adodb/lang/adodb-ca.inc.php -text
_adodb/lang/adodb-cn.inc.php -text
_adodb/lang/adodb-cz.inc.php -text
_adodb/lang/adodb-da.inc.php -text
_adodb/lang/adodb-de.inc.php -text
_adodb/lang/adodb-en.inc.php -text
_adodb/lang/adodb-es.inc.php -text
_adodb/lang/adodb-esperanto.inc.php -text
_adodb/lang/adodb-fr.inc.php -text
_adodb/lang/adodb-hu.inc.php -text
_adodb/lang/adodb-it.inc.php -text
......@@ -99,8 +76,6 @@ _adodb/lang/adodb-ro.inc.php -text
_adodb/lang/adodb-ru1251.inc.php -text
_adodb/lang/adodb-sv.inc.php -text
_adodb/license.txt -text
_adodb/pear/Auth/Container/ADOdb.php -text
_adodb/pear/readme.Auth.txt -text
_adodb/perf/perf-db2.inc.php -text
_adodb/perf/perf-informix.inc.php -text
_adodb/perf/perf-mssql.inc.php -text
......@@ -124,42 +99,8 @@ _adodb/session/adodb-sessions.mysql.sql -text
_adodb/session/adodb-sessions.oracle.clob.sql -text
_adodb/session/adodb-sessions.oracle.sql -text
_adodb/session/crypt.inc.php -text
_adodb/session/old/adodb-cryptsession.php -text
_adodb/session/old/adodb-session-clob.php -text
_adodb/session/old/adodb-session.php -text
_adodb/session/old/crypt.inc.php -text
_adodb/tests/benchmark.php -text
_adodb/tests/client.php -text
_adodb/tests/pdo.php -text
_adodb/tests/test-datadict.php -text
_adodb/tests/test-perf.php -text
_adodb/tests/test-pgblob.php -text
_adodb/tests/test-php5.php -text
_adodb/tests/test-xmlschema.php -text
_adodb/tests/test.php -text
_adodb/tests/test2.php -text
_adodb/tests/test3.php -text
_adodb/tests/test4.php -text
_adodb/tests/test5.php -text
_adodb/tests/test_rs_array.php -text
_adodb/tests/testcache.php -text
_adodb/tests/testdatabases.inc.php -text
_adodb/tests/testgenid.php -text
_adodb/tests/testmssql.php -text
_adodb/tests/testoci8.php -text
_adodb/tests/testoci8cursor.php -text
_adodb/tests/testpaging.php -text
_adodb/tests/testpear.php -text
_adodb/tests/testsessions.php -text
_adodb/tests/time.php -text
_adodb/tests/tmssql.php -text
_adodb/tests/xmlschema.xml -text
_adodb/toexport.inc.php -text
_adodb/tohtml.inc.php -text
_adodb/xmlschema.dtd -text
_adodb/xsl/convert-0.1-0.2.xsl -text
_adodb/xsl/convert-0.2-0.1.xsl -text
_adodb/xsl/remove-0.2.xsl -text
_jscalendar/README -text
_jscalendar/calendar-blue.css -text
_jscalendar/calendar-blue2.css -text
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?php
/**
* @version V4.55 3 Jan 2005 (c) 2000-2005 John Lim ([email protected].my). All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
*
* Set tabs to 4 for best viewing.
*
* Latest version is available at http://php.weblogs.com
*
*/
// added Claudio Bustos clbustos#entelchile.net
if (!defined('ADODB_ERROR_HANDLER_TYPE')) define('ADODB_ERROR_HANDLER_TYPE',E_USER_ERROR);
if (!defined('ADODB_ERROR_HANDLER')) define('ADODB_ERROR_HANDLER','ADODB_Error_Handler');
/**
* Default Error Handler. This will be called with the following params
*
* @param $dbms the RDBMS you are connecting to
* @param $fn the name of the calling function (in uppercase)
* @param $errno the native error number from the database
* @param $errmsg the native error msg from the database
* @param $p1 $fn specific parameter - see below
* @param $p2 $fn specific parameter - see below
* @param $thisConn $current connection object - can be false if no connection object created
*/
function ADODB_Error_Handler($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnection)
{
if (error_reporting() == 0) return; // obey @ protocol
switch($fn) {
case 'EXECUTE':
$sql = $p1;
$inputparams = $p2;
$s = "$dbms error: [$errno: $errmsg] in $fn(\"$sql\")\n";
break;
case 'PCONNECT':
case 'CONNECT':
$host = $p1;
$database = $p2;
$s = "$dbms error: [$errno: $errmsg] in $fn($host, '****', '****', $database)\n";
break;
default:
$s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)\n";
break;
}
/*
* Log connection error somewhere
* 0 message is sent to PHP's system logger, using the Operating System's system
* logging mechanism or a file, depending on what the error_log configuration
* directive is set to.
* 1 message is sent by email to the address in the destination parameter.
* This is the only message type where the fourth parameter, extra_headers is used.
* This message type uses the same internal function as mail() does.
* 2 message is sent through the PHP debugging connection.
* This option is only available if remote debugging has been enabled.
* In this case, the destination parameter specifies the host name or IP address
* and optionally, port number, of the socket receiving the debug information.
* 3 message is appended to the file destination
*/
if (defined('ADODB_ERROR_LOG_TYPE')) {
$t = date('Y-m-d H:i:s');
if (defined('ADODB_ERROR_LOG_DEST'))
error_log("($t) $s", ADODB_ERROR_LOG_TYPE, ADODB_ERROR_LOG_DEST);
else
error_log("($t) $s", ADODB_ERROR_LOG_TYPE);
}
//print "<p>$s</p>";
trigger_error($s,ADODB_ERROR_HANDLER_TYPE);
}
?>
<?php
/**
* @version V4.61 24 Feb 2005 (c) 2000-2005 John Lim ([email protected]). All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
*
* Set tabs to 4 for best viewing.
*
* Latest version is available at http://php.weblogs.com
*
*/
// added Claudio Bustos clbustos#entelchile.net
if (!defined('ADODB_ERROR_HANDLER_TYPE')) define('ADODB_ERROR_HANDLER_TYPE',E_USER_ERROR);
if (!defined('ADODB_ERROR_HANDLER')) define('ADODB_ERROR_HANDLER','ADODB_Error_Handler');
/**
* Default Error Handler. This will be called with the following params
*
* @param $dbms the RDBMS you are connecting to
* @param $fn the name of the calling function (in uppercase)
* @param $errno the native error number from the database
* @param $errmsg the native error msg from the database
* @param $p1 $fn specific parameter - see below
* @param $p2 $fn specific parameter - see below
* @param $thisConn $current connection object - can be false if no connection object created
*/
function ADODB_Error_Handler($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnection)
{
if (error_reporting() == 0) return; // obey @ protocol
switch($fn) {
case 'EXECUTE':
$sql = $p1;
$inputparams = $p2;
$s = "$dbms error: [$errno: $errmsg] in $fn(\"$sql\")\n";
break;
case 'PCONNECT':
case 'CONNECT':
$host = $p1;
$database = $p2;
$s = "$dbms error: [$errno: $errmsg] in $fn($host, '****', '****', $database)\n";
break;
default:
$s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)\n";
break;
}
/*
* Log connection error somewhere
* 0 message is sent to PHP's system logger, using the Operating System's system
* logging mechanism or a file, depending on what the error_log configuration
* directive is set to.
* 1 message is sent by email to the address in the destination parameter.
* This is the only message type where the fourth parameter, extra_headers is used.
* This message type uses the same internal function as mail() does.
* 2 message is sent through the PHP debugging connection.
* This option is only available if remote debugging has been enabled.
* In this case, the destination parameter specifies the host name or IP address
* and optionally, port number, of the socket receiving the debug information.
* 3 message is appended to the file destination
*/
if (defined('ADODB_ERROR_LOG_TYPE')) {
$t = date('Y-m-d H:i:s');
if (defined('ADODB_ERROR_LOG_DEST'))
error_log("($t) $s", ADODB_ERROR_LOG_TYPE, ADODB_ERROR_LOG_DEST);
else
error_log("($t) $s", ADODB_ERROR_LOG_TYPE);
}
//print "<p>$s</p>";
trigger_error($s,ADODB_ERROR_HANDLER_TYPE);
}
?>
<?php
/**
* @version V4.50 6 July 2004 (c) 2000-2005 John Lim ([email protected]). All rights reserved.
* Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
*
* Set tabs to 4 for best viewing.
*
* Latest version is available at http://php.weblogs.com
*
*/
include_once('PEAR.php');
if (!defined('ADODB_ERROR_HANDLER')) define('ADODB_ERROR_HANDLER','ADODB_Error_PEAR');
/*
* Enabled the following if you want to terminate scripts when an error occurs
*/
//PEAR::setErrorHandling (PEAR_ERROR_DIE);
/*
* Name of the PEAR_Error derived class to call.
*/
if (!defined('ADODB_PEAR_ERROR_CLASS')) define('ADODB_PEAR_ERROR_CLASS','PEAR_Error');
/*
* Store the last PEAR_Error object here
*/
global $ADODB_Last_PEAR_Error; $ADODB_Last_PEAR_Error = false;
/**
* Error Handler with PEAR support. This will be called with the following params
*
* @param $dbms the RDBMS you are connecting to
* @param $fn the name of the calling function (in uppercase)
* @param $errno the native error number from the database
* @param $errmsg the native error msg from the database
* @param $p1 $fn specific parameter - see below
* @param $P2 $fn specific parameter - see below
*/
function ADODB_Error_PEAR($dbms, $fn, $errno, $errmsg, $p1=false, $p2=false)
{
global $ADODB_Last_PEAR_Error;
if (error_reporting() == 0) return; // obey @ protocol
switch($fn) {
case 'EXECUTE':
$sql = $p1;
$inputparams = $p2;
$s = "$dbms error: [$errno: $errmsg] in $fn(\"$sql\")";
break;
case 'PCONNECT':
case 'CONNECT':
$host = $p1;
$database = $p2;
$s = "$dbms error: [$errno: $errmsg] in $fn('$host', ?, ?, '$database')";
break;
default:
$s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)";
break;
}
$class = ADODB_PEAR_ERROR_CLASS;
$ADODB_Last_PEAR_Error = new $class($s, $errno,
$GLOBALS['_PEAR_default_error_mode'],
$GLOBALS['_PEAR_default_error_options'],
$errmsg);
//print "<p>!$s</p>";
}
/**
* Returns last PEAR_Error object. This error might be for an error that
* occured several sql statements ago.
*/
function &ADODB_PEAR_Error()
{
global $ADODB_Last_PEAR_Error;
return $ADODB_Last_PEAR_Error;
}
?>
\ No newline at end of file
<?php
/**
* @version V4.61 24 Feb 2005 (c) 2000-2005 John Lim ([email protected]). All rights reserved.
* Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
*
* Set tabs to 4 for best viewing.
*
* Latest version is available at http://php.weblogs.com
*
*/
include_once('PEAR.php');
if (!defined('ADODB_ERROR_HANDLER')) define('ADODB_ERROR_HANDLER','ADODB_Error_PEAR');
/*
* Enabled the following if you want to terminate scripts when an error occurs
*/
//PEAR::setErrorHandling (PEAR_ERROR_DIE);
/*
* Name of the PEAR_Error derived class to call.
*/
if (!defined('ADODB_PEAR_ERROR_CLASS')) define('ADODB_PEAR_ERROR_CLASS','PEAR_Error');
/*
* Store the last PEAR_Error object here
*/
global $ADODB_Last_PEAR_Error; $ADODB_Last_PEAR_Error = false;
/**
* Error Handler with PEAR support. This will be called with the following params
*
* @param $dbms the RDBMS you are connecting to
* @param $fn the name of the calling function (in uppercase)
* @param $errno the native error number from the database
* @param $errmsg the native error msg from the database
* @param $p1 $fn specific parameter - see below
* @param $P2 $fn specific parameter - see below
*/
function ADODB_Error_PEAR($dbms, $fn, $errno, $errmsg, $p1=false, $p2=false)
{
global $ADODB_Last_PEAR_Error;
if (error_reporting() == 0) return; // obey @ protocol
switch($fn) {
case 'EXECUTE':
$sql = $p1;
$inputparams = $p2;
$s = "$dbms error: [$errno: $errmsg] in $fn(\"$sql\")";
break;
case 'PCONNECT':
case 'CONNECT':
$host = $p1;
$database = $p2;
$s = "$dbms error: [$errno: $errmsg] in $fn('$host', ?, ?, '$database')";
break;
default:
$s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)";
break;
}
$class = ADODB_PEAR_ERROR_CLASS;
$ADODB_Last_PEAR_Error = new $class($s, $errno,
$GLOBALS['_PEAR_default_error_mode'],
$GLOBALS['_PEAR_default_error_options'],
$errmsg);
//print "<p>!$s</p>";
}
/**
* Returns last PEAR_Error object. This error might be for an error that
* occured several sql statements ago.
*/
function &ADODB_PEAR_Error()
{
global $ADODB_Last_PEAR_Error;
return $ADODB_Last_PEAR_Error;
}
?>
<?php
/**
* @version V4.55 3 Jan 2005 (c) 2000-2005 John Lim ([email protected]). All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
*
* Set tabs to 4 for best viewing.
*
* Latest version is available at http://php.weblogs.com
*
* Exception-handling code using PHP5 exceptions (try-catch-throw).
*/
if (!defined('ADODB_ERROR_HANDLER_TYPE')) define('ADODB_ERROR_HANDLER_TYPE',E_USER_ERROR);
define('ADODB_ERROR_HANDLER','adodb_throw');
class ADODB_Exception extends Exception {
var $dbms;
var $fn;
var $sql = '';
var $params = '';
var $host = '';
var $database = '';
function __construct($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection)
{
switch($fn) {
case 'EXECUTE':
$this->sql = $p1;
$this->params = $p2;
$s = "$dbms error: [$errno: $errmsg] in $fn(\"$p1\")\n";
break;
case 'PCONNECT':
case 'CONNECT':
$user = $thisConnection->user;
$s = "$dbms error: [$errno: $errmsg] in $fn($p1, '$user', '****', $p2)\n";
break;
default:
$s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)\n";
break;
}
$this->dbms = $dbms;
$this->host = $thisConnection->host;
$this->database = $thisConnection->database;
$this->fn = $fn;
$this->msg = $errmsg;
if (!is_numeric($errno)) $errno = -1;
parent::__construct($s,$errno);
}
}
/**
* Default Error Handler. This will be called with the following params
*
* @param $dbms the RDBMS you are connecting to
* @param $fn the name of the calling function (in uppercase)
* @param $errno the native error number from the database
* @param $errmsg the native error msg from the database
* @param $p1 $fn specific parameter - see below
* @param $P2 $fn specific parameter - see below
*/
function adodb_throw($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection)
{
global $ADODB_EXCEPTION;
if (error_reporting() == 0) return; // obey @ protocol
if (is_string($ADODB_EXCEPTION)) $errfn = $ADODB_EXCEPTION;
else $errfn = 'ADODB_EXCEPTION';
throw new $errfn($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection);
}
?>
\ No newline at end of file
<?php
/**
* @version V4.61 24 Feb 2005 (c) 2000-2005 John Lim ([email protected]). All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
*
* Set tabs to 4 for best viewing.
*
* Latest version is available at http://php.weblogs.com
*
* Exception-handling code using PHP5 exceptions (try-catch-throw).
*/
if (!defined('ADODB_ERROR_HANDLER_TYPE')) define('ADODB_ERROR_HANDLER_TYPE',E_USER_ERROR);
define('ADODB_ERROR_HANDLER','adodb_throw');
class ADODB_Exception extends Exception {
var $dbms;
var $fn;
var $sql = '';
var $params = '';
var $host = '';
var $database = '';
function __construct($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection)
{
switch($fn) {
case 'EXECUTE':
$this->sql = $p1;
$this->params = $p2;
$s = "$dbms error: [$errno: $errmsg] in $fn(\"$p1\")\n";
break;
case 'PCONNECT':
case 'CONNECT':
$user = $thisConnection->user;
$s = "$dbms error: [$errno: $errmsg] in $fn($p1, '$user', '****', $p2)\n";
break;
default:
$s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)\n";
break;
}
$this->dbms = $dbms;
$this->host = $thisConnection->host;
$this->database = $thisConnection->database;
$this->fn = $fn;
$this->msg = $errmsg;
if (!is_numeric($errno)) $errno = -1;
parent::__construct($s,$errno);
}
}
/**
* Default Error Handler. This will be called with the following params
*
* @param $dbms the RDBMS you are connecting to
* @param $fn the name of the calling function (in uppercase)
* @param $errno the native error number from the database
* @param $errmsg the native error msg from the database
* @param $p1 $fn specific parameter - see below
* @param $P2 $fn specific parameter - see below
*/
function adodb_throw($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection)
{
global $ADODB_EXCEPTION;
if (error_reporting() == 0) return; // obey @ protocol
if (is_string($ADODB_EXCEPTION)) $errfn = $ADODB_EXCEPTION;
else $errfn = 'ADODB_EXCEPTION';
throw new $errfn($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection);
}
?>
<?php
/*
V4.55 3 Jan 2005 (c) 2000-2005 John Lim ([email protected]). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Set tabs to 4.
Declares the ADODB Base Class for PHP5 "ADODB_BASE_RS", and supports iteration with
the ADODB_Iterator class.
$rs = $db->Execute("select * from adoxyz");
foreach($rs as $k => $v) {
echo $k; print_r($v); echo "<br>";
}
Iterator code based on http://cvs.php.net/cvs.php/php-src/ext/spl/examples/cachingiterator.inc?login=2
*/
class ADODB_Iterator implements Iterator {
private $rs;
function __construct($rs)
{
$this->rs = $rs;
}
function rewind()
{
$this->rs->MoveFirst();
}
function valid()