|
From: <var...@us...> - 2013-05-16 08:47:33
|
Revision: 8779
http://sourceforge.net/p/phpwiki/code/8779
Author: vargenau
Date: 2013-05-16 08:47:28 +0000 (Thu, 16 May 2013)
Log Message:
-----------
Upgrade adodb
Modified Paths:
--------------
trunk/lib/WikiDB/adodb/adodb-csvlib.inc.php
trunk/lib/WikiDB/adodb/adodb-error.inc.php
trunk/lib/WikiDB/adodb/adodb-errorhandler.inc.php
trunk/lib/WikiDB/adodb/adodb-errorpear.inc.php
trunk/lib/WikiDB/adodb/adodb-exceptions.inc.php
trunk/lib/WikiDB/adodb/adodb-iterator.inc.php
trunk/lib/WikiDB/adodb/adodb-lib.inc.php
trunk/lib/WikiDB/adodb/adodb-pear.inc.php
trunk/lib/WikiDB/adodb/adodb-php4.inc.php
trunk/lib/WikiDB/adodb/adodb-time.inc.php
trunk/lib/WikiDB/adodb/adodb.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-access.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ado.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ado_access.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ado_mssql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-borland_ibase.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-csv.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-db2.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-fbsql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-firebird.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ibase.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-informix.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-informix72.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ldap.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mssql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mssqlnative.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mssqlpo.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mysql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mysqli.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mysqlt.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-netezza.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-oci8.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-oci805.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-oci8po.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbc.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbc_mssql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbc_oracle.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbtp.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbtp_unicode.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-oracle.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres64.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres7.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-proxy.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sapdb.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sqlanywhere.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sqlite.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sybase.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-vfp.inc.php
trunk/lib/WikiDB/adodb/license.txt
trunk/lib/WikiDB/adodb/readme.txt
Added Paths:
-----------
trunk/lib/WikiDB/adodb/adodb-active-record.inc.php
trunk/lib/WikiDB/adodb/adodb-active-recordx.inc.php
trunk/lib/WikiDB/adodb/adodb-datadict.inc.php
trunk/lib/WikiDB/adodb/adodb-memcache.lib.inc.php
trunk/lib/WikiDB/adodb/adodb-pager.inc.php
trunk/lib/WikiDB/adodb/adodb-perf.inc.php
trunk/lib/WikiDB/adodb/adodb-xmlschema.inc.php
trunk/lib/WikiDB/adodb/adodb-xmlschema03.inc.php
trunk/lib/WikiDB/adodb/contrib/
trunk/lib/WikiDB/adodb/contrib/toxmlrpc.inc.php
trunk/lib/WikiDB/adodb/cute_icons_for_site/
trunk/lib/WikiDB/adodb/cute_icons_for_site/adodb.gif
trunk/lib/WikiDB/adodb/cute_icons_for_site/adodb2.gif
trunk/lib/WikiDB/adodb/datadict/
trunk/lib/WikiDB/adodb/datadict/datadict-access.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-db2.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-firebird.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-generic.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-ibase.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-informix.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-mssql.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-mssqlnative.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-mysql.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-oci8.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-postgres.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-sapdb.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-sqlite.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-sybase.inc.php
trunk/lib/WikiDB/adodb/docs/
trunk/lib/WikiDB/adodb/docs/docs-active-record.htm
trunk/lib/WikiDB/adodb/docs/docs-adodb.htm
trunk/lib/WikiDB/adodb/docs/docs-datadict.htm
trunk/lib/WikiDB/adodb/docs/docs-oracle.htm
trunk/lib/WikiDB/adodb/docs/docs-perf.htm
trunk/lib/WikiDB/adodb/docs/docs-session.htm
trunk/lib/WikiDB/adodb/docs/docs-session.old.htm
trunk/lib/WikiDB/adodb/docs/old-changelog.htm
trunk/lib/WikiDB/adodb/docs/readme.htm
trunk/lib/WikiDB/adodb/docs/tips_portable_sql.htm
trunk/lib/WikiDB/adodb/docs/tute.htm
trunk/lib/WikiDB/adodb/drivers/adodb-ado5.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ads.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-db2oci.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-db2ora.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mssql_n.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mysqlpo.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbc_db2.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_mssql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_mysql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_oci.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_pgsql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_sqlite.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres8.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres9.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sqlite3.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sqlitepo.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sybase_ase.inc.php
trunk/lib/WikiDB/adodb/lang/
trunk/lib/WikiDB/adodb/lang/adodb-da.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-de.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-en.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-es.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-esperanto.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-fa.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-fr.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-it.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-nl.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-ro.inc.php
trunk/lib/WikiDB/adodb/pear/
trunk/lib/WikiDB/adodb/pear/Auth/
trunk/lib/WikiDB/adodb/pear/Auth/Container/
trunk/lib/WikiDB/adodb/pear/Auth/Container/ADOdb.php
trunk/lib/WikiDB/adodb/pear/readme.Auth.txt
trunk/lib/WikiDB/adodb/perf/
trunk/lib/WikiDB/adodb/perf/perf-db2.inc.php
trunk/lib/WikiDB/adodb/perf/perf-informix.inc.php
trunk/lib/WikiDB/adodb/perf/perf-mssql.inc.php
trunk/lib/WikiDB/adodb/perf/perf-mssqlnative.inc.php
trunk/lib/WikiDB/adodb/perf/perf-mysql.inc.php
trunk/lib/WikiDB/adodb/perf/perf-oci8.inc.php
trunk/lib/WikiDB/adodb/perf/perf-postgres.inc.php
trunk/lib/WikiDB/adodb/pivottable.inc.php
trunk/lib/WikiDB/adodb/rsfilter.inc.php
trunk/lib/WikiDB/adodb/server.php
trunk/lib/WikiDB/adodb/session/
trunk/lib/WikiDB/adodb/session/adodb-compress-bzip2.php
trunk/lib/WikiDB/adodb/session/adodb-compress-gzip.php
trunk/lib/WikiDB/adodb/session/adodb-cryptsession.php
trunk/lib/WikiDB/adodb/session/adodb-cryptsession2.php
trunk/lib/WikiDB/adodb/session/adodb-encrypt-mcrypt.php
trunk/lib/WikiDB/adodb/session/adodb-encrypt-md5.php
trunk/lib/WikiDB/adodb/session/adodb-encrypt-secret.php
trunk/lib/WikiDB/adodb/session/adodb-encrypt-sha1.php
trunk/lib/WikiDB/adodb/session/adodb-sess.txt
trunk/lib/WikiDB/adodb/session/adodb-session-clob.php
trunk/lib/WikiDB/adodb/session/adodb-session-clob2.php
trunk/lib/WikiDB/adodb/session/adodb-session.php
trunk/lib/WikiDB/adodb/session/adodb-session2.php
trunk/lib/WikiDB/adodb/session/adodb-sessions.mysql.sql
trunk/lib/WikiDB/adodb/session/adodb-sessions.oracle.clob.sql
trunk/lib/WikiDB/adodb/session/adodb-sessions.oracle.sql
trunk/lib/WikiDB/adodb/session/crypt.inc.php
trunk/lib/WikiDB/adodb/session/old/
trunk/lib/WikiDB/adodb/session/old/adodb-cryptsession.php
trunk/lib/WikiDB/adodb/session/old/adodb-session-clob.php
trunk/lib/WikiDB/adodb/session/old/adodb-session.php
trunk/lib/WikiDB/adodb/session/old/crypt.inc.php
trunk/lib/WikiDB/adodb/session/session_schema.xml
trunk/lib/WikiDB/adodb/session/session_schema2.xml
trunk/lib/WikiDB/adodb/tests/
trunk/lib/WikiDB/adodb/tests/benchmark.php
trunk/lib/WikiDB/adodb/tests/client.php
trunk/lib/WikiDB/adodb/tests/pdo.php
trunk/lib/WikiDB/adodb/tests/test-active-record.php
trunk/lib/WikiDB/adodb/tests/test-active-recs2.php
trunk/lib/WikiDB/adodb/tests/test-active-relations.php
trunk/lib/WikiDB/adodb/tests/test-active-relationsx.php
trunk/lib/WikiDB/adodb/tests/test-datadict.php
trunk/lib/WikiDB/adodb/tests/test-perf.php
trunk/lib/WikiDB/adodb/tests/test-pgblob.php
trunk/lib/WikiDB/adodb/tests/test-php5.php
trunk/lib/WikiDB/adodb/tests/test-xmlschema.php
trunk/lib/WikiDB/adodb/tests/test.php
trunk/lib/WikiDB/adodb/tests/test2.php
trunk/lib/WikiDB/adodb/tests/test3.php
trunk/lib/WikiDB/adodb/tests/test4.php
trunk/lib/WikiDB/adodb/tests/test5.php
trunk/lib/WikiDB/adodb/tests/test_rs_array.php
trunk/lib/WikiDB/adodb/tests/testcache.php
trunk/lib/WikiDB/adodb/tests/testdatabases.inc.php
trunk/lib/WikiDB/adodb/tests/testgenid.php
trunk/lib/WikiDB/adodb/tests/testmssql.php
trunk/lib/WikiDB/adodb/tests/testoci8.php
trunk/lib/WikiDB/adodb/tests/testoci8cursor.php
trunk/lib/WikiDB/adodb/tests/testpaging.php
trunk/lib/WikiDB/adodb/tests/testpear.php
trunk/lib/WikiDB/adodb/tests/testsessions.php
trunk/lib/WikiDB/adodb/tests/time.php
trunk/lib/WikiDB/adodb/tests/tmssql.php
trunk/lib/WikiDB/adodb/tests/xmlschema-mssql.xml
trunk/lib/WikiDB/adodb/tests/xmlschema.xml
trunk/lib/WikiDB/adodb/toexport.inc.php
trunk/lib/WikiDB/adodb/tohtml.inc.php
trunk/lib/WikiDB/adodb/xmlschema.dtd
trunk/lib/WikiDB/adodb/xmlschema03.dtd
trunk/lib/WikiDB/adodb/xsl/
trunk/lib/WikiDB/adodb/xsl/convert-0.1-0.2.xsl
trunk/lib/WikiDB/adodb/xsl/convert-0.1-0.3.xsl
trunk/lib/WikiDB/adodb/xsl/convert-0.2-0.1.xsl
trunk/lib/WikiDB/adodb/xsl/convert-0.2-0.3.xsl
trunk/lib/WikiDB/adodb/xsl/remove-0.2.xsl
trunk/lib/WikiDB/adodb/xsl/remove-0.3.xsl
Removed Paths:
-------------
trunk/lib/WikiDB/adodb/readme.htm
Added: trunk/lib/WikiDB/adodb/adodb-active-record.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/adodb-active-record.inc.php (rev 0)
+++ trunk/lib/WikiDB/adodb/adodb-active-record.inc.php 2013-05-16 08:47:28 UTC (rev 8779)
@@ -0,0 +1,1002 @@
+<?php
+/*
+
+@version V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
+ Latest version is available at http://adodb.sourceforge.net
+
+ 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.
+
+ Active Record implementation. Superset of Zend Framework's.
+
+ Version 0.92
+
+ See http://www-128.ibm.com/developerworks/java/library/j-cb03076/?ca=dgr-lnxw01ActiveRecord
+ for info on Ruby on Rails Active Record implementation
+*/
+
+
+global $_ADODB_ACTIVE_DBS;
+global $ADODB_ACTIVE_CACHESECS; // set to true to enable caching of metadata such as field info
+global $ACTIVE_RECORD_SAFETY; // set to false to disable safety checks
+global $ADODB_ACTIVE_DEFVALS; // use default values of table definition when creating new active record.
+
+// array of ADODB_Active_DB's, indexed by ADODB_Active_Record->_dbat
+$_ADODB_ACTIVE_DBS = array();
+$ACTIVE_RECORD_SAFETY = true;
+$ADODB_ACTIVE_DEFVALS = false;
+$ADODB_ACTIVE_CACHESECS = 0;
+
+class ADODB_Active_DB {
+ var $db; // ADOConnection
+ var $tables; // assoc array of ADODB_Active_Table objects, indexed by tablename
+}
+
+class ADODB_Active_Table {
+ var $name; // table name
+ var $flds; // assoc array of adofieldobjs, indexed by fieldname
+ var $keys; // assoc array of primary keys, indexed by fieldname
+ var $_created; // only used when stored as a cached file
+ var $_belongsTo = array();
+ var $_hasMany = array();
+}
+
+// $db = database connection
+// $index = name of index - can be associative, for an example see
+// http://phplens.com/lens/lensforum/msgs.php?id=17790
+// returns index into $_ADODB_ACTIVE_DBS
+function ADODB_SetDatabaseAdapter(&$db, $index=false)
+{
+ global $_ADODB_ACTIVE_DBS;
+
+ foreach($_ADODB_ACTIVE_DBS as $k => $d) {
+ if (PHP_VERSION >= 5) {
+ if ($d->db === $db) return $k;
+ } else {
+ if ($d->db->_connectionID === $db->_connectionID && $db->database == $d->db->database)
+ return $k;
+ }
+ }
+
+ $obj = new ADODB_Active_DB();
+ $obj->db = $db;
+ $obj->tables = array();
+
+ if ($index == false) $index = sizeof($_ADODB_ACTIVE_DBS);
+
+
+ $_ADODB_ACTIVE_DBS[$index] = $obj;
+
+ return sizeof($_ADODB_ACTIVE_DBS)-1;
+}
+
+
+class ADODB_Active_Record {
+ static $_changeNames = true; // dynamically pluralize table names
+ static $_quoteNames = false;
+
+ static $_foreignSuffix = '_id'; //
+ var $_dbat; // associative index pointing to ADODB_Active_DB eg. $ADODB_Active_DBS[_dbat]
+ var $_table; // tablename, if set in class definition then use it as table name
+ var $_tableat; // associative index pointing to ADODB_Active_Table, eg $ADODB_Active_DBS[_dbat]->tables[$this->_tableat]
+ var $_where; // where clause set in Load()
+ var $_saved = false; // indicates whether data is already inserted.
+ var $_lasterr = false; // last error message
+ var $_original = false; // the original values loaded or inserted, refreshed on update
+
+ var $foreignName; // CFR: class name when in a relationship
+
+ var $lockMode = ' for update '; // you might want to change to
+
+ static function UseDefaultValues($bool=null)
+ {
+ global $ADODB_ACTIVE_DEFVALS;
+ if (isset($bool)) $ADODB_ACTIVE_DEFVALS = $bool;
+ return $ADODB_ACTIVE_DEFVALS;
+ }
+
+ // should be static
+ static function SetDatabaseAdapter(&$db, $index=false)
+ {
+ return ADODB_SetDatabaseAdapter($db, $index);
+ }
+
+
+ public function __set($name, $value)
+ {
+ $name = str_replace(' ', '_', $name);
+ $this->$name = $value;
+ }
+
+ // php5 constructor
+ function __construct($table = false, $pkeyarr=false, $db=false)
+ {
+ global $ADODB_ASSOC_CASE,$_ADODB_ACTIVE_DBS;
+
+ if ($db == false && is_object($pkeyarr)) {
+ $db = $pkeyarr;
+ $pkeyarr = false;
+ }
+
+ if (!$table) {
+ if (!empty($this->_table)) $table = $this->_table;
+ else $table = $this->_pluralize(get_class($this));
+ }
+ $this->foreignName = strtolower(get_class($this)); // CFR: default foreign name
+ if ($db) {
+ $this->_dbat = ADODB_Active_Record::SetDatabaseAdapter($db);
+ } else if (!isset($this->_dbat)) {
+ if (sizeof($_ADODB_ACTIVE_DBS) == 0) $this->Error("No database connection set; use ADOdb_Active_Record::SetDatabaseAdapter(\$db)",'ADODB_Active_Record::__constructor');
+ end($_ADODB_ACTIVE_DBS);
+ $this->_dbat = key($_ADODB_ACTIVE_DBS);
+ }
+
+ $this->_table = $table;
+ $this->_tableat = $table; # reserved for setting the assoc value to a non-table name, eg. the sql string in future
+
+ $this->UpdateActiveTable($pkeyarr);
+ }
+
+ function __wakeup()
+ {
+ $class = get_class($this);
+ new $class;
+ }
+
+ function _pluralize($table)
+ {
+ if (!ADODB_Active_Record::$_changeNames) return $table;
+
+ $ut = strtoupper($table);
+ $len = strlen($table);
+ $lastc = $ut[$len-1];
+ $lastc2 = substr($ut,$len-2);
+ switch ($lastc) {
+ case 'S':
+ return $table.'es';
+ case 'Y':
+ return substr($table,0,$len-1).'ies';
+ case 'X':
+ return $table.'es';
+ case 'H':
+ if ($lastc2 == 'CH' || $lastc2 == 'SH')
+ return $table.'es';
+ default:
+ return $table.'s';
+ }
+ }
+
+ // CFR Lamest singular inflector ever - @todo Make it real!
+ // Note: There is an assumption here...and it is that the argument's length >= 4
+ function _singularize($tables)
+ {
+
+ if (!ADODB_Active_Record::$_changeNames) return $table;
+
+ $ut = strtoupper($tables);
+ $len = strlen($tables);
+ if($ut[$len-1] != 'S')
+ return $tables; // I know...forget oxen
+ if($ut[$len-2] != 'E')
+ return substr($tables, 0, $len-1);
+ switch($ut[$len-3])
+ {
+ case 'S':
+ case 'X':
+ return substr($tables, 0, $len-2);
+ case 'I':
+ return substr($tables, 0, $len-3) . 'y';
+ case 'H';
+ if($ut[$len-4] == 'C' || $ut[$len-4] == 'S')
+ return substr($tables, 0, $len-2);
+ default:
+ return substr($tables, 0, $len-1); // ?
+ }
+ }
+
+ function hasMany($foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record')
+ {
+ $ar = new $foreignClass($foreignRef);
+ $ar->foreignName = $foreignRef;
+ $ar->UpdateActiveTable();
+ $ar->foreignKey = ($foreignKey) ? $foreignKey : $foreignRef.ADODB_Active_Record::$_foreignSuffix;
+ $table =& $this->TableInfo();
+ $table->_hasMany[$foreignRef] = $ar;
+ # $this->$foreignRef = $this->_hasMany[$foreignRef]; // WATCHME Removed assignment by ref. to please __get()
+ }
+
+ // use when you don't want ADOdb to auto-pluralize tablename
+ static function TableHasMany($table, $foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record')
+ {
+ $ar = new ADODB_Active_Record($table);
+ $ar->hasMany($foreignRef, $foreignKey, $foreignClass);
+ }
+
+ // use when you don't want ADOdb to auto-pluralize tablename
+ static function TableKeyHasMany($table, $tablePKey, $foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record')
+ {
+ if (!is_array($tablePKey)) $tablePKey = array($tablePKey);
+ $ar = new ADODB_Active_Record($table,$tablePKey);
+ $ar->hasMany($foreignRef, $foreignKey, $foreignClass);
+ }
+
+
+ // use when you want ADOdb to auto-pluralize tablename for you. Note that the class must already be defined.
+ // e.g. class Person will generate relationship for table Persons
+ static function ClassHasMany($parentclass, $foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record')
+ {
+ $ar = new $parentclass();
+ $ar->hasMany($foreignRef, $foreignKey, $foreignClass);
+ }
+
+
+ function belongsTo($foreignRef,$foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record')
+ {
+ global $inflector;
+
+ $ar = new $parentClass($this->_pluralize($foreignRef));
+ $ar->foreignName = $foreignRef;
+ $ar->parentKey = $parentKey;
+ $ar->UpdateActiveTable();
+ $ar->foreignKey = ($foreignKey) ? $foreignKey : $foreignRef.ADODB_Active_Record::$_foreignSuffix;
+
+ $table =& $this->TableInfo();
+ $table->_belongsTo[$foreignRef] = $ar;
+ # $this->$foreignRef = $this->_belongsTo[$foreignRef];
+ }
+
+ static function ClassBelongsTo($class, $foreignRef, $foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record')
+ {
+ $ar = new $class();
+ $ar->belongsTo($foreignRef, $foreignKey, $parentKey, $parentClass);
+ }
+
+ static function TableBelongsTo($table, $foreignRef, $foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record')
+ {
+ $ar = new ADOdb_Active_Record($table);
+ $ar->belongsTo($foreignRef, $foreignKey, $parentKey, $parentClass);
+ }
+
+ static function TableKeyBelongsTo($table, $tablePKey, $foreignRef, $foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record')
+ {
+ if (!is_array($tablePKey)) $tablePKey = array($tablePKey);
+ $ar = new ADOdb_Active_Record($table, $tablePKey);
+ $ar->belongsTo($foreignRef, $foreignKey, $parentKey, $parentClass);
+ }
+
+
+ /**
+ * __get Access properties - used for lazy loading
+ *
+ * @param mixed $name
+ * @access protected
+ * @return mixed
+ */
+ function __get($name)
+ {
+ return $this->LoadRelations($name, '', -1, -1);
+ }
+
+ /**
+ * @param string $name
+ * @param string $whereOrderBy : eg. ' AND field1 = value ORDER BY field2'
+ * @param offset
+ * @param limit
+ * @return mixed
+ */
+ function LoadRelations($name, $whereOrderBy='', $offset=-1,$limit=-1)
+ {
+ $extras = array();
+ $table = $this->TableInfo();
+ if ($limit >= 0) $extras['limit'] = $limit;
+ if ($offset >= 0) $extras['offset'] = $offset;
+
+ if (strlen($whereOrderBy))
+ if (!preg_match('/^[ \n\r]*AND/i',$whereOrderBy))
+ if (!preg_match('/^[ \n\r]*ORDER[ \n\r]/i',$whereOrderBy))
+ $whereOrderBy = 'AND '.$whereOrderBy;
+
+ if(!empty($table->_belongsTo[$name]))
+ {
+ $obj = $table->_belongsTo[$name];
+ $columnName = $obj->foreignKey;
+ if(empty($this->$columnName))
+ $this->$name = null;
+ else
+ {
+ if ($obj->parentKey) $key = $obj->parentKey;
+ else $key = reset($table->keys);
+
+ $arrayOfOne = $obj->Find($key.'='.$this->$columnName.' '.$whereOrderBy,false,false,$extras);
+ if ($arrayOfOne) {
+ $this->$name = $arrayOfOne[0];
+ return $arrayOfOne[0];
+ }
+ }
+ }
+ if(!empty($table->_hasMany[$name]))
+ {
+ $obj = $table->_hasMany[$name];
+ $key = reset($table->keys);
+ $id = @$this->$key;
+ if (!is_numeric($id)) {
+ $db = $this->DB();
+ $id = $db->qstr($id);
+ }
+ $objs = $obj->Find($obj->foreignKey.'='.$id. ' '.$whereOrderBy,false,false,$extras);
+ if (!$objs) $objs = array();
+ $this->$name = $objs;
+ return $objs;
+ }
+
+ return array();
+ }
+ //////////////////////////////////
+
+ // update metadata
+ function UpdateActiveTable($pkeys=false,$forceUpdate=false)
+ {
+ global $ADODB_ASSOC_CASE,$_ADODB_ACTIVE_DBS , $ADODB_CACHE_DIR, $ADODB_ACTIVE_CACHESECS;
+ global $ADODB_ACTIVE_DEFVALS,$ADODB_FETCH_MODE;
+
+ $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat];
+
+ $table = $this->_table;
+ $tables = $activedb->tables;
+ $tableat = $this->_tableat;
+ if (!$forceUpdate && !empty($tables[$tableat])) {
+
+ $acttab = $tables[$tableat];
+ foreach($acttab->flds as $name => $fld) {
+ if ($ADODB_ACTIVE_DEFVALS && isset($fld->default_value))
+ $this->$name = $fld->default_value;
+ else
+ $this->$name = null;
+ }
+ return;
+ }
+ $db = $activedb->db;
+ $fname = $ADODB_CACHE_DIR . '/adodb_' . $db->databaseType . '_active_'. $table . '.cache';
+ if (!$forceUpdate && $ADODB_ACTIVE_CACHESECS && $ADODB_CACHE_DIR && file_exists($fname)) {
+ $fp = fopen($fname,'r');
+ @flock($fp, LOCK_SH);
+ $acttab = unserialize(fread($fp,100000));
+ fclose($fp);
+ if ($acttab->_created + $ADODB_ACTIVE_CACHESECS - (abs(rand()) % 16) > time()) {
+ // abs(rand()) randomizes deletion, reducing contention to delete/refresh file
+ // ideally, you should cache at least 32 secs
+
+ foreach($acttab->flds as $name => $fld) {
+ if ($ADODB_ACTIVE_DEFVALS && isset($fld->default_value))
+ $this->$name = $fld->default_value;
+ else
+ $this->$name = null;
+ }
+
+ $activedb->tables[$table] = $acttab;
+
+ //if ($db->debug) ADOConnection::outp("Reading cached active record file: $fname");
+ return;
+ } else if ($db->debug) {
+ ADOConnection::outp("Refreshing cached active record file: $fname");
+ }
+ }
+ $activetab = new ADODB_Active_Table();
+ $activetab->name = $table;
+
+ $save = $ADODB_FETCH_MODE;
+ $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+ if ($db->fetchMode !== false) $savem = $db->SetFetchMode(false);
+
+ $cols = $db->MetaColumns($table);
+
+ if (isset($savem)) $db->SetFetchMode($savem);
+ $ADODB_FETCH_MODE = $save;
+
+ if (!$cols) {
+ $this->Error("Invalid table name: $table",'UpdateActiveTable');
+ return false;
+ }
+ $fld = reset($cols);
+ if (!$pkeys) {
+ if (isset($fld->primary_key)) {
+ $pkeys = array();
+ foreach($cols as $name => $fld) {
+ if (!empty($fld->primary_key)) $pkeys[] = $name;
+ }
+ } else
+ $pkeys = $this->GetPrimaryKeys($db, $table);
+ }
+ if (empty($pkeys)) {
+ $this->Error("No primary key found for table $table",'UpdateActiveTable');
+ return false;
+ }
+
+ $attr = array();
+ $keys = array();
+
+ switch($ADODB_ASSOC_CASE) {
+ case 0:
+ foreach($cols as $name => $fldobj) {
+ $name = strtolower($name);
+ if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value))
+ $this->$name = $fldobj->default_value;
+ else
+ $this->$name = null;
+ $attr[$name] = $fldobj;
+ }
+ foreach($pkeys as $k => $name) {
+ $keys[strtolower($name)] = strtolower($name);
+ }
+ break;
+
+ case 1:
+ foreach($cols as $name => $fldobj) {
+ $name = strtoupper($name);
+
+ if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value))
+ $this->$name = $fldobj->default_value;
+ else
+ $this->$name = null;
+ $attr[$name] = $fldobj;
+ }
+
+ foreach($pkeys as $k => $name) {
+ $keys[strtoupper($name)] = strtoupper($name);
+ }
+ break;
+ default:
+ foreach($cols as $name => $fldobj) {
+ $name = ($fldobj->name);
+
+ if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value))
+ $this->$name = $fldobj->default_value;
+ else
+ $this->$name = null;
+ $attr[$name] = $fldobj;
+ }
+ foreach($pkeys as $k => $name) {
+ $keys[$name] = $cols[$name]->name;
+ }
+ break;
+ }
+
+ $activetab->keys = $keys;
+ $activetab->flds = $attr;
+
+ if ($ADODB_ACTIVE_CACHESECS && $ADODB_CACHE_DIR) {
+ $activetab->_created = time();
+ $s = serialize($activetab);
+ if (!function_exists('adodb_write_file')) include(ADODB_DIR.'/adodb-csvlib.inc.php');
+ adodb_write_file($fname,$s);
+ }
+ if (isset($activedb->tables[$table])) {
+ $oldtab = $activedb->tables[$table];
+
+ if ($oldtab) $activetab->_belongsTo = $oldtab->_belongsTo;
+ if ($oldtab) $activetab->_hasMany = $oldtab->_hasMany;
+ }
+ $activedb->tables[$table] = $activetab;
+ }
+
+ function GetPrimaryKeys(&$db, $table)
+ {
+ return $db->MetaPrimaryKeys($table);
+ }
+
+ // error handler for both PHP4+5.
+ function Error($err,$fn)
+ {
+ global $_ADODB_ACTIVE_DBS;
+
+ $fn = get_class($this).'::'.$fn;
+ $this->_lasterr = $fn.': '.$err;
+
+ if ($this->_dbat < 0) $db = false;
+ else {
+ $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat];
+ $db = $activedb->db;
+ }
+
+ if (function_exists('adodb_throw')) {
+ if (!$db) adodb_throw('ADOdb_Active_Record', $fn, -1, $err, 0, 0, false);
+ else adodb_throw($db->databaseType, $fn, -1, $err, 0, 0, $db);
+ } else
+ if (!$db || $db->debug) ADOConnection::outp($this->_lasterr);
+
+ }
+
+ // return last error message
+ function ErrorMsg()
+ {
+ if (!function_exists('adodb_throw')) {
+ if ($this->_dbat < 0) $db = false;
+ else $db = $this->DB();
+
+ // last error could be database error too
+ if ($db && $db->ErrorMsg()) return $db->ErrorMsg();
+ }
+ return $this->_lasterr;
+ }
+
+ function ErrorNo()
+ {
+ if ($this->_dbat < 0) return -9999; // no database connection...
+ $db = $this->DB();
+
+ return (int) $db->ErrorNo();
+ }
+
+
+ // retrieve ADOConnection from _ADODB_Active_DBs
+ function DB()
+ {
+ global $_ADODB_ACTIVE_DBS;
+
+ if ($this->_dbat < 0) {
+ $false = false;
+ $this->Error("No database connection set: use ADOdb_Active_Record::SetDatabaseAdaptor(\$db)", "DB");
+ return $false;
+ }
+ $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat];
+ $db = $activedb->db;
+ return $db;
+ }
+
+ // retrieve ADODB_Active_Table
+ function &TableInfo()
+ {
+ global $_ADODB_ACTIVE_DBS;
+ $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat];
+ $table = $activedb->tables[$this->_tableat];
+ return $table;
+ }
+
+
+ // I have an ON INSERT trigger on a table that sets other columns in the table.
+ // So, I find that for myTable, I want to reload an active record after saving it. -- Malcolm Cook
+ function Reload()
+ {
+ $db =& $this->DB(); if (!$db) return false;
+ $table =& $this->TableInfo();
+ $where = $this->GenWhere($db, $table);
+ return($this->Load($where));
+ }
+
+
+ // set a numeric array (using natural table field ordering) as object properties
+ function Set(&$row)
+ {
+ global $ACTIVE_RECORD_SAFETY;
+
+ $db = $this->DB();
+
+ if (!$row) {
+ $this->_saved = false;
+ return false;
+ }
+
+ $this->_saved = true;
+
+ $table = $this->TableInfo();
+ if ($ACTIVE_RECORD_SAFETY && sizeof($table->flds) != sizeof($row)) {
+ # <AP>
+ $bad_size = TRUE;
+ if (sizeof($row) == 2 * sizeof($table->flds)) {
+ // Only keep string keys
+ $keys = array_filter(array_keys($row), 'is_string');
+ if (sizeof($keys) == sizeof($table->flds))
+ $bad_size = FALSE;
+ }
+ if ($bad_size) {
+ $this->Error("Table structure of $this->_table has changed","Load");
+ return false;
+ }
+ # </AP>
+ }
+ else
+ $keys = array_keys($row);
+
+ # <AP>
+ reset($keys);
+ $this->_original = array();
+ foreach($table->flds as $name=>$fld) {
+ $value = $row[current($keys)];
+ $this->$name = $value;
+ $this->_original[] = $value;
+ next($keys);
+ }
+
+ # </AP>
+ return true;
+ }
+
+ // get last inserted id for INSERT
+ function LastInsertID(&$db,$fieldname)
+ {
+ if ($db->hasInsertID)
+ $val = $db->Insert_ID($this->_table,$fieldname);
+ else
+ $val = false;
+
+ if (is_null($val) || $val === false) {
+ // this might not work reliably in multi-user environment
+ return $db->GetOne("select max(".$fieldname.") from ".$this->_table);
+ }
+ return $val;
+ }
+
+ // quote data in where clause
+ function doquote(&$db, $val,$t)
+ {
+ switch($t) {
+ case 'L':
+ if (strpos($db->databaseType,'postgres') !== false) return $db->qstr($val);
+ case 'D':
+ case 'T':
+ if (empty($val)) return 'null';
+
+ case 'B':
+ case 'N'...
[truncated message content] |
|
From: <var...@us...> - 2014-07-21 12:04:16
|
Revision: 8996
http://sourceforge.net/p/phpwiki/code/8996
Author: vargenau
Date: 2014-07-21 12:04:00 +0000 (Mon, 21 Jul 2014)
Log Message:
-----------
Update adodb to adodb519
Modified Paths:
--------------
trunk/lib/WikiDB/adodb/adodb-active-record.inc.php
trunk/lib/WikiDB/adodb/adodb-active-recordx.inc.php
trunk/lib/WikiDB/adodb/adodb-csvlib.inc.php
trunk/lib/WikiDB/adodb/adodb-datadict.inc.php
trunk/lib/WikiDB/adodb/adodb-error.inc.php
trunk/lib/WikiDB/adodb/adodb-errorhandler.inc.php
trunk/lib/WikiDB/adodb/adodb-errorpear.inc.php
trunk/lib/WikiDB/adodb/adodb-exceptions.inc.php
trunk/lib/WikiDB/adodb/adodb-iterator.inc.php
trunk/lib/WikiDB/adodb/adodb-lib.inc.php
trunk/lib/WikiDB/adodb/adodb-memcache.lib.inc.php
trunk/lib/WikiDB/adodb/adodb-pager.inc.php
trunk/lib/WikiDB/adodb/adodb-pear.inc.php
trunk/lib/WikiDB/adodb/adodb-perf.inc.php
trunk/lib/WikiDB/adodb/adodb-php4.inc.php
trunk/lib/WikiDB/adodb/adodb-time.inc.php
trunk/lib/WikiDB/adodb/adodb-xmlschema.inc.php
trunk/lib/WikiDB/adodb/adodb-xmlschema03.inc.php
trunk/lib/WikiDB/adodb/adodb.inc.php
trunk/lib/WikiDB/adodb/contrib/toxmlrpc.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-access.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-db2.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-firebird.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-generic.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-ibase.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-informix.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-mssql.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-mssqlnative.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-mysql.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-oci8.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-postgres.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-sapdb.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-sqlite.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-sybase.inc.php
trunk/lib/WikiDB/adodb/docs/docs-active-record.htm
trunk/lib/WikiDB/adodb/docs/docs-adodb.htm
trunk/lib/WikiDB/adodb/docs/docs-datadict.htm
trunk/lib/WikiDB/adodb/docs/docs-oracle.htm
trunk/lib/WikiDB/adodb/docs/docs-perf.htm
trunk/lib/WikiDB/adodb/docs/docs-session.htm
trunk/lib/WikiDB/adodb/docs/docs-session.old.htm
trunk/lib/WikiDB/adodb/docs/old-changelog.htm
trunk/lib/WikiDB/adodb/docs/tips_portable_sql.htm
trunk/lib/WikiDB/adodb/docs/tute.htm
trunk/lib/WikiDB/adodb/drivers/adodb-access.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ado.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ado5.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ado_access.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ado_mssql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ads.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-borland_ibase.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-csv.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-db2.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-db2oci.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-db2ora.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-fbsql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-firebird.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ibase.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-informix.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-informix72.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ldap.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mssql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mssql_n.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mssqlnative.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mssqlpo.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mysql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mysqli.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mysqlpo.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mysqlt.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-netezza.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-oci8.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-oci805.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-oci8po.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbc.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbc_db2.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbc_mssql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbc_oracle.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbtp.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbtp_unicode.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-oracle.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_mssql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_mysql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_oci.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_pgsql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_sqlite.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres64.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres7.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres8.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres9.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-proxy.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sapdb.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sqlanywhere.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sqlite.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sqlite3.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sqlitepo.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sybase.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sybase_ase.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-vfp.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-da.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-de.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-en.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-es.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-esperanto.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-fa.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-fr.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-it.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-nl.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-ro.inc.php
trunk/lib/WikiDB/adodb/license.txt
trunk/lib/WikiDB/adodb/pear/Auth/Container/ADOdb.php
trunk/lib/WikiDB/adodb/pear/readme.Auth.txt
trunk/lib/WikiDB/adodb/perf/perf-db2.inc.php
trunk/lib/WikiDB/adodb/perf/perf-informix.inc.php
trunk/lib/WikiDB/adodb/perf/perf-mssql.inc.php
trunk/lib/WikiDB/adodb/perf/perf-mssqlnative.inc.php
trunk/lib/WikiDB/adodb/perf/perf-mysql.inc.php
trunk/lib/WikiDB/adodb/perf/perf-oci8.inc.php
trunk/lib/WikiDB/adodb/perf/perf-postgres.inc.php
trunk/lib/WikiDB/adodb/pivottable.inc.php
trunk/lib/WikiDB/adodb/rsfilter.inc.php
trunk/lib/WikiDB/adodb/server.php
trunk/lib/WikiDB/adodb/session/adodb-compress-bzip2.php
trunk/lib/WikiDB/adodb/session/adodb-compress-gzip.php
trunk/lib/WikiDB/adodb/session/adodb-cryptsession.php
trunk/lib/WikiDB/adodb/session/adodb-cryptsession2.php
trunk/lib/WikiDB/adodb/session/adodb-encrypt-mcrypt.php
trunk/lib/WikiDB/adodb/session/adodb-encrypt-md5.php
trunk/lib/WikiDB/adodb/session/adodb-encrypt-secret.php
trunk/lib/WikiDB/adodb/session/adodb-encrypt-sha1.php
trunk/lib/WikiDB/adodb/session/adodb-sess.txt
trunk/lib/WikiDB/adodb/session/adodb-session-clob.php
trunk/lib/WikiDB/adodb/session/adodb-session-clob2.php
trunk/lib/WikiDB/adodb/session/adodb-session.php
trunk/lib/WikiDB/adodb/session/adodb-session2.php
trunk/lib/WikiDB/adodb/session/crypt.inc.php
trunk/lib/WikiDB/adodb/session/old/adodb-cryptsession.php
trunk/lib/WikiDB/adodb/session/old/adodb-session-clob.php
trunk/lib/WikiDB/adodb/session/old/adodb-session.php
trunk/lib/WikiDB/adodb/session/old/crypt.inc.php
trunk/lib/WikiDB/adodb/session/session_schema.xml
trunk/lib/WikiDB/adodb/session/session_schema2.xml
trunk/lib/WikiDB/adodb/tests/benchmark.php
trunk/lib/WikiDB/adodb/tests/client.php
trunk/lib/WikiDB/adodb/tests/pdo.php
trunk/lib/WikiDB/adodb/tests/test-active-record.php
trunk/lib/WikiDB/adodb/tests/test-active-recs2.php
trunk/lib/WikiDB/adodb/tests/test-active-relations.php
trunk/lib/WikiDB/adodb/tests/test-active-relationsx.php
trunk/lib/WikiDB/adodb/tests/test-datadict.php
trunk/lib/WikiDB/adodb/tests/test-perf.php
trunk/lib/WikiDB/adodb/tests/test-pgblob.php
trunk/lib/WikiDB/adodb/tests/test-php5.php
trunk/lib/WikiDB/adodb/tests/test-xmlschema.php
trunk/lib/WikiDB/adodb/tests/test.php
trunk/lib/WikiDB/adodb/tests/test2.php
trunk/lib/WikiDB/adodb/tests/test3.php
trunk/lib/WikiDB/adodb/tests/test4.php
trunk/lib/WikiDB/adodb/tests/test5.php
trunk/lib/WikiDB/adodb/tests/test_rs_array.php
trunk/lib/WikiDB/adodb/tests/testcache.php
trunk/lib/WikiDB/adodb/tests/testdatabases.inc.php
trunk/lib/WikiDB/adodb/tests/testgenid.php
trunk/lib/WikiDB/adodb/tests/testmssql.php
trunk/lib/WikiDB/adodb/tests/testoci8.php
trunk/lib/WikiDB/adodb/tests/testoci8cursor.php
trunk/lib/WikiDB/adodb/tests/testpaging.php
trunk/lib/WikiDB/adodb/tests/testpear.php
trunk/lib/WikiDB/adodb/tests/testsessions.php
trunk/lib/WikiDB/adodb/tests/time.php
trunk/lib/WikiDB/adodb/tests/tmssql.php
trunk/lib/WikiDB/adodb/toexport.inc.php
trunk/lib/WikiDB/adodb/tohtml.inc.php
trunk/lib/WikiDB/adodb/xmlschema.dtd
trunk/lib/WikiDB/adodb/xmlschema03.dtd
trunk/lib/WikiDB/adodb/xsl/convert-0.1-0.2.xsl
trunk/lib/WikiDB/adodb/xsl/convert-0.1-0.3.xsl
trunk/lib/WikiDB/adodb/xsl/convert-0.2-0.1.xsl
trunk/lib/WikiDB/adodb/xsl/convert-0.2-0.3.xsl
trunk/lib/WikiDB/adodb/xsl/remove-0.2.xsl
trunk/lib/WikiDB/adodb/xsl/remove-0.3.xsl
Added Paths:
-----------
trunk/lib/WikiDB/adodb/README.md
trunk/lib/WikiDB/adodb/composer.json
trunk/lib/WikiDB/adodb/docs/adodb-faq.html
trunk/lib/WikiDB/adodb/docs/adodb.gif
trunk/lib/WikiDB/adodb/docs/adodb2.gif
trunk/lib/WikiDB/adodb/docs/index.html
trunk/lib/WikiDB/adodb/drivers/adodb-oci8quercus.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-ar.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-bg.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-bgutf8.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-ca.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-cn.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-cz.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-hu.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-pl.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-pt-br.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-ru1251.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-sv.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-uk1251.inc.php
trunk/lib/WikiDB/adodb/lang/adodb_th.inc.php
trunk/lib/WikiDB/adodb/pear/auth_adodb_example.php
Removed Paths:
-------------
trunk/lib/WikiDB/adodb/docs/readme.htm
trunk/lib/WikiDB/adodb/readme.txt
Added: trunk/lib/WikiDB/adodb/README.md
===================================================================
--- trunk/lib/WikiDB/adodb/README.md (rev 0)
+++ trunk/lib/WikiDB/adodb/README.md 2014-07-21 12:04:00 UTC (rev 8996)
@@ -0,0 +1,94 @@
+ADODB Library for PHP5
+======================
+
+(c) 2000-2014 John Lim (jl...@na...)
+
+Released under both BSD and GNU Lesser GPL library license.
+This means you can use it in proprietary products.
+
+Home page: http://adodb.sourceforge.net/
+
+
+Introduction
+============
+
+PHP's database access functions are not standardized. This creates a
+need for a database class library to hide the differences between the
+different databases (encapsulate the differences) so we can easily
+switch databases.
+
+The library currently supports MySQL, Interbase, Sybase, PostgreSQL, Oracle,
+Microsoft SQL server, Foxpro ODBC, Access ODBC, Informix, DB2,
+Sybase SQL Anywhere, generic ODBC and Microsoft's ADO.
+
+We hope more people will contribute drivers to support other databases.
+
+
+Installation
+============
+
+Unpack all the files into a directory accessible by your web server.
+
+To test, try modifying some of the tutorial examples.
+Make sure you customize the connection settings correctly.
+
+You can debug using:
+
+``` php
+<?php
+include('adodb/adodb.inc.php');
+
+$db = ADONewConnection($driver); # eg. 'mysql' or 'oci8'
+$db->debug = true;
+$db->Connect($server, $user, $password, $database);
+$rs = $db->Execute('select * from some_small_table');
+print "<pre>";
+print_r($rs->GetRows());
+print "</pre>";
+```
+
+
+Documentation and Examples
+==========================
+
+Refer to the `docs` directory for library documentation and examples.
+
+- Main documentation: `docs-adodb.htm`.
+ Query, update and insert records using a portable API.
+- Data dictionary docs: `docs-datadict.htm`.
+ Describes how to create database tables and indexes in a portable manner.
+- Database performance monitoring docs: `docs-perf.htm`.
+ Allows you to perform health checks, tune and monitor your database.
+- Database-backed session docs: `docs-session.htm`.
+
+There is also a tutorial `tute.htm` that contrasts ADOdb code with
+mysql code.
+
+
+Files
+=====
+
+- `adodb.inc.php` is the library's main file. You only need to include this file.
+- `adodb-*.inc.php` are the database specific driver code.
+- `adodb-session.php` is the PHP4 session handling code.
+- `test.php` contains a list of test commands to exercise the class library.
+- `testdatabases.inc.php` contains the list of databases to apply the tests on.
+- `Benchmark.php` is a simple benchmark to test the throughput of a SELECT
+statement for databases described in testdatabases.inc.php. The benchmark
+tables are created in test.php.
+
+
+Feature Requests and Bug Reports
+================================
+
+Please report bugs, issues and feature requests on Github:
+
+https://github.com/ADOdb/ADOdb/issues
+
+You may also find legacy issues in
+
+- the old [ADOdb forums](http://phplens.com/lens/lensforum/topics.php?id=4) on phplens.com
+- the [SourceForge tickets section](http://sourceforge.net/p/adodb/_list/tickets)
+
+However, please note that they are not actively monitored and should
+only be used as reference.
Modified: trunk/lib/WikiDB/adodb/adodb-active-record.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/adodb-active-record.inc.php 2014-07-21 09:44:17 UTC (rev 8995)
+++ trunk/lib/WikiDB/adodb/adodb-active-record.inc.php 2014-07-21 12:04:00 UTC (rev 8996)
@@ -1,18 +1,18 @@
<?php
/*
-@version V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
+@version V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
Latest version is available at http://adodb.sourceforge.net
-
- Released under both BSD license and Lesser GPL library license.
- Whenever there is any discrepancy between the two licenses,
+
+ 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.
-
+
Active Record implementation. Superset of Zend Framework's.
-
+
Version 0.92
-
- See http://www-128.ibm.com/developerworks/java/library/j-cb03076/?ca=dgr-lnxw01ActiveRecord
+
+ See http://www-128.ibm.com/developerworks/java/library/j-cb03076/?ca=dgr-lnxw01ActiveRecord
for info on Ruby on Rails Active Record implementation
*/
@@ -44,30 +44,30 @@
// $db = database connection
// $index = name of index - can be associative, for an example see
-// http://phplens.com/lens/lensforum/msgs.php?id=17790
+// http://phplens.com/lens/lensforum/msgs.php?id=17790
// returns index into $_ADODB_ACTIVE_DBS
function ADODB_SetDatabaseAdapter(&$db, $index=false)
{
global $_ADODB_ACTIVE_DBS;
-
+
foreach($_ADODB_ACTIVE_DBS as $k => $d) {
if (PHP_VERSION >= 5) {
if ($d->db === $db) return $k;
} else {
- if ($d->db->_connectionID === $db->_connectionID && $db->database == $d->db->database)
+ if ($d->db->_connectionID === $db->_connectionID && $db->database == $d->db->database)
return $k;
}
}
-
+
$obj = new ADODB_Active_DB();
$obj->db = $db;
$obj->tables = array();
-
+
if ($index == false) $index = sizeof($_ADODB_ACTIVE_DBS);
-
+
$_ADODB_ACTIVE_DBS[$index] = $obj;
-
+
return sizeof($_ADODB_ACTIVE_DBS)-1;
}
@@ -75,8 +75,8 @@
class ADODB_Active_Record {
static $_changeNames = true; // dynamically pluralize table names
static $_quoteNames = false;
-
- static $_foreignSuffix = '_id'; //
+
+ static $_foreignSuffix = '_id'; //
var $_dbat; // associative index pointing to ADODB_Active_DB eg. $ADODB_Active_DBS[_dbat]
var $_table; // tablename, if set in class definition then use it as table name
var $_tableat; // associative index pointing to ADODB_Active_Table, eg $ADODB_Active_DBS[_dbat]->tables[$this->_tableat]
@@ -87,8 +87,8 @@
var $foreignName; // CFR: class name when in a relationship
- var $lockMode = ' for update '; // you might want to change to
-
+ var $lockMode = ' for update '; // you might want to change to
+
static function UseDefaultValues($bool=null)
{
global $ADODB_ACTIVE_DEFVALS;
@@ -97,29 +97,29 @@
}
// should be static
- static function SetDatabaseAdapter(&$db, $index=false)
+ static function SetDatabaseAdapter(&$db, $index=false)
{
return ADODB_SetDatabaseAdapter($db, $index);
}
-
-
+
+
public function __set($name, $value)
{
$name = str_replace(' ', '_', $name);
$this->$name = $value;
}
-
+
// php5 constructor
function __construct($table = false, $pkeyarr=false, $db=false)
{
global $ADODB_ASSOC_CASE,$_ADODB_ACTIVE_DBS;
-
+
if ($db == false && is_object($pkeyarr)) {
$db = $pkeyarr;
$pkeyarr = false;
}
-
- if (!$table) {
+
+ if (!$table) {
if (!empty($this->_table)) $table = $this->_table;
else $table = $this->_pluralize(get_class($this));
}
@@ -137,13 +137,13 @@
$this->UpdateActiveTable($pkeyarr);
}
-
+
function __wakeup()
{
$class = get_class($this);
new $class;
}
-
+
function _pluralize($table)
{
if (!ADODB_Active_Record::$_changeNames) return $table;
@@ -154,26 +154,26 @@
$lastc2 = substr($ut,$len-2);
switch ($lastc) {
case 'S':
- return $table.'es';
+ return $table.'es';
case 'Y':
return substr($table,0,$len-1).'ies';
- case 'X':
+ case 'X':
return $table.'es';
- case 'H':
+ case 'H':
if ($lastc2 == 'CH' || $lastc2 == 'SH')
return $table.'es';
default:
return $table.'s';
}
}
-
+
// CFR Lamest singular inflector ever - @todo Make it real!
// Note: There is an assumption here...and it is that the argument's length >= 4
function _singularize($tables)
{
-
+
if (!ADODB_Active_Record::$_changeNames) return $table;
-
+
$ut = strtoupper($tables);
$len = strlen($tables);
if($ut[$len-1] != 'S')
@@ -205,14 +205,14 @@
$table->_hasMany[$foreignRef] = $ar;
# $this->$foreignRef = $this->_hasMany[$foreignRef]; // WATCHME Removed assignment by ref. to please __get()
}
-
+
// use when you don't want ADOdb to auto-pluralize tablename
static function TableHasMany($table, $foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record')
{
$ar = new ADODB_Active_Record($table);
$ar->hasMany($foreignRef, $foreignKey, $foreignClass);
}
-
+
// use when you don't want ADOdb to auto-pluralize tablename
static function TableKeyHasMany($table, $tablePKey, $foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record')
{
@@ -220,8 +220,8 @@
$ar = new ADODB_Active_Record($table,$tablePKey);
$ar->hasMany($foreignRef, $foreignKey, $foreignClass);
}
-
-
+
+
// use when you want ADOdb to auto-pluralize tablename for you. Note that the class must already be defined.
// e.g. class Person will generate relationship for table Persons
static function ClassHasMany($parentclass, $foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record')
@@ -229,8 +229,8 @@
$ar = new $parentclass();
$ar->hasMany($foreignRef, $foreignKey, $foreignClass);
}
-
+
function belongsTo($foreignRef,$foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record')
{
global $inflector;
@@ -240,24 +240,24 @@
$ar->parentKey = $parentKey;
$ar->UpdateActiveTable();
$ar->foreignKey = ($foreignKey) ? $foreignKey : $foreignRef.ADODB_Active_Record::$_foreignSuffix;
-
+
$table =& $this->TableInfo();
$table->_belongsTo[$foreignRef] = $ar;
# $this->$foreignRef = $this->_belongsTo[$foreignRef];
}
-
+
static function ClassBelongsTo($class, $foreignRef, $foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record')
{
$ar = new $class();
$ar->belongsTo($foreignRef, $foreignKey, $parentKey, $parentClass);
}
-
+
static function TableBelongsTo($table, $foreignRef, $foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record')
{
$ar = new ADOdb_Active_Record($table);
$ar->belongsTo($foreignRef, $foreignKey, $parentKey, $parentClass);
}
-
+
static function TableKeyBelongsTo($table, $tablePKey, $foreignRef, $foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record')
{
if (!is_array($tablePKey)) $tablePKey = array($tablePKey);
@@ -268,8 +268,8 @@
/**
* __get Access properties - used for lazy loading
- *
- * @param mixed $name
+ *
+ * @param mixed $name
* @access protected
* @return mixed
*/
@@ -277,9 +277,9 @@
{
return $this->LoadRelations($name, '', -1, -1);
}
-
+
/**
- * @param string $name
+ * @param string $name
* @param string $whereOrderBy : eg. ' AND field1 = value ORDER BY field2'
* @param offset
* @param limit
@@ -291,12 +291,12 @@
$table = $this->TableInfo();
if ($limit >= 0) $extras['limit'] = $limit;
if ($offset >= 0) $extras['offset'] = $offset;
-
- if (strlen($whereOrderBy))
+
+ if (strlen($whereOrderBy))
if (!preg_match('/^[ \n\r]*AND/i',$whereOrderBy))
if (!preg_match('/^[ \n\r]*ORDER[ \n\r]/i',$whereOrderBy))
$whereOrderBy = 'AND '.$whereOrderBy;
-
+
if(!empty($table->_belongsTo[$name]))
{
$obj = $table->_belongsTo[$name];
@@ -307,7 +307,7 @@
{
if ($obj->parentKey) $key = $obj->parentKey;
else $key = reset($table->keys);
-
+
$arrayOfOne = $obj->Find($key.'='.$this->$columnName.' '.$whereOrderBy,false,false,$extras);
if ($arrayOfOne) {
$this->$name = $arrayOfOne[0];
@@ -316,7 +316,7 @@
}
}
if(!empty($table->_hasMany[$name]))
- {
+ {
$obj = $table->_hasMany[$name];
$key = reset($table->keys);
$id = @$this->$key;
@@ -329,11 +329,11 @@
$this->$name = $objs;
return $objs;
}
-
+
return array();
}
//////////////////////////////////
-
+
// update metadata
function UpdateActiveTable($pkeys=false,$forceUpdate=false)
{
@@ -349,7 +349,7 @@
$acttab = $tables[$tableat];
foreach($acttab->flds as $name => $fld) {
- if ($ADODB_ACTIVE_DEFVALS && isset($fld->default_value))
+ if ($ADODB_ACTIVE_DEFVALS && isset($fld->default_value))
$this->$name = $fld->default_value;
else
$this->$name = null;
@@ -363,19 +363,19 @@
@flock($fp, LOCK_SH);
$acttab = unserialize(fread($fp,100000));
fclose($fp);
- if ($acttab->_created + $ADODB_ACTIVE_CACHESECS - (abs(rand()) % 16) > time()) {
+ if ($acttab->_created + $ADODB_ACTIVE_CACHESECS - (abs(rand()) % 16) > time()) {
// abs(rand()) randomizes deletion, reducing contention to delete/refresh file
// ideally, you should cache at least 32 secs
-
+
foreach($acttab->flds as $name => $fld) {
- if ($ADODB_ACTIVE_DEFVALS && isset($fld->default_value))
+ if ($ADODB_ACTIVE_DEFVALS && isset($fld->default_value))
$this->$name = $fld->default_value;
else
$this->$name = null;
}
-
+
$activedb->tables[$table] = $acttab;
-
+
//if ($db->debug) ADOConnection::outp("Reading cached active record file: $fname");
return;
} else if ($db->debug) {
@@ -384,18 +384,18 @@
}
$activetab = new ADODB_Active_Table();
$activetab->name = $table;
-
+
$save = $ADODB_FETCH_MODE;
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
if ($db->fetchMode !== false) $savem = $db->SetFetchMode(false);
-
+
$cols = $db->MetaColumns($table);
-
+
if (isset($savem)) $db->SetFetchMode($savem);
$ADODB_FETCH_MODE = $save;
-
+
if (!$cols) {
- $this->Error("Invalid table name: $table",'UpdateActiveTable');
+ $this->Error("Invalid table name: $table",'UpdateActiveTable');
return false;
}
$fld = reset($cols);
@@ -405,17 +405,17 @@
foreach($cols as $name => $fld) {
if (!empty($fld->primary_key)) $pkeys[] = $name;
}
- } else
+ } else
$pkeys = $this->GetPrimaryKeys($db, $table);
}
if (empty($pkeys)) {
$this->Error("No primary key found for table $table",'UpdateActiveTable');
return false;
}
-
+
$attr = array();
$keys = array();
-
+
switch($ADODB_ASSOC_CASE) {
case 0:
foreach($cols as $name => $fldobj) {
@@ -430,18 +430,18 @@
$keys[strtolower($name)] = strtolower($name);
}
break;
-
- case 1:
+
+ case 1:
foreach($cols as $name => $fldobj) {
$name = strtoupper($name);
-
+
if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value))
$this->$name = $fldobj->default_value;
else
$this->$name = null;
$attr[$name] = $fldobj;
}
-
+
foreach($pkeys as $k => $name) {
$keys[strtoupper($name)] = strtoupper($name);
}
@@ -449,7 +449,7 @@
default:
foreach($cols as $name => $fldobj) {
$name = ($fldobj->name);
-
+
if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value))
$this->$name = $fldobj->default_value;
else
@@ -461,7 +461,7 @@
}
break;
}
-
+
$activetab->keys = $keys;
$activetab->flds = $attr;
@@ -473,58 +473,58 @@
}
if (isset($activedb->tables[$table])) {
$oldtab = $activedb->tables[$table];
-
+
if ($oldtab) $activetab->_belongsTo = $oldtab->_belongsTo;
if ($oldtab) $activetab->_hasMany = $oldtab->_hasMany;
}
$activedb->tables[$table] = $activetab;
}
-
+
function GetPrimaryKeys(&$db, $table)
{
return $db->MetaPrimaryKeys($table);
}
-
- // error handler for both PHP4+5.
+
+ // error handler for both PHP4+5.
function Error($err,$fn)
{
global $_ADODB_ACTIVE_DBS;
-
+
$fn = get_class($this).'::'.$fn;
$this->_lasterr = $fn.': '.$err;
-
+
if ($this->_dbat < 0) $db = false;
else {
$activedb = $_ADODB_ACTIVE_DBS[$this->_dbat];
$db = $activedb->db;
}
-
- if (function_exists('adodb_throw')) {
+
+ if (function_exists('adodb_throw')) {
if (!$db) adodb_throw('ADOdb_Active_Record', $fn, -1, $err, 0, 0, false);
else adodb_throw($db->databaseType, $fn, -1, $err, 0, 0, $db);
} else
if (!$db || $db->debug) ADOConnection::outp($this->_lasterr);
-
+
}
-
+
// return last error message
function ErrorMsg()
{
if (!function_exists('adodb_throw')) {
if ($this->_dbat < 0) $db = false;
else $db = $this->DB();
-
+
// last error could be database error too
if ($db && $db->ErrorMsg()) return $db->ErrorMsg();
}
return $this->_lasterr;
}
-
- function ErrorNo()
+
+ function ErrorNo()
{
if ($this->_dbat < 0) return -9999; // no database connection...
$db = $this->DB();
-
+
return (int) $db->ErrorNo();
}
@@ -533,7 +533,7 @@
function DB()
{
global $_ADODB_ACTIVE_DBS;
-
+
if ($this->_dbat < 0) {
$false = false;
$this->Error("No database connection set: use ADOdb_Active_Record::SetDatabaseAdaptor(\$db)", "DB");
@@ -543,7 +543,7 @@
$db = $activedb->db;
return $db;
}
-
+
// retrieve ADODB_Active_Table
function &TableInfo()
{
@@ -552,8 +552,8 @@
$table = $activedb->tables[$this->_tableat];
return $table;
}
-
-
+
+
// I have an ON INSERT trigger on a table that sets other columns in the table.
// So, I find that for myTable, I want to reload an active record after saving it. -- Malcolm Cook
function Reload()
@@ -564,21 +564,21 @@
return($this->Load($where));
}
-
+
// set a numeric array (using natural table field ordering) as object properties
function Set(&$row)
{
global $ACTIVE_RECORD_SAFETY;
-
+
$db = $this->DB();
-
+
if (!$row) {
- $this->_saved = false;
+ $this->_saved = false;
return false;
}
-
+
$this->_saved = true;
-
+
$table = $this->TableInfo();
if ($ACTIVE_RECORD_SAFETY && sizeof($table->flds) != sizeof($row)) {
# <AP>
@@ -597,7 +597,7 @@
}
else
$keys = array_keys($row);
-
+
# <AP>
reset($keys);
$this->_original = array();
@@ -611,7 +611,7 @@
# </AP>
return true;
}
-
+
// get last inserted id for INSERT
function LastInsertID(&$db,$fieldname)
{
@@ -619,32 +619,32 @@
$val = $db->Insert_ID($this->_table,$fieldname);
else
$val = false;
-
+
if (is_null($val) || $val === false) {
// this might not work reliably in multi-user environment
return $db->GetOne("select max(".$fieldname.") from ".$this->_table);
}
return $val;
}
-
+
// quote data in where clause
function doquote(&$db, $val,$t)
{
switch($t) {
case 'L':
if (strpos($db->databaseType,'postgres') !== false) return $db->qstr($val);
- case 'D':
+ case 'D':
case 'T':
if (empty($val)) return 'null';
-
- case 'B':
+
+ case 'B':
case 'N':
case 'C':
case 'X':
if (is_null($val)) return 'null';
-
- if (strlen($val)>0 &&
- (strncmp($val,"'",1) != 0 || substr($val,strlen($val)-1,1) != "'")) {
+
+ if (strlen($val)>0 &&
+ (strncmp($val,"'",1) != 0 || substr($val,strlen($val)-1,1) != "'")) {
return $db->qstr($val);
break;
}
@@ -653,13 +653,13 @@
break;
}
}
-
+
// generate where clause for an UPDATE/SELECT
function GenWhere(&$db, &$table)
{
$keys = $table->keys;
$parr = array();
-
+
foreach($keys as $k) {
$f = $table->fl...
[truncated message content] |
|
From: <var...@us...> - 2014-08-25 13:35:33
|
Revision: 9048
http://sourceforge.net/p/phpwiki/code/9048
Author: vargenau
Date: 2014-08-25 13:35:28 +0000 (Mon, 25 Aug 2014)
Log Message:
-----------
Update adodb
Modified Paths:
--------------
trunk/lib/WikiDB/adodb/adodb-active-record.inc.php
trunk/lib/WikiDB/adodb/adodb-active-recordx.inc.php
trunk/lib/WikiDB/adodb/adodb-csvlib.inc.php
trunk/lib/WikiDB/adodb/adodb-datadict.inc.php
trunk/lib/WikiDB/adodb/adodb-error.inc.php
trunk/lib/WikiDB/adodb/adodb-errorhandler.inc.php
trunk/lib/WikiDB/adodb/adodb-errorpear.inc.php
trunk/lib/WikiDB/adodb/adodb-exceptions.inc.php
trunk/lib/WikiDB/adodb/adodb-iterator.inc.php
trunk/lib/WikiDB/adodb/adodb-lib.inc.php
trunk/lib/WikiDB/adodb/adodb-memcache.lib.inc.php
trunk/lib/WikiDB/adodb/adodb-pager.inc.php
trunk/lib/WikiDB/adodb/adodb-pear.inc.php
trunk/lib/WikiDB/adodb/adodb-perf.inc.php
trunk/lib/WikiDB/adodb/adodb-php4.inc.php
trunk/lib/WikiDB/adodb/adodb-time.inc.php
trunk/lib/WikiDB/adodb/adodb.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-access.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-db2.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-firebird.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-generic.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-ibase.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-informix.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-mssql.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-mssqlnative.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-mysql.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-oci8.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-postgres.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-sapdb.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-sqlite.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-sybase.inc.php
trunk/lib/WikiDB/adodb/docs/docs-adodb.htm
trunk/lib/WikiDB/adodb/docs/docs-datadict.htm
trunk/lib/WikiDB/adodb/docs/docs-perf.htm
trunk/lib/WikiDB/adodb/docs/docs-session.htm
trunk/lib/WikiDB/adodb/docs/docs-session.old.htm
trunk/lib/WikiDB/adodb/drivers/adodb-access.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ado.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ado5.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ado_access.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ado_mssql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-borland_ibase.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-csv.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-db2.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-db2oci.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-db2ora.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-fbsql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-firebird.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ibase.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-informix.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-informix72.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ldap.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mssql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mssqlnative.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mssqlpo.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mysql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mysqli.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mysqlpo.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mysqlt.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-netezza.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-oci8.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-oci805.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-oci8po.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-oci8quercus.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbc.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbc_db2.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbc_mssql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbc_oracle.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbtp.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbtp_unicode.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-oracle.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_mssql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_mysql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_oci.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_pgsql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_sqlite.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres64.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres7.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres8.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres9.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-proxy.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sapdb.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sqlanywhere.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sqlite.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sqlite3.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sqlitepo.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sybase.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sybase_ase.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-vfp.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-ca.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-pt-br.inc.php
trunk/lib/WikiDB/adodb/lang/adodb-sv.inc.php
trunk/lib/WikiDB/adodb/pear/Auth/Container/ADOdb.php
trunk/lib/WikiDB/adodb/perf/perf-db2.inc.php
trunk/lib/WikiDB/adodb/perf/perf-informix.inc.php
trunk/lib/WikiDB/adodb/perf/perf-mssql.inc.php
trunk/lib/WikiDB/adodb/perf/perf-mssqlnative.inc.php
trunk/lib/WikiDB/adodb/perf/perf-mysql.inc.php
trunk/lib/WikiDB/adodb/perf/perf-oci8.inc.php
trunk/lib/WikiDB/adodb/perf/perf-postgres.inc.php
trunk/lib/WikiDB/adodb/pivottable.inc.php
trunk/lib/WikiDB/adodb/rsfilter.inc.php
trunk/lib/WikiDB/adodb/server.php
trunk/lib/WikiDB/adodb/session/adodb-compress-bzip2.php
trunk/lib/WikiDB/adodb/session/adodb-compress-gzip.php
trunk/lib/WikiDB/adodb/session/adodb-cryptsession.php
trunk/lib/WikiDB/adodb/session/adodb-cryptsession2.php
trunk/lib/WikiDB/adodb/session/adodb-encrypt-mcrypt.php
trunk/lib/WikiDB/adodb/session/adodb-encrypt-md5.php
trunk/lib/WikiDB/adodb/session/adodb-encrypt-secret.php
trunk/lib/WikiDB/adodb/session/adodb-session-clob.php
trunk/lib/WikiDB/adodb/session/adodb-session-clob2.php
trunk/lib/WikiDB/adodb/session/adodb-session.php
trunk/lib/WikiDB/adodb/session/adodb-session2.php
trunk/lib/WikiDB/adodb/session/old/adodb-cryptsession.php
trunk/lib/WikiDB/adodb/session/old/adodb-session-clob.php
trunk/lib/WikiDB/adodb/session/old/adodb-session.php
trunk/lib/WikiDB/adodb/tests/benchmark.php
trunk/lib/WikiDB/adodb/tests/client.php
trunk/lib/WikiDB/adodb/tests/test-datadict.php
trunk/lib/WikiDB/adodb/tests/test-php5.php
trunk/lib/WikiDB/adodb/tests/test.php
trunk/lib/WikiDB/adodb/tests/test3.php
trunk/lib/WikiDB/adodb/tests/test4.php
trunk/lib/WikiDB/adodb/tests/test5.php
trunk/lib/WikiDB/adodb/tests/testcache.php
trunk/lib/WikiDB/adodb/tests/testdatabases.inc.php
trunk/lib/WikiDB/adodb/tests/testmssql.php
trunk/lib/WikiDB/adodb/tests/testoci8.php
trunk/lib/WikiDB/adodb/tests/testoci8cursor.php
trunk/lib/WikiDB/adodb/tests/testpaging.php
trunk/lib/WikiDB/adodb/tests/testpear.php
trunk/lib/WikiDB/adodb/tests/testsessions.php
trunk/lib/WikiDB/adodb/toexport.inc.php
trunk/lib/WikiDB/adodb/tohtml.inc.php
Added Paths:
-----------
trunk/lib/WikiDB/adodb/drivers/adodb-text.inc.php
Modified: trunk/lib/WikiDB/adodb/adodb-active-record.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/adodb-active-record.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/adodb-active-record.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,7 +1,7 @@
<?php
/*
-@version V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+@version V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
Latest version is available at http://adodb.sourceforge.net
Released under both BSD license and Lesser GPL library license.
Modified: trunk/lib/WikiDB/adodb/adodb-active-recordx.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/adodb-active-recordx.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/adodb-active-recordx.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,7 +1,7 @@
<?php
/*
-@version V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+@version V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
Latest version is available at http://adodb.sourceforge.net
Released under both BSD license and Lesser GPL library license.
Modified: trunk/lib/WikiDB/adodb/adodb-csvlib.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/adodb-csvlib.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/adodb-csvlib.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -8,7 +8,7 @@
/*
- V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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. See License.txt.
Modified: trunk/lib/WikiDB/adodb/adodb-datadict.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/adodb-datadict.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/adodb-datadict.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,7 +1,7 @@
<?php
/**
- V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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.
Modified: trunk/lib/WikiDB/adodb/adodb-error.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/adodb-error.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/adodb-error.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,6 +1,6 @@
<?php
/**
- * @version V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ * @version V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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.
Modified: trunk/lib/WikiDB/adodb/adodb-errorhandler.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/adodb-errorhandler.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/adodb-errorhandler.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,6 +1,6 @@
<?php
/**
- * @version V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ * @version V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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.
Modified: trunk/lib/WikiDB/adodb/adodb-errorpear.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/adodb-errorpear.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/adodb-errorpear.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,6 +1,6 @@
<?php
/**
- * @version V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ * @version V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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.
Modified: trunk/lib/WikiDB/adodb/adodb-exceptions.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/adodb-exceptions.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/adodb-exceptions.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,7 +1,7 @@
<?php
/**
- * @version V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ * @version V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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.
@@ -29,9 +29,9 @@
{
switch($fn) {
case 'EXECUTE':
- $this->sql = $p1;
+ $this->sql = is_array($p1) ? $p1[0] : $p1;
$this->params = $p2;
- $s = "$dbms error: [$errno: $errmsg] in $fn(\"$p1\")\n";
+ $s = "$dbms error: [$errno: $errmsg] in $fn(\"$this->sql\")\n";
break;
case 'PCONNECT':
Modified: trunk/lib/WikiDB/adodb/adodb-iterator.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/adodb-iterator.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/adodb-iterator.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,7 +1,7 @@
<?php
/*
- V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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.
Modified: trunk/lib/WikiDB/adodb/adodb-lib.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/adodb-lib.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/adodb-lib.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -6,7 +6,7 @@
$ADODB_INCLUDED_LIB = 1;
/*
- @version V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ @version V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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. See License.txt.
@@ -543,7 +543,7 @@
return $rsreturn;
}
-// Iv\xE1n Oliva version
+// Iván Oliva version
function _adodb_pageexecute_no_last_page(&$zthis, $sql, $nrows, $page, $inputarr=false, $secs2cache=0)
{
Modified: trunk/lib/WikiDB/adodb/adodb-memcache.lib.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/adodb-memcache.lib.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/adodb-memcache.lib.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -7,11 +7,11 @@
$ADODB_INCLUDED_MEMCACHE = 1;
global $ADODB_INCLUDED_CSV;
-if (empty($ADODB_INCLUDED_CSV)) include(ADODB_DIR.'/adodb-csvlib.inc.php');
+if (empty($ADODB_INCLUDED_CSV)) include_once(ADODB_DIR.'/adodb-csvlib.inc.php');
/*
- V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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. See License.txt.
Modified: trunk/lib/WikiDB/adodb/adodb-pager.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/adodb-pager.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/adodb-pager.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,7 +1,7 @@
<?php
/*
- V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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.
Modified: trunk/lib/WikiDB/adodb/adodb-pear.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/adodb-pear.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/adodb-pear.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,6 +1,6 @@
<?php
/**
- * @version V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ * @version V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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.
Modified: trunk/lib/WikiDB/adodb/adodb-perf.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/adodb-perf.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/adodb-perf.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,6 +1,6 @@
<?php
/*
-V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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. See License.txt.
Modified: trunk/lib/WikiDB/adodb/adodb-php4.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/adodb-php4.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/adodb-php4.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,7 +1,7 @@
<?php
/*
- V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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.
Modified: trunk/lib/WikiDB/adodb/adodb-time.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/adodb-time.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/adodb-time.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,5 +1,5 @@
<?php
-/**
+/*
ADOdb Date Library, part of the ADOdb abstraction library
Download: http://phplens.com/phpeverywhere/
Modified: trunk/lib/WikiDB/adodb/adodb.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/adodb.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/adodb.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -14,7 +14,7 @@
/**
\mainpage
- @version V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ @version V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
Released under both BSD license and Lesser GPL library license. You can choose which license
you prefer.
@@ -179,7 +179,7 @@
/**
* ADODB version as a string.
*/
- $ADODB_vers = 'V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved. Released BSD & LGPL.';
+ $ADODB_vers = 'V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved. Released BSD & LGPL.';
/**
* Determines whether recordset->RecordCount() is used.
@@ -294,8 +294,8 @@
if (strlen($ADODB_CACHE_DIR) > 1) {
$rez = $this->_dirFlush($ADODB_CACHE_DIR);
- if ($debug) ADOConnection::outp( "flushall: $dir<br><pre>\n". $rez."</pre>");
- }
+ if ($debug) ADOConnection::outp( "flushall: $ADODB_CACHE_DIR<br><pre>\n". $rez."</pre>");
+ }
return $rez;
}
@@ -461,7 +461,7 @@
{
global $ADODB_vers;
- $ok = preg_match( '/^[Vv]?([0-9]\.[0-9]+(dev|[a-z]))?/', $ADODB_vers, $matches );
+ $ok = preg_match( '/^[Vv]?([0-9]\.[0-9]+(dev|[a-z])?)/', $ADODB_vers, $matches );
if (!$ok) return (float) substr($ADODB_vers,1);
else return $matches[1];
}
@@ -1899,38 +1899,37 @@
$forceUpdate means that even if the data has not changed, perform update.
*/
- function AutoExecute($table, $fields_values, $mode = 'INSERT', $where = FALSE, $forceUpdate=true, $magicq=false)
+ function AutoExecute($table, $fields_values, $mode = 'INSERT', $where = false, $forceUpdate = true, $magicq = false)
{
- $false = false;
- $sql = 'SELECT * FROM '.$table;
- if ($where!==FALSE) $sql .= ' WHERE '.$where;
- else if ($mode == 'UPDATE' || $mode == 2 /* DB_AUTOQUERY_UPDATE */) {
- $this->outp_throw('AutoExecute: Illegal mode=UPDATE with empty WHERE clause','AutoExecute');
- return $false;
+ if ($where === false && ($mode == 'UPDATE' || $mode == 2 /* DB_AUTOQUERY_UPDATE */) ) {
+ $this->outp_throw('AutoExecute: Illegal mode=UPDATE with empty WHERE clause', 'AutoExecute');
+ return false;
}
- $rs = $this->SelectLimit($sql,1);
- if (!$rs) return $false; // table does not exist
+ $sql = "SELECT * FROM $table";
+ $rs = $this->SelectLimit($sql, 1);
+ if (!$rs) return false; // table does not exist
+
$rs->tableName = $table;
+ if ($where !== false) {
+ $sql .= " WHERE $where";
+ }
$rs->sql = $sql;
- switch((string) $mode) {
- case 'UPDATE':
- case '2':
- $sql = $this->GetUpdateSQL($rs, $fields_values, $forceUpdate, $magicq);
- break;
- case 'INSERT':
- case '1':
- $sql = $this->GetInsertSQL($rs, $fields_values, $magicq);
- break;
- default:
- $this->outp_throw("AutoExecute: Unknown mode=$mode",'AutoExecute');
- return $false;
+ switch($mode) {
+ case 'UPDATE':
+ case DB_AUTOQUERY_UPDATE:
+ $sql = $this->GetUpdateSQL($rs, $fields_values, $forceUpdate, $magicq);
+ break;
+ case 'INSERT':
+ case DB_AUTOQUERY_INSERT:
+ $sql = $this->GetInsertSQL($rs, $fields_values, $magicq);
+ break;
+ default:
+ $this->outp_throw("AutoExecute: Unknown mode=$mode", 'AutoExecute');
+ return false;
}
- $ret = false;
- if ($sql) $ret = $this->Execute($sql);
- if ($ret) $ret = true;
- return $ret;
+ return $sql && $this->Execute($sql);
}
@@ -2716,7 +2715,7 @@
/**
* Will select the supplied $page number from a recordset, given that it is paginated in pages of
* $nrows rows per page. It also saves two boolean values saying if the given page is the first
- * and/or last one of the recordset. Added by Iv\xE1n Oliva to provide recordset pagination.
+ * and/or last one of the recordset. Added by Iván Oliva to provide recordset pagination.
*
* See docs-adodb.htm#ex8 for an example of usage.
*
@@ -2743,7 +2742,7 @@
/**
* Will select the supplied $page number from a recordset, given that it is paginated in pages of
* $nrows rows per page. It also saves two boolean values saying if the given page is the first
- * and/or last one of the recordset. Added by Iv\xE1n Oliva to provide recordset pagination.
+ * and/or last one of the recordset. Added by Iván Oliva to provide recordset pagination.
*
* @param secs2cache seconds to cache data, set to 0 to force query
* @param sql
@@ -2943,9 +2942,9 @@
var $_obj; /** Used by FetchObj */
var $_names; /** Used by FetchObj */
- var $_currentPage = -1; /** Added by Iv\xE1n Oliva to implement recordset pagination */
- var $_atFirstPage = false; /** Added by Iv\xE1n Oliva to implement recordset pagination */
- var $_atLastPage = false; /** Added by Iv\xE1n Oliva to implement recordset pagination */
+ var $_currentPage = -1; /** Added by Iván Oliva to implement recordset pagination */
+ var $_atFirstPage = false; /** Added by Iván Oliva to implement recordset pagination */
+ var $_atLastPage = false; /** Added by Iván Oliva to implement recordset pagination */
var $_lastPageNo = -1;
var $_maxRecordCount = 0;
var $datetime = false;
Modified: trunk/lib/WikiDB/adodb/datadict/datadict-access.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/datadict/datadict-access.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/datadict/datadict-access.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,7 +1,7 @@
<?php
/**
- V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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.
Modified: trunk/lib/WikiDB/adodb/datadict/datadict-db2.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/datadict/datadict-db2.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/datadict/datadict-db2.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,7 +1,7 @@
<?php
/**
- V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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.
Modified: trunk/lib/WikiDB/adodb/datadict/datadict-firebird.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/datadict/datadict-firebird.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/datadict/datadict-firebird.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,7 +1,7 @@
<?php
/**
- V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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.
Modified: trunk/lib/WikiDB/adodb/datadict/datadict-generic.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/datadict/datadict-generic.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/datadict/datadict-generic.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,7 +1,7 @@
<?php
/**
- V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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.
Modified: trunk/lib/WikiDB/adodb/datadict/datadict-ibase.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/datadict/datadict-ibase.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/datadict/datadict-ibase.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,7 +1,7 @@
<?php
/**
- V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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.
Modified: trunk/lib/WikiDB/adodb/datadict/datadict-informix.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/datadict/datadict-informix.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/datadict/datadict-informix.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,7 +1,7 @@
<?php
/**
- V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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.
Modified: trunk/lib/WikiDB/adodb/datadict/datadict-mssql.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/datadict/datadict-mssql.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/datadict/datadict-mssql.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,7 +1,7 @@
<?php
/**
- V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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.
Modified: trunk/lib/WikiDB/adodb/datadict/datadict-mssqlnative.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/datadict/datadict-mssqlnative.inc.php 2014-08-01 08:47:57 UTC (rev 9047)
+++ trunk/lib/WikiDB/adodb/datadict/datadict-mssqlnative.inc.php 2014-08-25 13:35:28 UTC (rev 9048)
@@ -1,7 +1,7 @@
<?php
/**
- V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
+ V5.20dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). 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.
Modified: trunk/lib/WikiDB/adodb/datadict/datadict-mysql.inc.php
===================================================================
--- trunk/lib/WikiDB/adodb/datadict/datadict-mysql.inc.php 2014-08-01 08:47:57 UTC (rev 9047)...
[truncated message content] |
|
From: <var...@us...> - 2016-10-14 10:40:25
|
Revision: 9968
http://sourceforge.net/p/phpwiki/code/9968
Author: vargenau
Date: 2016-10-14 10:40:22 +0000 (Fri, 14 Oct 2016)
Log Message:
-----------
Update Adodb to version 5.20.7
Modified Paths:
--------------
trunk/lib/WikiDB/adodb/README.md
trunk/lib/WikiDB/adodb/adodb-active-record.inc.php
trunk/lib/WikiDB/adodb/adodb-active-recordx.inc.php
trunk/lib/WikiDB/adodb/adodb-csvlib.inc.php
trunk/lib/WikiDB/adodb/adodb-datadict.inc.php
trunk/lib/WikiDB/adodb/adodb-error.inc.php
trunk/lib/WikiDB/adodb/adodb-errorhandler.inc.php
trunk/lib/WikiDB/adodb/adodb-errorpear.inc.php
trunk/lib/WikiDB/adodb/adodb-exceptions.inc.php
trunk/lib/WikiDB/adodb/adodb-iterator.inc.php
trunk/lib/WikiDB/adodb/adodb-lib.inc.php
trunk/lib/WikiDB/adodb/adodb-memcache.lib.inc.php
trunk/lib/WikiDB/adodb/adodb-pager.inc.php
trunk/lib/WikiDB/adodb/adodb-pear.inc.php
trunk/lib/WikiDB/adodb/adodb-perf.inc.php
trunk/lib/WikiDB/adodb/adodb-php4.inc.php
trunk/lib/WikiDB/adodb/adodb-time.inc.php
trunk/lib/WikiDB/adodb/adodb-xmlschema.inc.php
trunk/lib/WikiDB/adodb/adodb-xmlschema03.inc.php
trunk/lib/WikiDB/adodb/adodb.inc.php
trunk/lib/WikiDB/adodb/composer.json
trunk/lib/WikiDB/adodb/datadict/datadict-access.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-db2.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-firebird.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-generic.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-ibase.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-informix.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-mssql.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-mssqlnative.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-mysql.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-oci8.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-postgres.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-sapdb.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-sqlite.inc.php
trunk/lib/WikiDB/adodb/datadict/datadict-sybase.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-access.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ado.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ado5.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ado_access.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ado_mssql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ads.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-borland_ibase.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-csv.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-db2.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-db2oci.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-db2ora.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-fbsql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-firebird.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ibase.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-informix.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-informix72.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-ldap.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mssql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mssql_n.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mssqlnative.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mssqlpo.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mysql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mysqli.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mysqlpo.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-mysqlt.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-netezza.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-oci8.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-oci805.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-oci8po.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-oci8quercus.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbc.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbc_db2.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbc_mssql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbc_oracle.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbtp.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-odbtp_unicode.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-oracle.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_mssql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_mysql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_oci.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_pgsql.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_sqlite.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres64.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres7.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres8.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-postgres9.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-proxy.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sapdb.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sqlanywhere.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sqlite.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sqlite3.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sqlitepo.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sybase.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-sybase_ase.inc.php
trunk/lib/WikiDB/adodb/drivers/adodb-vfp.inc.php
trunk/lib/WikiDB/adodb/pear/Auth/Container/ADOdb.php
trunk/lib/WikiDB/adodb/perf/perf-db2.inc.php
trunk/lib/WikiDB/adodb/perf/perf-informix.inc.php
trunk/lib/WikiDB/adodb/perf/perf-mssql.inc.php
trunk/lib/WikiDB/adodb/perf/perf-mssqlnative.inc.php
trunk/lib/WikiDB/adodb/perf/perf-mysql.inc.php
trunk/lib/WikiDB/adodb/perf/perf-oci8.inc.php
trunk/lib/WikiDB/adodb/perf/perf-postgres.inc.php
trunk/lib/WikiDB/adodb/pivottable.inc.php
trunk/lib/WikiDB/adodb/rsfilter.inc.php
trunk/lib/WikiDB/adodb/server.php
trunk/lib/WikiDB/adodb/session/adodb-compress-bzip2.php
trunk/lib/WikiDB/adodb/session/adodb-compress-gzip.php
trunk/lib/WikiDB/adodb/session/adodb-cryptsession.php
trunk/lib/WikiDB/adodb/session/adodb-cryptsession2.php
trunk/lib/WikiDB/adodb/session/adodb-encrypt-mcrypt.php
trunk/lib/WikiDB/adodb/session/adodb-encrypt-md5.php
trunk/lib/WikiDB/adodb/session/adodb-encrypt-secret.php
trunk/lib/WikiDB/adodb/session/adodb-session-clob.php
trunk/lib/WikiDB/adodb/session/adodb-session-clob2.php
trunk/lib/WikiDB/adodb/session/adodb-session.php
trunk/lib/WikiDB/adodb/session/adodb-session2.php
trunk/lib/WikiDB/adodb/session/old/adodb-cryptsession.php
trunk/lib/WikiDB/adodb/session/old/adodb-session-clob.php
trunk/lib/WikiDB/adodb/session/old/adodb-session.php
trunk/lib/WikiDB/adodb/toexport.inc.php
trunk/lib/WikiDB/adodb/tohtml.inc.php
Added Paths:
-----------
trunk/lib/WikiDB/adodb/.mailmap
trunk/lib/WikiDB/adodb/0001-XML-add-support-for-DESCR-tags-for-tables-fields.patch
trunk/lib/WikiDB/adodb/LICENSE.md
trunk/lib/WikiDB/adodb/docs/README.md
trunk/lib/WikiDB/adodb/docs/changelog.md
trunk/lib/WikiDB/adodb/docs/changelog_v2.x.md
trunk/lib/WikiDB/adodb/docs/changelog_v3.x.md
trunk/lib/WikiDB/adodb/docs/changelog_v4+5.md
trunk/lib/WikiDB/adodb/docs/changelog_v4.x.md
trunk/lib/WikiDB/adodb/drivers/adodb-pdo_sqlsrv.inc.php
trunk/lib/WikiDB/adodb/fix-202.php
trunk/lib/WikiDB/adodb/fix-226.php
trunk/lib/WikiDB/adodb/nbproject/
trunk/lib/WikiDB/adodb/nbproject/private/
trunk/lib/WikiDB/adodb/nbproject/private/config.properties
trunk/lib/WikiDB/adodb/nbproject/private/private.properties
trunk/lib/WikiDB/adodb/nbproject/private/private.xml
trunk/lib/WikiDB/adodb/nbproject/project.properties
trunk/lib/WikiDB/adodb/nbproject/project.xml
trunk/lib/WikiDB/adodb/pr265.php
trunk/lib/WikiDB/adodb/test.xml
Removed Paths:
-------------
trunk/lib/WikiDB/adodb/docs/adodb-faq.html
trunk/lib/WikiDB/adodb/docs/docs-active-record.htm
trunk/lib/WikiDB/adodb/docs/docs-adodb.htm
trunk/lib/WikiDB/adodb/docs/docs-datadict.htm
trunk/lib/WikiDB/adodb/docs/docs-oracle.htm
trunk/lib/WikiDB/adodb/docs/docs-perf.htm
trunk/lib/WikiDB/adodb/docs/docs-session.htm
trunk/lib/WikiDB/adodb/docs/docs-session.old.htm
trunk/lib/WikiDB/adodb/docs/index.html
trunk/lib/WikiDB/adodb/docs/old-changelog.htm
trunk/lib/WikiDB/adodb/docs/tips_portable_sql.htm
trunk/lib/WikiDB/adodb/docs/tute.htm
trunk/lib/WikiDB/adodb/drivers/adodb-text.inc.php
trunk/lib/WikiDB/adodb/license.txt
trunk/lib/WikiDB/adodb/tests/
Added: trunk/lib/WikiDB/adodb/.mailmap
===================================================================
--- trunk/lib/WikiDB/adodb/.mailmap (rev 0)
+++ trunk/lib/WikiDB/adodb/.mailmap 2016-10-14 10:40:22 UTC (rev 9968)
@@ -0,0 +1,4 @@
+Andreas Fernandez <a.f...@sc...> <and...@as...>
+Mike Benoit <mi...@ti...> MikeB <ip...@sn...>
+Mike Benoit <mi...@ti...> mike.benoit
+
Added: trunk/lib/WikiDB/adodb/0001-XML-add-support-for-DESCR-tags-for-tables-fields.patch
===================================================================
--- trunk/lib/WikiDB/adodb/0001-XML-add-support-for-DESCR-tags-for-tables-fields.patch (rev 0)
+++ trunk/lib/WikiDB/adodb/0001-XML-add-support-for-DESCR-tags-for-tables-fields.patch 2016-10-14 10:40:22 UTC (rev 9968)
@@ -0,0 +1,60 @@
+From 9fbb2c7751c0fdb89062a87910730ea9ccb5d04c Mon Sep 17 00:00:00 2001
+From: peterdd <dd...@li...>
+Date: Thu, 4 Aug 2016 04:10:12 +0200
+Subject: [PATCH] XML: add support for 'DESCR' tags for tables/fields
+
+Fixes #265
+
+Signed-off-by: Damien Regad <dr...@ma...>
+
+Original commits squashed; commit message reworded; updated changelog.
+---
+ adodb-xmlschema03.inc.php | 12 ++++++++++++
+ docs/changelog.md | 1 +
+ 2 files changed, 13 insertions(+)
+
+diff --git a/adodb-xmlschema03.inc.php b/adodb-xmlschema03.inc.php
+index c1ecb88..794f5e2 100644
+--- a/adodb-xmlschema03.inc.php
++++ b/adodb-xmlschema03.inc.php
+@@ -347,6 +347,14 @@ class dbTable extends dbObject {
+ */
+ function _tag_cdata( &$parser, $cdata ) {
+ switch( $this->currentElement ) {
++ // Table or field comment
++ case 'DESCR':
++ if( isset( $this->current_field ) ) {
++ $this->addFieldOpt( $this->current_field, $this->currentElement, $cdata );
++ } else {
++ $this->addTableComment( $cdata );
++ }
++ break;
+ // Table/field constraint
+ case 'CONSTRAINT':
+ if( isset( $this->current_field ) ) {
+@@ -511,6 +519,10 @@ class dbTable extends dbObject {
+ return $this->opts;
+ }
+
++ function addTableComment( $opt ) {
++ $this->opts['comment'] = $opt;
++ return $this->opts;
++ }
+
+ /**
+ * Generates the SQL that will create the table in the database
+diff --git a/docs/changelog.md b/docs/changelog.md
+index 742f4e4..1fe10f4 100644
+--- a/docs/changelog.md
++++ b/docs/changelog.md
+@@ -44,6 +44,7 @@ Older changelogs:
+ - sqlite: Fix Metataypes mapping. #177
+ - sqlite: driver did not support metaForeignKeys. #179
+ - session: add 'httponly' flag to cookie. #190
++- xml: add support for 'DESCR' tags for tables/fields. #265
+
+ ## 5.20.6 - 31-Aug-2016
+
+--
+2.7.4
+
Added: trunk/lib/WikiDB/adodb/LICENSE.md
===================================================================
--- trunk/lib/WikiDB/adodb/LICENSE.md (rev 0)
+++ trunk/lib/WikiDB/adodb/LICENSE.md 2016-10-14 10:40:22 UTC (rev 9968)
@@ -0,0 +1,496 @@
+ADOdb License
+=============
+
+ADOdb is dual licensed under BSD and LGPL.
+
+In plain English, you do not need to distribute your application in source code form,
+nor do you need to distribute ADOdb source code, provided you follow the rest of
+terms of the BSD license.
+
+For more info about ADOdb, visit http://adodb.sourceforge.net/
+
+BSD 3-Clause License
+--------------------
+
+(c) 2000-2013 John Lim (jl...@na...)
+(c) 2014 Damien Regad, Mark Newnham and the ADOdb community
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors
+ may be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+### DISCLAIMER
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+GNU LESSER GENERAL PUBLIC LICENSE
+---------------------------------
+
+_Version 2.1, February 1999_
+_Copyright © 1991, 1999 Free Software Foundation, Inc._
+_51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA_
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+_This is the first released version of the Lesser GPL. It also counts
+as the successor of the GNU Library Public License, version 2, hence
+the version number 2.1._
+
+### Preamble
+
+The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+We protect your rights with a two-step method: **(1)** we copyright the
+library, and **(2)** we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+We call this license the “Lesser” General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+“work based on the library” and a “work that uses the library”. The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+### TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+**0.** This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called “this License”).
+Each licensee is addressed as “you”.
+
+A “library” means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+The “Library”, below, refers to any such software library or work
+which has been distributed under these terms. A “work based on the
+Library” means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term “modification”.)
+
+“Source code” for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+**1.** You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+**2.** You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+* **a)** The modified work must itself be a software library.
+* **b)** You must cause the files modified to carry prominent notices
+stating that you changed the files and the date of any change.
+* **c)** You must cause the whole of the work to be licensed at no
+charge to all third parties under the terms of this License.
+* **d)** If a facility in the modified Library refers to a function or a
+table of data to be supplied by an application program that uses
+the facility, other than as an argument passed when the facility
+is invoked, then you must make a good faith effort to ensure that,
+in the event an application does not supply such function or
+table, the facility still operates, and performs whatever part of
+its purpose remains meaningful.
+(For example, a function in a library to compute square roots has
+a purpose that is entirely well-defined independent of the
+application. Therefore, Subsection 2d requires that any
+application-supplied function or table used by this function must
+be optional: if the application does not supply it, the square
+root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+**3.** You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+**4.** You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+**5.** A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a “work that uses the Library”. Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+However, linking a “work that uses the Library” with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a “work that uses the
+library”. The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+When a “work that uses the Library” uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+**6.** As an exception to the Sections above, you may also combine or
+link a “work that uses the Library” with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+* **a)** Accompany the work with the complete corresponding
+machine-readable source code for the Library including whatever
+changes were used in the work (which must be distributed under
+Sections 1 and 2 above); and, if the work is an executable linked
+with the Library, with the complete machine-readable “work that
+uses the Library”, as object code and/or source code, so that the
+user can modify the Library and then relink to produce a modified
+executable containing the modified Library. (It is understood
+that the user who changes the contents of definitions files in the
+Library will not necessarily be able to recompile the application
+to use the modified definitions.)
+* **b)** Use a suitable shared library mechanism for linking with the
+Library. A suitable mechanism is one that (1) uses at run time a
+copy of the library already present on the user's computer system,
+rather than copying library functions into the executable, and (2)
+will operate properly with a modified version of the library, if
+the user installs one, as long as the modified version is
+interface-compatible with the version that the work was made with.
+* **c)** Accompany the work with a written offer, valid for at
+least three years, to give the same user the materials
+specified in Subsection 6a, above, for a charge no more
+than the cost of performing this distribution.
+* **d)** If distribution of the work is made by offering access to copy
+from a designated place, offer equivalent access to copy the above
+specified materials from the same place.
+* **e)** Verify that the user has already received a copy of these
+materials or that you have already sent this use...
[truncated message content] |