[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] phpgwapi/inc/adodb adodb-active-record.inc.php ...
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] phpgwapi/inc/adodb adodb-active-record.inc.php ... |
Date: |
Tue, 29 Aug 2006 08:00:51 +0000 |
CVSROOT: /sources/phpgwapi
Module name: phpgwapi
Changes by: Sigurd Nes <sigurdne> 06/08/29 08:00:50
Modified files:
inc/adodb : adodb-active-record.inc.php
adodb-csvlib.inc.php adodb-datadict.inc.php
adodb-error.inc.php adodb-errorhandler.inc.php
adodb-errorpear.inc.php
adodb-exceptions.inc.php adodb-iterator.inc.php
adodb-lib.inc.php adodb-pager.inc.php
adodb-pear.inc.php adodb-perf.inc.php
adodb-php4.inc.php adodb-xmlschema.inc.php
adodb-xmlschema03.inc.php adodb.inc.php
pivottable.inc.php rsfilter.inc.php server.php
toexport.inc.php tohtml.inc.php
inc/adodb/datadict: datadict-access.inc.php datadict-db2.inc.php
datadict-firebird.inc.php
datadict-generic.inc.php
datadict-ibase.inc.php
datadict-informix.inc.php
datadict-mssql.inc.php
datadict-mysql.inc.php datadict-oci8.inc.php
datadict-postgres.inc.php
datadict-sybase.inc.php
inc/adodb/docs : docs-active-record.htm docs-adodb.htm
docs-datadict.htm docs-perf.htm
docs-session.htm
inc/adodb/drivers: adodb-access.inc.php adodb-ado.inc.php
adodb-ado5.inc.php adodb-ado_access.inc.php
adodb-ado_mssql.inc.php
adodb-borland_ibase.inc.php adodb-csv.inc.php
adodb-db2.inc.php adodb-fbsql.inc.php
adodb-firebird.inc.php adodb-ibase.inc.php
adodb-informix.inc.php
adodb-informix72.inc.php adodb-ldap.inc.php
adodb-mssql.inc.php adodb-mssqlpo.inc.php
adodb-mysql.inc.php adodb-mysqli.inc.php
adodb-mysqlt.inc.php adodb-netezza.inc.php
adodb-oci8.inc.php adodb-oci805.inc.php
adodb-oci8po.inc.php adodb-odbc.inc.php
adodb-odbc_db2.inc.php
adodb-odbc_mssql.inc.php
adodb-odbc_oracle.inc.php adodb-odbtp.inc.php
adodb-odbtp_unicode.inc.php
adodb-oracle.inc.php adodb-pdo.inc.php
adodb-pdo_mssql.inc.php
adodb-pdo_mysql.inc.php adodb-pdo_oci.inc.php
adodb-pdo_pgsql.inc.php
adodb-postgres.inc.php
adodb-postgres64.inc.php
adodb-postgres7.inc.php
adodb-postgres8.inc.php adodb-proxy.inc.php
adodb-sapdb.inc.php adodb-sqlanywhere.inc.php
adodb-sqlite.inc.php adodb-sqlitepo.inc.php
adodb-sybase.inc.php adodb-sybase_ase.inc.php
adodb-vfp.inc.php
inc/adodb/pear/Auth/Container: ADOdb.php
inc/adodb/perf : perf-db2.inc.php perf-informix.inc.php
perf-mssql.inc.php perf-mysql.inc.php
perf-oci8.inc.php perf-postgres.inc.php
inc/adodb/session: adodb-compress-bzip2.php
adodb-compress-gzip.php
adodb-cryptsession.php
adodb-encrypt-mcrypt.php
adodb-encrypt-md5.php
adodb-encrypt-secret.php
adodb-session-clob.php adodb-session.php
adodb-sessions.mysql.sql
adodb-sessions.oracle.clob.sql
adodb-sessions.oracle.sql
inc/adodb/session/old: adodb-cryptsession.php
adodb-session-clob.php adodb-session.php
inc/adodb/tests: test-active-record.php test-xmlschema.php
test4.php testsessions.php xmlschema-mssql.xml
xmlschema.xml
Added files:
inc/adodb : adodb-memcache.lib.inc.php
inc/adodb/docs : docs-session.old.htm
inc/adodb/session: adodb-cryptsession2.php
adodb-session-clob2.php adodb-session2.php
session_schema2.xml
Log message:
Update to latest and greatest from upstream 4.9.2 released August 29,
2006
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-active-record.inc.php?cvsroot=phpgwapi&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-csvlib.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-datadict.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-error.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-errorhandler.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-errorpear.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-exceptions.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-iterator.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-lib.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-pager.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-pear.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-perf.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-php4.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-xmlschema.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-xmlschema03.inc.php?cvsroot=phpgwapi&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/pivottable.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/rsfilter.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/server.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/toexport.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/tohtml.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-memcache.lib.inc.php?cvsroot=phpgwapi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/datadict/datadict-access.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/datadict/datadict-db2.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/datadict/datadict-firebird.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/datadict/datadict-generic.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/datadict/datadict-ibase.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/datadict/datadict-informix.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/datadict/datadict-mssql.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/datadict/datadict-mysql.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/datadict/datadict-oci8.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/datadict/datadict-postgres.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/datadict/datadict-sybase.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/docs/docs-active-record.htm?cvsroot=phpgwapi&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/docs/docs-adodb.htm?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/docs/docs-datadict.htm?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/docs/docs-perf.htm?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/docs/docs-session.htm?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/docs/docs-session.old.htm?cvsroot=phpgwapi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-access.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-ado.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-ado5.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-ado_access.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-ado_mssql.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-borland_ibase.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-csv.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-db2.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-fbsql.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-firebird.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-ibase.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-informix.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-informix72.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-ldap.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-mssql.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-mssqlpo.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-mysql.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-mysqli.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-mysqlt.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-netezza.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-oci8.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-oci805.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-oci8po.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-odbc.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-odbc_db2.inc.php?cvsroot=phpgwapi&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-odbc_mssql.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-odbc_oracle.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-odbtp.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-odbtp_unicode.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-oracle.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-pdo.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-pdo_mssql.inc.php?cvsroot=phpgwapi&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-pdo_mysql.inc.php?cvsroot=phpgwapi&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-pdo_oci.inc.php?cvsroot=phpgwapi&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-pdo_pgsql.inc.php?cvsroot=phpgwapi&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-postgres.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-postgres64.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-postgres7.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-postgres8.inc.php?cvsroot=phpgwapi&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-proxy.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-sapdb.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-sqlanywhere.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-sqlite.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-sqlitepo.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-sybase.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-sybase_ase.inc.php?cvsroot=phpgwapi&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-vfp.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/pear/Auth/Container/ADOdb.php?cvsroot=phpgwapi&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/perf/perf-db2.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/perf/perf-informix.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/perf/perf-mssql.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/perf/perf-mysql.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/perf/perf-oci8.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/perf/perf-postgres.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/adodb-compress-bzip2.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/adodb-compress-gzip.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/adodb-cryptsession.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/adodb-encrypt-mcrypt.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/adodb-encrypt-md5.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/adodb-encrypt-secret.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/adodb-session-clob.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/adodb-session.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/adodb-sessions.mysql.sql?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/adodb-sessions.oracle.clob.sql?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/adodb-sessions.oracle.sql?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/adodb-cryptsession2.php?cvsroot=phpgwapi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/adodb-session-clob2.php?cvsroot=phpgwapi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/adodb-session2.php?cvsroot=phpgwapi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/session_schema2.xml?cvsroot=phpgwapi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/old/adodb-cryptsession.php?cvsroot=phpgwapi&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/old/adodb-session-clob.php?cvsroot=phpgwapi&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/old/adodb-session.php?cvsroot=phpgwapi&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/tests/test-active-record.php?cvsroot=phpgwapi&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/tests/test-xmlschema.php?cvsroot=phpgwapi&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/tests/test4.php?cvsroot=phpgwapi&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/tests/testsessions.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/tests/xmlschema-mssql.xml?cvsroot=phpgwapi&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/tests/xmlschema.xml?cvsroot=phpgwapi&r1=1.3&r2=1.4
Patches:
Index: adodb-active-record.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-active-record.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- adodb-active-record.inc.php 22 Jun 2006 09:06:36 -0000 1.2
+++ adodb-active-record.inc.php 29 Aug 2006 08:00:49 -0000 1.3
@@ -1,7 +1,7 @@
<?php
/*
address@hidden V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
address@hidden V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
Latest version is available at http://adodb.sourceforge.net
Released under both BSD license and Lesser GPL library license.
@@ -102,6 +102,12 @@
$this->UpdateActiveTable($pkeyarr);
}
+ function __wakeup()
+ {
+ $class = get_class($this);
+ new $class;
+ }
+
function _pluralize($table)
{
$ut = strtoupper($table);
@@ -409,22 +415,28 @@
$cnt = 0;
$table =& $this->TableInfo();
+ $valarr = array();
+ $names = array();
+ $valstr = array();
+
foreach($table->flds as $name=>$fld) {
$val = $this->$name;
- /*
- if (is_null($val)) {
- if (isset($fld->not_null) && $fld->not_null) {
- if (isset($fld->default_value) &&
strlen($fld->default_value)) continue;
- else $this->Error("Cannot insert null
into $name","Insert");
- }
- }*/
-
+ if(!is_null($val) || !array_key_exists($name,
$table->keys)) {
$valarr[] = $val;
$names[] = $name;
$valstr[] = $db->Param($cnt);
$cnt += 1;
}
+ }
+ if (empty($names)){
+ foreach($table->flds as $name=>$fld) {
+ $valarr[] = null;
+ $names[] = $name;
+ $valstr[] = $db->Param($cnt);
+ $cnt += 1;
+ }
+ }
$sql = 'INSERT INTO '.$this->_table."(".implode(',',$names).')
VALUES ('.implode(',',$valstr).')';
$ok = $db->Execute($sql,$valarr);
@@ -454,7 +466,9 @@
$where = $this->GenWhere($db,$table);
$sql = 'DELETE FROM '.$this->_table.' WHERE '.$where;
- $db->Execute($sql);
+ $ok = $db->Execute($sql);
+
+ return $ok ? true : false;
}
// returns an array of active record objects
@@ -553,7 +567,6 @@
continue;
}
-
if (is_null($val)) {
if (isset($fld->not_null) && $fld->not_null) {
if (isset($fld->default_value) &&
strlen($fld->default_value)) continue;
@@ -564,7 +577,7 @@
}
}
- if ( $val == $this->_original[$i]) {
+ if (isset($this->_original[$i]) && $val ==
$this->_original[$i]) {
continue;
}
$valarr[] = $val;
Index: adodb-csvlib.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-csvlib.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- adodb-csvlib.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ adodb-csvlib.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -8,7 +8,7 @@
/*
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Index: adodb-datadict.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-datadict.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- adodb-datadict.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ adodb-datadict.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/**
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: adodb-error.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-error.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- adodb-error.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ adodb-error.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/**
- * @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
+ * @version V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
Index: adodb-errorhandler.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-errorhandler.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- adodb-errorhandler.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ adodb-errorhandler.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/**
- * @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
+ * @version V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
Index: adodb-errorpear.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-errorpear.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- adodb-errorpear.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ adodb-errorpear.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/**
- * @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
+ * @version V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
* Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: adodb-exceptions.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-exceptions.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- adodb-exceptions.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ adodb-exceptions.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/**
- * @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
+ * @version V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
Index: adodb-iterator.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-iterator.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- adodb-iterator.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ adodb-iterator.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/*
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: adodb-lib.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-lib.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- adodb-lib.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ adodb-lib.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -7,7 +7,7 @@
$ADODB_INCLUDED_LIB = 1;
/*
- @version V4.90 8 June 2006 (c) 2000-2006 John Lim (address@hidden). All
rights reserved.
+ @version V4.92 29 Aug 2006 (c) 2000-2006 John Lim (address@hidden). 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.
@@ -16,6 +16,69 @@
Less commonly used functions are placed here to reduce size of
adodb.inc.php.
*/
+function adodb_probetypes(&$array,&$types,$probe=8)
+{
+// probe and guess the type
+ $types = array();
+ if ($probe > sizeof($array)) $max = sizeof($array);
+ else $max = $probe;
+
+
+ for ($j=0;$j < $max; $j++) {
+ $row =& $array[$j];
+ if (!$row) break;
+ $i = -1;
+ foreach($row as $v) {
+ $i += 1;
+
+ if (isset($types[$i]) && $types[$i]=='C') continue;
+
+ //print " ($i ".$types[$i]. "$v) ";
+ $v = trim($v);
+
+ if (!preg_match('/^[+-]{0,1}[0-9\.]+$/',$v)) {
+ $types[$i] = 'C'; // once C, always C
+
+ continue;
+ }
+ if ($j == 0) {
+ // If empty string, we presume is character
+ // test for integer for 1st row only
+ // after that it is up to testing other rows to prove
+ // that it is not an integer
+ if (strlen($v) == 0) $types[$i] = 'C';
+ if (strpos($v,'.') !== false) $types[$i] = 'N';
+ else $types[$i] = 'I';
+ continue;
+ }
+
+ if (strpos($v,'.') !== false) $types[$i] = 'N';
+
+ }
+ }
+}
+
+function &adodb_transpose(&$arr, &$newarr, &$hdr)
+{
+ $oldX = sizeof(reset($arr));
+ $oldY = sizeof($arr);
+
+ if ($hdr) {
+ $startx = 1;
+ $hdr = array();
+ for ($y = 0; $y < $oldY; $y++) {
+ $hdr[] = $arr[$y][0];
+ }
+ } else
+ $startx = 0;
+
+ for ($x = $startx; $x < $oldX; $x++) {
+ $newarr[] = array();
+ for ($y = 0; $y < $oldY; $y++) {
+ $newarr[$x-$startx][] = $arr[$y][$x];
+ }
+ }
+}
// Force key to upper.
// See also http://www.php.net/manual/en/function.array-change-key-case.php
@@ -156,7 +219,7 @@
if ($fieldsize > 2) {
$group = rtrim($zthis->fields[2]);
}
-
+/*
if ($optgroup != $group) {
$optgroup = $group;
if ($firstgroup) {
@@ -167,7 +230,7 @@
$s .="\n<optgroup label='". htmlspecialchars($group) ."'>";
}
}
-
+*/
if ($hasvalue)
$value = " value='".htmlspecialchars($zval2)."'";
@@ -297,14 +360,14 @@
{
$qryRecs = 0;
- if (preg_match("/^\s*SELECT\s+DISTINCT/is", $sql) ||
+ if (!empty($zthis->_nestedSQL) ||
preg_match("/^\s*SELECT\s+DISTINCT/is", $sql) ||
preg_match('/\s+GROUP\s+BY\s+/is',$sql) ||
preg_match('/\s+UNION\s+/is',$sql)) {
// ok, has SELECT DISTINCT or GROUP BY so see if we can use a
table alias
// but this is only supported by oracle and postgresql...
if ($zthis->dataProvider == 'oci8') {
- $rewritesql =
preg_replace('/(\sORDER\s+BY\s.*)/is','',$sql);
+ $rewritesql =
preg_replace('/(\sORDER\s+BY\s[^)]*)/is','',$sql);
// Allow Oracle hints to be used for query
optimization, Chris Wrye
if (preg_match('#/\\*+.*?\\*\\/#', $sql, $hint)) {
@@ -313,13 +376,9 @@
$rewritesql = "SELECT COUNT(*) FROM
(".$rewritesql.")";
} else if (strncmp($zthis->databaseType,'postgres',8) == 0) {
-
- $info = $zthis->ServerInfo();
- if (substr($info['version'],0,3) >= 7.1) { // good till
version 999
$rewritesql =
preg_replace('/(\sORDER\s+BY\s[^)]*)/is','',$sql);
$rewritesql = "SELECT COUNT(*) FROM
($rewritesql) _ADODB_ALIAS_";
}
- }
} else {
// now replace SELECT ... FROM with SELECT COUNT(*) FROM
$rewritesql = preg_replace(
@@ -383,7 +442,6 @@
$rstest->Close();
if ($qryRecs == -1) return 0;
}
-
return $qryRecs;
}
Index: adodb-pager.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-pager.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- adodb-pager.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ adodb-pager.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/*
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All
rights reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All
rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: adodb-pear.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-pear.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- adodb-pear.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ adodb-pear.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/**
- * @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
+ * @version V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
Index: adodb-perf.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-perf.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- adodb-perf.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ adodb-perf.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
@@ -71,7 +71,7 @@
$rs =& $conn->Execute($sql,$inputarr);
$t1 = microtime();
- if (!empty($conn->_logsql)) {
+ if (!empty($conn->_logsql) && (empty($conn->_logsqlErrors) || !$rs)) {
$conn->_logsql = false; // disable logsql error simulation
$dbT = $conn->databaseType;
@@ -149,6 +149,7 @@
if ($dbT == 'informix') $isql = str_replace(chr(10),'
',$isql);
$arr = false;
} else {
+ if ($dbT == 'db2') $arr['f'] = (float) $arr['f'];
$isql = "insert into $perf_table
(created,sql0,sql1,params,tracer,timer) values( $d,?,?,?,?,?)";
}
@@ -862,7 +863,6 @@
$table = $this->table();
$sql = str_replace('adodb_logsql',$table,$this->createTableSQL);
-
$savelog = $this->conn->LogSQL(false);
$ok = $this->conn->Execute($sql);
$this->conn->LogSQL($savelog);
Index: adodb-php4.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-php4.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- adodb-php4.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ adodb-php4.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/*
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: adodb-xmlschema.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-xmlschema.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- adodb-xmlschema.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ adodb-xmlschema.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -12,7 +12,7 @@
*
* Last Editor: $Author: sigurdne $
* @author Richard Tango-Lowy & Dan Cech
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*
* @package axmls
* @tutorial getting_started.pkg
@@ -1209,7 +1209,7 @@
* @tutorial getting_started.pkg
*
* @author Richard Tango-Lowy & Dan Cech
-* @version $Revision: 1.5 $
+* @version $Revision: 1.6 $
*
* @package axmls
*/
Index: adodb-xmlschema03.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-xmlschema03.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- adodb-xmlschema03.inc.php 22 Jun 2006 09:06:36 -0000 1.2
+++ adodb-xmlschema03.inc.php 29 Aug 2006 08:00:49 -0000 1.3
@@ -12,7 +12,7 @@
*
* Last Editor: $Author: sigurdne $
* @author Richard Tango-Lowy & Dan Cech
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*
* @package axmls
* @tutorial getting_started.pkg
@@ -1309,7 +1309,7 @@
* @tutorial getting_started.pkg
*
* @author Richard Tango-Lowy & Dan Cech
-* @version $Revision: 1.2 $
+* @version $Revision: 1.3 $
*
* @package axmls
*/
@@ -2092,16 +2092,20 @@
* in the schema.
*
* @param boolean $data Include data in schema dump
+ * @indent string indentation to use
+ * @prefix string extract only tables with given prefix
+ * @stripprefix strip prefix string when storing in XML schema
* @return string Generated XML schema
*/
- function ExtractSchema( $data = FALSE, $indent = ' ' ) {
+ function ExtractSchema( $data = FALSE, $indent = ' ', $prefix = '' ,
$stripprefix=false) {
$old_mode = $this->db->SetFetchMode( ADODB_FETCH_NUM );
$schema = '<?xml version="1.0"?>' . "\n"
. '<schema version="' . $this->schemaVersion .
'">' . "\n";
- if( is_array( $tables = $this->db->MetaTables( 'TABLES' ) ) ) {
+ if( is_array( $tables = $this->db->MetaTables( 'TABLES' ,
($prefix) ? $prefix.'%' : '') ) ) {
foreach( $tables as $table ) {
+ if ($stripprefix) $table =
str_replace(str_replace('\\_', '_', $pfx ), '', $table);
$schema .= $indent . '<table name="' .
htmlentities( $table ) . '">' . "\n";
// grab details from database
Index: adodb.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- adodb.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ adodb.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -273,6 +273,13 @@
var $raiseErrorFn = false; /// error function to call
var $isoDates = false; /// accepts dates in ISO format
var $cacheSecs = 3600; /// cache for 1 hour
+
+ // memcache
+ var $memCache = false; /// should we use memCache instead of caching in
files
+ var $memCacheHost; /// memCache host
+ var $memCachePort = 11211; /// memCache port
+ var $memCacheCompress = false; /// Use 'true' to store the item
compressed (uses zlib)
+
var $sysDate = false; /// name of function that returns the current date
var $sysTimeStamp = false; /// name of function that returns the
current timestamp
var $arrayClass = 'ADORecordSet_array'; /// name of class used to
generate array recordsets, which are pre-downloaded recordsets
@@ -679,6 +686,7 @@
}
+
/*
Usage in oracle
$stmt = $db->Prepare('select * from table where id =:myid and
group=:group');
@@ -699,6 +707,19 @@
return false;
}
+
+ function IgnoreErrors($saveErrs=false)
+ {
+ if (!$saveErrs) {
+ $saveErrs = array($this->raiseErrorFn,$this->_transOK);
+ $this->raiseErrorFn = false;
+ return $saveErrs;
+ } else {
+ $this->raiseErrorFn = $saveErrs[0];
+ $this->_transOK = $saveErrs[1];
+ }
+ }
+
/**
Improved method of initiating a transaction. Used together with
CompleteTrans().
Advantages include:
@@ -1115,7 +1136,7 @@
$sql = preg_replace(
'/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.'
'.((integer)$nrows).' ',$sql);
- if ($secs2cache>0) {
+ if ($secs2cache != 0) {
$ret =&
$this->CacheExecute($secs2cache, $sql,$inputarr);
} else {
$ret =&
$this->Execute($sql,$inputarr);
@@ -1148,10 +1169,10 @@
$ADODB_COUNTRECS = false;
if ($offset>0){
- if ($secs2cache>0) $rs =
&$this->CacheExecute($secs2cache,$sql,$inputarr);
+ if ($secs2cache != 0) $rs =
&$this->CacheExecute($secs2cache,$sql,$inputarr);
else $rs = &$this->Execute($sql,$inputarr);
} else {
- if ($secs2cache>0) $rs =
&$this->CacheExecute($secs2cache,$sql,$inputarr);
+ if ($secs2cache != 0) $rs =
&$this->CacheExecute($secs2cache,$sql,$inputarr);
else $rs = &$this->Execute($sql,$inputarr);
}
$ADODB_COUNTRECS = $savec;
@@ -1335,6 +1356,16 @@
return $rv;
}
+ function &Transpose(&$rs)
+ {
+ $rs2 =& $this->_rs2rs($rs);
+ $false = false;
+ if (!$rs2) return $false;
+
+ $rs2->_transpose();
+ return $rs2;
+ }
+
/*
Calculate the offset of a date for a particular database and
generate
appropriate SQL. Useful for calculating future/past
dates and storing
@@ -1518,6 +1549,16 @@
{
global $ADODB_CACHE_DIR;
+ if ($this->memCache) {
+ global $ADODB_INCLUDED_MEMCACHE;
+
+ $key = false;
+ if (empty($ADODB_INCLUDED_MEMCACHE))
include(ADODB_DIR.'/adodb-memcache.lib.inc.php');
+ if ($sql) $key =
$this->_gencachename($sql.serialize($inputarr),false,true);
+ FlushMemCache($key, $this->memCacheHost,
$this->memCachePort, $this->debug);
+ return;
+ }
+
if (strlen($ADODB_CACHE_DIR) > 1 && !$sql) {
/*if (strncmp(PHP_OS,'WIN',3) === 0)
$dir = str_replace('/', '\\', $ADODB_CACHE_DIR);
@@ -1568,6 +1609,15 @@
{
global $ADODB_CACHE_DIR;
+ if ($this->memCache) {
+ global $ADODB_INCLUDED_MEMCACHE;
+ $key = false;
+ if (empty($ADODB_INCLUDED_MEMCACHE))
include(ADODB_DIR.'/adodb-memcache.lib.inc.php');
+ if ($sql) $key =
$this->_gencachename($sql.serialize($inputarr),false,true);
+ flushmemCache($key, $this->memCacheHost,
$this->memCachePort, $this->debug);
+ return;
+ }
+
if (strlen($ADODB_CACHE_DIR) > 1 && !$sql) {
if (strncmp(PHP_OS,'WIN',3) === 0) {
$cmd = 'del /s
'.str_replace('/','\\',$ADODB_CACHE_DIR).'\adodb_*.cache';
@@ -1608,7 +1658,7 @@
* Assuming that we can have 50,000 files per directory with good
performance,
* then we can scale to 12.8 million unique cached recordsets. Wow!
*/
- function _gencachename($sql,$createdir)
+ function _gencachename($sql,$createdir,$memcache=false)
{
global $ADODB_CACHE_DIR;
static $notSafeMode;
@@ -1620,6 +1670,7 @@
$mode = $this->fetchMode;
}
$m =
md5($sql.$this->databaseType.$this->database.$this->user.$mode);
+ if ($memcache) return $m;
if (!isset($notSafeMode)) $notSafeMode = !ini_get('safe_mode');
$dir = ($notSafeMode) ? $ADODB_CACHE_DIR.'/'.substr($m,0,2) :
$ADODB_CACHE_DIR;
@@ -1659,13 +1710,22 @@
} else
$sqlparam = $sql;
+ if ($this->memCache) {
+ global $ADODB_INCLUDED_MEMCACHE;
+ if (empty($ADODB_INCLUDED_MEMCACHE))
include(ADODB_DIR.'/adodb-memcache.lib.inc.php');
+ $md5file =
$this->_gencachename($sql.serialize($inputarr),false,true);
+ } else {
global $ADODB_INCLUDED_CSV;
if (empty($ADODB_INCLUDED_CSV))
include(ADODB_DIR.'/adodb-csvlib.inc.php');
-
$md5file = $this->_gencachename($sql.serialize($inputarr),true);
+ }
+
$err = '';
if ($secs2cache > 0){
+ if ($this->memCache)
+ $rs = &getmemCache($md5file,$err,$secs2cache,
$this->memCacheHost, $this->memCachePort);
+ else
$rs =
&csv2rs($md5file,$err,$secs2cache,$this->arrayClass);
$this->numCacheHits += 1;
} else {
@@ -1676,7 +1736,7 @@
if (!$rs) {
// no cached rs found
if ($this->debug) {
- if (get_magic_quotes_runtime()) {
+ if (get_magic_quotes_runtime() &&
!$this->memCache) {
ADOConnection::outp("Please disable
magic_quotes_runtime - it corrupts cache files :(");
}
if ($this->debug !== -1) ADOConnection::outp( "
$md5file cache failure: $err (see sql below)");
@@ -1684,6 +1744,14 @@
$rs = &$this->Execute($sqlparam,$inputarr);
+ if ($rs && $this->memCache) {
+ $rs = &$this->_rs2rs($rs); // read entire
recordset into memory immediately
+ if(!putmemCache($md5file, $rs,
$this->memCacheHost, $this->memCachePort, $this->memCacheCompress,
$this->debug)) {
+ if ($fn = $this->raiseErrorFn)
+
$fn($this->databaseType,'CacheExecute',-32000,"Cache write
error",$md5file,$sql,$this);
+ if ($this->debug) ADOConnection::outp(
" Cache write error");
+ }
+ } else
if ($rs) {
$eof = $rs->EOF;
$rs = &$this->_rs2rs($rs); // read entire
recordset into memory immediately
@@ -1702,6 +1770,7 @@
}
} else
+ if (!$this->memCache)
@unlink($md5file);
} else {
$this->_errorMsg = '';
@@ -2868,7 +2937,17 @@
if ($ADODB_EXTENSION) {
if ($numIndex) {
while (!$this->EOF) {
-
$results[trim($this->fields[0])] = array_slice($this->fields, 1);
+ //
$results[trim($this->fields[0])] = array_slice($this->fields, 1);
+ // Fix for array_slice
re-numbering numeric associative keys in PHP5
+ $keys =
array_slice(array_keys($this->fields), 1);
+ $sliced_array = array();
+
+ foreach($keys as $key) {
+ $sliced_array[$key] =
$this->fields[$key];
+ }
+
+
$results[trim(reset($this->fields))] = $sliced_array;
+
adodb_movenext($this);
}
} else {
@@ -2880,7 +2959,16 @@
} else {
if ($numIndex) {
while (!$this->EOF) {
-
$results[trim($this->fields[0])] = array_slice($this->fields, 1);
+
//$results[trim($this->fields[0])] = array_slice($this->fields, 1);
+ // Fix for array_slice
re-numbering numeric associative keys in PHP5
+ $keys =
array_slice(array_keys($this->fields), 1);
+ $sliced_array = array();
+
+ foreach($keys as $key) {
+ $sliced_array[$key] =
$this->fields[$key];
+ }
+
+
$results[trim(reset($this->fields))] = $sliced_array;
$this->MoveNext();
}
} else {
@@ -3555,6 +3643,7 @@
}
}
+
function _close() {}
/**
@@ -3611,7 +3700,7 @@
var $_types; // the array of types of each column (C B I L M)
var $_colnames; // names of each column in array
var $_skiprow1; // skip 1st row because it holds column names
- var $_fieldarr; // holds array of field objects
+ var $_fieldobjects; // holds array of field objects
var $canSeek = true;
var $affectedrows = false;
var $insertid = false;
@@ -3631,6 +3720,37 @@
$this->fetchMode = $ADODB_FETCH_MODE;
}
+ function _transpose()
+ {
+ global $ADODB_INCLUDED_LIB;
+
+ if (empty($ADODB_INCLUDED_LIB))
include(ADODB_DIR.'/adodb-lib.inc.php');
+ $hdr = true;
+
+ adodb_transpose($this->_array, $newarr, $hdr);
+ //adodb_pr($newarr);
+
+ $this->_skiprow1 = false;
+ $this->_array =& $newarr;
+ $this->_colnames = $hdr;
+
+ adodb_probetypes($newarr,$this->_types);
+
+ $this->_fieldobjects = array();
+
+ foreach($hdr as $k => $name) {
+ $f = new ADOFieldObject();
+ $f->name = $name;
+ $f->type = $this->_types[$k];
+ $f->max_length = -1;
+ $this->_fieldobjects[] = $f;
+
+ }
+ $this->fields = reset($this->_array);
+
+ $this->_initrs();
+
+ }
/**
* Setup the array.
Index: pivottable.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/pivottable.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- pivottable.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ pivottable.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/**
- * @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
+ * @version V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
Index: rsfilter.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/rsfilter.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- rsfilter.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ rsfilter.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/**
- * @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
+ * @version V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
Index: server.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/server.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- server.php 22 Jun 2006 09:06:36 -0000 1.5
+++ server.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/**
- * @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
+ * @version V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
* Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: toexport.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/toexport.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- toexport.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ toexport.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/**
- * @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
+ * @version V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
Index: tohtml.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/tohtml.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- tohtml.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ tohtml.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: datadict/datadict-access.inc.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/datadict/datadict-access.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- datadict/datadict-access.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ datadict/datadict-access.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/**
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: datadict/datadict-db2.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/datadict/datadict-db2.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- datadict/datadict-db2.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ datadict/datadict-db2.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/**
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: datadict/datadict-firebird.inc.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/datadict/datadict-firebird.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- datadict/datadict-firebird.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ datadict/datadict-firebird.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/**
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: datadict/datadict-generic.inc.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/datadict/datadict-generic.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- datadict/datadict-generic.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ datadict/datadict-generic.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/**
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: datadict/datadict-ibase.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/datadict/datadict-ibase.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- datadict/datadict-ibase.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ datadict/datadict-ibase.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/**
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: datadict/datadict-informix.inc.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/datadict/datadict-informix.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- datadict/datadict-informix.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ datadict/datadict-informix.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/**
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
@@ -32,7 +32,7 @@
case 'B': return 'BLOB';
case 'D': return 'DATE';
- case 'T': return 'DATETIME';
+ case 'T': return 'DATETIME YEAR TO SECOND';
case 'L': return 'SMALLINT';
case 'I': return 'INTEGER';
Index: datadict/datadict-mssql.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/datadict/datadict-mssql.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- datadict/datadict-mssql.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ datadict/datadict-mssql.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/**
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: datadict/datadict-mysql.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/datadict/datadict-mysql.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- datadict/datadict-mysql.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ datadict/datadict-mysql.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/**
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: datadict/datadict-oci8.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/datadict/datadict-oci8.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- datadict/datadict-oci8.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ datadict/datadict-oci8.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/**
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
@@ -75,8 +75,8 @@
case 'X': return $this->typeX;
case 'XL': return $this->typeXL;
- case 'C2': return 'NVARCHAR';
- case 'X2': return 'NVARCHAR(2000)';
+ case 'C2': return 'NVARCHAR2';
+ case 'X2': return 'NVARCHAR2(4000)';
case 'B': return 'BLOB';
Index: datadict/datadict-postgres.inc.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/datadict/datadict-postgres.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- datadict/datadict-postgres.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ datadict/datadict-postgres.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/**
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: datadict/datadict-sybase.inc.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/datadict/datadict-sybase.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- datadict/datadict-sybase.inc.php 22 Jun 2006 09:06:36 -0000 1.5
+++ datadict/datadict-sybase.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/**
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: docs/docs-active-record.htm
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/docs/docs-active-record.htm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- docs/docs-active-record.htm 22 Jun 2006 09:06:36 -0000 1.2
+++ docs/docs-active-record.htm 29 Aug 2006 08:00:49 -0000 1.3
@@ -30,7 +30,7 @@
<li>ADOdb_Active_Record works when you are connected to multiple databases.
Zend's only works when connected to a default database.<p>
<li>Support for $ADODB_ASSOC_CASE. The field names are upper-cased,
lower-cased or left in natural case depending on this setting.<p>
<li>No field name conversion to camel-caps style, unlike Zend's implementation
which will convert field names such as 'first_name' to 'firstName'.<p>
-<li>New ADOConnection::GetActiveRecords() and
ADOConnection::GetActiveRecordsClass() functions in adodb.inc.php.<p>
+<li>NewADOConnection::GetActiveRecords() and
ADOConnection::GetActiveRecordsClass() functions in adodb.inc.php.<p>
<li>Caching of table metadata so it is only queried once per table, no matter
how many Active Records are created.<p>
<li>The additional functionality is described <a href=#additional>below</a>.
</ul>
@@ -45,9 +45,9 @@
The first step to using ADOdb_Active_Record is to set the default connection
that an ADOdb_Active_Record objects will use to connect to a database.
<pre>
-require_once('adodb/adodb-active-record.php');
+require_once('adodb/adodb-active-record.inc.php');
-$db = new ADOConnection('mysql://root:address@hidden/dbname');
+$db = NewADOConnection('mysql://root:address@hidden/dbname');
ADOdb_Active_Record::SetDatabaseAdapter($db);
</pre>
@@ -233,7 +233,7 @@
}
$person = new Person();
-peopleArray =& $person->Find("name like ? order by age", array('Sm%'));
+$peopleArray =& $person->Find("name like ? order by age", array('Sm%'));
</pre>
<h3><li>Error Handling and Debugging</h3>
@@ -497,9 +497,14 @@
<p>PHP5 specific: Change PHP5 implementation of Active Record to use __get()
and __set() for better performance.
<h3> Change Log</h3>
+<p>0.05
+<p>If inserting a record and the value of a primary key field is null, then we
do not insert that field in as
+we assume it is an auto-increment field. Needed by mssql.
+
<p>0.04 5 June 2006 <br>
<p>Added support for declaring table name in $_table in class declaration. Thx
Bill Dueber for idea.
<p>Added find($where,$bindarr=false) method to retrieve an array of active
record objects.
+
<p>0.03 <br>
- Now we only update fields that have changed, using $this->_original.<br>
- We do not include auto_increment fields in replace(). Thx Travis Cline<br>
Index: docs/docs-adodb.htm
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/docs/docs-adodb.htm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- docs/docs-adodb.htm 22 Jun 2006 09:06:36 -0000 1.5
+++ docs/docs-adodb.htm 29 Aug 2006 08:00:49 -0000 1.6
@@ -15,7 +15,7 @@
<body bgcolor="#ffffff" text="black">
<h2>ADOdb Library for PHP</h2>
-<p>V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com)</p>
+<p>V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com)</p>
<p><font size="1">This software is dual licensed using BSD-Style and LGPL.
This
means you can use it in compiled proprietary and commercial
products.</font></p>
@@ -102,7 +102,7 @@
<a href="#genid">GenID</a> <a href="#createseq">CreateSequence</a> <a
href="#dropseq">DropSequence</a>
<br>
Error Handling: <a href="#errormsg">ErrorMsg</a> <a
href="#errorno">ErrorNo</a>
- <a href="#metaerror">MetaError</a> <a
href="#metaerrormsg">MetaErrorMsg</a><br>
+ <a href="#metaerror">MetaError</a> <a href="#metaerrormsg">MetaErrorMsg</a>
<a href="#ignoreerrors">IgnoreErrors</a><br>
Data Dictionary (metadata): <a href="#metadatabases">MetaDatabases</a> <a
href="#metatables">MetaTables</a>
<a href="#metacolumns">MetaColumns</a> <a
href="#metacolumnames">MetaColumnNames</a>
<a href="#metaprimarykeys">MetaPrimaryKeys</a> <a
href="#metaforeignkeys">MetaForeignKeys</a>
@@ -274,8 +274,9 @@
$dsn2 = 'mysql://root:address@hidden/mydb?persist';
</pre>
<p>
-If you have special characters such as /:? in your dsn, then you need to
rawurlencode them first:
-</p><pre> $pwd = rawurlencode($pwd);<br> $dsn =
"mysql://root:address@hidden/mydb";<br></pre>
+If you have special characters such as /:?_ in your dsn, then you need to
rawurlencode them first:
+</p><pre> $pwd = rawurlencode($pwd);<br> $dsn =
"mysql://root:address@hidden/mydb";
+
$dsn2=rawurlencode("sybase_ase")."://user:address@hidden/path?query";<br></pre>
<p>
Legal options are:
</p><p>
@@ -1766,7 +1767,13 @@
</font><p><font><b>CacheFlush<a
name="cacheflush"></a>($sql=false,$inputarr=false)</b></font></p>
<p><font>Flush (delete) any cached recordsets for the SQL statement $sql in
$ADODB_CACHE_DIR.
</font></p><p><font>If no parameter is passed in, then all adodb_*.cache files
are deleted.
-</font></p><p><font> If you want to flush all cached recordsets manually,
execute the following
+</font></p>
+ <p>CacheSelectLimit() rewrites the SQL query, so you won't be able to pass
the SQL to CacheFlush. In this case,
+ to flush the cached SQL recordset returned by CacheSelectLimit(), set
$secs2cache to -1:
+<pre>
+ $db->CacheSelectLimit(-1, $sql, $nrows);
+</pre>
+<p><font> If you want to flush all cached recordsets manually, execute the
following
PHP code (works only under Unix): <br>
<code> system("rm -f `find ".$ADODB_CACHE_DIR." -name
adodb_*.cache`");</code></font></p>
@@ -1805,7 +1812,16 @@
<font>Note that old versions of PHP (pre 4.0.6) do
not support error number for ODBC. In general you do not need to call
this
function unless an ADOdb function returns false on an error.</font></p>
-
+<p><font><b>IgnoreErrors<a
name="ignoreerrors"></a>($saveErrHandlers)</b></font></p>
+<p>Allows you to ignore errors so that StartTrans()/CompleteTrans() is not
affected, nor is the default error handler called if an error occurs.
+Useful when you want to check if a field or table exists in a database without
invoking an error if it does not exist.
+<p>Usage:
+<pre>
+$saveErrHandlers = $conn->IgnoreErrors();
+$rs = $conn->Execute("select field from some_table_that_might_not_exist");
+$conn->IgnoreErrors($saveErrHandlers);
+</pre>
+<p>Warning: do not call StartTrans()/CompleteTrans() inside a code block that
is using IgnoreErrors().
<p><font><b>SetFetchMode<a name="setfetchmode"></a>($mode)</b></font></p>
<p><font>Sets the current fetch mode for the connection and stores
it in $db->fetchMode. Legal modes are ADODB_FETCH_ASSOC and
ADODB_FETCH_NUM.
@@ -2346,10 +2362,15 @@
{
global $EXECS;
-if (!is_array(inputarray)) $EXECS++;
-<font color="#006600"># handle 2-dimensional input arrays</font>
-else if (is_array(reset($inputarray))) $EXECS += sizeof($inputarray);
-else $EXECS++;
+ if (!is_array(inputarray)) $EXECS++;
+ <font color="#006600"># handle 2-dimensional input arrays</font>
+ else if (is_array(reset($inputarray))) $EXECS += sizeof($inputarray);
+ else $EXECS++;
+
+
+ <font color="#006600"># in PHP4.4 and PHP5, we need to return a value
by reference</font>
+ $null = null;
+ return $null;
}
<font color="#006600"># $db is the connection object</font>
@@ -2900,6 +2921,45 @@
PHP</a>. </font></p>
<h2><font>Change Log<a name="Changes"></a><a name="changes"></a><a
name="changelog"></a></font></h2>
+<p><a name="4.92"></a><b>4.92 29 Aug 2006</b>
+<P>Added IgnoreErrors() to bypass default error handling.
+<p>The _adodb_getcount() function in adodb-lib.inc.php, some ORDER BY bug
fixes.
+<p>For ibase and firebird, set $sysTimeStamp = "CURRENT_TIMESTAMP".
+<p>Fixed postgres connection bug:
http://phplens.com/lens/lensforum/msgs.php?id=11057.
+<p>Changed CacheSelectLimit() to flush cache when $secs2cache==-1 due to
complaints from other users.
+<p>Added support for using memcached with CacheExecute/CacheSelectLimit.
Requires memcache module PECL extension. Usage:
+<pre>
+$db = NewADOConnection($driver);
+$db->memCache = true; /// should we use memCache instead of caching in files
+$db->memCacheHost = 126.0.1.1; /// memCache host
+$db->memCachePort = 11211; /// this is default memCache port
+$db->memCacheCompress = false; /// Use 'true' to store the item compressed
(uses zlib)
+
+$db->Connect(...);
+$db->CacheExecute($sql);
+</pre>
+<p>Implemented Transpose() for recordsets. Recordset must be retrieved using
ADODB_FETCH_NUM. First column becomes the
+column name.
+<pre>
+$DB = NewADOConnection('mysql');
+$DB->Connect(...);
+$DB->SetFetchMode(ADODB_FETCH_NUM);
+$rs = $DB->Execute('select productname,productid,unitprice from products limit
10');
+$rs2 = $DB->Transpose($rs);
+rs2html($rs2);
+</pre>
+<p><a name="4.91"></a><b>4.91 2 Aug 2006</b>
+<p>Major session code rewrite .... See session docs.
+<p>PDO bindinputarray was not set properly for MySQL (changed from true to
false).
+<p>Changed CacheSelectLimit() to re-cache when $secs2cache==0. This is one way
to flush the cache when SelectLimit is called.
+<p>Added to quotes to mysql and mysqli: "SHOW COLUMNS FROM `%s`";
+<p>Removed accidental optgroup handling in GetMenu().
+<a>Fixed ibase _BlobDecode for php5 compat, and also mem alloc issues for
small blobs, thx salvatori#interia.pl
+<p>Mysql driver OffsetDate() speedup, useful for adodb-sessions.
+<p>Fix for GetAssoc() PHP5 compat. See
http://phplens.com/lens/lensforum/msgs.php?id=15425
+<p>Active Record - If inserting a record and the value of a primary key field
is null, then we do not insert that field in as we assume it is an
auto-increment field. Needed by mssql.
+<p>Changed postgres7 MetaForeignKeys() see
http://phplens.com/lens/lensforum/msgs.php?id=15531
+<p>DB2 will now return db2_conn_errormsg() when it is a connection error.
<p><a name="4.90"></a><b>4.90 8 June 2006</b>
<p>Changed adodb_countrec() in adodb-lib.inc.php to allow LIMIT to be used as
a speedup to reduce no of records counted.
<p>Added support for transaction modes for postgres and oci8 with
SetTransactionMode().
Index: docs/docs-datadict.htm
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/docs/docs-datadict.htm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- docs/docs-datadict.htm 22 Jun 2006 09:06:37 -0000 1.5
+++ docs/docs-datadict.htm 29 Aug 2006 08:00:49 -0000 1.6
@@ -20,7 +20,7 @@
</head>
<body style="background-color: rgb(255, 255, 255);">
<h2>ADOdb Data Dictionary Library for PHP</h2>
-<p>V4.90 8 June 2006 (c) 2000-2006 John Lim (<a
+<p>V4.92 29 Aug 2006 (c) 2000-2006 John Lim (<a
href="mailto:jlim#natsoft.com.my">jlim#natsoft.com.my</a>).<br>
AXMLS (c) 2004 ars Cognita, Inc</p>
<p><font size="1">This software is dual licensed using BSD-Style and
Index: docs/docs-perf.htm
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/docs/docs-perf.htm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- docs/docs-perf.htm 22 Jun 2006 09:06:37 -0000 1.5
+++ docs/docs-perf.htm 29 Aug 2006 08:00:49 -0000 1.6
@@ -18,7 +18,7 @@
</head>
<body>
<h3>The ADOdb Performance Monitoring Library</h3>
-<p>V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my)</p>
+<p>V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my)</p>
<p><font size="1">This software is dual licensed using BSD-Style and
LGPL. This means you can use it in compiled proprietary and commercial
products.</font></p>
Index: docs/docs-session.htm
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/docs/docs-session.htm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- docs/docs-session.htm 22 Jun 2006 09:06:37 -0000 1.5
+++ docs/docs-session.htm 29 Aug 2006 08:00:49 -0000 1.6
@@ -19,9 +19,9 @@
</style>
</head>
<body style="background-color: rgb(255, 255, 255);">
-<h3>ADODB Session Management Manual</h3>
+<h1>ADODB Session 2 Management Manual</h1>
<p>
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my)
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my)
</p>
<p> <font size="1">This software is dual licensed using BSD-Style and
LGPL. This means you can use it in compiled proprietary and commercial
@@ -29,9 +29,17 @@
<p>Useful ADOdb links: <a
href="http://adodb.sourceforge.net/#download">Download</a>
<a href="http://adodb.sourceforge.net/#docs">Other Docs</a>
</p>
-<h3>Introduction</h3>
-<p> We store state information specific to a user or web client in
-session variables. These session variables persist throughout a
+<h2>Introduction</h2>
+<p> This document discusses the newer session handler adodb-session2.php. If
+ you have used the older adodb-session.php, then be forewarned that you will
+ need to alter your session table format. Otherwise everything is <a
href="#compat">backward
+ compatible</a>.
+ Here are the <a href="docs-session.old.htm">older
+ docs</a> for
+ adodb-session.php.</p>
+<h2>Why Session Variables in a Database? </h2>
+<p>We store state information specific to a user or web
+ client in session variables. These session variables persist throughout a
session, as the user moves from page to page. </p>
<p>To use session variables, call session_start() at the beginning of
your web page, before your HTTP headers are sent. Then for every
@@ -54,11 +62,49 @@
<p>These records will be garbage collected based on the php.ini [session]
timeout settings.
You can register a notification function to notify you when the record has
expired and
is about to be freed by the garbage collector.</p>
-<p><b>Important Upgrade Notice:</b> Since ADOdb 4.05, the session files
-have been moved to its own folder, adodb/session. This is a rewrite
-of the session code by Ross Smith. The old session code is in
-adodb/session/old. </p>
-<h4>ADOdb Session Handler Features</h4>
+<p>An alternative to using a database backed session handler is to use <a
href="http://www.danga.com/memcached/">memcached</a>.
+ This is a distributed memory based caching system suitable for storing
session
+ information.
+ </p>
+<h2> The Improved Session Handler</h2>
+<p>In ADOdb 4.91, we added a new session handler, in adodb-session2.php.
+It features the following improvements:
+<ul>
+<li>Fully supports server farms using a new database table format. The
+ previous version used the web server time for timestamps, which can cause
problems
+ on a system with multiple web servers with possibly inconsistent
+ times. The new version uses the database server time instead for all
timestamps.
+<li>The older database table format is obsolete. The database table must be
modified
+ to support storage of the database server time mentioned above. Also the
field
+ named DATA has been changed to SESSDATA. In some databases, DATA is a
reserved
+ word.
+<li>The functions dataFieldName() and syncSeconds() is obsolete.
+</ul>
+
+<p>Usage is
+
+<pre>
+include_once("adodb/session/adodb-session2.php");
+ADOdb_Session::config($driver, $host, $user, $password,
$database,$options=false);
+session_start();
+
+<font
+ color="#004040">#<br># Test session vars, the following should increment on
refresh<br>#<br>$_SESSION['AVAR'] += 1;<br>print
"<p>\$_SESSION['AVAR']={$_SESSION['AVAR']}</p>";</font>
+</pre>
+
+<p>When the session is created in session_start( ), the global variable
$<b>ADODB_SESS_CONN</b> holds
+the connection object.
+<p>The default name of the table is sessions2. If you want to override it:
+
+<pre>
+include_once("adodb/session/adodb-session2.php");
+$options['table'] = 'mytablename';
+ADOdb_Session::config($driver, $host, $user, $password, $database,$options);
+session_start();
+</pre>
+
+
+<h3>ADOdb Session Handler Features</h3>
<ul>
<li>Ability to define a notification function that is called when a
session expires. Typically
@@ -67,28 +113,29 @@
only perform an update
to the session data if there is a data change. </li>
<li>Support for large amounts of session data with CLOBs (see
-adodb-session-clob.php). Useful
+adodb-session-clob2.php). Useful
for Oracle. </li>
<li>Support for encrypted session data, see
-adodb-cryptsession.inc.php. Enabling encryption is simply a matter of
-including adodb-cryptsession.inc.php instead of adodb-session.inc.php. </li>
+adodb-cryptsession2.php. Enabling encryption is simply a matter of
+including adodb-cryptsession2.php instead of adodb-session2.php. </li>
</ul>
-<h3>Setup</h3>
+<h3>Session Handler Files </h3>
<p>There are 3 session management files that you can use:
</p>
-<pre>adodb-session.php : The default<br>adodb-session-clob.php : Use
this if you are storing DATA in clobs<br>adodb-cryptsession.php : Use this if
you want to store encrypted session data in the database<br><br>
-</pre>
-<p><strong>Examples</strong>
-<p><pre>
- <font
- color="#004040"> include('adodb/adodb.inc.php');<br> <br><b>
$ADODB_SESSION_DRIVER='mysql';<br> $ADODB_SESSION_CONNECT='localhost';<br>
$ADODB_SESSION_USER ='scott';<br> $ADODB_SESSION_PWD ='tiger';<br>
$ADODB_SESSION_DB ='sessiondb';</b><br> <br>
<b>include('adodb/session/adodb-session.php');</b><br> session_start();<br>
<br> #<br> # Test session vars, the following should increment on
refresh<br> #<br> $_SESSION['AVAR'] += 1;<br> print
"<p>\$_SESSION['AVAR']={$_SESSION['AVAR']}</p>";<br></font></pre>
+<pre>adodb-session2.php : The default<br>adodb-cryptsession2.php :
Use this if you want to store encrypted session data in the
database<br>adodb-session-clob2.php : Use this if you are storing DATA in
clobs and you are NOT using oci8 driver</pre>
+<h2><strong>Usage Examples</strong></h2>
+<p>To force non-persistent connections, call <font
color="#004040"><b>Persist</b></font>() first before session_start():
-<p>To force non-persistent connections, call adodb_session_open() first before
session_start():
-<p>
- <pre>
- <font color="#004040"><br> include('adodb/adodb.inc.php');<br> <br><b>
$ADODB_SESSION_DRIVER='mysql';<br> $ADODB_SESSION_CONNECT='localhost';<br>
$ADODB_SESSION_USER ='scott';<br> $ADODB_SESSION_PWD ='tiger';<br>
$ADODB_SESSION_DB ='sessiondb';</b><br> <br>
<b>include('adodb/session/adodb-session.php');<br>
adodb_sess_open(false,false,false);</b><br> session_start();<br> </font>
- </pre>
-<p> The 3rd parameter to adodb_sess_open($path, $sessname, $connectMode) sets
the connection method. You can pass in the following:</p>
+
+<pre>
+ <font color="#004040">
+include_once("adodb/session/adodb-session2.php");
+$driver = 'mysql'; $host = 'localhost'; $user = 'auser'; $pwd = 'secret';
$database = 'sessiondb';
+ADOdb_Session::config($driver, $host, $user, $password,
$database,$options=false);<b><br>ADOdb_session::Persist($connectMode=false);</b>
+session_start();<br> </font>
+</pre>
+<p> The parameter to the Persist( ) method sets the connection mode. You can
+ pass the following:</p>
<table width="50%" border="1">
<tr>
<td><b>$connectMode</b></td>
@@ -115,56 +162,56 @@
<td>Connect( )</td>
</tr>
</table>
-<p>To use a encrypted sessions, simply replace the file adodb-session.php:</p>
+<p>To use a encrypted sessions, simply replace the file adodb-session2.php:</p>
<pre> <font
- color="#004040"><br> include('adodb/adodb.inc.php');<br> <br><b>
$ADODB_SESSION_DRIVER='mysql';<br> $ADODB_SESSION_CONNECT='localhost';<br>
$ADODB_SESSION_USER ='scott';<br> $ADODB_SESSION_PWD ='tiger';<br>
$ADODB_SESSION_DB ='sessiondb';<br> <br>
include('adodb/session/adodb-cryptsession.php');</b><br>
session_start();</font><br>
- </pre>
- <p>And the same technique for adodb-session-clob.php:</p>
+
color="#004040"><b><br>include('adodb/session/adodb-cryptsession2.php');</b><br>$driver
= 'mysql'; $host = 'localhost'; $user = 'auser'; $pwd = 'secret'; $database =
'sessiondb';
+ADOdb_Session::config($driver, $host, $user, $password,
$database,$options=false);<b><br>adodb_sess_open(false,false,$connectMode=false);</b>
+session_start();<br></font></pre>
+ <p>And the same technique for adodb-session-clob2.php:</p>
<pre> <font
- color="#004040"><br> include('adodb/adodb.inc.php');<br> <br><b>
$ADODB_SESSION_DRIVER='mysql';<br> $ADODB_SESSION_CONNECT='localhost';<br>
$ADODB_SESSION_USER ='scott';<br> $ADODB_SESSION_PWD ='tiger';<br>
$ADODB_SESSION_DB ='sessiondb';<br> <br>
include('adodb/session/adodb-session-clob.php');</b><br>
session_start();</font>
- </pre>
- <p>An alternative way to set persistant or non-persistent connections is to
call the following function before session_start() is called.
- <pre>
- ADODB_Session::persist('P'); # 'C' for non-persistent connections
- </pre>
- <h4>Installation</h4>
-<p>1. Create this table in your database (MySQL syntax):
-<p><pre> <a
+
color="#004040"><br><b>include('adodb/session/adodb-session2-clob2.php');</b><br>$driver
= 'oci8'; $host = 'localhost'; $user = 'auser'; $pwd = 'secret'; $database =
'sessiondb';
+ADOdb_Session::config($driver, $host, $user, $password,
$database,$options=false);<b><br>adodb_sess_open(false,false,$connectMode=false);</b>
+session_start();</font></pre>
+ <h2>Installation</h2>
+<p>1. Create this table in your database. Here is the MySQL version:
+<pre> <a
name="sessiontab"></a> <font color="#004040">
- create table sessions (
- SESSKEY char(32) not null,
- EXPIRY int(11) unsigned not null,
- EXPIREREF varchar(64),
- DATA text not null,
- primary key (sesskey)
- );</font>
- </pre>
-
- <p>You may want to rename the 'data' field to 'session_data' as
- 'data' appears to be a reserved word for one or more of the following:
- <ul>
- <li> ANSI SQL
- <li> IBM DB2
- <li> MS SQL Server
- <li> Postgres
- <li> SAP
- </ul>
-<p>
- If you do, then execute:
-<pre>
- ADODB_Session::dataFieldName('session_data');
+CREATE TABLE sessions2(
+ sesskey VARCHAR( 64 ) NOT NULL DEFAULT '',
+ expiry DATETIME NOT NULL ,
+ expireref VARCHAR( 250 ) DEFAULT '',
+ created DATETIME NOT NULL ,
+ modified DATETIME NOT NULL ,
+ sessdata LONGTEXT DEFAULT '',
+ PRIMARY KEY ( sesskey ) ,
+ INDEX sess2_expiry( expiry ),
+ INDEX sess2_expireref( expireref )
+)</font></pre>
+
+ <p> For PostgreSQL, use:
+ <pre>CREATE TABLE sessions2(
+ sesskey VARCHAR( 64 ) NOT NULL DEFAULT '',
+ expiry TIMESTAMP NOT NULL ,
+ expireref VARCHAR( 250 ) DEFAULT '',
+ created TIMESTAMP NOT NULL ,
+ modified TIMESTAMP NOT NULL ,
+ sessdata TEXT DEFAULT '',
+ PRIMARY KEY ( sesskey )
+ );
</pre>
- <p> For the adodb-session-clob.php version, create this:
-<p> <pre>
+ <pre>create INDEX sess2_expiry on sessions2( expiry );
+create INDEX sess2_expireref on sessions2 ( expireref );</pre>
+ <p>Here is the Oracle definition, which uses a CLOB for the SESSDATA field:
+ <pre>
<font
- color="#004040"><br> create table sessions (<br> SESSKEY char(32)
not null,<br> EXPIRY int(11) unsigned not null,<br> EXPIREREF
varchar(64),<br> DATA CLOB,<br> primary key (sesskey)<br> );</font>
- </pre>
- <p>2. Then define the following parameters. You can either modify this file,
or define them before this file is included:
- <pre> <font
- color="#004040"><br> $ADODB_SESSION_DRIVER='database driver, eg. mysql or
ibase';<br> $ADODB_SESSION_CONNECT='server to connect to';<br>
$ADODB_SESSION_USER ='user';<br> $ADODB_SESSION_PWD ='password';<br>
$ADODB_SESSION_DB ='database';<br> $ADODB_SESSION_TBL = 'sessions'; #
setting this is optional<br> </font>
- </pre><p>
- When the session is created, $<b>ADODB_SESS_CONN</b> holds the connection
object.<br> <br> 3. Recommended is PHP 4.0.6 or later. There are documented
session bugs in earlier versions of PHP.
-<h3>Notifications</h3>
+ color="#004040">CREATE TABLE SESSIONS2<br>(<br> SESSKEY VARCHAR2(48
BYTE) NOT NULL,<br> EXPIRY DATE
NOT NULL,<br> EXPIREREF VARCHAR2(200 BYTE),<br> CREATED DATE
NOT NULL,<br> MODIFIED DATE
NOT NULL,<br> SESSDATA CLOB,<br> PRIMARY KEY(SESSKEY)<br>);
+<br>CREATE INDEX SESS2_EXPIRY ON SESSIONS2(EXPIRY);
+CREATE INDEX SESS2_EXPIREREF ON SESSIONS2(EXPIREREF);</font></pre>
+<p> We need to use a CLOB here because for text greater than 4000 bytes long,
+ Oracle requires you to use the CLOB data type. If you are using the oci8
driver,
+ ADOdb will automatically enable CLOB handling. So you can use either
adodb-session2.php
+ or adodb-session-clob2.php - in this case it doesn't matter. <br>
+<h2>Notifications</h2>
<p>You can receive notification when your session is cleaned up by the session
garbage collector or
when you call session_destroy().
<p>PHP's session extension will automatically run a special garbage collection
function based on
@@ -220,7 +267,7 @@
record has been created, you will need to modify any session variable
to force a database record update.
</p>
-<h4>Neat Notification Tricks</h4>
+<h3>Neat Notification Tricks</h3>
<p><i>ExpireRef</i> normally holds the user id of the current session.
</p>
<p>1. You can then write a session monitor, scanning expireref to see
@@ -234,70 +281,56 @@
<p>3. You can scan the sessions table to ensure no user
can be logged in twice. Useful for security reasons.
</p>
-<h3>Using Oracle CLOBs</h3>
-<p>Suppose you are storing the DATA field in a CLOB:
- <pre><font color="#004040">
- CREATE TABLE sessions (
- SESSKEY VARCHAR(32) NOT NULL,
- EXPIRY NUMBER(16) NOT NULL,
- EXPIREREF VARCHAR(64),
- DATA CLOB,
- PRIMARY KEY (sesskey)
- );</font>
- </pre>
- <p>Then your PHP code could look like this:
- <pre>
- ADODB_SESSION_DRIVER='oci8';
- $ADODB_SESSION_CONNECT=$tnsname;
- $ADODB_SESSION_USER ='scott';
- $ADODB_SESSION_PWD = 'tiger';
- $ADODB_SESSION_DB ='';
-
- $ADODB_SESSION_USE_LOBS = 'clob';
- $ADODB_SESSION_TBL = 'sessions';
-
- $ADODB_SESS_DEBUG=0;
-
- include(ADODB_DIR.'/session/adodb-session.php');
-
- ADODB_Session::persist('P'); # use 'C' for non-persistent connects
-
- session_start();
- </pre>
- <p>Note that you can set persistance using ADODB_Session::persist('P').
-
-<h3>Compression/Encryption Schemes</h3>
+<h2>Compression/Encryption Schemes</h2>
Since ADOdb 4.05, thanks to Ross Smith, multiple encryption and
compression schemes are supported. Currently, supported are:
<p>
<pre> MD5Crypt (crypt.inc.php)<br> MCrypt<br> Secure (Horde's emulation of
MCrypt, if MCrypt module is not available.)<br> GZip<br> BZip2<br></pre>
<p>These are stackable. E.g.
-<p><pre>ADODB_Session::filter(new
ADODB_Compress_Bzip2());<br>ADODB_Session::filter(new
ADODB_Encrypt_MD5());<br></pre>
+<pre>ADODB_Session::filter(new
ADODB_Compress_Bzip2());<br>ADODB_Session::filter(new
ADODB_Encrypt_MD5());<br></pre>
will compress and then encrypt the record in the database.
-<h3>adodb_session_regenerate_id()</h3>
-<p>Dynamically change the current session id with a newly generated one and
update database. Currently only
-works with cookies. Useful to improve security by reducing the risk of
session-hijacking.
-See this article on <a
href=http://shiflett.org/articles/security-corner-feb2004>Session Fixation</a>
for more info
-on the theory behind this feature. Usage:
-<pre>
- $ADODB_SESSION_DRIVER='mysql';
- $ADODB_SESSION_CONNECT='localhost';
- $ADODB_SESSION_USER ='root';
- $ADODB_SESSION_PWD ='abc';
- $ADODB_SESSION_DB ='phplens';
-
- include('path/to/adodb/session/adodb-session.php');
+<h2>Session Cookie Regeneration: adodb_session_regenerate_id()</h2>
+<p>Dynamically change the current session id with a newly generated one and
update
+ database. Currently only works with cookies. Useful to improve security by
+ reducing the risk of session-hijacking. See this article on <a
href=http://shiflett.org/articles/security-corner-feb2004>Session
+ Fixation</a> for more info
+on the theory behind this feature. Usage:<pre>
+ include('path/to/adodb/session/adodb-session2.php');
session_start();
- # Every 10 page loads, reset cookie for safety.
+ # Approximately every 10 page loads, reset cookie for safety.
# This is extremely simplistic example, better
# to regenerate only when the user logs in or changes
# user privilege levels.
if ((rand()%10) == 0) adodb_session_regenerate_id();
</pre>
<p>This function calls session_regenerate_id() internally or simulates it if
the function does not exist.
+<h2>Vacuum/Optimize Database</h2>
+<p>During session garbage collection, if postgresql is detected,
+ ADOdb can be set to run VACUUM. If mysql is detected, then optimize database
+ could be called.You can turn this on or off using:</p>
+<pre>$turnOn = true; # or false
+ADODB_Session::optimize($turnOn);
+</pre>
+<p>The default is optimization is disabled.</p>
+<h2><a name=compat></a>Backwards Compatability </h2>
+<p>The older method of connecting to ADOdb using global variables is still
supported:</p>
+<pre> $ADODB_SESSION_DRIVER='mysql';
+ $ADODB_SESSION_CONNECT='localhost';
+ $ADODB_SESSION_USER ='root';
+ $ADODB_SESSION_PWD ='abc';
+ $ADODB_SESSION_DB ='phplens';
+
+ include('path/to/adodb/session/adodb-<strong>session2</strong>.php'); </pre>
+<p>In the above example, the only things you need to change in your code to
upgrade
+ is </p>
+<ul>
+ <li>your session table format to the new one.</li>
+ <li>the include file from adodb-session.php to adodb-session2.php. </li>
+</ul>
<h2>More Info</h2>
-<p>Also see the <a href="docs-adodb.htm">core ADOdb documentation</a>.
-</p>
+<p>Also see the <a href="docs-adodb.htm">core ADOdb documentation</a>. And if
+ you are interested in the obsolete adodb-session.php, see <a
href="docs-session.old.htm">old
+ session documentation</a>. </p>
</body>
</html>
Index: drivers/adodb-access.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-access.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-access.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-access.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Index: drivers/adodb-ado.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-ado.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-ado.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-ado.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-ado5.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-ado5.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-ado5.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-ado5.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-ado_access.inc.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-ado_access.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-ado_access.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-ado_access.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Index: drivers/adodb-ado_mssql.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-ado_mssql.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-ado_mssql.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-ado_mssql.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-borland_ibase.inc.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-borland_ibase.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-borland_ibase.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-borland_ibase.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
@@ -20,6 +20,7 @@
class ADODB_borland_ibase extends ADODB_ibase {
var $databaseType = "borland_ibase";
+
function ADODB_borland_ibase()
{
$this->ADODB_ibase();
Index: drivers/adodb-csv.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-csv.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-csv.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-csv.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-db2.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-db2.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-db2.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-db2.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,13 +1,15 @@
<?php
/*
- V4.90 8 June 2006 (c) 2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
-This is a version of the ADODB driver for DB2. It uses the 'ibm_db2' PECL
extension for PHP
- (http://pecl.php.net/package/ibm_db2), which in turn requires DB2 V8.2.2.
+ This is a version of the ADODB driver for DB2. It uses the 'ibm_db2' PECL
extension
+ for PHP (http://pecl.php.net/package/ibm_db2), which in turn requires DB2
V8.2.2 or
+ higher.
- Tested with PHP 5.1.1 and Apache 2.0.55 on Windows XP SP2.
+ Originally tested with PHP 5.1.1 and Apache 2.0.55 on Windows XP SP2.
+ More recently tested with PHP 5.1.2 and Apache 2.0.55 on Windows XP SP2.
- This file was ported from "adodb-odbc.inc.php" by Larry Menard,
"address@hidden".
+ This file was ported from "adodb-odbc.inc.php" by Larry Menard,
"larry.menard#rogers.com".
I ripped out what I believed to be a lot of redundant or obsolete code, but
there are
probably still some remnants of the ODBC support in this file; I'm relying
on reviewers
of this code to point out any other things that can be removed.
@@ -32,7 +34,6 @@
var $sysTimeStamp = 'CURRENT TIMESTAMP';
var $fmtTimeStamp = "'Y-m-d-H.i.s'";
- #var $fmtTimeStamp = "'Y-m-d, h:i:sA'";
var $replaceQuote = "''"; // string to use to replace quotes
var $dataProvider = "db2";
var $hasAffectedRows = true;
@@ -42,7 +43,9 @@
var $useFetchArray = false; // setting this to true will make array
elements in FETCH_ASSOC mode case-sensitive
// breaking
backward-compat
var $_bindInputArray = false;
- var $_genSeqSQL = "create table %s (id integer)";
+ var $_genIDSQL = "VALUES NEXTVAL FOR %s";
+ var $_genSeqSQL = "CREATE SEQUENCE %s START WITH 1 NO MAXVALUE NO
CYCLE";
+ var $_dropSeqSQL = "DROP SEQUENCE %s";
var $_autocommit = true;
var $_haserrorfunctions = true;
var $_lastAffectedRows = 0;
@@ -82,7 +85,8 @@
// For db2_connect(), there is an optional 4th arg. If
present, it must be
// an array of valid options. So far, we don't use them.
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
+ $this->_errorMsg = @db2_conn_errormsg();
+
if (isset($this->connectStmt))
$this->Execute($this->connectStmt);
return $this->_connectionID != false;
@@ -109,19 +113,31 @@
}
if (isset($php_errormsg)) $php_errormsg = '';
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
+ $this->_errorMsg = @db2_conn_errormsg();
if ($this->_connectionID && $this->autoRollback)
@db2_rollback($this->_connectionID);
if (isset($this->connectStmt))
$this->Execute($this->connectStmt);
return $this->_connectionID != false;
}
+ // format and return date string in database timestamp format
+ function DBTimeStamp($ts)
+ {
+ if (empty($ts) && $ts !== 0) return 'null';
+ if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
+ return
'TO_DATE('.adodb_date($this->fmtTimeStamp,$ts).",'YYYY-MM-DD HH24:MI:SS')";
+ }
// Format date column in sql string given an input format that
understands Y M D
function SQLDate($fmt, $col=false)
{
// use right() and replace() ?
if (!$col) $col = $this->sysDate;
+
+ /* use TO_CHAR() if $fmt is TO_CHAR() allowed fmt */
+ if ($fmt== 'Y-m-d H:i:s')
+ return 'TO_CHAR('.$col.", 'YYYY-MM-DD HH24:MI:SS')";
+
$s = '';
$len = strlen($fmt);
@@ -131,31 +147,38 @@
switch($ch) {
case 'Y':
case 'y':
+ if ($len==1) return "year($col)";
$s .= "char(year($col))";
break;
case 'M':
+ if ($len==1) return "monthname($col)";
$s .= "substr(monthname($col),1,3)";
break;
case 'm':
+ if ($len==1) return "month($col)";
$s .= "right(digits(month($col)),2)";
break;
case 'D':
case 'd':
+ if ($len==1) return "day($col)";
$s .= "right(digits(day($col)),2)";
break;
case 'H':
case 'h':
+ if ($len==1) return "hour($col)";
if ($col != $this->sysDate) $s .=
"right(digits(hour($col)),2)";
else $s .= "''";
break;
case 'i':
case 'I':
+ if ($len==1) return "minute($col)";
if ($col != $this->sysDate)
$s .= "right(digits(minute($col)),2)";
else $s .= "''";
break;
case 'S':
case 's':
+ if ($len==1) return "second($col)";
if ($col != $this->sysDate)
$s .= "right(digits(second($col)),2)";
else $s .= "''";
@@ -207,11 +230,9 @@
if (empty($this->_genSeqSQL)) return false;
$ok = $this->Execute(sprintf($this->_genSeqSQL,$seqname));
if (!$ok) return false;
- $start -= 1;
- return $this->Execute("insert into $seqname values($start)");
+ return true;
}
- var $_dropSeqSQL = 'drop table %s';
function DropSequence($seqname)
{
if (empty($this->_dropSeqSQL)) return false;
@@ -228,37 +249,17 @@
{
// if you have to modify the parameter below, your database is
overloaded,
// or you need to implement generation of id's yourself!
- $MAXLOOPS = 100;
- while (--$MAXLOOPS>=0) {
- $num = $this->GetOne("select id from $seq");
- if ($num === false) {
- $this->Execute(sprintf($this->_genSeqSQL
,$seq));
- $start -= 1;
- $num = '0';
- $ok = $this->Execute("insert into $seq
values($start)");
- if (!$ok) return false;
- }
- $this->Execute("update $seq set id=id+1 where id=$num");
-
- if ($this->affected_rows() > 0) {
- $num += 1;
- $this->genID = $num;
+ $num = $this->GetOne("VALUES NEXTVAL FOR $seq");
return $num;
}
- }
- if ($fn = $this->raiseErrorFn) {
- $fn($this->databaseType,'GENID',-32000,"Unable to
generate unique id after $MAXLOOPS attempts",$seq,$num);
- }
- return false;
- }
function ErrorMsg()
{
if ($this->_haserrorfunctions) {
if ($this->_errorMsg !== false) return $this->_errorMsg;
- if (empty($this->_connectionID)) return @db2_errormsg();
- return @db2_errormsg($this->_connectionID);
+ if (empty($this->_connectionID)) return
@db2_conn_errormsg();
+ return @db2_conn_errormsg($this->_connectionID);
} else return ADOConnection::ErrorMsg();
}
@@ -271,8 +272,8 @@
return (strlen($this->_errorCode)<=2) ? 0 :
$this->_errorCode;
}
- if (empty($this->_connectionID)) $e = @db2_error();
- else $e = @db2_error($this->_connectionID);
+ if (empty($this->_connectionID)) $e =
@db2_conn_error();
+ else $e = @db2_conn_error($this->_connectionID);
// bug in 4.0.6, error number can be corrupted string
(should be 6 digits)
// so we check and patch
@@ -343,9 +344,53 @@
return $arr2;
}
+ function MetaForeignKeys($table, $owner = FALSE, $upper = FALSE,
$asociative = FALSE )
+ {
+ global $ADODB_FETCH_MODE;
+
+ if ($this->uCaseTables) $table = strtoupper($table);
+ $schema = '';
+ $this->_findschema($table,$schema);
+
+ $savem = $ADODB_FETCH_MODE;
+ $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+ $qid =
@db2_foreign_keys($this->_connectionID,'',$schema,$table);
+ if (!$qid) {
+ $ADODB_FETCH_MODE = $savem;
+ return false;
+ }
+ $rs = new ADORecordSet_db2($qid);
+
+ $ADODB_FETCH_MODE = $savem;
+ /*
+ $rs->fields indices
+ 0 PKTABLE_CAT
+ 1 PKTABLE_SCHEM
+ 2 PKTABLE_NAME
+ 3 PKCOLUMN_NAME
+ 4 FKTABLE_CAT
+ 5 FKTABLE_SCHEM
+ 6 FKTABLE_NAME
+ 7 FKCOLUMN_NAME
+ */
+ if (!$rs) return false;
+
+ $foreign_keys = array();
+ while (!$rs->EOF) {
+ if (strtoupper(trim($rs->fields[2])) == $table &&
(!$schema || strtoupper($rs->fields[1]) == $schema)) {
+ if
(!is_array($foreign_keys[$rs->fields[5].'.'.$rs->fields[6]]))
+
$foreign_keys[$rs->fields[5].'.'.$rs->fields[6]] = array();
+
$foreign_keys[$rs->fields[5].'.'.$rs->fields[6]][$rs->fields[7]] =
$rs->fields[3];
+ }
+ $rs->MoveNext();
+ }
+
+ $rs->Close();
+ return $foreign_key;
+ }
- function &MetaTables($ttype=false)
+ function &MetaTables($ttype=false,$schema=false)
{
global $ADODB_FETCH_MODE;
@@ -372,11 +417,12 @@
for ($i=0; $i < sizeof($arr); $i++) {
if (!$arr[$i][2]) continue;
$type = $arr[$i][3];
+ $schemaval = ($schema) ? $arr[$i][1].'.' : '';
if ($ttype) {
if ($isview) {
- if (strncmp($type,'V',1) === 0) $arr2[]
= $arr[$i][2];
- } else if (strncmp($type,'SYS',3) !== 0)
$arr2[] = $arr[$i][2];
- } else if (strncmp($type,'SYS',3) !== 0) $arr2[] =
$arr[$i][2];
+ if (strncmp($type,'V',1) === 0) $arr2[]
= $schemaval.$arr[$i][2];
+ } else if (strncmp($type,'SYS',3) !== 0)
$arr2[] = $schemaval.$arr[$i][2];
+ } else if (strncmp($type,'SYS',3) !== 0) $arr2[] =
$schemaval.$arr[$i][2];
}
return $arr2;
}
@@ -505,12 +551,41 @@
$fld->max_length = $rs->fields[7];
$fld->not_null = !empty($rs->fields[10]);
$fld->scale = $rs->fields[8];
+ $fld->primary_key = false;
$retarr[strtoupper($fld->name)] = $fld;
} else if (sizeof($retarr)>0)
break;
$rs->MoveNext();
}
- $rs->Close(); //-- crashes 4.03pl1 -- why?
+ $rs->Close();
+ if (empty($retarr)) $retarr = false;
+
+ $qid = db2_primary_keys($this->_connectionID, "", $schema,
$table);
+ if (empty($qid)) return $false;
+
+ $rs =& new ADORecordSet_db2($qid);
+ $ADODB_FETCH_MODE = $savem;
+
+ if (!$rs) return $retarr;
+ $rs->_fetch();
+
+ /*
+ $rs->fields indices
+ 0 TABLE_CAT
+ 1 TABLE_SCHEM
+ 2 TABLE_NAME
+ 3 COLUMN_NAME
+ 4 KEY_SEQ
+ 5 PK_NAME
+ */
+ while (!$rs->EOF) {
+ if (strtoupper(trim($rs->fields[2])) == $table &&
(!$schema || strtoupper($rs->fields[1]) == $schema)) {
+
$retarr[strtoupper($rs->fields[3])]->primary_key = true;
+ } else if (sizeof($retarr)>0)
+ break;
+ $rs->MoveNext();
+ }
+ $rs->Close();
if (empty($retarr)) $retarr = false;
return $retarr;
@@ -548,8 +623,8 @@
if (! db2_execute($stmtid,$inputarr)) {
if ($this->_haserrorfunctions) {
- $this->_errorMsg = db2_errormsg();
- $this->_errorCode = db2_error();
+ $this->_errorMsg = db2_stmt_errormsg();
+ $this->_errorCode = db2_stmt_error();
}
return false;
}
@@ -558,13 +633,13 @@
$stmtid = $sql[1];
if (!db2_execute($stmtid)) {
if ($this->_haserrorfunctions) {
- $this->_errorMsg = db2_errormsg();
- $this->_errorCode = db2_error();
+ $this->_errorMsg = db2_stmt_errormsg();
+ $this->_errorCode = db2_stmt_error();
}
return false;
}
} else
- $stmtid = db2_exec($this->_connectionID,$sql);
+ $stmtid = @db2_exec($this->_connectionID,$sql);
$this->_lastAffectedRows = 0;
if ($stmtid) {
@@ -586,6 +661,7 @@
$this->_errorCode = db2_stmt_error();
} else
$this->_errorMsg = isset($php_errormsg) ?
$php_errormsg : '';
+
}
return $stmtid;
}
Index: drivers/adodb-fbsql.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-fbsql.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-fbsql.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-fbsql.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
- @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All
rights reserved.
+ @version V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All
rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-firebird.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-firebird.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-firebird.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-firebird.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
@@ -19,7 +19,7 @@
var $databaseType = "firebird";
var $dialect = 3;
- var $sysTimeStamp = "cast('NOW' as timestamp)";
+ var $sysTimeStamp = "CURRENT_TIMESTAMP"; //"cast('NOW' as timestamp)";
function ADODB_firebird()
{
Index: drivers/adodb-ibase.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-ibase.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-ibase.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-ibase.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
@@ -47,7 +47,7 @@
var $buffers = 0;
var $dialect = 1;
var $sysDate = "cast('TODAY' as timestamp)";
- var $sysTimeStamp = "cast('NOW' as timestamp)";
+ var $sysTimeStamp = "CURRENT_TIMESTAMP"; //"cast('NOW' as timestamp)";
var $ansiOuter = true;
var $hasAffectedRows = false;
var $poorAffectedRows = true;
@@ -556,7 +556,7 @@
// old blobdecode function
// still used to auto-decode all blob's
- function _BlobDecode( $blob )
+ function _BlobDecode_old( $blob )
{
$blobid = ibase_blob_open($this->_connectionID, $blob );
$realblob = ibase_blob_get( $blobid,$this->maxblobsize); // 2nd
param is max size of blob -- Kevin Boillet <address@hidden>
@@ -568,6 +568,32 @@
return( $realblob );
}
+ function _BlobDecode( $blob )
+ {
+ if (ADODB_PHPVER >= 0x5000) {
+ $blob_data = ibase_blob_info($this->_connectionID, $blob );
+ $blobid = ibase_blob_open($this->_connectionID, $blob );
+ } else {
+
+ $blob_data = ibase_blob_info( $blob );
+ $blobid = ibase_blob_open( $blob );
+ }
+
+ if( $blob_data[0] > $this->maxblobsize ) {
+
+ $realblob = ibase_blob_get($blobid, $this->maxblobsize);
+
+ while($string = ibase_blob_get($blobid, 8192)){
+ $realblob .= $string;
+ }
+ } else {
+ $realblob = ibase_blob_get($blobid, $blob_data[0]);
+ }
+
+ ibase_blob_close( $blobid );
+ return( $realblob );
+ }
+
function UpdateBlobFile($table,$column,$path,$where,$blobtype='BLOB')
{
$fd = fopen($path,'rb');
Index: drivers/adodb-informix.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-informix.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-informix.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-informix.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/**
-* @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All
rights reserved.
+* @version V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All
rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
Index: drivers/adodb-informix72.inc.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-informix72.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-informix72.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-informix72.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim. All rights reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim. 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.
@@ -192,7 +192,7 @@
}
$rs->Close();
- $rspKey->Close(); //!eos
+ $rspkey->Close(); //!eos
return $retarr;
}
Index: drivers/adodb-ldap.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-ldap.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-ldap.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-ldap.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-mssql.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-mssql.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-mssql.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-mssql.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-mssqlpo.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-mssqlpo.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-mssqlpo.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-mssqlpo.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/**
-* @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All
rights reserved.
+* @version V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All
rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
Index: drivers/adodb-mysql.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-mysql.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-mysql.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-mysql.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
@@ -24,7 +24,7 @@
var $hasInsertID = true;
var $hasAffectedRows = true;
var $metaTablesSQL = "SHOW TABLES";
- var $metaColumnsSQL = "SHOW COLUMNS FROM %s";
+ var $metaColumnsSQL = "SHOW COLUMNS FROM `%s`";
var $fmtTimeStamp = "'Y-m-d H:i:s'";
var $hasLimit = true;
var $hasMoveFirst = true;
@@ -341,8 +341,11 @@
function OffsetDate($dayFraction,$date=false)
{
if (!$date) $date = $this->sysDate;
+
$fraction = $dayFraction * 24 * 3600;
- return "from_unixtime(unix_timestamp($date)+$fraction)";
+ return $date . ' + INTERVAL ' . $fraction.' SECOND';
+
+// return "from_unixtime(unix_timestamp($date)+$fraction)";
}
// returns true or false
Index: drivers/adodb-mysqli.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-mysqli.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-mysqli.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-mysqli.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
@@ -32,7 +32,7 @@
var $hasInsertID = true;
var $hasAffectedRows = true;
var $metaTablesSQL = "SHOW TABLES";
- var $metaColumnsSQL = "SHOW COLUMNS FROM %s";
+ var $metaColumnsSQL = "SHOW COLUMNS FROM `%s`";
var $fmtTimeStamp = "'Y-m-d H:i:s'";
var $hasLimit = true;
var $hasMoveFirst = true;
@@ -430,9 +430,12 @@
// dayFraction is a day in floating point
function OffsetDate($dayFraction,$date=false)
{
- if (!$date)
- $date = $this->sysDate;
- return
"from_unixtime(unix_timestamp($date)+($dayFraction)*24*3600)";
+ if (!$date) $date = $this->sysDate;
+
+ $fraction = $dayFraction * 24 * 3600;
+ return $date . ' + INTERVAL ' . $fraction.' SECOND';
+
+// return "from_unixtime(unix_timestamp($date)+$fraction)";
}
function &MetaTables($ttype=false,$showSchema=false,$mask=false)
Index: drivers/adodb-mysqlt.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-mysqlt.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-mysqlt.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-mysqlt.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-netezza.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-netezza.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-netezza.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-netezza.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
First cut at the Netezza Driver by Josh Eldridge joshuae74#hotmail.com
Based on the previous postgres drivers.
Index: drivers/adodb-oci8.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-oci8.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-oci8.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-oci8.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/*
- version V4.90 8 June 2006 (c) 2000-2006 John Lim. All rights reserved.
+ version V4.92 29 Aug 2006 (c) 2000-2006 John Lim. All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
@@ -75,6 +75,7 @@
var $noNullStrings = false;
var $connectSID = false;
var $_bind = false;
+ var $_nestedSQL = true;
var $_hasOCIFetchStatement = false;
var $_getarray = false; // currently not working
var $leftOuter = ''; // oracle wierdness, $col = $value (+) for LEFT
OUTER, $col (+)= $value for RIGHT OUTER
Index: drivers/adodb-oci805.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-oci805.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-oci805.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-oci805.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/**
- * @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
+ * @version V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my).
All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
Index: drivers/adodb-oci8po.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-oci8po.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-oci8po.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-oci8po.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim. All rights reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim. 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.
Index: drivers/adodb-odbc.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-odbc.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-odbc.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-odbc.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-odbc_db2.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-odbc_db2.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- drivers/adodb-odbc_db2.inc.php 22 Jun 2006 09:06:37 -0000 1.3
+++ drivers/adodb-odbc_db2.inc.php 29 Aug 2006 08:00:49 -0000 1.4
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-odbc_mssql.inc.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-odbc_mssql.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-odbc_mssql.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-odbc_mssql.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-odbc_oracle.inc.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-odbc_oracle.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-odbc_oracle.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-odbc_oracle.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-odbtp.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-odbtp.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-odbtp.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-odbtp.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
@@ -150,6 +150,8 @@
function _connect($HostOrInterface, $UserOrDSN='', $argPassword='',
$argDatabase='')
{
$this->_connectionID =
@odbtp_connect($HostOrInterface,$UserOrDSN,$argPassword,$argDatabase);
+ odbtp_convert_datetime($this->_connectionID,true);
+
if ($this->_connectionID === false) {
$this->_errorMsg = $this->ErrorMsg() ;
return false;
Index: drivers/adodb-odbtp_unicode.inc.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-odbtp_unicode.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-odbtp_unicode.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-odbtp_unicode.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All
rights reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All
rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Index: drivers/adodb-oracle.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-oracle.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-oracle.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-oracle.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-pdo.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-pdo.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-pdo.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-pdo.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
@@ -326,6 +326,7 @@
return $obj;
}
+
/* returns queryID or false */
function _query($sql,$inputarr=false)
{
@@ -334,7 +335,8 @@
} else {
$stmt = $this->_connectionID->prepare($sql);
}
-
+ #adodb_backtrace();
+ #var_dump($this->_bindInputArray);
if ($stmt) {
$this->_driver->debug = $this->debug;
if ($inputarr) $ok = $stmt->execute($inputarr);
Index: drivers/adodb-pdo_mssql.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-pdo_mssql.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- drivers/adodb-pdo_mssql.inc.php 22 Jun 2006 09:06:37 -0000 1.3
+++ drivers/adodb-pdo_mssql.inc.php 29 Aug 2006 08:00:49 -0000 1.4
@@ -2,7 +2,7 @@
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-pdo_mysql.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-pdo_mysql.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- drivers/adodb-pdo_mysql.inc.php 22 Jun 2006 09:06:37 -0000 1.3
+++ drivers/adodb-pdo_mysql.inc.php 29 Aug 2006 08:00:49 -0000 1.4
@@ -2,7 +2,7 @@
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
@@ -12,20 +12,31 @@
class ADODB_pdo_mysql extends ADODB_pdo {
var $metaTablesSQL = "SHOW TABLES";
- var $metaColumnsSQL = "SHOW COLUMNS FROM %s";
- var $_bindInputArray = false;
+ var $metaColumnsSQL = "SHOW COLUMNS FROM `%s`";
var $sysDate = 'CURDATE()';
var $sysTimeStamp = 'NOW()';
+ var $nameQuote = '`';
function _init($parentDriver)
{
$parentDriver->hasTransactions = false;
- $parentDriver->_bindInputArray = true;
+ $parentDriver->_bindInputArray = false;
$parentDriver->hasInsertID = true;
$parentDriver->_connectionID->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,true);
}
+ // dayFraction is a day in floating point
+ function OffsetDate($dayFraction,$date=false)
+ {
+ if (!$date) $date = $this->sysDate;
+
+ $fraction = $dayFraction * 24 * 3600;
+ return $date . ' + INTERVAL ' . $fraction.' SECOND';
+
+// return "from_unixtime(unix_timestamp($date)+$fraction)";
+ }
+
function ServerInfo()
{
$arr['description'] = ADOConnection::GetOne("select version()");
Index: drivers/adodb-pdo_oci.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-pdo_oci.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- drivers/adodb-pdo_oci.inc.php 22 Jun 2006 09:06:37 -0000 1.3
+++ drivers/adodb-pdo_oci.inc.php 29 Aug 2006 08:00:49 -0000 1.4
@@ -2,7 +2,7 @@
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
@@ -26,7 +26,7 @@
function _init($parentDriver)
{
$parentDriver->_bindInputArray = true;
-
+ $parentDriver->_nestedSQL = true;
if ($this->_initdate) {
$parentDriver->Execute("ALTER SESSION SET
NLS_DATE_FORMAT='".$this->NLS_DATE_FORMAT."'");
}
Index: drivers/adodb-pdo_pgsql.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-pdo_pgsql.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- drivers/adodb-pdo_pgsql.inc.php 22 Jun 2006 09:06:37 -0000 1.3
+++ drivers/adodb-pdo_pgsql.inc.php 29 Aug 2006 08:00:49 -0000 1.4
@@ -1,7 +1,7 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
@@ -59,6 +59,7 @@
$parentDriver->hasTransactions = false; ## <<< BUG IN PDO pgsql
driver
$parentDriver->hasInsertID = true;
+ $parentDriver->_nestedSQL = true;
}
function ServerInfo()
Index: drivers/adodb-postgres.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-postgres.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-postgres.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-postgres.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-postgres64.inc.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-postgres64.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-postgres64.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-postgres64.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
@@ -657,7 +657,7 @@
if ($str) {
$host = split(":", $str);
if ($host[0]) $str =
"host=".adodb_addslashes($host[0]);
- else $str = 'host=localhost';
+ else $str = '';
if (isset($host[1])) $str .= " port=$host[1]";
else if (!empty($this->port)) $str .= "
port=".$this->port;
}
Index: drivers/adodb-postgres7.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-postgres7.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-postgres7.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-postgres7.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
@@ -29,6 +29,12 @@
$this->rsPrefix .= 'assoc_';
}
$this->_bindInputArray = PHP_VERSION >= 5.1;
+
+ $info = $this->ServerInfo();
+ $this->pgVersion = (float) substr($info['version'],0,3);
+ if ($this->pgVersion >= 7.1) { // good till version 999
+ $this->_nestedSQL = true;
+ }
}
@@ -74,22 +80,22 @@
$rs =& $this->Execute($sql);
- if ($rs && !$rs->EOF) {
+ if (!$rs || $rs->EOF) return false;
+
$arr =& $rs->GetArray();
$a = array();
- foreach($arr as $v)
- {
+ foreach($arr as $v) {
$data = explode(chr(0), $v['args']);
- if ($upper) {
- $a[strtoupper($data[2])][] =
strtoupper($data[4].'='.$data[5]);
- } else {
- $a[$data[2]][] = $data[4].'='.$data[5];
+ $size = count($data)-1; //-1 because the last node is
empty
+ for($i = 4; $i < $size; $i++) {
+ if ($upper)
+ $a[strtoupper($data[2])][] =
strtoupper($data[$i].'='.$data[++$i]);
+ else
+ $a[$data[2]][] =
$data[$i].'='.$data[++$i];
}
}
return $a;
}
- return false;
- }
function _query($sql,$inputarr)
{
Index: drivers/adodb-postgres8.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-postgres8.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- drivers/adodb-postgres8.inc.php 22 Jun 2006 09:06:37 -0000 1.3
+++ drivers/adodb-postgres8.inc.php 29 Aug 2006 08:00:49 -0000 1.4
@@ -1,6 +1,6 @@
<?php
/*
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-proxy.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-proxy.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-proxy.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-proxy.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-sapdb.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-sapdb.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-sapdb.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-sapdb.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-sqlanywhere.inc.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-sqlanywhere.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-sqlanywhere.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-sqlanywhere.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All
rights
+version V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All
rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
Index: drivers/adodb-sqlite.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-sqlite.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-sqlite.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-sqlite.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-sqlitepo.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-sqlitepo.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-sqlitepo.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-sqlitepo.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: drivers/adodb-sybase.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-sybase.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-sybase.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-sybase.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim. All rights reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim. 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.
Index: drivers/adodb-sybase_ase.inc.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-sybase_ase.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- drivers/adodb-sybase_ase.inc.php 22 Jun 2006 09:06:37 -0000 1.3
+++ drivers/adodb-sybase_ase.inc.php 29 Aug 2006 08:00:49 -0000 1.4
@@ -1,6 +1,6 @@
<?php
/*
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
@@ -9,6 +9,10 @@
Contributed by Interakt Online. Thx Cristian MARIN cristic#interaktonline.com
*/
+
+
+require_once ADODB_DIR."/drivers/adodb-sybase.inc.php";
+
class ADODB_sybase_ase extends ADODB_sybase {
var $databaseType = "sybase_ase";
Index: drivers/adodb-vfp.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-vfp.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- drivers/adodb-vfp.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ drivers/adodb-vfp.inc.php 29 Aug 2006 08:00:49 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: pear/Auth/Container/ADOdb.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/pear/Auth/Container/ADOdb.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- pear/Auth/Container/ADOdb.php 22 Jun 2006 09:06:37 -0000 1.2
+++ pear/Auth/Container/ADOdb.php 29 Aug 2006 08:00:50 -0000 1.3
@@ -17,7 +17,7 @@
// | Richard Tango-Lowy <address@hidden> |
// +----------------------------------------------------------------------+
//
-// $Id: ADOdb.php,v 1.2 2006/06/22 09:06:37 sigurdne Exp $
+// $Id: ADOdb.php,v 1.3 2006/08/29 08:00:50 sigurdne Exp $
//
require_once 'Auth/Container.php';
@@ -35,7 +35,7 @@
*
* @author Richard Tango-Lowy <address@hidden>
* @package Auth
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
class Auth_Container_ADOdb extends Auth_Container
{
Index: perf/perf-db2.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/perf/perf-db2.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- perf/perf-db2.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ perf/perf-db2.inc.php 29 Aug 2006 08:00:50 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Index: perf/perf-informix.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/perf/perf-informix.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- perf/perf-informix.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ perf/perf-informix.inc.php 29 Aug 2006 08:00:50 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Index: perf/perf-mssql.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/perf/perf-mssql.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- perf/perf-mssql.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ perf/perf-mssql.inc.php 29 Aug 2006 08:00:50 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Index: perf/perf-mysql.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/perf/perf-mysql.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- perf/perf-mysql.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ perf/perf-mysql.inc.php 29 Aug 2006 08:00:50 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Index: perf/perf-oci8.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/perf/perf-oci8.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- perf/perf-oci8.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ perf/perf-oci8.inc.php 29 Aug 2006 08:00:50 -0000 1.6
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Index: perf/perf-postgres.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/perf/perf-postgres.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- perf/perf-postgres.inc.php 22 Jun 2006 09:06:37 -0000 1.5
+++ perf/perf-postgres.inc.php 29 Aug 2006 08:00:50 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Index: session/adodb-compress-bzip2.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/session/adodb-compress-bzip2.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- session/adodb-compress-bzip2.php 22 Jun 2006 09:06:37 -0000 1.5
+++ session/adodb-compress-bzip2.php 29 Aug 2006 08:00:50 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Contributed by Ross Smith (address@hidden).
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
Index: session/adodb-compress-gzip.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/session/adodb-compress-gzip.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- session/adodb-compress-gzip.php 22 Jun 2006 09:06:37 -0000 1.5
+++ session/adodb-compress-gzip.php 29 Aug 2006 08:00:50 -0000 1.6
@@ -2,7 +2,7 @@
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Contributed by Ross Smith (address@hidden).
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
Index: session/adodb-cryptsession.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/session/adodb-cryptsession.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- session/adodb-cryptsession.php 22 Jun 2006 09:06:37 -0000 1.5
+++ session/adodb-cryptsession.php 29 Aug 2006 08:00:50 -0000 1.6
@@ -2,7 +2,7 @@
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Contributed by Ross Smith (address@hidden).
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
@@ -16,7 +16,10 @@
*/
-require_once dirname(__FILE__) . '/adodb-session.php';
+if (!defined('ADODB_SESSION')) {
+ require_once dirname(__FILE__) . '/adodb-session.php';
+}
+
require_once ADODB_SESSION . '/adodb-encrypt-md5.php';
ADODB_Session::filter(new ADODB_Encrypt_MD5());
Index: session/adodb-encrypt-mcrypt.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/session/adodb-encrypt-mcrypt.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- session/adodb-encrypt-mcrypt.php 22 Jun 2006 09:06:37 -0000 1.5
+++ session/adodb-encrypt-mcrypt.php 29 Aug 2006 08:00:50 -0000 1.6
@@ -2,7 +2,7 @@
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Contributed by Ross Smith (address@hidden).
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
Index: session/adodb-encrypt-md5.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/session/adodb-encrypt-md5.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- session/adodb-encrypt-md5.php 22 Jun 2006 09:06:37 -0000 1.5
+++ session/adodb-encrypt-md5.php 29 Aug 2006 08:00:50 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Contributed by Ross Smith (address@hidden).
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
Index: session/adodb-encrypt-secret.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/session/adodb-encrypt-secret.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- session/adodb-encrypt-secret.php 22 Jun 2006 09:06:37 -0000 1.5
+++ session/adodb-encrypt-secret.php 29 Aug 2006 08:00:50 -0000 1.6
@@ -1,7 +1,7 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Contributed by Ross Smith (address@hidden).
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
Index: session/adodb-session-clob.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/session/adodb-session-clob.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- session/adodb-session-clob.php 22 Jun 2006 09:06:37 -0000 1.5
+++ session/adodb-session-clob.php 29 Aug 2006 08:00:50 -0000 1.6
@@ -2,7 +2,7 @@
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Contributed by Ross Smith (address@hidden).
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
@@ -16,8 +16,9 @@
*/
-require_once dirname(__FILE__) . '/adodb-session.php';
-
+if (!defined('ADODB_SESSION')) {
+ require_once dirname(__FILE__) . '/adodb-session.php';
+}
ADODB_Session::clob('CLOB');
?>
\ No newline at end of file
Index: session/adodb-session.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/session/adodb-session.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- session/adodb-session.php 22 Jun 2006 09:06:37 -0000 1.5
+++ session/adodb-session.php 29 Aug 2006 08:00:50 -0000 1.6
@@ -2,7 +2,7 @@
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Contributed by Ross Smith (address@hidden).
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
@@ -501,9 +501,11 @@
ADODB_Session::password($password);
ADODB_Session::database($database);
+ if ($driver == 'oci8' || $driver == 'oci8po') $options['lob'] =
'CLOB';
+
if (isset($options['table']))
ADODB_Session::table($options['table']);
- if (isset($options['clob']))
ADODB_Session::table($options['clob']);
- if (isset($options['field']))
ADODB_Session::dataFieldName($options['field']);
+ if (isset($options['lob']))
ADODB_Session::clob($options['lob']);
+ if (isset($options['debug']))
ADODB_Session::debug($options['debug']);
}
/*!
@@ -511,7 +513,8 @@
If $conn already exists, reuse that connection
*/
- function open($save_path, $session_name, $persist = null) {
+ function open($save_path, $session_name, $persist = null)
+ {
$conn =& ADODB_Session::_conn();
if ($conn) {
@@ -565,7 +568,8 @@
/*!
Close the connection
*/
- function close() {
+ function close()
+ {
/*
$conn =& ADODB_Session::_conn();
if ($conn) $conn->Close();
@@ -576,7 +580,8 @@
/*
Slurp in the session variables and return the serialized string
*/
- function read($key) {
+ function read($key)
+ {
$conn =& ADODB_Session::_conn();
$data = ADODB_Session::dataFieldName();
$filter = ADODB_Session::filter();
@@ -586,7 +591,7 @@
return '';
}
- assert('$table');
+ //assert('$table');
$qkey = $conn->quote($key);
$binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' :
'';
@@ -629,7 +634,8 @@
If the data has not been modified since the last read(), we do
not write.
*/
- function write($key, $val) {
+ function write($key, $val)
+ {
global $ADODB_SESSION_READONLY;
if (!empty($ADODB_SESSION_READONLY)) return;
@@ -650,7 +656,7 @@
}
$qkey = $conn->qstr($key);
- assert('$table');
+ //assert('$table');
$expiry = time() + $lifetime;
@@ -714,6 +720,7 @@
break;
}
+ $conn->StartTrans();
$expiryref = $conn->qstr($arr['expireref']);
// do we insert or update? => as for sesskey
$rs =& $conn->Execute("SELECT COUNT(*) AS cnt FROM
$table WHERE $binary sesskey = $qkey");
@@ -722,27 +729,18 @@
} else {
$sql = "INSERT INTO $table (expiry, $data,
sesskey,expireref) VALUES ($expiry, $lob_value, $qkey,$expiryref)";
}
- if ($rs) {
- $rs->Close();
- }
+ if ($rs)$rs->Close();
+
$err = '';
$rs1 =& $conn->Execute($sql);
- if (!$rs1) {
- $err = $conn->ErrorMsg()."\n";
- }
+ if (!$rs1) $err = $conn->ErrorMsg()."\n";
+
$rs2 =& $conn->UpdateBlob($table, $data, $val, "
sesskey=$qkey", strtoupper($clob));
+ if (!$rs2) $err .= $conn->ErrorMsg()."\n";
- if (!$rs2) {
- $err .= $conn->ErrorMsg()."\n";
- }
$rs = ($rs && $rs2) ? true : false;
- if ($rs1) {
- $rs1->Close();
- }
- if (is_object($rs2)) {
- $rs2->Close();
- }
+ $conn->CompleteTrans();
}
if (!$rs) {
@@ -777,7 +775,7 @@
return false;
}
- assert('$table');
+ //assert('$table');
$qkey = $conn->quote($key);
$binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' :
'';
@@ -806,16 +804,14 @@
$sql = "DELETE FROM $table WHERE $binary sesskey = $qkey";
$rs =& $conn->Execute($sql);
ADODB_Session::_dumprs($rs);
- if ($rs) {
- $rs->Close();
- }
return $rs ? true : false;
}
/*!
*/
- function gc($maxlifetime) {
+ function gc($maxlifetime)
+ {
$conn =& ADODB_Session::_conn();
$debug = ADODB_Session::debug();
$expire_notify = ADODB_Session::expireNotify();
@@ -827,10 +823,8 @@
return false;
}
- assert('$table');
$time = time();
-
$binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' :
'';
if ($expire_notify) {
@@ -842,18 +836,18 @@
ADODB_Session::_dumprs($rs);
$conn->SetFetchMode($savem);
if ($rs) {
- $conn->BeginTrans();
+ $conn->StartTrans();
$keys = array();
while (!$rs->EOF) {
$ref = $rs->fields[0];
$key = $rs->fields[1];
$fn($ref, $key);
- $del = $conn->Execute("DELETE FROM
$table WHERE sesskey='$key'");
+ $del = $conn->Execute("DELETE FROM
$table WHERE sesskey=".$conn->Param('0'),array($key));
$rs->MoveNext();
}
$rs->Close();
- $conn->CommitTrans();
+ $conn->CompleteTrans();
}
} else {
@@ -861,8 +855,8 @@
$sql = "SELECT sesskey FROM $table WHERE expiry
< $time";
$arr =& $conn->GetAll($sql);
foreach ($arr as $row) {
- $sql2 = "DELETE FROM $table WHERE
sesskey='$row[0]'";
- $conn->Execute($sql2);
+ $sql2 = "DELETE FROM $table WHERE
sesskey=".$conn->Param('0');
+ $conn->Execute($sql2,array($row[0]));
}
} else {
$sql = "DELETE FROM $table WHERE expiry <
$time";
Index: session/adodb-sessions.mysql.sql
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/session/adodb-sessions.mysql.sql,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- session/adodb-sessions.mysql.sql 22 Jun 2006 09:06:37 -0000 1.5
+++ session/adodb-sessions.mysql.sql 29 Aug 2006 08:00:50 -0000 1.6
@@ -1,4 +1,4 @@
--- $CVSHeader: phpgwapi/inc/adodb/session/adodb-sessions.mysql.sql,v 1.5
2006/06/22 09:06:37 sigurdne Exp $
+-- $CVSHeader: phpgwapi/inc/adodb/session/adodb-sessions.mysql.sql,v 1.6
2006/08/29 08:00:50 sigurdne Exp $
CREATE DATABASE /*! IF NOT EXISTS */ adodb_sessions;
Index: session/adodb-sessions.oracle.clob.sql
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/session/adodb-sessions.oracle.clob.sql,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- session/adodb-sessions.oracle.clob.sql 22 Jun 2006 09:06:37 -0000
1.5
+++ session/adodb-sessions.oracle.clob.sql 29 Aug 2006 08:00:50 -0000
1.6
@@ -1,4 +1,4 @@
--- $CVSHeader: phpgwapi/inc/adodb/session/adodb-sessions.oracle.clob.sql,v 1.5
2006/06/22 09:06:37 sigurdne Exp $
+-- $CVSHeader: phpgwapi/inc/adodb/session/adodb-sessions.oracle.clob.sql,v 1.6
2006/08/29 08:00:50 sigurdne Exp $
DROP TABLE adodb_sessions;
Index: session/adodb-sessions.oracle.sql
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/session/adodb-sessions.oracle.sql,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- session/adodb-sessions.oracle.sql 22 Jun 2006 09:06:37 -0000 1.5
+++ session/adodb-sessions.oracle.sql 29 Aug 2006 08:00:50 -0000 1.6
@@ -1,4 +1,4 @@
--- $CVSHeader: phpgwapi/inc/adodb/session/adodb-sessions.oracle.sql,v 1.5
2006/06/22 09:06:37 sigurdne Exp $
+-- $CVSHeader: phpgwapi/inc/adodb/session/adodb-sessions.oracle.sql,v 1.6
2006/08/29 08:00:50 sigurdne Exp $
DROP TABLE adodb_sessions;
Index: session/old/adodb-cryptsession.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/session/old/adodb-cryptsession.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- session/old/adodb-cryptsession.php 22 Jun 2006 09:06:37 -0000 1.3
+++ session/old/adodb-cryptsession.php 29 Aug 2006 08:00:50 -0000 1.4
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: session/old/adodb-session-clob.php
===================================================================
RCS file:
/sources/phpgwapi/phpgwapi/inc/adodb/session/old/adodb-session-clob.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- session/old/adodb-session-clob.php 22 Jun 2006 09:06:37 -0000 1.3
+++ session/old/adodb-session-clob.php 29 Aug 2006 08:00:50 -0000 1.4
@@ -1,6 +1,6 @@
<?php
/*
- V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: session/old/adodb-session.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/session/old/adodb-session.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- session/old/adodb-session.php 22 Jun 2006 09:06:37 -0000 1.3
+++ session/old/adodb-session.php 29 Aug 2006 08:00:50 -0000 1.4
@@ -1,6 +1,6 @@
<?php
/*
-V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Index: tests/test-active-record.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/tests/test-active-record.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- tests/test-active-record.php 18 Mar 2006 16:53:17 -0000 1.1
+++ tests/test-active-record.php 29 Aug 2006 08:00:50 -0000 1.2
@@ -45,8 +45,8 @@
*/
$person = new Person();
- $person->nameFirst = 'Andi';
- $person->nameLast = 'Gutmans';
+ $person->name_first = 'Andi';
+ $person->name_last = 'Gutmans';
$person->save(); // this save() will fail on INSERT as favorite_color
is a must fill...
Index: tests/test-xmlschema.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/tests/test-xmlschema.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- tests/test-xmlschema.php 18 Mar 2006 16:53:17 -0000 1.4
+++ tests/test-xmlschema.php 29 Aug 2006 08:00:50 -0000 1.5
@@ -8,7 +8,7 @@
// To build the schema, start by creating a normal ADOdb connection:
$db = ADONewConnection( 'mysql' );
-$db->Connect( 'localhost', 'root', '', 'schematest' );
+$db->Connect( 'localhost', 'root', '', 'test' ) || die('fail connect1');
// To create a schema object and build the query array.
$schema = new adoSchema( $db );
@@ -22,7 +22,7 @@
// Build the SQL array
$sql = $schema->ParseSchema( "xmlschema.xml" );
-print_r( $sql );
+var_dump( $sql );
print "</pre>\n";
// Execute the SQL on the database
Index: tests/test4.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/tests/test4.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- tests/test4.php 22 Jun 2006 09:06:37 -0000 1.4
+++ tests/test4.php 29 Aug 2006 08:00:50 -0000 1.5
@@ -39,8 +39,14 @@
$conn = &ADONewConnection("mysql"); // create a connection
$conn->PConnect("localhost", "root", "", "test"); // connect to MySQL, testdb
-$conn =& ADONewConnection('oci8po');
-$conn->Connect('','scott','natsoft');
+#$conn =& ADONewConnection('oci8po');
+#$conn->Connect('','scott','natsoft');
+
+$connstr = "mysql:dbname=northwind";
+$u = 'root';$p='';
+$conn =& ADONewConnection('pdo');
+$conn->Connect($connstr, $u, $p);
+
//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
$conn->debug=1;
Index: tests/testsessions.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/tests/testsessions.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- tests/testsessions.php 22 Jun 2006 09:06:37 -0000 1.5
+++ tests/testsessions.php 29 Aug 2006 08:00:50 -0000 1.6
@@ -19,39 +19,46 @@
error_reporting(E_ALL);
+
+ob_start();
+include('../session/adodb-cryptsession2.php');
+
+$options['debug'] = 99;
+$db = 'postgres';
+
#### CONNECTION
-if (0) {
- $ADODB_SESSION_DRIVER='oci8';
- $ADODB_SESSION_CONNECT='';
- $ADODB_SESSION_USER ='scott';
- $ADODB_SESSION_PWD ='natsoft';
- $ADODB_SESSION_DB ='';
-} else {
- $ADODB_SESSION_DRIVER='mysql';
- $ADODB_SESSION_CONNECT='localhost';
- $ADODB_SESSION_USER ='root';
- $ADODB_SESSION_PWD ='';
- $ADODB_SESSION_DB ='xphplens_2';
+switch($db) {
+case 'oci8':
+ $options['table'] = 'adodb_sessions2';
+ ADOdb_Session::config('oci8', '', 'jcollect', 'natsoft', '',$options);
+ break;
+
+case 'postgres':
+ ADOdb_Session::config('postgres', 'localhost', 'tester', 'test',
'test',$options);
+ break;
+
+case 'mysql':
+default:
+ ADOdb_Session::config('mysql', 'localhost', 'root', '',
'xphplens_2',$options);
+ break;
+
+
}
-### TURN DEBUGGING ON
- $ADODB_SESS_DEBUG = 99;
#### SETUP NOTIFICATION
$USER = 'JLIM'.rand();
$ADODB_SESSION_EXPIRE_NOTIFY = array('USER','NotifyExpire');
-
-#### INIT
- ob_start();
- include('../session/adodb-cryptsession.php');
+ adodb_session_create_table();
session_start();
adodb_session_regenerate_id();
### SETUP SESSION VARIABLES
- $_SESSION['MONKEY'] = array('1','abc',44.41);
+ if (empty($_SESSION['MONKEY'])) $_SESSION['MONKEY'] =
array(1,'abc',44.41);
+ else $_SESSION['MONKEY'][0] += 1;
if (!isset($_GET['nochange'])) @$_SESSION['AVAR'] += 1;
@@ -62,6 +69,8 @@
print "<hr /> <b>Cookies</b>: ";
print_r($_COOKIE);
+ var_dump($_SESSION['MONKEY']);
+
### RANDOMLY PERFORM Garbage Collection
### In real-production environment, this is done for you
### by php's session extension, which calls adodb_sess_gc()
Index: tests/xmlschema-mssql.xml
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/tests/xmlschema-mssql.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- tests/xmlschema-mssql.xml 21 Feb 2006 14:07:19 -0000 1.1
+++ tests/xmlschema-mssql.xml 29 Aug 2006 08:00:50 -0000 1.2
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
-<schema version="0.2">
+<schema version="0.3">
<table name="simple_table">
<field name="id" type="I" size="11">
<KEY/>
Index: tests/xmlschema.xml
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/tests/xmlschema.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- tests/xmlschema.xml 21 Feb 2006 13:47:42 -0000 1.3
+++ tests/xmlschema.xml 29 Aug 2006 08:00:50 -0000 1.4
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
-<schema version="0.2">
+<schema version="0.3">
<table name="mytable">
<field name="row1" type="I">
<descr>An integer row that's a primary key and autoincrements</descr>
Index: adodb-memcache.lib.inc.php
===================================================================
RCS file: adodb-memcache.lib.inc.php
diff -N adodb-memcache.lib.inc.php
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ adodb-memcache.lib.inc.php 29 Aug 2006 08:00:49 -0000 1.1
@@ -0,0 +1,118 @@
+<?php
+
+// security - hide paths
+if (!defined('ADODB_DIR')) die();
+
+global $ADODB_INCLUDED_MEMCACHE;
+$ADODB_INCLUDED_MEMCACHE = 1;
+
+/*
+
+ V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ Released under both BSD license and Lesser GPL library license.
+ Whenever there is any discrepancy between the two licenses,
+ the BSD license will take precedence. See License.txt.
+ Set tabs to 4 for best viewing.
+
+ Latest version is available at http://adodb.sourceforge.net
+
+*/
+
+ function &getmemcache($key,&$err, $timeout=0, $host, $port)
+ {
+ $false = false;
+ $err = false;
+
+ if (!function_exists('memcache_pconnect')) {
+ $err = 'Memcache module PECL extension not found!';
+ return $false;
+ }
+
+ $memcache = new Memcache;
+ if (address@hidden>pconnect($host, $port)) {
+ $err = 'Can\'t connect to memcache server on:
'.$host.':'.$port;
+ return $false;
+ }
+
+ $rs = $memcache->get($key);
+ if (!$rs) {
+ $err = 'Item with such key doesn\'t exists on the
memcached server.';
+ return $false;
+ }
+
+ $tdiff = intval($rs->timeCreated+$timeout - time());
+ if ($tdiff <= 2) {
+ switch($tdiff) {
+ case 2:
+ if ((rand() & 15) == 0) {
+ $err = "Timeout 2";
+ return $false;
+ }
+ break;
+ case 1:
+ if ((rand() & 3) == 0) {
+ $err = "Timeout 1";
+ return $false;
+ }
+ break;
+ default:
+ $err = "Timeout 0";
+ return $false;
+ }
+ }
+ return $rs;
+ }
+
+ function putmemcache($key, $rs, $host, $port, $compress, $debug=false)
+ {
+ $false = false;
+ $true = true;
+
+ if (!function_exists('memcache_pconnect')) {
+ if ($debug) ADOConnection::outp(" Memcache module PECL
extension not found!<br>\n");
+ return $false;
+ }
+
+ $memcache = new Memcache;
+ if (address@hidden>pconnect($host, $port)) {
+ if ($debug) ADOConnection::outp(" Can't connect to
memcache server on: $host:$port<br>\n");
+ return $false;
+ }
+
+ $rs->timeCreated = time();
+ if (!$memcache->set($key, $rs, $compress, 0)) {
+ if ($debug) ADOConnection::outp(" Failed to save data
at the memcached server!<br>\n");
+ return $false;
+ }
+ return $true;
+ }
+
+ function flushmemcache($key=false, $host, $port, $debug=false)
+ {
+ if (!function_exists('memcache_pconnect')) {
+ if ($debug) ADOConnection::outp(" Memcache module PECL
extension not found!<br>\n");
+ return;
+ }
+
+ $memcache = new Memcache;
+ if (address@hidden>pconnect($host, $port)) {
+ if ($debug) ADOConnection::outp(" Can't connect to
memcache server on: $host:$port<br>\n");
+ return;
+ }
+
+ if ($key) {
+ if (!$memcache->delete($key)) {
+ if ($debug) ADOConnection::outp("CacheFlush:
$key entery doesn't exist on memcached server!<br>\n");
+ } else {
+ if ($debug) ADOConnection::outp("CacheFlush:
$key entery flushed from memcached server!<br>\n");
+ }
+ } else {
+ if (!$memcache->flush()) {
+ if ($debug) ADOConnection::outp("CacheFlush:
Failure flushing all enteries from memcached server!<br>\n");
+ } else {
+ if ($debug) ADOConnection::outp("CacheFlush:
All enteries flushed from memcached server!<br>\n");
+ }
+ }
+ return;
+ }
+?>
Index: docs/docs-session.old.htm
===================================================================
RCS file: docs/docs-session.old.htm
diff -N docs/docs-session.old.htm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ docs/docs-session.old.htm 29 Aug 2006 08:00:49 -0000 1.1
@@ -0,0 +1,313 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <title>ADODB Old Session Management Manual</title>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+ <style type="text/css">
+body, td {
+/*font-family: Arial, Helvetica, sans-serif;*/
+font-size: 11pt;
+}
+pre {
+font-size: 9pt;
+background-color: #EEEEEE; padding: .5em; margin: 0px;
+}
+.toplink {
+font-size: 8pt;
+}
+ </style>
+</head>
+<body style="background-color: rgb(255, 255, 255);">
+<h3>ADODB Session Management Manual</h3>
+<p>
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my)
+</p>
+<p> <font size="1">This software is dual licensed using BSD-Style and
+LGPL. This means you can use it in compiled proprietary and commercial
+products. </font>
+<p>Useful ADOdb links: <a
href="http://adodb.sourceforge.net/#download">Download</a>
+ <a href="http://adodb.sourceforge.net/#docs">Other Docs</a>
+</p>
+<h3>Introduction</h3>
+<p>This documentation discusses the old adodb-session.php.
+Here is the <a href=docs-session.htm>new documentation</a> on the newer
adodb-session2.php.
+<p> We store state information specific to a user or web client in
+session variables. These session variables persist throughout a
+session, as the user moves from page to page. </p>
+<p>To use session variables, call session_start() at the beginning of
+your web page, before your HTTP headers are sent. Then for every
+variable you want to keep alive for the duration of the session, call
+session_register($variable_name). By default, the session handler will
+keep track of the session by using a cookie. You can save objects or
+arrays in session variables also.
+</p>
+<p>The default method of storing sessions is to store it in a file.
+However if you have special needs such as you:
+</p>
+<ul>
+ <li>Have multiple web servers that need to share session info</li>
+ <li>Need to do special processing of each session</li>
+ <li>Require notification when a session expires</li>
+</ul>
+<p>The ADOdb session handler provides you with the above
+additional capabilities by storing the session information as records
+in a database table that can be shared across multiple servers. </p>
+<p>These records will be garbage collected based on the php.ini [session]
timeout settings.
+You can register a notification function to notify you when the record has
expired and
+is about to be freed by the garbage collector.</p>
+<p><b>Important Upgrade Notice:</b> Since ADOdb 4.05, the session files
+have been moved to its own folder, adodb/session. This is a rewrite
+of the session code by Ross Smith. The old session code is in
+adodb/session/old. </p>
+<h4>ADOdb Session Handler Features</h4>
+<ul>
+ <li>Ability to define a notification function that is called when a
+session expires. Typically
+used to detect session logout and release global resources. </li>
+ <li>Optimization of database writes. We crc32 the session data and
+only perform an update
+to the session data if there is a data change. </li>
+ <li>Support for large amounts of session data with CLOBs (see
+adodb-session-clob.php). Useful
+for Oracle. </li>
+ <li>Support for encrypted session data, see
+adodb-cryptsession.php. Enabling encryption is simply a matter of
+including adodb-cryptsession.php instead of adodb-session.php. </li>
+</ul>
+<h3>Setup</h3>
+<p>There are 3 session management files that you can use:
+</p>
+<pre>adodb-session.php : The default<br>adodb-session-clob.php : Use
this if you are storing DATA in clobs<br>adodb-cryptsession.php : Use this if
you want to store encrypted session data in the database<br><br>
+</pre>
+<p><strong>Examples</strong>
+<p><pre>
+ <font
+ color="#004040"> include('adodb/adodb.inc.php');<br> <br><b>
$ADODB_SESSION_DRIVER='mysql';<br> $ADODB_SESSION_CONNECT='localhost';<br>
$ADODB_SESSION_USER ='scott';<br> $ADODB_SESSION_PWD ='tiger';<br>
$ADODB_SESSION_DB ='sessiondb';</b><br> <br>
<b>include('adodb/session/adodb-session.php');</b><br> session_start();<br>
<br> #<br> # Test session vars, the following should increment on
refresh<br> #<br> $_SESSION['AVAR'] += 1;<br> print
"<p>\$_SESSION['AVAR']={$_SESSION['AVAR']}</p>";<br></font></pre>
+
+<p>To force non-persistent connections, call adodb_session_open() first before
session_start():
+<p>
+ <pre>
+ <font color="#004040"><br> include('adodb/adodb.inc.php');<br> <br><b>
$ADODB_SESSION_DRIVER='mysql';<br> $ADODB_SESSION_CONNECT='localhost';<br>
$ADODB_SESSION_USER ='scott';<br> $ADODB_SESSION_PWD ='tiger';<br>
$ADODB_SESSION_DB ='sessiondb';</b><br> <br>
<b>include('adodb/session/adodb-session.php');<br>
adodb_sess_open(false,false,false);</b><br> session_start();<br> </font>
+ </pre>
+<p> The 3rd parameter to adodb_sess_open($path, $sessname, $connectMode) sets
the connection method. You can pass in the following:</p>
+<table width="50%" border="1">
+ <tr>
+ <td><b>$connectMode</b></td>
+ <td><b>Connection Method</b></td>
+ </tr>
+ <tr>
+ <td>true</td>
+ <td><p>PConnect( )</p></td>
+ </tr>
+ <tr>
+ <td>false</td>
+ <td>Connect( )</td>
+ </tr>
+ <tr>
+ <td>'N'</td>
+ <td>NConnect( )</td>
+ </tr>
+ <tr>
+ <td>'P'</td>
+ <td>PConnect( )</td>
+ </tr>
+ <tr>
+ <td>'C'</td>
+ <td>Connect( )</td>
+ </tr>
+</table>
+<p>To use a encrypted sessions, simply replace the file adodb-session.php:</p>
+ <pre> <font
+ color="#004040"><br> include('adodb/adodb.inc.php');<br> <br><b>
$ADODB_SESSION_DRIVER='mysql';<br> $ADODB_SESSION_CONNECT='localhost';<br>
$ADODB_SESSION_USER ='scott';<br> $ADODB_SESSION_PWD ='tiger';<br>
$ADODB_SESSION_DB ='sessiondb';<br> <br>
include('adodb/session/adodb-cryptsession.php');</b><br>
session_start();</font><br>
+ </pre>
+ <p>And the same technique for adodb-session-clob.php:</p>
+ <pre> <font
+ color="#004040"><br> include('adodb/adodb.inc.php');<br> <br><b>
$ADODB_SESSION_DRIVER='mysql';<br> $ADODB_SESSION_CONNECT='localhost';<br>
$ADODB_SESSION_USER ='scott';<br> $ADODB_SESSION_PWD ='tiger';<br>
$ADODB_SESSION_DB ='sessiondb';<br> <br>
include('adodb/session/adodb-session-clob.php');</b><br>
session_start();</font>
+ </pre>
+ <p>An alternative way to set persistant or non-persistent connections is to
call the following function before session_start() is called.
+ <pre>
+ ADODB_Session::persist('P'); # 'C' for non-persistent connections
+ </pre>
+ <h4>Installation</h4>
+<p>1. Create this table in your database (MySQL syntax):
+<p><pre> <a
+ name="sessiontab"></a> <font color="#004040">
+ create table sessions (
+ SESSKEY char(32) not null,
+ EXPIRY int(11) unsigned not null,
+ EXPIREREF varchar(64),
+ DATA text not null,
+ primary key (sesskey)
+ );</font>
+ </pre>
+
+ <p>You may want to rename the 'data' field to 'session_data' as
+ 'data' appears to be a reserved word for one or more of the following:
+ <ul>
+ <li> ANSI SQL
+ <li> IBM DB2
+ <li> MS SQL Server
+ <li> Postgres
+ <li> SAP
+ </ul>
+<p>
+ If you do, then execute:
+<pre>
+ ADODB_Session::dataFieldName('session_data');
+</pre>
+ <p> For the adodb-session-clob.php version, create this:
+<p> <pre>
+ <font
+ color="#004040"><br> create table sessions (<br> SESSKEY char(32)
not null,<br> EXPIRY int(11) unsigned not null,<br> EXPIREREF
varchar(64),<br> DATA CLOB,<br> primary key (sesskey)<br> );</font>
+ </pre>
+ <p>2. Then define the following parameters. You can either modify this file,
or define them before this file is included:
+ <pre> <font
+ color="#004040"><br> $ADODB_SESSION_DRIVER='database driver, eg. mysql or
ibase';<br> $ADODB_SESSION_CONNECT='server to connect to';<br>
$ADODB_SESSION_USER ='user';<br> $ADODB_SESSION_PWD ='password';<br>
$ADODB_SESSION_DB ='database';<br> $ADODB_SESSION_TBL = 'sessions'; #
setting this is optional<br> </font>
+ </pre><p>
+ When the session is created, $<b>ADODB_SESS_CONN</b> holds the connection
object.<br> <br> 3. Recommended is PHP 4.0.6 or later. There are documented
session bugs in earlier versions of PHP.
+<h3>Notifications</h3>
+<p>You can receive notification when your session is cleaned up by the session
garbage collector or
+when you call session_destroy().
+<p>PHP's session extension will automatically run a special garbage collection
function based on
+your php.ini session.cookie_lifetime and session.gc_probability settings. This
will in turn call
+adodb's garbage collection function, which can be setup to do notification.
+<p>
+<pre>
+ PHP Session --> ADOdb Session --> Find all recs --> Send -->
Delete queued
+ GC Function GC Function to be deleted notification
records
+ executed at called by for all recs
+ random time Session Extension queued for
deletion
+</pre>
+<p>When a session is created, we need to store a value in the session record
(in the EXPIREREF field), typically
+the userid of the session. Later when the session has expired, just before
the record is deleted,
+we reload the EXPIREREF field and call the notification function with the
value of EXPIREREF, which
+is the userid of the person being logged off.
+<p>ADOdb uses a global variable $ADODB_SESSION_EXPIRE_NOTIFY that you must
predefine before session
+start to store the notification configuration.
+$ADODB_SESSION_EXPIRE_NOTIFY is an array with 2 elements, the
+first being the name of the session variable you would like to store in
+the EXPIREREF field, and the 2nd is the notification function's name. </p>
+<p>For example, suppose we want to be notified when a user's session has
expired,
+based on the userid. When the user logs in, we store the id in the global
session variable
+$USERID. The function name is 'NotifyFn'.
+<p>
+So we define (before session_start() is called): </p>
+<pre> <font color="#004040">
+ $ADODB_SESSION_EXPIRE_NOTIFY = array('USERID','NotifyFn');
+</font></pre>
+And when the NotifyFn is called (when the session expires), the
+$USERID is passed in as the first parameter, eg. NotifyFn($userid, $sesskey).
The
+session key (which is the primary key of the record in the sessions
+table) is the 2nd parameter.
+<p> Here is an example of a Notification function that deletes some
+records in the database and temporary files: </p>
+<pre><font color="#004040">
+ function NotifyFn($expireref, $sesskey)
+ {
+ global $ADODB_SESS_CONN; # the session connection object
+ $user = $ADODB_SESS_CONN->qstr($expireref);
+
+ $ADODB_SESS_CONN->Execute("delete from shopping_cart where
user=$user");
+ system("rm /work/tmpfiles/$expireref/*");
+ }</font>
+ </pre>
+<p> NOTE 1: If you have register_globals disabled in php.ini, then you
+will have to manually set the EXPIREREF. E.g. </p>
+<pre> <font color="#004040">
+$GLOBALS['USERID'] = GetUserID();
+$ADODB_SESSION_EXPIRE_NOTIFY = array('USERID','NotifyFn');</font>
+</pre>
+<p> NOTE 2: If you want to change the EXPIREREF after the session
+record has been created, you will need to modify any session variable
+to force a database record update.
+</p>
+<h4>Neat Notification Tricks</h4>
+<p><i>ExpireRef</i> normally holds the user id of the current session.
+</p>
+<p>1. You can then write a session monitor, scanning expireref to see
+who is currently logged on.
+</p>
+<p>2. If you delete the sessions record for a specific user, eg.
+</p>
+<pre>delete from sessions where expireref = '$USER'<br></pre>
+then the user is logged out. Useful for ejecting someone from a
+site.
+<p>3. You can scan the sessions table to ensure no user
+can be logged in twice. Useful for security reasons.
+</p>
+<h3>Using Oracle CLOBs</h3>
+<p>Suppose you are storing the DATA field in a CLOB:
+ <pre><font color="#004040">
+ CREATE TABLE sessions (
+ SESSKEY VARCHAR(32) NOT NULL,
+ EXPIRY NUMBER(16) NOT NULL,
+ EXPIREREF VARCHAR(64),
+ DATA CLOB,
+ PRIMARY KEY (sesskey)
+ );</font>
+ </pre>
+ <p>Then your PHP code could look like this:
+ <pre>
+ ADODB_SESSION_DRIVER='oci8';
+ $ADODB_SESSION_CONNECT=$tnsname;
+ $ADODB_SESSION_USER ='scott';
+ $ADODB_SESSION_PWD = 'tiger';
+ $ADODB_SESSION_DB ='';
+
+ $ADODB_SESSION_USE_LOBS = 'clob';
+ $ADODB_SESSION_TBL = 'sessions';
+
+ $ADODB_SESS_DEBUG=0;
+
+ include(ADODB_DIR.'/session/adodb-session.php');
+
+ ADODB_Session::persist('P'); # use 'C' for non-persistent connects
+
+ session_start();
+ </pre>
+ <p>Note that you can set persistance using ADODB_Session::persist('P').
+
+<h3>Compression/Encryption Schemes</h3>
+Since ADOdb 4.05, thanks to Ross Smith, multiple encryption and
+compression schemes are supported. Currently, supported are:
+<p>
+<pre> MD5Crypt (crypt.inc.php)<br> MCrypt<br> Secure (Horde's emulation of
MCrypt, if MCrypt module is not available.)<br> GZip<br> BZip2<br></pre>
+<p>These are stackable. E.g.
+<p><pre>ADODB_Session::filter(new
ADODB_Compress_Bzip2());<br>ADODB_Session::filter(new
ADODB_Encrypt_MD5());<br></pre>
+will compress and then encrypt the record in the database.
+<h3>adodb_session_regenerate_id()</h3>
+<p>Dynamically change the current session id with a newly generated one and
update database. Currently only
+works with cookies. Useful to improve security by reducing the risk of
session-hijacking.
+See this article on <a
href=http://shiflett.org/articles/security-corner-feb2004>Session Fixation</a>
for more info
+on the theory behind this feature. Usage:
+<pre>
+ $ADODB_SESSION_DRIVER='mysql';
+ $ADODB_SESSION_CONNECT='localhost';
+ $ADODB_SESSION_USER ='root';
+ $ADODB_SESSION_PWD ='abc';
+ $ADODB_SESSION_DB ='phplens';
+
+ include('path/to/adodb/session/adodb-session.php');
+
+ session_start();
+ # Every 10 page loads, reset cookie for safety.
+ # This is extremely simplistic example, better
+ # to regenerate only when the user logs in or changes
+ # user privilege levels.
+ if ((rand()%10) == 0) adodb_session_regenerate_id();
+</pre>
+<p>This function calls session_regenerate_id() internally or simulates it if
the function does not exist.
+<h3>Vacuum/Optimize Database</h3>
+<p>During session garbage collection, if postgresql is detected,
+ ADOdb can be set to run VACUUM. If mysql is detected, then optimize database
+ could be called.You can turn this on or off using:</p>
+<pre>$turnOn = true; # or false
+ADODB_Session::optimize($turnOn);
+</pre>
+<p>The default for optimization is it is disabled.</p>
+<h2>More Info</h2>
+<p>Also see the <a href="docs-adodb.htm">core ADOdb documentation</a>.
+</p>
+</body>
+</html>
Index: session/adodb-cryptsession2.php
===================================================================
RCS file: session/adodb-cryptsession2.php
diff -N session/adodb-cryptsession2.php
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ session/adodb-cryptsession2.php 29 Aug 2006 08:00:50 -0000 1.1
@@ -0,0 +1,27 @@
+<?php
+
+
+/*
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ Contributed by Ross Smith (address@hidden).
+ Released under both BSD license and Lesser GPL library license.
+ Whenever there is any discrepancy between the two licenses,
+ the BSD license will take precedence.
+ Set tabs to 4 for best viewing.
+*/
+
+/*
+
+This file is provided for backwards compatibility purposes
+
+*/
+
+if (!defined('ADODB_SESSION')) {
+ require_once dirname(__FILE__) . '/adodb-session2.php';
+}
+
+require_once ADODB_SESSION . '/adodb-encrypt-md5.php';
+
+ADODB_Session::filter(new ADODB_Encrypt_MD5());
+
+?>
\ No newline at end of file
Index: session/adodb-session-clob2.php
===================================================================
RCS file: session/adodb-session-clob2.php
diff -N session/adodb-session-clob2.php
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ session/adodb-session-clob2.php 29 Aug 2006 08:00:50 -0000 1.1
@@ -0,0 +1,24 @@
+<?php
+
+
+/*
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ Contributed by Ross Smith (address@hidden).
+ Released under both BSD license and Lesser GPL library license.
+ Whenever there is any discrepancy between the two licenses,
+ the BSD license will take precedence.
+ Set tabs to 4 for best viewing.
+*/
+
+/*
+
+This file is provided for backwards compatibility purposes
+
+*/
+
+if (!defined('ADODB_SESSION')) {
+ require_once dirname(__FILE__) . '/adodb-session2.php';
+}
+ADODB_Session::clob('CLOB');
+
+?>
\ No newline at end of file
Index: session/adodb-session2.php
===================================================================
RCS file: session/adodb-session2.php
diff -N session/adodb-session2.php
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ session/adodb-session2.php 29 Aug 2006 08:00:50 -0000 1.1
@@ -0,0 +1,941 @@
+<?php
+
+
+/*
+V4.92 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights
reserved.
+ Contributed by Ross Smith (address@hidden).
+ Released under both BSD license and Lesser GPL library license.
+ Whenever there is any discrepancy between the two licenses,
+ the BSD license will take precedence.
+ Set tabs to 4 for best viewing.
+
+
+*/
+
+/*
+
+CREATE Table SCripts
+
+Oracle
+======
+
+CREATE TABLE SESSIONS2
+(
+ SESSKEY VARCHAR2(48 BYTE) NOT NULL,
+ EXPIRY DATE NOT NULL,
+ EXPIREREF VARCHAR2(200 BYTE),
+ CREATED DATE NOT NULL,
+ MODIFIED DATE NOT NULL,
+ SESSDATA CLOB,
+ PRIMARY KEY(SESSKEY)
+);
+
+
+CREATE INDEX SESS2_EXPIRY ON SESSIONS2(EXPIRY);
+CREATE UNIQUE INDEX SESS2_PK ON SESSIONS2(SESSKEY);
+CREATE INDEX SESS2_EXP_REF ON SESSIONS2(EXPIREREF);
+
+
+
+ MySQL
+ =====
+
+CREATE TABLE sessions2(
+ sesskey VARCHAR( 64 ) NOT NULL DEFAULT '',
+ expiry TIMESTAMP NOT NULL ,
+ expireref VARCHAR( 250 ) DEFAULT '',
+ created TIMESTAMP NOT NULL ,
+ modified TIMESTAMP NOT NULL ,
+ sessdata LONGTEXT DEFAULT '',
+ PRIMARY KEY ( sesskey ) ,
+ INDEX sess2_expiry( expiry ),
+ INDEX sess2_expireref( expireref )
+)
+
+
+*/
+
+if (!defined('_ADODB_LAYER')) {
+ require realpath(dirname(__FILE__) . '/../adodb.inc.php');
+}
+
+if (defined('ADODB_SESSION')) return 1;
+
+define('ADODB_SESSION', dirname(__FILE__));
+define('ADODB_SESSION2', ADODB_SESSION);
+
+/*
+ Unserialize session data manually. See
http://phplens.com/lens/lensforum/msgs.php?id=9821
+
+ From Kerr Schere, to unserialize session data stored via ADOdb.
+ 1. Pull the session data from the db and loop through it.
+ 2. Inside the loop, you will need to urldecode the data column.
+ 3. After urldecode, run the serialized string through this function:
+
+*/
+function adodb_unserialize( $serialized_string )
+{
+ $variables = array( );
+ $a = preg_split( "/(\w+)\|/", $serialized_string, -1,
PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
+ for( $i = 0; $i < count( $a ); $i = $i+2 ) {
+ $variables[$a[$i]] = unserialize( $a[$i+1] );
+ }
+ return( $variables );
+}
+
+/*
+ Thanks Joe Li. See
http://phplens.com/lens/lensforum/msgs.php?id=11487&x=1
+ Since adodb 4.61.
+*/
+function adodb_session_regenerate_id()
+{
+ $conn =& ADODB_Session::_conn();
+ if (!$conn) return false;
+
+ $old_id = session_id();
+ if (function_exists('session_regenerate_id')) {
+ session_regenerate_id();
+ } else {
+ session_id(md5(uniqid(rand(), true)));
+ $ck = session_get_cookie_params();
+ setcookie(session_name(), session_id(), false, $ck['path'],
$ck['domain'], $ck['secure']);
+ //@session_start();
+ }
+ $new_id = session_id();
+ $ok =& $conn->Execute('UPDATE '. ADODB_Session::table(). ' SET
sesskey='. $conn->qstr($new_id). ' WHERE sesskey='.$conn->qstr($old_id));
+
+ /* it is possible that the update statement fails due to a collision */
+ if (!$ok) {
+ session_id($old_id);
+ if (empty($ck)) $ck = session_get_cookie_params();
+ setcookie(session_name(), session_id(), false, $ck['path'],
$ck['domain'], $ck['secure']);
+ return false;
+ }
+
+ return true;
+}
+
+/*
+ Generate database table for session data
+ @see http://phplens.com/lens/lensforum/msgs.php?id=12280
+ @return 0 if failure, 1 if errors, 2 if successful.
+ @author Markus Staab http://www.public-4u.de
+*/
+function adodb_session_create_table($schemaFile=null,$conn = null)
+{
+ // set default values
+ if ($schemaFile===null) $schemaFile = ADODB_SESSION .
'/session_schema2.xml';
+ if ($conn===null) $conn =& ADODB_Session::_conn();
+
+ if (!$conn) return 0;
+
+ $schema = new adoSchema($conn);
+ $schema->ParseSchema($schemaFile);
+ return $schema->ExecuteSchema();
+}
+
+/*!
+ \static
+*/
+class ADODB_Session {
+ /////////////////////
+ // getter/setter methods
+ /////////////////////
+
+ /*
+
+ function Lock($lock=null)
+ {
+ static $_lock = false;
+
+ if (!is_null($lock)) $_lock = $lock;
+ return $lock;
+ }
+ */
+ /*!
+ */
+ function driver($driver = null)
+ {
+ static $_driver = 'mysql';
+ static $set = false;
+
+ if (!is_null($driver)) {
+ $_driver = trim($driver);
+ $set = true;
+ } elseif (!$set) {
+ // backwards compatibility
+ if (isset($GLOBALS['ADODB_SESSION_DRIVER'])) {
+ return $GLOBALS['ADODB_SESSION_DRIVER'];
+ }
+ }
+
+ return $_driver;
+ }
+
+ /*!
+ */
+ function host($host = null) {
+ static $_host = 'localhost';
+ static $set = false;
+
+ if (!is_null($host)) {
+ $_host = trim($host);
+ $set = true;
+ } elseif (!$set) {
+ // backwards compatibility
+ if (isset($GLOBALS['ADODB_SESSION_CONNECT'])) {
+ return $GLOBALS['ADODB_SESSION_CONNECT'];
+ }
+ }
+
+ return $_host;
+ }
+
+ /*!
+ */
+ function user($user = null)
+ {
+ static $_user = 'root';
+ static $set = false;
+
+ if (!is_null($user)) {
+ $_user = trim($user);
+ $set = true;
+ } elseif (!$set) {
+ // backwards compatibility
+ if (isset($GLOBALS['ADODB_SESSION_USER'])) {
+ return $GLOBALS['ADODB_SESSION_USER'];
+ }
+ }
+
+ return $_user;
+ }
+
+ /*!
+ */
+ function password($password = null)
+ {
+ static $_password = '';
+ static $set = false;
+
+ if (!is_null($password)) {
+ $_password = $password;
+ $set = true;
+ } elseif (!$set) {
+ // backwards compatibility
+ if (isset($GLOBALS['ADODB_SESSION_PWD'])) {
+ return $GLOBALS['ADODB_SESSION_PWD'];
+ }
+ }
+
+ return $_password;
+ }
+
+ /*!
+ */
+ function database($database = null)
+ {
+ static $_database = '';
+ static $set = false;
+
+ if (!is_null($database)) {
+ $_database = trim($database);
+ $set = true;
+ } elseif (!$set) {
+ // backwards compatibility
+ if (isset($GLOBALS['ADODB_SESSION_DB'])) {
+ return $GLOBALS['ADODB_SESSION_DB'];
+ }
+ }
+ return $_database;
+ }
+
+ /*!
+ */
+ function persist($persist = null)
+ {
+ static $_persist = true;
+
+ if (!is_null($persist)) {
+ $_persist = trim($persist);
+ }
+
+ return $_persist;
+ }
+
+ /*!
+ */
+ function lifetime($lifetime = null)
+ {
+ static $_lifetime;
+ static $set = false;
+
+ if (!is_null($lifetime)) {
+ $_lifetime = (int) $lifetime;
+ $set = true;
+ } elseif (!$set) {
+ // backwards compatibility
+ if (isset($GLOBALS['ADODB_SESS_LIFE'])) {
+ return $GLOBALS['ADODB_SESS_LIFE'];
+ }
+ }
+ if (!$_lifetime) {
+ $_lifetime = ini_get('session.gc_maxlifetime');
+ if ($_lifetime <= 1) {
+ // bug in PHP 4.0.3 pl 1 -- how about other
versions?
+ //print "<h3>Session Error: PHP.INI setting
<i>session.gc_maxlifetime</i>not set: $lifetime</h3>";
+ $_lifetime = 1440;
+ }
+ }
+
+ return $_lifetime;
+ }
+
+ /*!
+ */
+ function debug($debug = null)
+ {
+ static $_debug = false;
+ static $set = false;
+
+ if (!is_null($debug)) {
+ $_debug = (bool) $debug;
+
+ $conn = ADODB_Session::_conn();
+ if ($conn) {
+ $conn->debug = $_debug;
+ }
+ $set = true;
+ } elseif (!$set) {
+ // backwards compatibility
+ if (isset($GLOBALS['ADODB_SESS_DEBUG'])) {
+ return $GLOBALS['ADODB_SESS_DEBUG'];
+ }
+ }
+
+ return $_debug;
+ }
+
+ /*!
+ */
+ function expireNotify($expire_notify = null)
+ {
+ static $_expire_notify;
+ static $set = false;
+
+ if (!is_null($expire_notify)) {
+ $_expire_notify = $expire_notify;
+ $set = true;
+ } elseif (!$set) {
+ // backwards compatibility
+ if (isset($GLOBALS['ADODB_SESSION_EXPIRE_NOTIFY'])) {
+ return $GLOBALS['ADODB_SESSION_EXPIRE_NOTIFY'];
+ }
+ }
+
+ return $_expire_notify;
+ }
+
+ /*!
+ */
+ function table($table = null)
+ {
+ static $_table = 'sessions2';
+ static $set = false;
+
+ if (!is_null($table)) {
+ $_table = trim($table);
+ $set = true;
+ } elseif (!$set) {
+ // backwards compatibility
+ if (isset($GLOBALS['ADODB_SESSION_TBL'])) {
+ return $GLOBALS['ADODB_SESSION_TBL'];
+ }
+ }
+
+ return $_table;
+ }
+
+ /*!
+ */
+ function optimize($optimize = null)
+ {
+ static $_optimize = false;
+ static $set = false;
+
+ if (!is_null($optimize)) {
+ $_optimize = (bool) $optimize;
+ $set = true;
+ } elseif (!$set) {
+ // backwards compatibility
+ if (defined('ADODB_SESSION_OPTIMIZE')) {
+ return true;
+ }
+ }
+
+ return $_optimize;
+ }
+
+ /*!
+ */
+ function syncSeconds($sync_seconds = null) {
+ //echo ("<p>WARNING: ADODB_SESSION::syncSeconds is longer used,
please remove this function for your code</p>");
+
+ return 0;
+ }
+
+ /*!
+ */
+ function clob($clob = null) {
+ static $_clob = false;
+ static $set = false;
+
+ if (!is_null($clob)) {
+ $_clob = strtolower(trim($clob));
+ $set = true;
+ } elseif (!$set) {
+ // backwards compatibility
+ if (isset($GLOBALS['ADODB_SESSION_USE_LOBS'])) {
+ return $GLOBALS['ADODB_SESSION_USE_LOBS'];
+ }
+ }
+
+ return $_clob;
+ }
+
+ /*!
+ */
+ function dataFieldName($data_field_name = null) {
+ //echo ("<p>WARNING: ADODB_SESSION::dataFieldName() is longer
used, please remove this function for your code</p>");
+ return '';
+ }
+
+ /*!
+ */
+ function filter($filter = null) {
+ static $_filter = array();
+
+ if (!is_null($filter)) {
+ if (!is_array($filter)) {
+ $filter = array($filter);
+ }
+ $_filter = $filter;
+ }
+
+ return $_filter;
+ }
+
+ /*!
+ */
+ function encryptionKey($encryption_key = null) {
+ static $_encryption_key = 'CRYPTED ADODB SESSIONS ROCK!';
+
+ if (!is_null($encryption_key)) {
+ $_encryption_key = $encryption_key;
+ }
+
+ return $_encryption_key;
+ }
+
+ /////////////////////
+ // private methods
+ /////////////////////
+
+ /*!
+ */
+ function &_conn($conn=null) {
+ return $GLOBALS['ADODB_SESS_CONN'];
+ }
+
+ /*!
+ */
+ function _crc($crc = null) {
+ static $_crc = false;
+
+ if (!is_null($crc)) {
+ $_crc = $crc;
+ }
+
+ return $_crc;
+ }
+
+ /*!
+ */
+ function _init() {
+ session_module_name('user');
+ session_set_save_handler(
+ array('ADODB_Session', 'open'),
+ array('ADODB_Session', 'close'),
+ array('ADODB_Session', 'read'),
+ array('ADODB_Session', 'write'),
+ array('ADODB_Session', 'destroy'),
+ array('ADODB_Session', 'gc')
+ );
+ }
+
+
+ /*!
+ */
+ function _sessionKey() {
+ // use this function to create the encryption key for crypted
sessions
+ // crypt the used key, ADODB_Session::encryptionKey() as key
and session_id() as salt
+ return crypt(ADODB_Session::encryptionKey(), session_id());
+ }
+
+ /*!
+ */
+ function _dumprs($rs) {
+ $conn =& ADODB_Session::_conn();
+ $debug = ADODB_Session::debug();
+
+ if (!$conn) {
+ return;
+ }
+
+ if (!$debug) {
+ return;
+ }
+
+ if (!$rs) {
+ echo "<br />\$rs is null or false<br />\n";
+ return;
+ }
+
+ //echo "<br />\nAffected_Rows=",$conn->Affected_Rows(),"<br
/>\n";
+
+ if (!is_object($rs)) {
+ return;
+ }
+
+ require_once ADODB_SESSION.'/../tohtml.inc.php';
+ rs2html($rs);
+ }
+
+ /////////////////////
+ // public methods
+ /////////////////////
+
+ function config($driver, $host, $user, $password,
$database=false,$options=false)
+ {
+ ADODB_Session::driver($driver);
+ ADODB_Session::host($host);
+ ADODB_Session::user($user);
+ ADODB_Session::password($password);
+ ADODB_Session::database($database);
+
+ if ($driver == 'oci8' || $driver == 'oci8po') $options['lob'] =
'CLOB';
+
+ if (isset($options['table']))
ADODB_Session::table($options['table']);
+ if (isset($options['lob']))
ADODB_Session::clob($options['lob']);
+ if (isset($options['debug']))
ADODB_Session::debug($options['debug']);
+ }
+
+ /*!
+ Create the connection to the database.
+
+ If $conn already exists, reuse that connection
+ */
+ function open($save_path, $session_name, $persist = null)
+ {
+ $conn =& ADODB_Session::_conn();
+
+ if ($conn) {
+ return true;
+ }
+
+ $database = ADODB_Session::database();
+ $debug = ADODB_Session::debug();
+ $driver = ADODB_Session::driver();
+ $host = ADODB_Session::host();
+ $password = ADODB_Session::password();
+ $user = ADODB_Session::user();
+
+ if (!is_null($persist)) {
+ ADODB_Session::persist($persist);
+ } else {
+ $persist = ADODB_Session::persist();
+ }
+
+# these can all be defaulted to in php.ini
+# assert('$database');
+# assert('$driver');
+# assert('$host');
+
+ $conn =& ADONewConnection($driver);
+
+ if ($debug) {
+ $conn->debug = true;
+ ADOConnection::outp( " driver=$driver user=$user
db=$database ");
+ }
+
+ if ($persist) {
+ switch($persist) {
+ default:
+ case 'P': $ok = $conn->PConnect($host, $user,
$password, $database); break;
+ case 'C': $ok = $conn->Connect($host, $user, $password,
$database); break;
+ case 'N': $ok = $conn->NConnect($host, $user,
$password, $database); break;
+ }
+ } else {
+ $ok = $conn->Connect($host, $user, $password,
$database);
+ }
+
+ if ($ok) $GLOBALS['ADODB_SESS_CONN'] =& $conn;
+ else
+ ADOConnection::outp('<p>Session: connection
failed</p>', false);
+
+
+ return $ok;
+ }
+
+ /*!
+ Close the connection
+ */
+ function close()
+ {
+/*
+ $conn =& ADODB_Session::_conn();
+ if ($conn) $conn->Close();
+*/
+ return true;
+ }
+
+ /*
+ Slurp in the session variables and return the serialized string
+ */
+ function read($key)
+ {
+ $conn =& ADODB_Session::_conn();
+ $filter = ADODB_Session::filter();
+ $table = ADODB_Session::table();
+
+ if (!$conn) {
+ return '';
+ }
+
+ //assert('$table');
+
+ $qkey = $conn->quote($key);
+ $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' :
'';
+
+ $sql = "SELECT sessdata FROM $table WHERE sesskey = $binary
$qkey AND expiry >= " . $conn->sysTimeStamp;
+ /* Lock code does not work as it needs to hold transaction
within whole page, and we don't know if
+ developer has commited elsewhere... :(
+ */
+ #if (ADODB_Session::Lock())
+ # $rs =& $conn->RowLock($table, "$binary sesskey = $qkey
AND expiry >= " . time(), sessdata);
+ #else
+
+ $rs =& $conn->Execute($sql);
+ //ADODB_Session::_dumprs($rs);
+ if ($rs) {
+ if ($rs->EOF) {
+ $v = '';
+ } else {
+ $v = reset($rs->fields);
+ $filter = array_reverse($filter);
+ foreach ($filter as $f) {
+ if (is_object($f)) {
+ $v = $f->read($v,
ADODB_Session::_sessionKey());
+ }
+ }
+ $v = rawurldecode($v);
+ }
+
+ $rs->Close();
+
+ ADODB_Session::_crc(strlen($v) . crc32($v));
+ return $v;
+ }
+
+ return '';
+ }
+
+ /*!
+ Write the serialized data to a database.
+
+ If the data has not been modified since the last read(), we do
not write.
+ */
+ function write($key, $val)
+ {
+ global $ADODB_SESSION_READONLY;
+
+ if (!empty($ADODB_SESSION_READONLY)) return;
+
+ $clob = ADODB_Session::clob();
+ $conn =& ADODB_Session::_conn();
+ $crc = ADODB_Session::_crc();
+ $debug = ADODB_Session::debug();
+ $driver = ADODB_Session::driver();
+ $expire_notify = ADODB_Session::expireNotify();
+ $filter = ADODB_Session::filter();
+ $lifetime = ADODB_Session::lifetime();
+ $table = ADODB_Session::table();
+
+ if (!$conn) {
+ return false;
+ }
+
+ $sysTimeStamp = $conn->sysTimeStamp;
+
+ //assert('$table');
+
+ $expiry = $conn->OffsetDate($lifetime/(24*3600),$sysTimeStamp);
+
+ $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' :
'';
+
+ // crc32 optimization since adodb 2.1
+ // now we only update expiry date, thx to sebastian thom in
adodb 2.32
+ if ($crc !== false && $crc == (strlen($val) . crc32($val))) {
+ if ($debug) {
+ echo '<p>Session: Only updating date - crc32
not changed</p>';
+ }
+
+ $expirevar = '';
+ if ($expire_notify) {
+ $var = reset($expire_notify);
+ global $$var;
+ if (isset($$var)) {
+ $expirevar = $$var;
+ }
+ }
+
+
+ $sql = "UPDATE $table SET expiry = $expiry
,expireref=".$conn->Param('0').", modified = $sysTimeStamp WHERE $binary
sesskey = ".$conn->Param('1')." AND expiry >= $sysTimeStamp";
+ $rs =& $conn->Execute($sql,array($expirevar,$key));
+ return true;
+ }
+ $val = rawurlencode($val);
+ foreach ($filter as $f) {
+ if (is_object($f)) {
+ $val = $f->write($val,
ADODB_Session::_sessionKey());
+ }
+ }
+
+ $expireref = '';
+ if ($expire_notify) {
+ $var = reset($expire_notify);
+ global $$var;
+ if (isset($$var)) {
+ $expireref = $$var;
+ }
+ }
+
+ if (!$clob) { // no lobs, simply use replace()
+ $rs =& $conn->Execute("SELECT COUNT(*) AS cnt FROM
$table WHERE $binary sesskey = ".$conn->Param(0),array($key));
+ if ($rs) $rs->Close();
+
+ if ($rs && reset($rs->fields) > 0) {
+ $sql = "UPDATE $table SET expiry=$expiry,
sessdata=".$conn->Param(0).", expireref=
".$conn->Param(1).",modified=$sysTimeStamp WHERE sesskey = ".$conn->Param('2');
+
+ } else {
+ $sql = "INSERT INTO $table (expiry, sessdata,
expireref, sesskey, created, modified)
+ VALUES ($expiry,".$conn->Param('0').",
". $conn->Param('1').", ".$conn->Param('2').", $sysTimeStamp, $sysTimeStamp)";
+ }
+
+
+ $rs =& $conn->Execute($sql,array($val,$expireref,$key));
+
+ } else {
+ // what value shall we insert/update for lob row?
+ switch ($driver) {
+ // empty_clob or empty_lob for oracle dbs
+ case 'oracle':
+ case 'oci8':
+ case 'oci8po':
+ case 'oci805':
+ $lob_value = sprintf('empty_%s()',
strtolower($clob));
+ break;
+
+ // null for all other
+ default:
+ $lob_value = 'null';
+ break;
+ }
+
+ $conn->StartTrans();
+
+ $rs =& $conn->Execute("SELECT COUNT(*) AS cnt FROM
$table WHERE $binary sesskey = ".$conn->Param(0),array($key));
+ if ($rs) $rs->Close();
+
+ if ($rs && reset($rs->fields) > 0) {
+ $sql = "UPDATE $table SET expiry=$expiry,
sessdata=$lob_value, expireref= ".$conn->Param(0).",modified=$sysTimeStamp
WHERE sesskey = ".$conn->Param('1');
+
+ } else {
+ $sql = "INSERT INTO $table (expiry, sessdata,
expireref, sesskey, created, modified)
+ VALUES ($expiry,$lob_value, ".
$conn->Param('0').", ".$conn->Param('1').", $sysTimeStamp, $sysTimeStamp)";
+ }
+
+ $rs =& $conn->Execute($sql,array($expireref,$key));
+
+ $qkey = $conn->qstr($key);
+ $rs2 =& $conn->UpdateBlob($table, 'sessdata', $val, "
sesskey=$qkey", strtoupper($clob));
+ $rs = $conn->CompleteTrans();
+
+
+ }
+
+ if (!$rs) {
+ ADOConnection::outp('<p>Session Replace: ' .
$conn->ErrorMsg() . '</p>', false);
+ return false;
+ } else {
+ // bug in access driver (could be odbc?) means that
info is not committed
+ // properly unless select statement executed in Win2000
+ if ($conn->databaseType == 'access') {
+ $sql = "SELECT sesskey FROM $table WHERE
$binary sesskey = $qkey";
+ $rs =& $conn->Execute($sql);
+ ADODB_Session::_dumprs($rs);
+ if ($rs) {
+ $rs->Close();
+ }
+ }
+ }/*
+ if (ADODB_Session::Lock()) {
+ $conn->CommitTrans();
+ }*/
+ return $rs ? true : false;
+ }
+
+ /*!
+ */
+ function destroy($key) {
+ $conn =& ADODB_Session::_conn();
+ $table = ADODB_Session::table();
+ $expire_notify = ADODB_Session::expireNotify();
+
+ if (!$conn) {
+ return false;
+ }
+
+ //assert('$table');
+
+ $qkey = $conn->quote($key);
+ $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' :
'';
+
+ if ($expire_notify) {
+ reset($expire_notify);
+ $fn = next($expire_notify);
+ $savem = $conn->SetFetchMode(ADODB_FETCH_NUM);
+ $sql = "SELECT expireref, sesskey FROM $table WHERE
$binary sesskey = $qkey";
+ $rs =& $conn->Execute($sql);
+ ADODB_Session::_dumprs($rs);
+ $conn->SetFetchMode($savem);
+ if (!$rs) {
+ return false;
+ }
+ if (!$rs->EOF) {
+ $ref = $rs->fields[0];
+ $key = $rs->fields[1];
+ //assert('$ref');
+ //assert('$key');
+ $fn($ref, $key);
+ }
+ $rs->Close();
+ }
+
+ $sql = "DELETE FROM $table WHERE $binary sesskey = $qkey";
+ $rs =& $conn->Execute($sql);
+ ADODB_Session::_dumprs($rs);
+ if ($rs) {
+ $rs->Close();
+ }
+
+ return $rs ? true : false;
+ }
+
+ /*!
+ */
+ function gc($maxlifetime)
+ {
+ $conn =& ADODB_Session::_conn();
+ $debug = ADODB_Session::debug();
+ $expire_notify = ADODB_Session::expireNotify();
+ $optimize = ADODB_Session::optimize();
+ $table = ADODB_Session::table();
+
+ if (!$conn) {
+ return false;
+ }
+
+ //assert('$table');
+
+ $time = $conn->sysTimeStamp;
+ $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' :
'';
+
+ if ($expire_notify) {
+ reset($expire_notify);
+ $fn = next($expire_notify);
+ $savem = $conn->SetFetchMode(ADODB_FETCH_NUM);
+ $sql = "SELECT expireref, sesskey FROM $table WHERE
expiry < $time";
+ $rs =& $conn->Execute($sql);
+ ADODB_Session::_dumprs($rs);
+ $conn->SetFetchMode($savem);
+ if ($rs) {
+ $conn->StartTrans();
+ $keys = array();
+ while (!$rs->EOF) {
+ $ref = $rs->fields[0];
+ $key = $rs->fields[1];
+ $fn($ref, $key);
+ $del = $conn->Execute("DELETE FROM
$table WHERE sesskey=".$conn->Param('0'),array($key));
+ $rs->MoveNext();
+ }
+ $rs->Close();
+
+ $conn->CompleteTrans();
+ }
+ } else {
+
+ if (0) {
+ $sql = "SELECT sesskey FROM $table WHERE expiry
< $time";
+ $arr =& $conn->GetAll($sql);
+ foreach ($arr as $row) {
+ $sql2 = "DELETE FROM $table WHERE
sesskey=".$conn->Param('0');
+ $conn->Execute($sql2,array($row[0]));
+ }
+ } else {
+ $sql = "DELETE FROM $table WHERE expiry <
$time";
+ $rs =& $conn->Execute($sql);
+ ADODB_Session::_dumprs($rs);
+ if ($rs) $rs->Close();
+ }
+ if ($debug) {
+ ADOConnection::outp("<p><b>Garbage
Collection</b>: $sql</p>");
+ }
+ }
+
+ // suggested by Cameron, "GaM3R" <address@hidden>
+ if ($optimize) {
+ $driver = ADODB_Session::driver();
+
+ if (preg_match('/mysql/i', $driver)) {
+ $sql = "OPTIMIZE TABLE $table";
+ }
+ if (preg_match('/postgres/i', $driver)) {
+ $sql = "VACUUM $table";
+ }
+ if (!empty($sql)) {
+ $conn->Execute($sql);
+ }
+ }
+
+
+ return true;
+ }
+}
+
+ADODB_Session::_init();
+if (empty($ADODB_SESSION_READONLY))
+ register_shutdown_function('session_write_close');
+
+// for backwards compatability only
+function adodb_sess_open($save_path, $session_name, $persist = true) {
+ return ADODB_Session::open($save_path, $session_name, $persist);
+}
+
+// for backwards compatability only
+function adodb_sess_gc($t)
+{
+ return ADODB_Session::gc($t);
+}
+
+?>
\ No newline at end of file
Index: session/session_schema2.xml
===================================================================
RCS file: session/session_schema2.xml
diff -N session/session_schema2.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ session/session_schema2.xml 29 Aug 2006 08:00:50 -0000 1.1
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<schema version="0.3">
+ <table name="sessions2">
+ <desc>table for ADOdb session-management</desc>
+
+ <field name="SESSKEY" type="C" size="64">
+ <descr>session key</descr>
+ <KEY/>
+ <NOTNULL/>
+ </field>
+
+
+
+ <field name="EXPIRY" type="T">
+ <descr></descr>
+ <NOTNULL/>
+ </field>
+
+ <field name="CREATED" type="T">
+ <descr></descr>
+ <NOTNULL/>
+ </field>
+
+ <field name="MODIFIED" type="T">
+ <descr></descr>
+ <NOTNULL/>
+ </field>
+
+ <field name="EXPIREREF" type="C" size="250">
+ <descr></descr>
+ </field>
+
+ <field name="DATA" type="XL">
+ <descr></descr>
+ <NOTNULL/>
+ </field>
+ </table>
+</schema>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] phpgwapi/inc/adodb adodb-active-record.inc.php ...,
Sigurd Nes <=