- // get next resultset - requires PHP 4.0.5 or later
- function NextRecordSet()
- {
- if (!mssql_next_result($this->_queryID)) return false;
- $this->_inited = false;
- $this->bind = false;
- $this->_currentRow = -1;
- $this->Init();
- return true;
- }
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- if ($this->fetchMode != ADODB_FETCH_NUM) return $this->fields[$colname];
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
-
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- /* Returns: an object containing field information.
- Get column information in the Recordset object. fetchField() can be used in order to obtain information about
- fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by
- fetchField() is retrieved. */
-
- function FetchField($fieldOffset = -1)
- {
- if ($fieldOffset != -1) {
- $f = @mssql_fetch_field($this->_queryID, $fieldOffset);
- }
- else if ($fieldOffset == -1) { /* The $fieldOffset argument is not provided thus its -1 */
- $f = @mssql_fetch_field($this->_queryID);
- }
- $false = false;
- if (empty($f)) return $false;
- return $f;
- }
-
- function _seek($row)
- {
- return @mssql_data_seek($this->_queryID, $row);
- }
-
- // speedup
- function MoveNext()
- {
- if ($this->EOF) return false;
-
- $this->_currentRow++;
-
- if ($this->fetchMode & ADODB_FETCH_ASSOC) {
- if ($this->fetchMode & ADODB_FETCH_NUM) {
- //ADODB_FETCH_BOTH mode
- $this->fields = @mssql_fetch_array($this->_queryID);
- }
- else {
- if ($this->hasFetchAssoc) {// only for PHP 4.2.0 or later
- $this->fields = @mssql_fetch_assoc($this->_queryID);
- } else {
- $flds = @mssql_fetch_array($this->_queryID);
- if (is_array($flds)) {
- $fassoc = array();
- foreach($flds as $k => $v) {
- if (is_numeric($k)) continue;
- $fassoc[$k] = $v;
- }
- $this->fields = $fassoc;
- } else
- $this->fields = false;
- }
- }
-
- if (is_array($this->fields)) {
- if (ADODB_ASSOC_CASE == 0) {
- foreach($this->fields as $k=>$v) {
- $kn = strtolower($k);
- if ($kn <> $k) {
- unset($this->fields[$k]);
- $this->fields[$kn] = $v;
- }
- }
- } else if (ADODB_ASSOC_CASE == 1) {
- foreach($this->fields as $k=>$v) {
- $kn = strtoupper($k);
- if ($kn <> $k) {
- unset($this->fields[$k]);
- $this->fields[$kn] = $v;
- }
- }
- }
- }
- } else {
- $this->fields = @mssql_fetch_row($this->_queryID);
- }
- if ($this->fields) return true;
- $this->EOF = true;
-
- return false;
- }
-
-
- // INSERT UPDATE DELETE returns false even if no error occurs in 4.0.4
- // also the date format has been changed from YYYY-mm-dd to dd MMM YYYY in 4.0.4. Idiot!
- function _fetch($ignore_fields=false)
- {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) {
- if ($this->fetchMode & ADODB_FETCH_NUM) {
- //ADODB_FETCH_BOTH mode
- $this->fields = @mssql_fetch_array($this->_queryID);
- } else {
- if ($this->hasFetchAssoc) // only for PHP 4.2.0 or later
- $this->fields = @mssql_fetch_assoc($this->_queryID);
- else {
- $this->fields = @mssql_fetch_array($this->_queryID);
- if (@is_array($$this->fields)) {
- $fassoc = array();
- foreach($$this->fields as $k => $v) {
- if (is_integer($k)) continue;
- $fassoc[$k] = $v;
- }
- $this->fields = $fassoc;
- }
- }
- }
-
- if (!$this->fields) {
- } else if (ADODB_ASSOC_CASE == 0) {
- foreach($this->fields as $k=>$v) {
- $kn = strtolower($k);
- if ($kn <> $k) {
- unset($this->fields[$k]);
- $this->fields[$kn] = $v;
- }
- }
- } else if (ADODB_ASSOC_CASE == 1) {
- foreach($this->fields as $k=>$v) {
- $kn = strtoupper($k);
- if ($kn <> $k) {
- unset($this->fields[$k]);
- $this->fields[$kn] = $v;
- }
- }
- }
- } else {
- $this->fields = @mssql_fetch_row($this->_queryID);
- }
- return $this->fields;
- }
-
- /* close() only needs to be called if you are worried about using too much memory while your script
- is running. All associated result memory for the specified result identifier will automatically be freed. */
-
- function _close()
- {
- $rez = mssql_free_result($this->_queryID);
- $this->_queryID = false;
- return $rez;
- }
- // mssql uses a default date like Dec 30 2000 12:00AM
- static function UnixDate($v)
- {
- return ADORecordSet_array_mssql::UnixDate($v);
- }
-
- static function UnixTimeStamp($v)
- {
- return ADORecordSet_array_mssql::UnixTimeStamp($v);
- }
-
-}
-
-
-class ADORecordSet_array_mssql extends ADORecordSet_array {
- function ADORecordSet_array_mssql($id=-1,$mode=false)
- {
- $this->ADORecordSet_array($id,$mode);
- }
-
- // mssql uses a default date like Dec 30 2000 12:00AM
- static function UnixDate($v)
- {
-
- if (is_numeric(substr($v,0,1)) && ADODB_PHPVER >= 0x4200) return parent::UnixDate($v);
-
- global $ADODB_mssql_mths,$ADODB_mssql_date_order;
-
- //Dec 30 2000 12:00AM
- if ($ADODB_mssql_date_order == 'dmy') {
- if (!preg_match( "|^([0-9]{1,2})[-/\. ]+([A-Za-z]{3})[-/\. ]+([0-9]{4})|" ,$v, $rr)) {
- return parent::UnixDate($v);
- }
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $theday = $rr[1];
- $themth = substr(strtoupper($rr[2]),0,3);
- } else {
- if (!preg_match( "|^([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4})|" ,$v, $rr)) {
- return parent::UnixDate($v);
- }
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $theday = $rr[2];
- $themth = substr(strtoupper($rr[1]),0,3);
- }
- $themth = $ADODB_mssql_mths[$themth];
- if ($themth <= 0) return false;
- // h-m-s-MM-DD-YY
- return mktime(0,0,0,$themth,$theday,$rr[3]);
- }
-
- static function UnixTimeStamp($v)
- {
-
- if (is_numeric(substr($v,0,1)) && ADODB_PHPVER >= 0x4200) return parent::UnixTimeStamp($v);
-
- global $ADODB_mssql_mths,$ADODB_mssql_date_order;
-
- //Dec 30 2000 12:00AM
- if ($ADODB_mssql_date_order == 'dmy') {
- if (!preg_match( "|^([0-9]{1,2})[-/\. ]+([A-Za-z]{3})[-/\. ]+([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})|"
- ,$v, $rr)) return parent::UnixTimeStamp($v);
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $theday = $rr[1];
- $themth = substr(strtoupper($rr[2]),0,3);
- } else {
- if (!preg_match( "|^([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})|"
- ,$v, $rr)) return parent::UnixTimeStamp($v);
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $theday = $rr[2];
- $themth = substr(strtoupper($rr[1]),0,3);
- }
-
- $themth = $ADODB_mssql_mths[$themth];
- if ($themth <= 0) return false;
-
- switch (strtoupper($rr[6])) {
- case 'P':
- if ($rr[4]<12) $rr[4] += 12;
- break;
- case 'A':
- if ($rr[4]==12) $rr[4] = 0;
- break;
- default:
- break;
- }
- // h-m-s-MM-DD-YY
- return mktime($rr[4],$rr[5],0,$themth,$theday,$rr[3]);
- }
-}
-
-/*
-Code Example 1:
-
-select object_name(constid) as constraint_name,
- object_name(fkeyid) as table_name,
- col_name(fkeyid, fkey) as column_name,
- object_name(rkeyid) as referenced_table_name,
- col_name(rkeyid, rkey) as referenced_column_name
-from sysforeignkeys
-where object_name(fkeyid) = x
-order by constraint_name, table_name, referenced_table_name, keyno
-
-Code Example 2:
-select constraint_name,
- column_name,
- ordinal_position
-from information_schema.key_column_usage
-where constraint_catalog = db_name()
-and table_name = x
-order by constraint_name, ordinal_position
-
-http://www.databasejournal.com/scripts/article.php/1440551
-*/
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-mssql_n.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-mssql_n.inc.php
deleted file mode 100644
index 69338b4..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-mssql_n.inc.php
+++ /dev/null
@@ -1,170 +0,0 @@
-_appendN($sql);
- return ADODB_mssql::_query($sql,$inputarr);
- }
-
- /**
- * This function will intercept all the literals used in the SQL, prepending the "N" char to them
- * in order to allow mssql to store properly data sent in the correct UCS-2 encoding (by freeTDS
- * and ODBTP) keeping SQL compatibility at ADOdb level (instead of hacking every project to add
- * the "N" notation when working against MSSQL.
- *
- * Note that this hack only must be used if ALL the char-based columns in your DB are of type nchar,
- * nvarchar and ntext
- */
- function _appendN($sql) {
-
- $result = $sql;
-
- /// Check we have some single quote in the query. Exit ok.
- if (strpos($sql, SINGLEQUOTE) === false) {
- return $sql;
- }
-
- /// Check we haven't an odd number of single quotes (this can cause problems below
- /// and should be considered one wrong SQL). Exit with debug info.
- if ((substr_count($sql, SINGLEQUOTE) & 1)) {
- if ($this->debug) {
- ADOConnection::outp("{$this->databaseType} internal transformation: not converted. Wrong number of quotes (odd)");
- }
- return $sql;
- }
-
- /// Check we haven't any backslash + single quote combination. It should mean wrong
- /// backslashes use (bad magic_quotes_sybase?). Exit with debug info.
- $regexp = '/(\\\\' . SINGLEQUOTE . '[^' . SINGLEQUOTE . '])/';
- if (preg_match($regexp, $sql)) {
- if ($this->debug) {
- ADOConnection::outp("{$this->databaseType} internal transformation: not converted. Found bad use of backslash + single quote");
- }
- return $sql;
- }
-
- /// Remove pairs of single-quotes
- $pairs = array();
- $regexp = '/(' . SINGLEQUOTE . SINGLEQUOTE . ')/';
- preg_match_all($regexp, $result, $list_of_pairs);
- if ($list_of_pairs) {
- foreach (array_unique($list_of_pairs[0]) as $key=>$value) {
- $pairs['<@#@#@PAIR-'.$key.'@#@#@>'] = $value;
- }
- if (!empty($pairs)) {
- $result = str_replace($pairs, array_keys($pairs), $result);
- }
- }
-
- /// Remove the rest of literals present in the query
- $literals = array();
- $regexp = '/(N?' . SINGLEQUOTE . '.*?' . SINGLEQUOTE . ')/is';
- preg_match_all($regexp, $result, $list_of_literals);
- if ($list_of_literals) {
- foreach (array_unique($list_of_literals[0]) as $key=>$value) {
- $literals['<#@#@#LITERAL-'.$key.'#@#@#>'] = $value;
- }
- if (!empty($literals)) {
- $result = str_replace($literals, array_keys($literals), $result);
- }
- }
-
-
- /// Analyse literals to prepend the N char to them if their contents aren't numeric
- if (!empty($literals)) {
- foreach ($literals as $key=>$value) {
- if (!is_numeric(trim($value, SINGLEQUOTE))) {
- /// Non numeric string, prepend our dear N
- $literals[$key] = 'N' . trim($value, 'N'); //Trimming potentially existing previous "N"
- }
- }
- }
-
- /// Re-apply literals to the text
- if (!empty($literals)) {
- $result = str_replace(array_keys($literals), $literals, $result);
- }
-
- /// Any pairs followed by N' must be switched to N' followed by those pairs
- /// (or strings beginning with single quotes will fail)
- $result = preg_replace("/((<@#@#@PAIR-(\d+)@#@#@>)+)N'/", "N'$1", $result);
-
- /// Re-apply pairs of single-quotes to the text
- if (!empty($pairs)) {
- $result = str_replace(array_keys($pairs), $pairs, $result);
- }
-
- /// Print transformation if debug = on
- if ($result != $sql && $this->debug) {
- ADOConnection::outp("{$this->databaseType} internal transformation: {$sql} to {$result}");
- }
-
- return $result;
- }
-}
-
-class ADORecordset_mssql_n extends ADORecordset_mssql {
- var $databaseType = "mssql_n";
- function ADORecordset_mssql_n($id,$mode=false)
- {
- $this->ADORecordset_mssql($id,$mode);
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-mssqlnative.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-mssqlnative.inc.php
deleted file mode 100644
index b10d555..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-mssqlnative.inc.php
+++ /dev/null
@@ -1,1190 +0,0 @@
-= 0x4300) {
-// docs say 4.2.0, but testing shows only since 4.3.0 does it work!
- ini_set('mssql.datetimeconvert',0);
-} else {
- global $ADODB_mssql_mths; // array, months must be upper-case
- $ADODB_mssql_date_order = 'mdy';
- $ADODB_mssql_mths = array(
- 'JAN'=>1,'FEB'=>2,'MAR'=>3,'APR'=>4,'MAY'=>5,'JUN'=>6,
- 'JUL'=>7,'AUG'=>8,'SEP'=>9,'OCT'=>10,'NOV'=>11,'DEC'=>12);
-}
-
-class ADODB_mssqlnative extends ADOConnection {
- var $databaseType = "mssqlnative";
- var $dataProvider = "mssqlnative";
- var $replaceQuote = "''"; // string to use to replace quotes
- var $fmtDate = "'Y-m-d'";
- var $fmtTimeStamp = "'Y-m-d\TH:i:s'";
- var $hasInsertID = true;
- var $substr = "substring";
- var $length = 'len';
- var $hasAffectedRows = true;
- var $poorAffectedRows = false;
- var $metaDatabasesSQL = "select name from sys.sysdatabases where name <> 'master'";
- var $metaTablesSQL="select name,case when type='U' then 'T' else 'V' end from sysobjects where (type='U' or type='V') and (name not in ('sysallocations','syscolumns','syscomments','sysdepends','sysfilegroups','sysfiles','sysfiles1','sysforeignkeys','sysfulltextcatalogs','sysindexes','sysindexkeys','sysmembers','sysobjects','syspermissions','sysprotects','sysreferences','systypes','sysusers','sysalternates','sysconstraints','syssegments','REFERENTIAL_CONSTRAINTS','CHECK_CONSTRAINTS','CONSTRAINT_TABLE_USAGE','CONSTRAINT_COLUMN_USAGE','VIEWS','VIEW_TABLE_USAGE','VIEW_COLUMN_USAGE','SCHEMATA','TABLES','TABLE_CONSTRAINTS','TABLE_PRIVILEGES','COLUMNS','COLUMN_DOMAIN_USAGE','COLUMN_PRIVILEGES','DOMAINS','DOMAIN_CONSTRAINTS','KEY_COLUMN_USAGE','dtproperties'))";
- var $metaColumnsSQL =
- "select c.name,
- t.name as type,
- c.length,
- c.xprec as precision,
- c.xscale as scale,
- c.isnullable as nullable,
- c.cdefault as default_value,
- c.xtype,
- t.length as type_length,
- sc.is_identity
- from syscolumns c
- join systypes t on t.xusertype=c.xusertype
- join sysobjects o on o.id=c.id
- join sys.tables st on st.name=o.name
- join sys.columns sc on sc.object_id = st.object_id and sc.name=c.name
- where o.name='%s'";
- var $hasTop = 'top'; // support mssql SELECT TOP 10 * FROM TABLE
- var $hasGenID = true;
- var $sysDate = 'convert(datetime,convert(char,GetDate(),102),102)';
- var $sysTimeStamp = 'GetDate()';
- var $maxParameterLen = 4000;
- var $arrayClass = 'ADORecordSet_array_mssqlnative';
- var $uniqueSort = true;
- var $leftOuter = '*=';
- var $rightOuter = '=*';
- var $ansiOuter = true; // for mssql7 or later
- var $identitySQL = 'select SCOPE_IDENTITY()'; // 'select SCOPE_IDENTITY'; # for mssql 2000
- var $uniqueOrderBy = true;
- var $_bindInputArray = true;
- var $_dropSeqSQL = "drop table %s";
- var $connectionInfo = array();
- var $sequences = false;
- var $mssql_version = '';
-
- function ADODB_mssqlnative()
- {
- if ($this->debug) {
- error_log("");
- sqlsrv_set_error_handling( SQLSRV_ERRORS_LOG_ALL );
- sqlsrv_log_set_severity( SQLSRV_LOG_SEVERITY_ALL );
- sqlsrv_log_set_subsystems(SQLSRV_LOG_SYSTEM_ALL);
- sqlsrv_configure('warnings_return_as_errors', 0);
- } else {
- sqlsrv_set_error_handling(0);
- sqlsrv_log_set_severity(0);
- sqlsrv_log_set_subsystems(SQLSRV_LOG_SYSTEM_ALL);
- sqlsrv_configure('warnings_return_as_errors', 0);
- }
- }
- function ServerVersion() {
- $data = $this->ServerInfo();
- if (preg_match('/^09/',$data['version'])){
- /*
- * SQL Server 2005
- */
- $this->mssql_version = 9;
- } elseif (preg_match('/^10/',$data['version'])){
- /*
- * SQL Server 2008
- */
- $this->mssql_version = 10;
- } elseif (preg_match('/^11/',$data['version'])){
- /*
- * SQL Server 2012
- */
- $this->mssql_version = 11;
- } else
- die("SQL SERVER VERSION {$data['version']} NOT SUPPORTED IN mssqlnative DRIVER");
- }
-
- function ServerInfo() {
- global $ADODB_FETCH_MODE;
- static $arr = false;
- if (is_array($arr))
- return $arr;
- if ($this->fetchMode === false) {
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- } elseif ($this->fetchMode >=0 && $this->fetchMode <=2) {
- $savem = $this->fetchMode;
- } else
- $savem = $this->SetFetchMode(ADODB_FETCH_NUM);
-
- $arrServerInfo = sqlsrv_server_info($this->_connectionID);
- $ADODB_FETCH_MODE = $savem;
- $arr['description'] = $arrServerInfo['SQLServerName'].' connected to '.$arrServerInfo['CurrentDatabase'];
- $arr['version'] = $arrServerInfo['SQLServerVersion'];//ADOConnection::_findvers($arr['description']);
- return $arr;
- }
-
- function IfNull( $field, $ifNull )
- {
- return " ISNULL($field, $ifNull) "; // if MS SQL Server
- }
-
- function _insertid()
- {
- // SCOPE_IDENTITY()
- // Returns the last IDENTITY value inserted into an IDENTITY column in
- // the same scope. A scope is a module -- a stored procedure, trigger,
- // function, or batch. Thus, two statements are in the same scope if
- // they are in the same stored procedure, function, or batch.
- return $this->lastInsertID;
- }
-
- function _affectedrows()
- {
- if ($this->_queryID)
- return sqlsrv_rows_affected($this->_queryID);
- }
-
- function GenID($seq='adodbseq',$start=1) {
- if (!$this->mssql_version)
- $this->ServerVersion();
- switch($this->mssql_version){
- case 9:
- case 10:
- return $this->GenID2008();
- break;
- case 11:
- return $this->GenID2012();
- break;
- }
- }
-
- function CreateSequence($seq='adodbseq',$start=1)
- {
- if (!$this->mssql_vesion)
- $this->ServerVersion();
-
- switch($this->mssql_version){
- case 9:
- case 10:
- return $this->CreateSequence2008();
- break;
- case 11:
- return $this->CreateSequence2012();
- break;
- }
-
- }
-
- /**
- * For Server 2005,2008, duplicate a sequence with an identity table
- */
- function CreateSequence2008($seq='adodbseq',$start=1)
- {
- if($this->debug) error_log(" CreateSequence($seq,$start)");
- sqlsrv_begin_transaction($this->_connectionID);
- $start -= 1;
- $this->Execute("create table $seq (id int)");//was float(53)
- $ok = $this->Execute("insert into $seq with (tablock,holdlock) values($start)");
- if (!$ok) {
- if($this->debug) error_log(" Error: ROLLBACK");
- sqlsrv_rollback($this->_connectionID);
- return false;
- }
- sqlsrv_commit($this->_connectionID);
- return true;
- }
-
- /**
- * Proper Sequences Only available to Server 2012 and up
- */
- function CreateSequence2012($seq='adodb',$start=1){
- if (!$this->sequences){
- $sql = "SELECT name FROM sys.sequences";
- $this->sequences = $this->GetCol($sql);
- }
- $ok = $this->Execute("CREATE SEQUENCE $seq START WITH $start INCREMENT BY 1");
- if (!$ok)
- die("CANNOT CREATE SEQUENCE" . print_r(sqlsrv_errors(),true));
- $this->sequences[] = $seq;
- }
-
- /**
- * For Server 2005,2008, duplicate a sequence with an identity table
- */
- function GenID2008($seq='adodbseq',$start=1)
- {
- if($this->debug) error_log(" CreateSequence($seq,$start)");
- sqlsrv_begin_transaction($this->_connectionID);
- $ok = $this->Execute("update $seq with (tablock,holdlock) set id = id + 1");
- if (!$ok) {
- $start -= 1;
- $this->Execute("create table $seq (id int)");//was float(53)
- $ok = $this->Execute("insert into $seq with (tablock,holdlock) values($start)");
- if (!$ok) {
- if($this->debug) error_log(" Error: ROLLBACK");
- sqlsrv_rollback($this->_connectionID);
- return false;
- }
- }
- $num = $this->GetOne("select id from $seq");
- sqlsrv_commit($this->_connectionID);
- return true;
- }
- /**
- * Only available to Server 2012 and up
- * Cannot do this the normal adodb way by trapping an error if the
- * sequence does not exist because sql server will auto create a
- * sequence with the starting number of -9223372036854775808
- */
- function GenID2012($seq='adodbseq',$start=1)
- {
-
- /*
- * First time in create an array of sequence names that we
- * can use in later requests to see if the sequence exists
- * the overhead is creating a list of sequences every time
- * we need access to at least 1. If we really care about
- * performance, we could maybe flag a 'nocheck' class variable
- */
- if (!$this->sequences){
- $sql = "SELECT name FROM sys.sequences";
- $this->sequences = $this->GetCol($sql);
- }
- if (!is_array($this->sequences)
- || is_array($this->sequences) && !in_array($seq,$this->sequences)){
- $this->CreateSequence2012($seq='adodbseq',$start=1);
-
- }
- $num = $this->GetOne("SELECT NEXT VALUE FOR $seq");
- return $num;
- }
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- if (!$col) $col = $this->sysTimeStamp;
- $s = '';
-
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- if ($s) $s .= '+';
- $ch = $fmt[$i];
- switch($ch) {
- case 'Y':
- case 'y':
- $s .= "datename(yyyy,$col)";
- break;
- case 'M':
- $s .= "convert(char(3),$col,0)";
- break;
- case 'm':
- $s .= "replace(str(month($col),2),' ','0')";
- break;
- case 'Q':
- case 'q':
- $s .= "datename(quarter,$col)";
- break;
- case 'D':
- case 'd':
- $s .= "replace(str(day($col),2),' ','0')";
- break;
- case 'h':
- $s .= "substring(convert(char(14),$col,0),13,2)";
- break;
-
- case 'H':
- $s .= "replace(str(datepart(hh,$col),2),' ','0')";
- break;
-
- case 'i':
- $s .= "replace(str(datepart(mi,$col),2),' ','0')";
- break;
- case 's':
- $s .= "replace(str(datepart(ss,$col),2),' ','0')";
- break;
- case 'a':
- case 'A':
- $s .= "substring(convert(char(19),$col,0),18,2)";
- break;
-
- default:
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- $s .= $this->qstr($ch);
- break;
- }
- }
- return $s;
- }
-
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
- $this->transCnt += 1;
- if ($this->debug) error_log(' begin transaction');
- sqlsrv_begin_transaction($this->_connectionID);
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if ($this->debug) error_log(' commit transaction');
- if (!$ok) return $this->RollbackTrans();
- if ($this->transCnt) $this->transCnt -= 1;
- sqlsrv_commit($this->_connectionID);
- return true;
- }
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->debug) error_log(' rollback transaction');
- if ($this->transCnt) $this->transCnt -= 1;
- sqlsrv_rollback($this->_connectionID);
- return true;
- }
-
- function SetTransactionMode( $transaction_mode )
- {
- $this->_transmode = $transaction_mode;
- if (empty($transaction_mode)) {
- $this->Execute('SET TRANSACTION ISOLATION LEVEL READ COMMITTED');
- return;
- }
- if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
- $this->Execute("SET TRANSACTION ".$transaction_mode);
- }
-
- /*
- Usage:
-
- $this->BeginTrans();
- $this->RowLock('table1,table2','table1.id=33 and table2.id=table1.id'); # lock row 33 for both tables
-
- # some operation on both tables table1 and table2
-
- $this->CommitTrans();
-
- See http://www.swynk.com/friends/achigrik/SQL70Locks.asp
- */
- function RowLock($tables,$where,$col='1 as adodbignore')
- {
- if ($col == '1 as adodbignore') $col = 'top 1 null as ignore';
- if (!$this->transCnt) $this->BeginTrans();
- return $this->GetOne("select $col from $tables with (ROWLOCK,HOLDLOCK) where $where");
- }
-
- function SelectDB($dbName)
- {
- $this->database = $dbName;
- $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions
- if ($this->_connectionID) {
- $rs = $this->Execute('USE '.$dbName);
- if($rs) {
- return true;
- } else return false;
- }
- else return false;
- }
-
- function ErrorMsg()
- {
- $retErrors = sqlsrv_errors(SQLSRV_ERR_ALL);
- if($retErrors != null) {
- foreach($retErrors as $arrError) {
- $this->_errorMsg .= "SQLState: ".$arrError[ 'SQLSTATE']."\n";
- $this->_errorMsg .= "Error Code: ".$arrError[ 'code']."\n";
- $this->_errorMsg .= "Message: ".$arrError[ 'message']."\n";
- }
- } else {
- $this->_errorMsg = "No errors found";
- }
- return $this->_errorMsg;
- }
-
- function ErrorNo()
- {
- if ($this->_logsql && $this->_errorCode !== false) return $this->_errorCode;
- $err = sqlsrv_errors(SQLSRV_ERR_ALL);
- if($err[0]) return $err[0]['code'];
- else return -1;
- }
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (!function_exists('sqlsrv_connect')) return null;
- $connectionInfo = $this->connectionInfo;
- $connectionInfo["Database"]=$argDatabasename;
- $connectionInfo["UID"]=$argUsername;
- $connectionInfo["PWD"]=$argPassword;
- if ($this->debug) error_log(" connecting... hostname: $argHostname params: ".var_export($connectionInfo,true));
- //if ($this->debug) error_log(" _connectionID before: ".serialize($this->_connectionID));
- if(!($this->_connectionID = sqlsrv_connect($argHostname,$connectionInfo))) {
- if ($this->debug) error_log( "errors : ".print_r( sqlsrv_errors(), true));
- return false;
- }
- //if ($this->debug) error_log(" _connectionID after: ".serialize($this->_connectionID));
- //if ($this->debug) error_log(" defined functions: ".var_export(get_defined_functions(),true)." ");
- return true;
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- //return null;//not implemented. NOTE: Persistent connections have no effect if PHP is used as a CGI program. (FastCGI!)
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename);
- }
-
- function Prepare($sql)
- {
- return $sql; // prepare does not work properly with bind parameters as bind parameters are managed by sqlsrv_prepare!
-
- $stmt = sqlsrv_prepare( $this->_connectionID, $sql);
- if (!$stmt) return $sql;
- return array($sql,$stmt);
- }
-
- // returns concatenated string
- // MSSQL requires integers to be cast as strings
- // automatically cast every datatype to VARCHAR(255)
- // @author David Rogers (introspectshun)
- function Concat()
- {
- $s = "";
- $arr = func_get_args();
-
- // Split single record on commas, if possible
- if (sizeof($arr) == 1) {
- foreach ($arr as $arg) {
- $args = explode(',', $arg);
- }
- $arr = $args;
- }
-
- array_walk($arr, create_function('&$v', '$v = "CAST(" . $v . " AS VARCHAR(255))";'));
- $s = implode('+',$arr);
- if (sizeof($arr) > 0) return "$s";
-
- return '';
- }
-
- /*
- Unfortunately, it appears that mssql cannot handle varbinary > 255 chars
- So all your blobs must be of type "image".
-
- Remember to set in php.ini the following...
-
- ; Valid range 0 - 2147483647. Default = 4096.
- mssql.textlimit = 0 ; zero to pass through
-
- ; Valid range 0 - 2147483647. Default = 4096.
- mssql.textsize = 0 ; zero to pass through
- */
- function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
- {
-
- if (strtoupper($blobtype) == 'CLOB') {
- $sql = "UPDATE $table SET $column='" . $val . "' WHERE $where";
- return $this->Execute($sql) != false;
- }
- $sql = "UPDATE $table SET $column=0x".bin2hex($val)." WHERE $where";
- return $this->Execute($sql) != false;
- }
-
- // returns query ID if successful, otherwise false
- function _query($sql,$inputarr=false)
- {
- $this->_errorMsg = false;
-
- if (is_array($sql)) $sql = $sql[1];
-
- $insert = false;
- // handle native driver flaw for retrieving the last insert ID
- if(preg_match('/^\W*(insert [^;]+);?$/i', $sql)) {
- $insert = true;
- $sql .= '; '.$this->identitySQL; // select scope_identity()
- }
- if($inputarr) {
- $rez = sqlsrv_query($this->_connectionID, $sql, $inputarr);
- } else {
- $rez = sqlsrv_query($this->_connectionID,$sql);
- }
-
- if ($this->debug) error_log(" running query: ".var_export($sql,true)." input array: ".var_export($inputarr,true)." result: ".var_export($rez,true));
-
- if(!$rez) {
- $rez = false;
- } else if ($insert) {
- // retrieve the last insert ID (where applicable)
- sqlsrv_next_result($rez);
- sqlsrv_fetch($rez);
- $this->lastInsertID = sqlsrv_get_field($rez, 0);
- }
- return $rez;
- }
-
- // returns true or false
- function _close()
- {
- if ($this->transCnt) $this->RollbackTrans();
- $rez = @sqlsrv_close($this->_connectionID);
- $this->_connectionID = false;
- return $rez;
- }
-
- // mssql uses a default date like Dec 30 2000 12:00AM
- static function UnixDate($v)
- {
- return ADORecordSet_array_mssqlnative::UnixDate($v);
- }
-
- static function UnixTimeStamp($v)
- {
- return ADORecordSet_array_mssqlnative::UnixTimeStamp($v);
- }
-
- function MetaIndexes($table,$primary=false, $owner = false)
- {
- $table = $this->qstr($table);
-
- $sql = "SELECT i.name AS ind_name, C.name AS col_name, USER_NAME(O.uid) AS Owner, c.colid, k.Keyno,
- CASE WHEN I.indid BETWEEN 1 AND 254 AND (I.status & 2048 = 2048 OR I.Status = 16402 AND O.XType = 'V') THEN 1 ELSE 0 END AS IsPK,
- CASE WHEN I.status & 2 = 2 THEN 1 ELSE 0 END AS IsUnique
- FROM dbo.sysobjects o INNER JOIN dbo.sysindexes I ON o.id = i.id
- INNER JOIN dbo.sysindexkeys K ON I.id = K.id AND I.Indid = K.Indid
- INNER JOIN dbo.syscolumns c ON K.id = C.id AND K.colid = C.Colid
- WHERE LEFT(i.name, 8) <> '_WA_Sys_' AND o.status >= 0 AND O.Name LIKE $table
- ORDER BY O.name, I.Name, K.keyno";
-
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- $rs = $this->Execute($sql);
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- if (!is_object($rs)) {
- return FALSE;
- }
-
- $indexes = array();
- while ($row = $rs->FetchRow()) {
- if (!$primary && $row[5]) continue;
-
- $indexes[$row[0]]['unique'] = $row[6];
- $indexes[$row[0]]['columns'][] = $row[1];
- }
- return $indexes;
- }
-
- function MetaForeignKeys($table, $owner=false, $upper=false)
- {
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $table = $this->qstr(strtoupper($table));
-
- $sql =
- "select object_name(constid) as constraint_name,
- col_name(fkeyid, fkey) as column_name,
- object_name(rkeyid) as referenced_table_name,
- col_name(rkeyid, rkey) as referenced_column_name
- from sysforeignkeys
- where upper(object_name(fkeyid)) = $table
- order by constraint_name, referenced_table_name, keyno";
-
- $constraints =& $this->GetArray($sql);
-
- $ADODB_FETCH_MODE = $save;
-
- $arr = false;
- foreach($constraints as $constr) {
- //print_r($constr);
- $arr[$constr[0]][$constr[2]][] = $constr[1].'='.$constr[3];
- }
- if (!$arr) return false;
-
- $arr2 = false;
-
- foreach($arr as $k => $v) {
- foreach($v as $a => $b) {
- if ($upper) $a = strtoupper($a);
- $arr2[$a] = $b;
- }
- }
- return $arr2;
- }
-
- //From: Fernando Moreira
- function MetaDatabases()
- {
- $this->SelectDB("master");
- $rs =& $this->Execute($this->metaDatabasesSQL);
- $rows = $rs->GetRows();
- $ret = array();
- for($i=0;$iSelectDB($this->database);
- if($ret)
- return $ret;
- else
- return false;
- }
-
- // "Stein-Aksel Basma"
- // tested with MSSQL 2000
- function MetaPrimaryKeys($table, $owner=false)
- {
- global $ADODB_FETCH_MODE;
-
- $schema = '';
- $this->_findschema($table,$schema);
- if (!$schema) $schema = $this->database;
- if ($schema) $schema = "and k.table_catalog like '$schema%'";
-
- $sql = "select distinct k.column_name,ordinal_position from information_schema.key_column_usage k,
- information_schema.table_constraints tc
- where tc.constraint_name = k.constraint_name and tc.constraint_type =
- 'PRIMARY KEY' and k.table_name = '$table' $schema order by ordinal_position ";
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $a = $this->GetCol($sql);
- $ADODB_FETCH_MODE = $savem;
-
- if ($a && sizeof($a)>0) return $a;
- $false = false;
- return $false;
- }
-
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- if ($mask) {
- $save = $this->metaTablesSQL;
- $mask = $this->qstr(($mask));
- $this->metaTablesSQL .= " AND name like $mask";
- }
- $ret = ADOConnection::MetaTables($ttype,$showSchema);
-
- if ($mask) {
- $this->metaTablesSQL = $save;
- }
- return $ret;
- }
- function MetaColumns($table, $upper=true, $schema=false){
-
- # start adg
- static $cached_columns = array();
- if ($this->cachedSchemaFlush)
- $cached_columns = array();
-
- if (array_key_exists($table,$cached_columns)){
- return $cached_columns[$table];
- }
- # end adg
-
- if (!$this->mssql_version)
- $this->ServerVersion();
-
- $this->_findschema($table,$schema);
- if ($schema) {
- $dbName = $this->database;
- $this->SelectDB($schema);
- }
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
-
- if ($schema) {
- $this->SelectDB($dbName);
- }
-
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- if (!is_object($rs)) {
- $false = false;
- return $false;
- }
-
- $retarr = array();
- while (!$rs->EOF){
-
- $fld = new ADOFieldObject();
- if (array_key_exists(0,$rs->fields)) {
- $fld->name = $rs->fields[0];
- $fld->type = $rs->fields[1];
- $fld->max_length = $rs->fields[2];
- $fld->precision = $rs->fields[3];
- $fld->scale = $rs->fields[4];
- $fld->not_null =!$rs->fields[5];
- $fld->has_default = $rs->fields[6];
- $fld->xtype = $rs->fields[7];
- $fld->type_length = $rs->fields[8];
- $fld->auto_increment= $rs->fields[9];
- } else {
- $fld->name = $rs->fields['name'];
- $fld->type = $rs->fields['type'];
- $fld->max_length = $rs->fields['length'];
- $fld->precision = $rs->fields['precision'];
- $fld->scale = $rs->fields['scale'];
- $fld->not_null =!$rs->fields['nullable'];
- $fld->has_default = $rs->fields['default_value'];
- $fld->xtype = $rs->fields['xtype'];
- $fld->type_length = $rs->fields['type_length'];
- $fld->auto_increment= $rs->fields['is_identity'];
- }
-
- if ($save == ADODB_FETCH_NUM)
- $retarr[] = $fld;
- else
- $retarr[strtoupper($fld->name)] = $fld;
-
- $rs->MoveNext();
-
- }
- $rs->Close();
- # start adg
- $cached_columns[$table] = $retarr;
- # end adg
- return $retarr;
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordset_mssqlnative extends ADORecordSet {
-
- var $databaseType = "mssqlnative";
- var $canSeek = false;
- var $fieldOffset = 0;
- // _mths works only in non-localised system
-
- function ADORecordset_mssqlnative($id,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
-
- }
- $this->fetchMode = $mode;
- return $this->ADORecordSet($id,$mode);
- }
-
-
- function _initrs()
- {
- global $ADODB_COUNTRECS;
- # KMN # if ($this->connection->debug) error_log("(before) ADODB_COUNTRECS: {$ADODB_COUNTRECS} _numOfRows: {$this->_numOfRows} _numOfFields: {$this->_numOfFields}");
- /*$retRowsAff = sqlsrv_rows_affected($this->_queryID);//"If you need to determine the number of rows a query will return before retrieving the actual results, appending a SELECT COUNT ... query would let you get that information, and then a call to next_result would move you to the "real" results."
- error_log("rowsaff: ".serialize($retRowsAff));
- $this->_numOfRows = ($ADODB_COUNTRECS)? $retRowsAff:-1;*/
- $this->_numOfRows = -1;//not supported
- $fieldmeta = sqlsrv_field_metadata($this->_queryID);
- $this->_numOfFields = ($fieldmeta)? count($fieldmeta):-1;
- # KMN # if ($this->connection->debug) error_log("(after) _numOfRows: {$this->_numOfRows} _numOfFields: {$this->_numOfFields}");
- /*
- * Copy the oracle method and cache the metadata at init time
- */
- if ($this->_numOfFields>0) {
- $this->_fieldobjs = array();
- $max = $this->_numOfFields;
- for ($i=0;$i<$max; $i++) $this->_fieldobjs[] = $this->_FetchField($i);
- }
-
- }
-
-
- //Contributed by "Sven Axelsson"
- // get next resultset - requires PHP 4.0.5 or later
- function NextRecordSet()
- {
- if (!sqlsrv_next_result($this->_queryID)) return false;
- $this->_inited = false;
- $this->bind = false;
- $this->_currentRow = -1;
- $this->Init();
- return true;
- }
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- if ($this->fetchMode != ADODB_FETCH_NUM) return $this->fields[$colname];
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
-
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- /* Returns: an object containing field information.
- Get column information in the Recordset object. fetchField() can be used in order to obtain information about
- fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by
- fetchField() is retrieved.
- Designed By jcortinap#jc.com.mx
- */
- function _FetchField($fieldOffset = -1)
- {
- $_typeConversion = array(
- -155 => 'datetimeoffset',
- -154 => 'time',
- -152 => 'xml',
- -151 => 'udt',
- -11 => 'uniqueidentifier',
- -10 => 'ntext',
- -9 => 'nvarchar',
- -8 => 'nchar',
- -7 => 'bit',
- -6 => 'tinyint',
- -5 => 'bigint',
- -4 => 'image',
- -3 => 'varbinary',
- -2 => 'timestamp',
- -1 => 'text',
- 1 => 'char',
- 2 => 'numeric',
- 3 => 'decimal',
- 4 => 'int',
- 5 => 'smallint',
- 6 => 'float',
- 7 => 'real',
- 12 => 'varchar',
- 91 => 'date',
- 93 => 'datetime'
- );
-
- $fa = @sqlsrv_field_metadata($this->_queryID);
- if ($fieldOffset != -1) {
- $fa = $fa[$fieldOffset];
- }
- $false = false;
- if (empty($fa)) {
- $f = false;//PHP Notice: Only variable references should be returned by reference
- }
- else
- {
- // Convert to an object
- $fa = array_change_key_case($fa, CASE_LOWER);
- $fb = array();
- if ($fieldOffset != -1)
- {
- $fb = array(
- 'name' => $fa['name'],
- 'max_length' => $fa['size'],
- 'column_source' => $fa['name'],
- 'type' => $_typeConversion[$fa['type']]
- );
- }
- else
- {
- foreach ($fa as $key => $value)
- {
- $fb[] = array(
- 'name' => $value['name'],
- 'max_length' => $value['size'],
- 'column_source' => $value['name'],
- 'type' => $_typeConversion[$value['type']]
- );
- }
- }
- $f = (object) $fb;
- }
- return $f;
- }
-
- /*
- * Fetchfield copies the oracle method, it loads the field information
- * into the _fieldobjs array once, to save multiple calls to the
- * sqlsrv_field_metadata function
- *
- * @author KM Newnham
- * @date 02/20/2013
- */
- function FetchField($fieldOffset = -1)
- {
- return $this->_fieldobjs[$fieldOffset];
- }
-
- function _seek($row)
- {
- return false;//There is no support for cursors in the driver at this time. All data is returned via forward-only streams.
- }
-
- // speedup
- function MoveNext()
- {
- //# KMN # if ($this->connection->debug) error_log("movenext()");
- //# KMN # if ($this->connection->debug) error_log("eof (beginning): ".$this->EOF);
- if ($this->EOF) return false;
-
- $this->_currentRow++;
- // # KMN # if ($this->connection->debug) error_log("_currentRow: ".$this->_currentRow);
-
- if ($this->_fetch()) return true;
- $this->EOF = true;
- //# KMN # if ($this->connection->debug) error_log("eof (end): ".$this->EOF);
-
- return false;
- }
-
-
- // INSERT UPDATE DELETE returns false even if no error occurs in 4.0.4
- // also the date format has been changed from YYYY-mm-dd to dd MMM YYYY in 4.0.4. Idiot!
- function _fetch($ignore_fields=false)
- {
- # KMN # if ($this->connection->debug) error_log("_fetch()");
- if ($this->fetchMode & ADODB_FETCH_ASSOC) {
- if ($this->fetchMode & ADODB_FETCH_NUM) {
- //# KMN # if ($this->connection->debug) error_log("fetch mode: both");
- $this->fields = @sqlsrv_fetch_array($this->_queryID,SQLSRV_FETCH_BOTH);
- } else {
- //# KMN # if ($this->connection->debug) error_log("fetch mode: assoc");
- $this->fields = @sqlsrv_fetch_array($this->_queryID,SQLSRV_FETCH_ASSOC);
- }
-
- if (is_array($this->fields)) {
- if (ADODB_ASSOC_CASE == 0) {
- foreach($this->fields as $k=>$v) {
- $this->fields[strtolower($k)] = $v;
- }
- } else if (ADODB_ASSOC_CASE == 1) {
- foreach($this->fields as $k=>$v) {
- $this->fields[strtoupper($k)] = $v;
- }
- }
- }
- } else {
- //# KMN # if ($this->connection->debug) error_log("fetch mode: num");
- $this->fields = @sqlsrv_fetch_array($this->_queryID,SQLSRV_FETCH_NUMERIC);
- }
- if(is_array($this->fields) && array_key_exists(1,$this->fields) && !array_key_exists(0,$this->fields)) {//fix fetch numeric keys since they're not 0 based
- $arrFixed = array();
- foreach($this->fields as $key=>$value) {
- if(is_numeric($key)) {
- $arrFixed[$key-1] = $value;
- } else {
- $arrFixed[$key] = $value;
- }
- }
- //if($this->connection->debug) error_log(" fixing non 0 based return array, old: ".print_r($this->fields,true)." new: ".print_r($arrFixed,true));
- $this->fields = $arrFixed;
- }
- if(is_array($this->fields)) {
- foreach($this->fields as $key=>$value) {
- if (is_object($value) && method_exists($value, 'format')) {//is DateTime object
- $this->fields[$key] = $value->format("Y-m-d\TH:i:s\Z");
- }
- }
- }
- if($this->fields === null) $this->fields = false;
- # KMN # if ($this->connection->debug) error_log(" after _fetch, fields: ".print_r($this->fields,true)." backtrace: ".adodb_backtrace(false));
- return $this->fields;
- }
-
- /* close() only needs to be called if you are worried about using too much memory while your script
- is running. All associated result memory for the specified result identifier will automatically be freed. */
- function _close()
- {
- $rez = sqlsrv_free_stmt($this->_queryID);
- $this->_queryID = false;
- return $rez;
- }
-
- // mssql uses a default date like Dec 30 2000 12:00AM
- static function UnixDate($v)
- {
- return ADORecordSet_array_mssqlnative::UnixDate($v);
- }
-
- static function UnixTimeStamp($v)
- {
- return ADORecordSet_array_mssqlnative::UnixTimeStamp($v);
- }
-}
-
-
-class ADORecordSet_array_mssqlnative extends ADORecordSet_array {
- function ADORecordSet_array_mssqlnative($id=-1,$mode=false)
- {
- $this->ADORecordSet_array($id,$mode);
- }
-
- // mssql uses a default date like Dec 30 2000 12:00AM
- static function UnixDate($v)
- {
-
- if (is_numeric(substr($v,0,1)) && ADODB_PHPVER >= 0x4200) return parent::UnixDate($v);
-
- global $ADODB_mssql_mths,$ADODB_mssql_date_order;
-
- //Dec 30 2000 12:00AM
- if ($ADODB_mssql_date_order == 'dmy') {
- if (!preg_match( "|^([0-9]{1,2})[-/\. ]+([A-Za-z]{3})[-/\. ]+([0-9]{4})|" ,$v, $rr)) {
- return parent::UnixDate($v);
- }
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $theday = $rr[1];
- $themth = substr(strtoupper($rr[2]),0,3);
- } else {
- if (!preg_match( "|^([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4})|" ,$v, $rr)) {
- return parent::UnixDate($v);
- }
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $theday = $rr[2];
- $themth = substr(strtoupper($rr[1]),0,3);
- }
- $themth = $ADODB_mssql_mths[$themth];
- if ($themth <= 0) return false;
- // h-m-s-MM-DD-YY
- return adodb_mktime(0,0,0,$themth,$theday,$rr[3]);
- }
-
- static function UnixTimeStamp($v)
- {
-
- if (is_numeric(substr($v,0,1)) && ADODB_PHPVER >= 0x4200) return parent::UnixTimeStamp($v);
-
- global $ADODB_mssql_mths,$ADODB_mssql_date_order;
-
- //Dec 30 2000 12:00AM
- if ($ADODB_mssql_date_order == 'dmy') {
- if (!preg_match( "|^([0-9]{1,2})[-/\. ]+([A-Za-z]{3})[-/\. ]+([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})|"
- ,$v, $rr)) return parent::UnixTimeStamp($v);
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $theday = $rr[1];
- $themth = substr(strtoupper($rr[2]),0,3);
- } else {
- if (!preg_match( "|^([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})|"
- ,$v, $rr)) return parent::UnixTimeStamp($v);
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $theday = $rr[2];
- $themth = substr(strtoupper($rr[1]),0,3);
- }
-
- $themth = $ADODB_mssql_mths[$themth];
- if ($themth <= 0) return false;
-
- switch (strtoupper($rr[6])) {
- case 'P':
- if ($rr[4]<12) $rr[4] += 12;
- break;
- case 'A':
- if ($rr[4]==12) $rr[4] = 0;
- break;
- default:
- break;
- }
- // h-m-s-MM-DD-YY
- return adodb_mktime($rr[4],$rr[5],0,$themth,$theday,$rr[3]);
- }
-}
-
-/*
-Code Example 1:
-
-select object_name(constid) as constraint_name,
- object_name(fkeyid) as table_name,
- col_name(fkeyid, fkey) as column_name,
- object_name(rkeyid) as referenced_table_name,
- col_name(rkeyid, rkey) as referenced_column_name
-from sysforeignkeys
-where object_name(fkeyid) = x
-order by constraint_name, table_name, referenced_table_name, keyno
-
-Code Example 2:
-select constraint_name,
- column_name,
- ordinal_position
-from information_schema.key_column_usage
-where constraint_catalog = db_name()
-and table_name = x
-order by constraint_name, ordinal_position
-
-http://www.databasejournal.com/scripts/article.php/1440551
-*/
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-mssqlpo.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-mssqlpo.inc.php
deleted file mode 100644
index ab226a6..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-mssqlpo.inc.php
+++ /dev/null
@@ -1,61 +0,0 @@
-_has_mssql_init) {
- ADOConnection::outp( "PrepareSP: mssql_init only available since PHP 4.1.0");
- return $sql;
- }
- if (is_string($sql)) $sql = str_replace('||','+',$sql);
- $stmt = mssql_init($sql,$this->_connectionID);
- if (!$stmt) return $sql;
- return array($sql,$stmt);
- }
-
- function _query($sql,$inputarr=false)
- {
- if (is_string($sql)) $sql = str_replace('||','+',$sql);
- return ADODB_mssql::_query($sql,$inputarr);
- }
-}
-
-class ADORecordset_mssqlpo extends ADORecordset_mssql {
- var $databaseType = "mssqlpo";
- function ADORecordset_mssqlpo($id,$mode=false)
- {
- $this->ADORecordset_mssql($id,$mode);
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-mysql.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-mysql.inc.php
deleted file mode 100644
index d82f169..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-mysql.inc.php
+++ /dev/null
@@ -1,894 +0,0 @@
-rsPrefix .= 'ext_';
- }
-
-
- // SetCharSet - switch the client encoding
- function SetCharSet($charset_name)
- {
- if (!function_exists('mysql_set_charset'))
- return false;
-
- if ($this->charSet !== $charset_name) {
- $ok = @mysql_set_charset($charset_name,$this->_connectionID);
- if ($ok) {
- $this->charSet = $charset_name;
- return true;
- }
- return false;
- }
- return true;
- }
-
- function ServerInfo()
- {
- $arr['description'] = ADOConnection::GetOne("select version()");
- $arr['version'] = ADOConnection::_findvers($arr['description']);
- return $arr;
- }
-
- function IfNull( $field, $ifNull )
- {
- return " IFNULL($field, $ifNull) "; // if MySQL
- }
-
- function MetaProcedures($NamePattern = false, $catalog = null, $schemaPattern = null)
- {
- // save old fetch mode
- global $ADODB_FETCH_MODE;
-
- $false = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- $procedures = array ();
-
- // get index details
-
- $likepattern = '';
- if ($NamePattern) {
- $likepattern = " LIKE '".$NamePattern."'";
- }
- $rs = $this->Execute('SHOW PROCEDURE STATUS'.$likepattern);
- if (is_object($rs)) {
-
- // parse index data into array
- while ($row = $rs->FetchRow()) {
- $procedures[$row[1]] = array(
- 'type' => 'PROCEDURE',
- 'catalog' => '',
-
- 'schema' => '',
- 'remarks' => $row[7],
- );
- }
- }
-
- $rs = $this->Execute('SHOW FUNCTION STATUS'.$likepattern);
- if (is_object($rs)) {
- // parse index data into array
- while ($row = $rs->FetchRow()) {
- $procedures[$row[1]] = array(
- 'type' => 'FUNCTION',
- 'catalog' => '',
- 'schema' => '',
- 'remarks' => $row[7]
- );
- }
- }
-
- // restore fetchmode
- if (isset($savem)) {
- $this->SetFetchMode($savem);
-
- }
- $ADODB_FETCH_MODE = $save;
-
-
- return $procedures;
- }
-
- /**
- * Retrieves a list of tables based on given criteria
- *
- * @param string $ttype Table type = 'TABLE', 'VIEW' or false=both (default)
- * @param string $showSchema schema name, false = current schema (default)
- * @param string $mask filters the table by name
- *
- * @return array list of tables
- */
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- $save = $this->metaTablesSQL;
- if ($showSchema && is_string($showSchema)) {
- $this->metaTablesSQL .= $this->qstr($showSchema);
- } else {
- $this->metaTablesSQL .= "schema()";
- }
-
- if ($mask) {
- $mask = $this->qstr($mask);
- $this->metaTablesSQL .= " AND table_name LIKE $mask";
- }
- $ret = ADOConnection::MetaTables($ttype,$showSchema);
-
- $this->metaTablesSQL = $save;
- return $ret;
- }
-
-
- function MetaIndexes ($table, $primary = FALSE, $owner=false)
- {
- // save old fetch mode
- global $ADODB_FETCH_MODE;
-
- $false = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- // get index details
- $rs = $this->Execute(sprintf('SHOW INDEX FROM %s',$table));
-
- // restore fetchmode
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- if (!is_object($rs)) {
- return $false;
- }
-
- $indexes = array ();
-
- // parse index data into array
- while ($row = $rs->FetchRow()) {
- if ($primary == FALSE AND $row[2] == 'PRIMARY') {
- continue;
- }
-
- if (!isset($indexes[$row[2]])) {
- $indexes[$row[2]] = array(
- 'unique' => ($row[1] == 0),
- 'columns' => array()
- );
- }
-
- $indexes[$row[2]]['columns'][$row[3] - 1] = $row[4];
- }
-
- // sort columns by order in the index
- foreach ( array_keys ($indexes) as $index )
- {
- ksort ($indexes[$index]['columns']);
- }
-
- return $indexes;
- }
-
-
- // if magic quotes disabled, use mysql_real_escape_string()
- function qstr($s,$magic_quotes=false)
- {
- if (is_null($s)) return 'NULL';
- if (!$magic_quotes) {
-
- if (ADODB_PHPVER >= 0x4300) {
- if (is_resource($this->_connectionID))
- return "'".mysql_real_escape_string($s,$this->_connectionID)."'";
- }
- if ($this->replaceQuote[0] == '\\'){
- $s = adodb_str_replace(array('\\',"\0"),array('\\\\',"\\\0"),$s);
- }
- return "'".str_replace("'",$this->replaceQuote,$s)."'";
- }
-
- // undo magic quotes for "
- $s = str_replace('\\"','"',$s);
- return "'$s'";
- }
-
- function _insertid()
- {
- return ADOConnection::GetOne('SELECT LAST_INSERT_ID()');
- //return mysql_insert_id($this->_connectionID);
- }
-
- function GetOne($sql,$inputarr=false)
- {
- global $ADODB_GETONE_EOF;
- if ($this->compat323 == false && strncasecmp($sql,'sele',4) == 0) {
- $rs = $this->SelectLimit($sql,1,-1,$inputarr);
- if ($rs) {
- $rs->Close();
- if ($rs->EOF) return $ADODB_GETONE_EOF;
- return reset($rs->fields);
- }
- } else {
- return ADOConnection::GetOne($sql,$inputarr);
- }
- return false;
- }
-
- function BeginTrans()
- {
- if ($this->debug) ADOConnection::outp("Transactions not supported in 'mysql' driver. Use 'mysqlt' or 'mysqli' driver");
- }
-
- function _affectedrows()
- {
- return mysql_affected_rows($this->_connectionID);
- }
-
- // See http://www.mysql.com/doc/M/i/Miscellaneous_functions.html
- // Reference on Last_Insert_ID on the recommended way to simulate sequences
- var $_genIDSQL = "update %s set id=LAST_INSERT_ID(id+1);";
- var $_genSeqSQL = "create table %s (id int not null)";
- var $_genSeqCountSQL = "select count(*) from %s";
- var $_genSeq2SQL = "insert into %s values (%s)";
- var $_dropSeqSQL = "drop table %s";
-
- function CreateSequence($seqname='adodbseq',$startID=1)
- {
- if (empty($this->_genSeqSQL)) return false;
- $u = strtoupper($seqname);
-
- $ok = $this->Execute(sprintf($this->_genSeqSQL,$seqname));
- if (!$ok) return false;
- return $this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1));
- }
-
-
- function GenID($seqname='adodbseq',$startID=1)
- {
- // post-nuke sets hasGenID to false
- if (!$this->hasGenID) return false;
-
- $savelog = $this->_logsql;
- $this->_logsql = false;
- $getnext = sprintf($this->_genIDSQL,$seqname);
- $holdtransOK = $this->_transOK; // save the current status
- $rs = @$this->Execute($getnext);
- if (!$rs) {
- if ($holdtransOK) $this->_transOK = true; //if the status was ok before reset
- $u = strtoupper($seqname);
- $this->Execute(sprintf($this->_genSeqSQL,$seqname));
- $cnt = $this->GetOne(sprintf($this->_genSeqCountSQL,$seqname));
- if (!$cnt) $this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1));
- $rs = $this->Execute($getnext);
- }
-
- if ($rs) {
- $this->genID = mysql_insert_id($this->_connectionID);
- $rs->Close();
- } else
- $this->genID = 0;
-
- $this->_logsql = $savelog;
- return $this->genID;
- }
-
- function MetaDatabases()
- {
- $qid = mysql_list_dbs($this->_connectionID);
- $arr = array();
- $i = 0;
- $max = mysql_num_rows($qid);
- while ($i < $max) {
- $db = mysql_tablename($qid,$i);
- if ($db != 'mysql') $arr[] = $db;
- $i += 1;
- }
- return $arr;
- }
-
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- if (!$col) $col = $this->sysTimeStamp;
- $s = 'DATE_FORMAT('.$col.",'";
- $concat = false;
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- $ch = $fmt[$i];
- switch($ch) {
-
- default:
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- /** FALL THROUGH */
- case '-':
- case '/':
- $s .= $ch;
- break;
-
- case 'Y':
- case 'y':
- $s .= '%Y';
- break;
- case 'M':
- $s .= '%b';
- break;
-
- case 'm':
- $s .= '%m';
- break;
- case 'D':
- case 'd':
- $s .= '%d';
- break;
-
- case 'Q':
- case 'q':
- $s .= "'),Quarter($col)";
-
- if ($len > $i+1) $s .= ",DATE_FORMAT($col,'";
- else $s .= ",('";
- $concat = true;
- break;
-
- case 'H':
- $s .= '%H';
- break;
-
- case 'h':
- $s .= '%I';
- break;
-
- case 'i':
- $s .= '%i';
- break;
-
- case 's':
- $s .= '%s';
- break;
-
- case 'a':
- case 'A':
- $s .= '%p';
- break;
-
- case 'w':
- $s .= '%w';
- break;
-
- case 'W':
- $s .= '%U';
- break;
-
- case 'l':
- $s .= '%W';
- break;
- }
- }
- $s.="')";
- if ($concat) $s = "CONCAT($s)";
- return $s;
- }
-
-
- // returns concatenated string
- // much easier to run "mysqld --ansi" or "mysqld --sql-mode=PIPES_AS_CONCAT" and use || operator
- function Concat()
- {
- $s = "";
- $arr = func_get_args();
-
- // suggestion by andrew005@mnogo.ru
- $s = implode(',',$arr);
- if (strlen($s) > 0) return "CONCAT($s)";
- else return '';
- }
-
- 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)";
- }
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (!empty($this->port)) $argHostname .= ":".$this->port;
-
- if (ADODB_PHPVER >= 0x4300)
- $this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword,
- $this->forceNewConnect,$this->clientFlags);
- else if (ADODB_PHPVER >= 0x4200)
- $this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword,
- $this->forceNewConnect);
- else
- $this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword);
-
- if ($this->_connectionID === false) return false;
- if ($argDatabasename) return $this->SelectDB($argDatabasename);
- return true;
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (!empty($this->port)) $argHostname .= ":".$this->port;
-
- if (ADODB_PHPVER >= 0x4300)
- $this->_connectionID = mysql_pconnect($argHostname,$argUsername,$argPassword,$this->clientFlags);
- else
- $this->_connectionID = mysql_pconnect($argHostname,$argUsername,$argPassword);
- if ($this->_connectionID === false) return false;
- if ($this->autoRollback) $this->RollbackTrans();
- if ($argDatabasename) return $this->SelectDB($argDatabasename);
- return true;
- }
-
- function _nconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- $this->forceNewConnect = true;
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename);
- }
-
- function MetaColumns($table, $normalize=true)
- {
- $this->_findschema($table,$schema);
- if ($schema) {
- $dbName = $this->database;
- $this->SelectDB($schema);
- }
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
-
- if ($schema) {
- $this->SelectDB($dbName);
- }
-
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- if (!is_object($rs)) {
- $false = false;
- return $false;
- }
-
- $retarr = array();
- while (!$rs->EOF){
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $type = $rs->fields[1];
-
- // split type into type(length):
- $fld->scale = null;
- if (preg_match("/^(.+)\((\d+),(\d+)/", $type, $query_array)) {
- $fld->type = $query_array[1];
- $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
- $fld->scale = is_numeric($query_array[3]) ? $query_array[3] : -1;
- } elseif (preg_match("/^(.+)\((\d+)/", $type, $query_array)) {
- $fld->type = $query_array[1];
- $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
- } elseif (preg_match("/^(enum)\((.*)\)$/i", $type, $query_array)) {
- $fld->type = $query_array[1];
- $arr = explode(",",$query_array[2]);
- $fld->enums = $arr;
- $zlen = max(array_map("strlen",$arr)) - 2; // PHP >= 4.0.6
- $fld->max_length = ($zlen > 0) ? $zlen : 1;
- } else {
- $fld->type = $type;
- $fld->max_length = -1;
- }
- $fld->not_null = ($rs->fields[2] != 'YES');
- $fld->primary_key = ($rs->fields[3] == 'PRI');
- $fld->auto_increment = (strpos($rs->fields[5], 'auto_increment') !== false);
- $fld->binary = (strpos($type,'blob') !== false || strpos($type,'binary') !== false);
- $fld->unsigned = (strpos($type,'unsigned') !== false);
- $fld->zerofill = (strpos($type,'zerofill') !== false);
-
- if (!$fld->binary) {
- $d = $rs->fields[4];
- if ($d != '' && $d != 'NULL') {
- $fld->has_default = true;
- $fld->default_value = $d;
- } else {
- $fld->has_default = false;
- }
- }
-
- if ($save == ADODB_FETCH_NUM) {
- $retarr[] = $fld;
- } else {
- $retarr[strtoupper($fld->name)] = $fld;
- }
- $rs->MoveNext();
- }
-
- $rs->Close();
- return $retarr;
- }
-
- // returns true or false
- function SelectDB($dbName)
- {
- $this->database = $dbName;
- $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions
- if ($this->_connectionID) {
- return @mysql_select_db($dbName,$this->_connectionID);
- }
- else return false;
- }
-
- // parameters use PostgreSQL convention, not MySQL
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs=0)
- {
- $offsetStr =($offset>=0) ? ((integer)$offset)."," : '';
- // jason judge, see http://phplens.com/lens/lensforum/msgs.php?id=9220
- if ($nrows < 0) $nrows = '18446744073709551615';
-
- if ($secs)
- $rs = $this->CacheExecute($secs,$sql." LIMIT $offsetStr".((integer)$nrows),$inputarr);
- else
- $rs = $this->Execute($sql." LIMIT $offsetStr".((integer)$nrows),$inputarr);
- return $rs;
- }
-
- // returns queryID or false
- function _query($sql,$inputarr=false)
- {
-
- return mysql_query($sql,$this->_connectionID);
- /*
- global $ADODB_COUNTRECS;
- if($ADODB_COUNTRECS)
- return mysql_query($sql,$this->_connectionID);
- else
- return @mysql_unbuffered_query($sql,$this->_connectionID); // requires PHP >= 4.0.6
- */
- }
-
- /* Returns: the last error message from previous database operation */
- function ErrorMsg()
- {
-
- if ($this->_logsql) return $this->_errorMsg;
- if (empty($this->_connectionID)) $this->_errorMsg = @mysql_error();
- else $this->_errorMsg = @mysql_error($this->_connectionID);
- return $this->_errorMsg;
- }
-
- /* Returns: the last error number from previous database operation */
- function ErrorNo()
- {
- if ($this->_logsql) return $this->_errorCode;
- if (empty($this->_connectionID)) return @mysql_errno();
- else return @mysql_errno($this->_connectionID);
- }
-
- // returns true or false
- function _close()
- {
- @mysql_close($this->_connectionID);
-
- $this->charSet = '';
- $this->_connectionID = false;
- }
-
-
- /*
- * Maximum size of C field
- */
- function CharMax()
- {
- return 255;
- }
-
- /*
- * Maximum size of X field
- */
- function TextMax()
- {
- return 4294967295;
- }
-
- // "Innox - Juan Carlos Gonzalez"
- function MetaForeignKeys( $table, $owner = FALSE, $upper = FALSE, $associative = FALSE )
- {
- global $ADODB_FETCH_MODE;
- if ($ADODB_FETCH_MODE == ADODB_FETCH_ASSOC || $this->fetchMode == ADODB_FETCH_ASSOC) $associative = true;
-
- if ( !empty($owner) ) {
- $table = "$owner.$table";
- }
- $a_create_table = $this->getRow(sprintf('SHOW CREATE TABLE %s', $table));
- if ($associative) {
- $create_sql = isset($a_create_table["Create Table"]) ? $a_create_table["Create Table"] : $a_create_table["Create View"];
- } else $create_sql = $a_create_table[1];
-
- $matches = array();
-
- if (!preg_match_all("/FOREIGN KEY \(`(.*?)`\) REFERENCES `(.*?)` \(`(.*?)`\)/", $create_sql, $matches)) return false;
- $foreign_keys = array();
- $num_keys = count($matches[0]);
- for ( $i = 0; $i < $num_keys; $i ++ ) {
- $my_field = explode('`, `', $matches[1][$i]);
- $ref_table = $matches[2][$i];
- $ref_field = explode('`, `', $matches[3][$i]);
-
- if ( $upper ) {
- $ref_table = strtoupper($ref_table);
- }
-
- // see https://sourceforge.net/tracker/index.php?func=detail&aid=2287278&group_id=42718&atid=433976
- if (!isset($foreign_keys[$ref_table])) {
- $foreign_keys[$ref_table] = array();
- }
- $num_fields = count($my_field);
- for ( $j = 0; $j < $num_fields; $j ++ ) {
- if ( $associative ) {
- $foreign_keys[$ref_table][$ref_field[$j]] = $my_field[$j];
- } else {
- $foreign_keys[$ref_table][] = "{$my_field[$j]}={$ref_field[$j]}";
- }
- }
- }
-
- return $foreign_keys;
- }
-
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-
-class ADORecordSet_mysql extends ADORecordSet{
-
- var $databaseType = "mysql";
- var $canSeek = true;
-
- function ADORecordSet_mysql($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode)
- {
- case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
- case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- default:
- $this->fetchMode = MYSQL_BOTH; break;
- }
- $this->adodbFetchMode = $mode;
- $this->ADORecordSet($queryID);
- }
-
- function _initrs()
- {
- //GLOBAL $ADODB_COUNTRECS;
- // $this->_numOfRows = ($ADODB_COUNTRECS) ? @mysql_num_rows($this->_queryID):-1;
- $this->_numOfRows = @mysql_num_rows($this->_queryID);
- $this->_numOfFields = @mysql_num_fields($this->_queryID);
- }
-
- function FetchField($fieldOffset = -1)
- {
- if ($fieldOffset != -1) {
- $o = @mysql_fetch_field($this->_queryID, $fieldOffset);
- $f = @mysql_field_flags($this->_queryID,$fieldOffset);
- if ($o) $o->max_length = @mysql_field_len($this->_queryID,$fieldOffset); // suggested by: Jim Nicholson (jnich#att.com)
- //$o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable
- if ($o) $o->binary = (strpos($f,'binary')!== false);
- }
- else { /* The $fieldOffset argument is not provided thus its -1 */
- $o = @mysql_fetch_field($this->_queryID);
- //if ($o) $o->max_length = @mysql_field_len($this->_queryID); // suggested by: Jim Nicholson (jnich#att.com)
- $o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable
- }
-
- return $o;
- }
-
- function GetRowAssoc($upper=true)
- {
- if ($this->fetchMode == MYSQL_ASSOC && !$upper) $row = $this->fields;
- else $row = ADORecordSet::GetRowAssoc($upper);
- return $row;
- }
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- // added @ by "Michael William Miller"
- if ($this->fetchMode != MYSQL_NUM) return @$this->fields[$colname];
-
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- function _seek($row)
- {
- if ($this->_numOfRows == 0) return false;
- return @mysql_data_seek($this->_queryID,$row);
- }
-
- function MoveNext()
- {
- //return adodb_movenext($this);
- //if (defined('ADODB_EXTENSION')) return adodb_movenext($this);
- if (@$this->fields = mysql_fetch_array($this->_queryID,$this->fetchMode)) {
- $this->_currentRow += 1;
- return true;
- }
- if (!$this->EOF) {
- $this->_currentRow += 1;
- $this->EOF = true;
- }
- return false;
- }
-
- function _fetch()
- {
- $this->fields = @mysql_fetch_array($this->_queryID,$this->fetchMode);
- return is_array($this->fields);
- }
-
- function _close() {
- @mysql_free_result($this->_queryID);
- $this->_queryID = false;
- }
-
- function MetaType($t,$len=-1,$fieldobj=false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
-
- $len = -1; // mysql max_length is not accurate
- switch (strtoupper($t)) {
- case 'STRING':
- case 'CHAR':
- case 'VARCHAR':
- case 'TINYBLOB':
- case 'TINYTEXT':
- case 'ENUM':
- case 'SET':
- if ($len <= $this->blobSize) return 'C';
-
- case 'TEXT':
- case 'LONGTEXT':
- case 'MEDIUMTEXT':
- return 'X';
-
- // php_mysql extension always returns 'blob' even if 'text'
- // so we have to check whether binary...
- case 'IMAGE':
- case 'LONGBLOB':
- case 'BLOB':
- case 'MEDIUMBLOB':
- case 'BINARY':
- return !empty($fieldobj->binary) ? 'B' : 'X';
-
- case 'YEAR':
- case 'DATE': return 'D';
-
- case 'TIME':
- case 'DATETIME':
- case 'TIMESTAMP': return 'T';
-
- case 'INT':
- case 'INTEGER':
- case 'BIGINT':
- case 'TINYINT':
- case 'MEDIUMINT':
- case 'SMALLINT':
-
- if (!empty($fieldobj->primary_key)) return 'R';
- else return 'I';
-
- default: return 'N';
- }
- }
-
-}
-
-class ADORecordSet_ext_mysql extends ADORecordSet_mysql {
- function ADORecordSet_ext_mysql($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode)
- {
- case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
- case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- default:
- $this->fetchMode = MYSQL_BOTH; break;
- }
- $this->adodbFetchMode = $mode;
- $this->ADORecordSet($queryID);
- }
-
- function MoveNext()
- {
- return @adodb_movenext($this);
- }
-}
-
-
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php
deleted file mode 100644
index 6de3e7f..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php
+++ /dev/null
@@ -1,1282 +0,0 @@
-_transmode = $transaction_mode;
- if (empty($transaction_mode)) {
- $this->Execute('SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ');
- return;
- }
- if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
- $this->Execute("SET SESSION TRANSACTION ".$transaction_mode);
- }
-
- // returns true or false
- // To add: parameter int $port,
- // parameter string $socket
- function _connect($argHostname = NULL,
- $argUsername = NULL,
- $argPassword = NULL,
- $argDatabasename = NULL, $persist=false)
- {
- if(!extension_loaded("mysqli")) {
- return null;
- }
- $this->_connectionID = @mysqli_init();
-
- if (is_null($this->_connectionID)) {
- // mysqli_init only fails if insufficient memory
- if ($this->debug)
- ADOConnection::outp("mysqli_init() failed : " . $this->ErrorMsg());
- return false;
- }
- /*
- I suggest a simple fix which would enable adodb and mysqli driver to
- read connection options from the standard mysql configuration file
- /etc/my.cnf - "Bastien Duclaux"
- */
- foreach($this->optionFlags as $arr) {
- mysqli_options($this->_connectionID,$arr[0],$arr[1]);
- }
-
- //http ://php.net/manual/en/mysqli.persistconns.php
- if ($persist && PHP_VERSION > 5.2 && strncmp($argHostname,'p:',2) != 0) $argHostname = 'p:'.$argHostname;
-
- #if (!empty($this->port)) $argHostname .= ":".$this->port;
- $ok = mysqli_real_connect($this->_connectionID,
- $argHostname,
- $argUsername,
- $argPassword,
- $argDatabasename,
- $this->port,
- $this->socket,
- $this->clientFlags);
-
- if ($ok) {
- if ($argDatabasename) return $this->SelectDB($argDatabasename);
- return true;
- } else {
- if ($this->debug)
- ADOConnection::outp("Could't connect : " . $this->ErrorMsg());
- $this->_connectionID = null;
- return false;
- }
- }
-
- // returns true or false
- // How to force a persistent connection
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename, true);
-
- }
-
- // When is this used? Close old connection first?
- // In _connect(), check $this->forceNewConnect?
- function _nconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- $this->forceNewConnect = true;
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename);
- }
-
- function IfNull( $field, $ifNull )
- {
- return " IFNULL($field, $ifNull) "; // if MySQL
- }
-
- // do not use $ADODB_COUNTRECS
- function GetOne($sql,$inputarr=false)
- {
- global $ADODB_GETONE_EOF;
-
- $ret = false;
- $rs = $this->Execute($sql,$inputarr);
- if ($rs) {
- if ($rs->EOF) $ret = $ADODB_GETONE_EOF;
- else $ret = reset($rs->fields);
- $rs->Close();
- }
- return $ret;
- }
-
- function ServerInfo()
- {
- $arr['description'] = $this->GetOne("select version()");
- $arr['version'] = ADOConnection::_findvers($arr['description']);
- return $arr;
- }
-
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
- $this->transCnt += 1;
-
- //$this->Execute('SET AUTOCOMMIT=0');
- mysqli_autocommit($this->_connectionID, false);
- $this->Execute('BEGIN');
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
-
- if ($this->transCnt) $this->transCnt -= 1;
- $this->Execute('COMMIT');
-
- //$this->Execute('SET AUTOCOMMIT=1');
- mysqli_autocommit($this->_connectionID, true);
- return true;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $this->Execute('ROLLBACK');
- //$this->Execute('SET AUTOCOMMIT=1');
- mysqli_autocommit($this->_connectionID, true);
- return true;
- }
-
- function RowLock($tables,$where='',$col='1 as adodbignore')
- {
- if ($this->transCnt==0) $this->BeginTrans();
- if ($where) $where = ' where '.$where;
- $rs = $this->Execute("select $col from $tables $where for update");
- return !empty($rs);
- }
-
- // if magic quotes disabled, use mysql_real_escape_string()
- // From docs-adodb.htm:
- // Quotes a string to be sent to the database. The $magic_quotes_enabled
- // parameter may look funny, but the idea is if you are quoting a
- // string extracted from a POST/GET variable, then
- // pass get_magic_quotes_gpc() as the second parameter. This will
- // ensure that the variable is not quoted twice, once by qstr and once
- // by the magic_quotes_gpc.
- //
- //Eg. $s = $db->qstr(_GET['name'],get_magic_quotes_gpc());
- function qstr($s, $magic_quotes = false)
- {
- if (is_null($s)) return 'NULL';
- if (!$magic_quotes) {
- if (PHP_VERSION >= 5)
- return "'" . mysqli_real_escape_string($this->_connectionID, $s) . "'";
-
- if ($this->replaceQuote[0] == '\\')
- $s = adodb_str_replace(array('\\',"\0"),array('\\\\',"\\\0"),$s);
- return "'".str_replace("'",$this->replaceQuote,$s)."'";
- }
- // undo magic quotes for "
- $s = str_replace('\\"','"',$s);
- return "'$s'";
- }
-
- function _insertid()
- {
- $result = @mysqli_insert_id($this->_connectionID);
- if ($result == -1){
- if ($this->debug) ADOConnection::outp("mysqli_insert_id() failed : " . $this->ErrorMsg());
- }
- return $result;
- }
-
- // Only works for INSERT, UPDATE and DELETE query's
- function _affectedrows()
- {
- $result = @mysqli_affected_rows($this->_connectionID);
- if ($result == -1) {
- if ($this->debug) ADOConnection::outp("mysqli_affected_rows() failed : " . $this->ErrorMsg());
- }
- return $result;
- }
-
- // See http://www.mysql.com/doc/M/i/Miscellaneous_functions.html
- // Reference on Last_Insert_ID on the recommended way to simulate sequences
- var $_genIDSQL = "update %s set id=LAST_INSERT_ID(id+1);";
- var $_genSeqSQL = "create table %s (id int not null)";
- var $_genSeqCountSQL = "select count(*) from %s";
- var $_genSeq2SQL = "insert into %s values (%s)";
- var $_dropSeqSQL = "drop table %s";
-
- function CreateSequence($seqname='adodbseq',$startID=1)
- {
- if (empty($this->_genSeqSQL)) return false;
- $u = strtoupper($seqname);
-
- $ok = $this->Execute(sprintf($this->_genSeqSQL,$seqname));
- if (!$ok) return false;
- return $this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1));
- }
-
- function GenID($seqname='adodbseq',$startID=1)
- {
- // post-nuke sets hasGenID to false
- if (!$this->hasGenID) return false;
-
- $getnext = sprintf($this->_genIDSQL,$seqname);
- $holdtransOK = $this->_transOK; // save the current status
- $rs = @$this->Execute($getnext);
- if (!$rs) {
- if ($holdtransOK) $this->_transOK = true; //if the status was ok before reset
- $u = strtoupper($seqname);
- $this->Execute(sprintf($this->_genSeqSQL,$seqname));
- $cnt = $this->GetOne(sprintf($this->_genSeqCountSQL,$seqname));
- if (!$cnt) $this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1));
- $rs = $this->Execute($getnext);
- }
-
- if ($rs) {
- $this->genID = mysqli_insert_id($this->_connectionID);
- $rs->Close();
- } else
- $this->genID = 0;
-
- return $this->genID;
- }
-
- function MetaDatabases()
- {
- $query = "SHOW DATABASES";
- $ret = $this->Execute($query);
- if ($ret && is_object($ret)){
- $arr = array();
- while (!$ret->EOF){
- $db = $ret->Fields('Database');
- if ($db != 'mysql') $arr[] = $db;
- $ret->MoveNext();
- }
- return $arr;
- }
- return $ret;
- }
-
-
- function MetaIndexes ($table, $primary = FALSE, $owner = false)
- {
- // save old fetch mode
- global $ADODB_FETCH_MODE;
-
- $false = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- // get index details
- $rs = $this->Execute(sprintf('SHOW INDEXES FROM %s',$table));
-
- // restore fetchmode
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- if (!is_object($rs)) {
- return $false;
- }
-
- $indexes = array ();
-
- // parse index data into array
- while ($row = $rs->FetchRow()) {
- if ($primary == FALSE AND $row[2] == 'PRIMARY') {
- continue;
- }
-
- if (!isset($indexes[$row[2]])) {
- $indexes[$row[2]] = array(
- 'unique' => ($row[1] == 0),
- 'columns' => array()
- );
- }
-
- $indexes[$row[2]]['columns'][$row[3] - 1] = $row[4];
- }
-
- // sort columns by order in the index
- foreach ( array_keys ($indexes) as $index )
- {
- ksort ($indexes[$index]['columns']);
- }
-
- return $indexes;
- }
-
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- if (!$col) $col = $this->sysTimeStamp;
- $s = 'DATE_FORMAT('.$col.",'";
- $concat = false;
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- $ch = $fmt[$i];
- switch($ch) {
- case 'Y':
- case 'y':
- $s .= '%Y';
- break;
- case 'Q':
- case 'q':
- $s .= "'),Quarter($col)";
-
- if ($len > $i+1) $s .= ",DATE_FORMAT($col,'";
- else $s .= ",('";
- $concat = true;
- break;
- case 'M':
- $s .= '%b';
- break;
-
- case 'm':
- $s .= '%m';
- break;
- case 'D':
- case 'd':
- $s .= '%d';
- break;
-
- case 'H':
- $s .= '%H';
- break;
-
- case 'h':
- $s .= '%I';
- break;
-
- case 'i':
- $s .= '%i';
- break;
-
- case 's':
- $s .= '%s';
- break;
-
- case 'a':
- case 'A':
- $s .= '%p';
- break;
-
- case 'w':
- $s .= '%w';
- break;
-
- case 'l':
- $s .= '%W';
- break;
-
- default:
-
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- $s .= $ch;
- break;
- }
- }
- $s.="')";
- if ($concat) $s = "CONCAT($s)";
- return $s;
- }
-
- // returns concatenated string
- // much easier to run "mysqld --ansi" or "mysqld --sql-mode=PIPES_AS_CONCAT" and use || operator
- function Concat()
- {
- $s = "";
- $arr = func_get_args();
-
- // suggestion by andrew005@mnogo.ru
- $s = implode(',',$arr);
- if (strlen($s) > 0) return "CONCAT($s)";
- else return '';
- }
-
- // 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 MetaProcedures($NamePattern = false, $catalog = null, $schemaPattern = null)
- {
- // save old fetch mode
- global $ADODB_FETCH_MODE;
-
- $false = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- $procedures = array ();
-
- // get index details
-
- $likepattern = '';
- if ($NamePattern) {
- $likepattern = " LIKE '".$NamePattern."'";
- }
- $rs = $this->Execute('SHOW PROCEDURE STATUS'.$likepattern);
- if (is_object($rs)) {
-
- // parse index data into array
- while ($row = $rs->FetchRow()) {
- $procedures[$row[1]] = array(
- 'type' => 'PROCEDURE',
- 'catalog' => '',
-
- 'schema' => '',
- 'remarks' => $row[7],
- );
- }
- }
-
- $rs = $this->Execute('SHOW FUNCTION STATUS'.$likepattern);
- if (is_object($rs)) {
- // parse index data into array
- while ($row = $rs->FetchRow()) {
- $procedures[$row[1]] = array(
- 'type' => 'FUNCTION',
- 'catalog' => '',
- 'schema' => '',
- 'remarks' => $row[7]
- );
- }
- }
-
- // restore fetchmode
- if (isset($savem)) {
- $this->SetFetchMode($savem);
-
- }
- $ADODB_FETCH_MODE = $save;
-
-
- return $procedures;
- }
-
- /**
- * Retrieves a list of tables based on given criteria
- *
- * @param string $ttype Table type = 'TABLE', 'VIEW' or false=both (default)
- * @param string $showSchema schema name, false = current schema (default)
- * @param string $mask filters the table by name
- *
- * @return array list of tables
- */
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- $save = $this->metaTablesSQL;
- if ($showSchema && is_string($showSchema)) {
- $this->metaTablesSQL .= $this->qstr($showSchema);
- } else {
- $this->metaTablesSQL .= "schema()";
- }
-
- if ($mask) {
- $mask = $this->qstr($mask);
- $this->metaTablesSQL .= " AND table_name LIKE $mask";
- }
- $ret = ADOConnection::MetaTables($ttype,$showSchema);
-
- $this->metaTablesSQL = $save;
- return $ret;
- }
-
- // "Innox - Juan Carlos Gonzalez"
- function MetaForeignKeys( $table, $owner = FALSE, $upper = FALSE, $associative = FALSE )
- {
- global $ADODB_FETCH_MODE;
-
- if ($ADODB_FETCH_MODE == ADODB_FETCH_ASSOC || $this->fetchMode == ADODB_FETCH_ASSOC) $associative = true;
-
- if ( !empty($owner) ) {
- $table = "$owner.$table";
- }
- $a_create_table = $this->getRow(sprintf('SHOW CREATE TABLE %s', $table));
- if ($associative) {
- $create_sql = isset($a_create_table["Create Table"]) ? $a_create_table["Create Table"] : $a_create_table["Create View"];
- } else $create_sql = $a_create_table[1];
-
- $matches = array();
-
- if (!preg_match_all("/FOREIGN KEY \(`(.*?)`\) REFERENCES `(.*?)` \(`(.*?)`\)/", $create_sql, $matches)) return false;
- $foreign_keys = array();
- $num_keys = count($matches[0]);
- for ( $i = 0; $i < $num_keys; $i ++ ) {
- $my_field = explode('`, `', $matches[1][$i]);
- $ref_table = $matches[2][$i];
- $ref_field = explode('`, `', $matches[3][$i]);
-
- if ( $upper ) {
- $ref_table = strtoupper($ref_table);
- }
-
- // see https://sourceforge.net/tracker/index.php?func=detail&aid=2287278&group_id=42718&atid=433976
- if (!isset($foreign_keys[$ref_table])) {
- $foreign_keys[$ref_table] = array();
- }
- $num_fields = count($my_field);
- for ( $j = 0; $j < $num_fields; $j ++ ) {
- if ( $associative ) {
- $foreign_keys[$ref_table][$ref_field[$j]] = $my_field[$j];
- } else {
- $foreign_keys[$ref_table][] = "{$my_field[$j]}={$ref_field[$j]}";
- }
- }
- }
-
- return $foreign_keys;
- }
-
- function MetaColumns($table, $normalize=true)
- {
- $false = false;
- if (!$this->metaColumnsSQL)
- return $false;
-
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== false)
- $savem = $this->SetFetchMode(false);
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- if (!is_object($rs))
- return $false;
-
- $retarr = array();
- while (!$rs->EOF) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $type = $rs->fields[1];
-
- // split type into type(length):
- $fld->scale = null;
- if (preg_match("/^(.+)\((\d+),(\d+)/", $type, $query_array)) {
- $fld->type = $query_array[1];
- $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
- $fld->scale = is_numeric($query_array[3]) ? $query_array[3] : -1;
- } elseif (preg_match("/^(.+)\((\d+)/", $type, $query_array)) {
- $fld->type = $query_array[1];
- $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
- } elseif (preg_match("/^(enum)\((.*)\)$/i", $type, $query_array)) {
- $fld->type = $query_array[1];
- $arr = explode(",",$query_array[2]);
- $fld->enums = $arr;
- $zlen = max(array_map("strlen",$arr)) - 2; // PHP >= 4.0.6
- $fld->max_length = ($zlen > 0) ? $zlen : 1;
- } else {
- $fld->type = $type;
- $fld->max_length = -1;
- }
- $fld->not_null = ($rs->fields[2] != 'YES');
- $fld->primary_key = ($rs->fields[3] == 'PRI');
- $fld->auto_increment = (strpos($rs->fields[5], 'auto_increment') !== false);
- $fld->binary = (strpos($type,'blob') !== false);
- $fld->unsigned = (strpos($type,'unsigned') !== false);
- $fld->zerofill = (strpos($type,'zerofill') !== false);
-
- if (!$fld->binary) {
- $d = $rs->fields[4];
- if ($d != '' && $d != 'NULL') {
- $fld->has_default = true;
- $fld->default_value = $d;
- } else {
- $fld->has_default = false;
- }
- }
-
- if ($save == ADODB_FETCH_NUM) {
- $retarr[] = $fld;
- } else {
- $retarr[strtoupper($fld->name)] = $fld;
- }
- $rs->MoveNext();
- }
-
- $rs->Close();
- return $retarr;
- }
-
- // returns true or false
- function SelectDB($dbName)
- {
-// $this->_connectionID = $this->mysqli_resolve_link($this->_connectionID);
- $this->database = $dbName;
- $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions
-
- if ($this->_connectionID) {
- $result = @mysqli_select_db($this->_connectionID, $dbName);
- if (!$result) {
- ADOConnection::outp("Select of database " . $dbName . " failed. " . $this->ErrorMsg());
- }
- return $result;
- }
- return false;
- }
-
- // parameters use PostgreSQL convention, not MySQL
- function SelectLimit($sql,
- $nrows = -1,
- $offset = -1,
- $inputarr = false,
- $secs = 0)
- {
- $offsetStr = ($offset >= 0) ? "$offset," : '';
- if ($nrows < 0) $nrows = '18446744073709551615';
-
- if ($secs)
- $rs = $this->CacheExecute($secs, $sql . " LIMIT $offsetStr$nrows" , $inputarr );
- else
- $rs = $this->Execute($sql . " LIMIT $offsetStr$nrows" , $inputarr );
-
- return $rs;
- }
-
-
- function Prepare($sql)
- {
- return $sql;
- $stmt = $this->_connectionID->prepare($sql);
- if (!$stmt) {
- echo $this->ErrorMsg();
- return $sql;
- }
- return array($sql,$stmt);
- }
-
-
- // returns queryID or false
- function _query($sql, $inputarr)
- {
- global $ADODB_COUNTRECS;
- // Move to the next recordset, or return false if there is none. In a stored proc
- // call, mysqli_next_result returns true for the last "recordset", but mysqli_store_result
- // returns false. I think this is because the last "recordset" is actually just the
- // return value of the stored proc (ie the number of rows affected).
- // Commented out for reasons of performance. You should retrieve every recordset yourself.
- // if (!mysqli_next_result($this->connection->_connectionID)) return false;
-
- if (is_array($sql)) {
-
- // Prepare() not supported because mysqli_stmt_execute does not return a recordset, but
- // returns as bound variables.
-
- $stmt = $sql[1];
- $a = '';
- foreach($inputarr as $k => $v) {
- if (is_string($v)) $a .= 's';
- else if (is_integer($v)) $a .= 'i';
- else $a .= 'd';
- }
-
- $fnarr = array_merge( array($stmt,$a) , $inputarr);
- $ret = call_user_func_array('mysqli_stmt_bind_param',$fnarr);
- $ret = mysqli_stmt_execute($stmt);
- return $ret;
- }
-
- /*
- if (!$mysql_res = mysqli_query($this->_connectionID, $sql, ($ADODB_COUNTRECS) ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT)) {
- if ($this->debug) ADOConnection::outp("Query: " . $sql . " failed. " . $this->ErrorMsg());
- return false;
- }
-
- return $mysql_res;
- */
-
- if ($this->multiQuery) {
- $rs = mysqli_multi_query($this->_connectionID, $sql.';');
- if ($rs) {
- $rs = ($ADODB_COUNTRECS) ? @mysqli_store_result( $this->_connectionID ) : @mysqli_use_result( $this->_connectionID );
- return $rs ? $rs : true; // mysqli_more_results( $this->_connectionID )
- }
- } else {
- $rs = mysqli_query($this->_connectionID, $sql, $ADODB_COUNTRECS ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT);
-
- if ($rs) return $rs;
- }
-
- if($this->debug)
- ADOConnection::outp("Query: " . $sql . " failed. " . $this->ErrorMsg());
-
- return false;
-
- }
-
- /* Returns: the last error message from previous database operation */
- function ErrorMsg()
- {
- if (empty($this->_connectionID))
- $this->_errorMsg = @mysqli_connect_error();
- else
- $this->_errorMsg = @mysqli_error($this->_connectionID);
- return $this->_errorMsg;
- }
-
- /* Returns: the last error number from previous database operation */
- function ErrorNo()
- {
- if (empty($this->_connectionID))
- return @mysqli_connect_errno();
- else
- return @mysqli_errno($this->_connectionID);
- }
-
- // returns true or false
- function _close()
- {
- @mysqli_close($this->_connectionID);
- $this->_connectionID = false;
- }
-
- /*
- * Maximum size of C field
- */
- function CharMax()
- {
- return 255;
- }
-
- /*
- * Maximum size of X field
- */
- function TextMax()
- {
- return 4294967295;
- }
-
-
-
- // this is a set of functions for managing client encoding - very important if the encodings
- // of your database and your output target (i.e. HTML) don't match
- // for instance, you may have UTF8 database and server it on-site as latin1 etc.
- // GetCharSet - get the name of the character set the client is using now
- // Under Windows, the functions should work with MySQL 4.1.11 and above, the set of charsets supported
- // depends on compile flags of mysql distribution
-
- function GetCharSet()
- {
- //we will use ADO's builtin property charSet
- if (!method_exists($this->_connectionID,'character_set_name'))
- return false;
-
- $this->charSet = @$this->_connectionID->character_set_name();
- if (!$this->charSet) {
- return false;
- } else {
- return $this->charSet;
- }
- }
-
- // SetCharSet - switch the client encoding
- function SetCharSet($charset_name)
- {
- if (!method_exists($this->_connectionID,'set_charset'))
- return false;
-
- if ($this->charSet !== $charset_name) {
- $if = @$this->_connectionID->set_charset($charset_name);
- if ($if === true & $this->GetCharSet() == $charset_name) {
- return true;
- } else return false;
- } else return true;
- }
-
-
-
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_mysqli extends ADORecordSet{
-
- var $databaseType = "mysqli";
- var $canSeek = true;
-
- function ADORecordSet_mysqli($queryID, $mode = false)
- {
- if ($mode === false)
- {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
-
- switch ($mode)
- {
- case ADODB_FETCH_NUM:
- $this->fetchMode = MYSQLI_NUM;
- break;
- case ADODB_FETCH_ASSOC:
- $this->fetchMode = MYSQLI_ASSOC;
- break;
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- default:
- $this->fetchMode = MYSQLI_BOTH;
- break;
- }
- $this->adodbFetchMode = $mode;
- $this->ADORecordSet($queryID);
- }
-
- function _initrs()
- {
- global $ADODB_COUNTRECS;
-
- $this->_numOfRows = $ADODB_COUNTRECS ? @mysqli_num_rows($this->_queryID) : -1;
- $this->_numOfFields = @mysqli_num_fields($this->_queryID);
- }
-
-/*
-1 = MYSQLI_NOT_NULL_FLAG
-2 = MYSQLI_PRI_KEY_FLAG
-4 = MYSQLI_UNIQUE_KEY_FLAG
-8 = MYSQLI_MULTIPLE_KEY_FLAG
-16 = MYSQLI_BLOB_FLAG
-32 = MYSQLI_UNSIGNED_FLAG
-64 = MYSQLI_ZEROFILL_FLAG
-128 = MYSQLI_BINARY_FLAG
-256 = MYSQLI_ENUM_FLAG
-512 = MYSQLI_AUTO_INCREMENT_FLAG
-1024 = MYSQLI_TIMESTAMP_FLAG
-2048 = MYSQLI_SET_FLAG
-32768 = MYSQLI_NUM_FLAG
-16384 = MYSQLI_PART_KEY_FLAG
-32768 = MYSQLI_GROUP_FLAG
-65536 = MYSQLI_UNIQUE_FLAG
-131072 = MYSQLI_BINCMP_FLAG
-*/
-
- function FetchField($fieldOffset = -1)
- {
- $fieldnr = $fieldOffset;
- if ($fieldOffset != -1) {
- $fieldOffset = @mysqli_field_seek($this->_queryID, $fieldnr);
- }
- $o = @mysqli_fetch_field($this->_queryID);
- if (!$o) return false;
- /* Properties of an ADOFieldObject as set by MetaColumns */
- $o->primary_key = $o->flags & MYSQLI_PRI_KEY_FLAG;
- $o->not_null = $o->flags & MYSQLI_NOT_NULL_FLAG;
- $o->auto_increment = $o->flags & MYSQLI_AUTO_INCREMENT_FLAG;
- $o->binary = $o->flags & MYSQLI_BINARY_FLAG;
- // $o->blob = $o->flags & MYSQLI_BLOB_FLAG; /* not returned by MetaColumns */
- $o->unsigned = $o->flags & MYSQLI_UNSIGNED_FLAG;
-
- return $o;
- }
-
- function GetRowAssoc($upper = true)
- {
- if ($this->fetchMode == MYSQLI_ASSOC && !$upper)
- return $this->fields;
- $row = ADORecordSet::GetRowAssoc($upper);
- return $row;
- }
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- if ($this->fetchMode != MYSQLI_NUM)
- return @$this->fields[$colname];
-
- if (!$this->bind) {
- $this->bind = array();
- for ($i = 0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- function _seek($row)
- {
- if ($this->_numOfRows == 0)
- return false;
-
- if ($row < 0)
- return false;
-
- mysqli_data_seek($this->_queryID, $row);
- $this->EOF = false;
- return true;
- }
-
-
- function NextRecordSet()
- {
- global $ADODB_COUNTRECS;
-
- mysqli_free_result($this->_queryID);
- $this->_queryID = -1;
- // Move to the next recordset, or return false if there is none. In a stored proc
- // call, mysqli_next_result returns true for the last "recordset", but mysqli_store_result
- // returns false. I think this is because the last "recordset" is actually just the
- // return value of the stored proc (ie the number of rows affected).
- if(!mysqli_next_result($this->connection->_connectionID)) {
- return false;
- }
- // CD: There is no $this->_connectionID variable, at least in the ADO version I'm using
- $this->_queryID = ($ADODB_COUNTRECS) ? @mysqli_store_result( $this->connection->_connectionID )
- : @mysqli_use_result( $this->connection->_connectionID );
- if(!$this->_queryID) {
- return false;
- }
- $this->_inited = false;
- $this->bind = false;
- $this->_currentRow = -1;
- $this->Init();
- return true;
- }
-
- // 10% speedup to move MoveNext to child class
- // This is the only implementation that works now (23-10-2003).
- // Other functions return no or the wrong results.
- function MoveNext()
- {
- if ($this->EOF) return false;
- $this->_currentRow++;
- $this->fields = @mysqli_fetch_array($this->_queryID,$this->fetchMode);
-
- if (is_array($this->fields)) return true;
- $this->EOF = true;
- return false;
- }
-
- function _fetch()
- {
- $this->fields = mysqli_fetch_array($this->_queryID,$this->fetchMode);
- return is_array($this->fields);
- }
-
- function _close()
- {
- //if results are attached to this pointer from Stored Proceedure calls, the next standard query will die 2014
- //only a problem with persistant connections
-
- while(mysqli_more_results($this->connection->_connectionID)){
- @mysqli_next_result($this->connection->_connectionID);
- }
-
- mysqli_free_result($this->_queryID);
- $this->_queryID = false;
- }
-
-/*
-
-0 = MYSQLI_TYPE_DECIMAL
-1 = MYSQLI_TYPE_CHAR
-1 = MYSQLI_TYPE_TINY
-2 = MYSQLI_TYPE_SHORT
-3 = MYSQLI_TYPE_LONG
-4 = MYSQLI_TYPE_FLOAT
-5 = MYSQLI_TYPE_DOUBLE
-6 = MYSQLI_TYPE_NULL
-7 = MYSQLI_TYPE_TIMESTAMP
-8 = MYSQLI_TYPE_LONGLONG
-9 = MYSQLI_TYPE_INT24
-10 = MYSQLI_TYPE_DATE
-11 = MYSQLI_TYPE_TIME
-12 = MYSQLI_TYPE_DATETIME
-13 = MYSQLI_TYPE_YEAR
-14 = MYSQLI_TYPE_NEWDATE
-247 = MYSQLI_TYPE_ENUM
-248 = MYSQLI_TYPE_SET
-249 = MYSQLI_TYPE_TINY_BLOB
-250 = MYSQLI_TYPE_MEDIUM_BLOB
-251 = MYSQLI_TYPE_LONG_BLOB
-252 = MYSQLI_TYPE_BLOB
-253 = MYSQLI_TYPE_VAR_STRING
-254 = MYSQLI_TYPE_STRING
-255 = MYSQLI_TYPE_GEOMETRY
-*/
-
- function MetaType($t, $len = -1, $fieldobj = false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
-
-
- $len = -1; // mysql max_length is not accurate
- switch (strtoupper($t)) {
- case 'STRING':
- case 'CHAR':
- case 'VARCHAR':
- case 'TINYBLOB':
- case 'TINYTEXT':
- case 'ENUM':
- case 'SET':
-
- case MYSQLI_TYPE_TINY_BLOB :
- #case MYSQLI_TYPE_CHAR :
- case MYSQLI_TYPE_STRING :
- case MYSQLI_TYPE_ENUM :
- case MYSQLI_TYPE_SET :
- case 253 :
- if ($len <= $this->blobSize) return 'C';
-
- case 'TEXT':
- case 'LONGTEXT':
- case 'MEDIUMTEXT':
- return 'X';
-
-
- // php_mysql extension always returns 'blob' even if 'text'
- // so we have to check whether binary...
- case 'IMAGE':
- case 'LONGBLOB':
- case 'BLOB':
- case 'MEDIUMBLOB':
-
- case MYSQLI_TYPE_BLOB :
- case MYSQLI_TYPE_LONG_BLOB :
- case MYSQLI_TYPE_MEDIUM_BLOB :
-
- return !empty($fieldobj->binary) ? 'B' : 'X';
- case 'YEAR':
- case 'DATE':
- case MYSQLI_TYPE_DATE :
- case MYSQLI_TYPE_YEAR :
-
- return 'D';
-
- case 'TIME':
- case 'DATETIME':
- case 'TIMESTAMP':
-
- case MYSQLI_TYPE_DATETIME :
- case MYSQLI_TYPE_NEWDATE :
- case MYSQLI_TYPE_TIME :
- case MYSQLI_TYPE_TIMESTAMP :
-
- return 'T';
-
- case 'INT':
- case 'INTEGER':
- case 'BIGINT':
- case 'TINYINT':
- case 'MEDIUMINT':
- case 'SMALLINT':
-
- case MYSQLI_TYPE_INT24 :
- case MYSQLI_TYPE_LONG :
- case MYSQLI_TYPE_LONGLONG :
- case MYSQLI_TYPE_SHORT :
- case MYSQLI_TYPE_TINY :
-
- if (!empty($fieldobj->primary_key)) return 'R';
-
- return 'I';
-
-
- // Added floating-point types
- // Maybe not necessery.
- case 'FLOAT':
- case 'DOUBLE':
- // case 'DOUBLE PRECISION':
- case 'DECIMAL':
- case 'DEC':
- case 'FIXED':
- default:
- //if (!is_numeric($t)) echo "--- Error in type matching $t -----
";
- return 'N';
- }
- } // function
-
-
-} // rs class
-
-}
-
-class ADORecordSet_array_mysqli extends ADORecordSet_array {
-
- function ADORecordSet_array_mysqli($id=-1,$mode=false)
- {
- $this->ADORecordSet_array($id,$mode);
- }
-
- function MetaType($t, $len = -1, $fieldobj = false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
-
-
- $len = -1; // mysql max_length is not accurate
- switch (strtoupper($t)) {
- case 'STRING':
- case 'CHAR':
- case 'VARCHAR':
- case 'TINYBLOB':
- case 'TINYTEXT':
- case 'ENUM':
- case 'SET':
-
- case MYSQLI_TYPE_TINY_BLOB :
- #case MYSQLI_TYPE_CHAR :
- case MYSQLI_TYPE_STRING :
- case MYSQLI_TYPE_ENUM :
- case MYSQLI_TYPE_SET :
- case 253 :
- if ($len <= $this->blobSize) return 'C';
-
- case 'TEXT':
- case 'LONGTEXT':
- case 'MEDIUMTEXT':
- return 'X';
-
-
- // php_mysql extension always returns 'blob' even if 'text'
- // so we have to check whether binary...
- case 'IMAGE':
- case 'LONGBLOB':
- case 'BLOB':
- case 'MEDIUMBLOB':
-
- case MYSQLI_TYPE_BLOB :
- case MYSQLI_TYPE_LONG_BLOB :
- case MYSQLI_TYPE_MEDIUM_BLOB :
-
- return !empty($fieldobj->binary) ? 'B' : 'X';
- case 'YEAR':
- case 'DATE':
- case MYSQLI_TYPE_DATE :
- case MYSQLI_TYPE_YEAR :
-
- return 'D';
-
- case 'TIME':
- case 'DATETIME':
- case 'TIMESTAMP':
-
- case MYSQLI_TYPE_DATETIME :
- case MYSQLI_TYPE_NEWDATE :
- case MYSQLI_TYPE_TIME :
- case MYSQLI_TYPE_TIMESTAMP :
-
- return 'T';
-
- case 'INT':
- case 'INTEGER':
- case 'BIGINT':
- case 'TINYINT':
- case 'MEDIUMINT':
- case 'SMALLINT':
-
- case MYSQLI_TYPE_INT24 :
- case MYSQLI_TYPE_LONG :
- case MYSQLI_TYPE_LONGLONG :
- case MYSQLI_TYPE_SHORT :
- case MYSQLI_TYPE_TINY :
-
- if (!empty($fieldobj->primary_key)) return 'R';
-
- return 'I';
-
-
- // Added floating-point types
- // Maybe not necessery.
- case 'FLOAT':
- case 'DOUBLE':
- // case 'DOUBLE PRECISION':
- case 'DECIMAL':
- case 'DEC':
- case 'FIXED':
- default:
- //if (!is_numeric($t)) echo "--- Error in type matching $t -----
";
- return 'N';
- }
- } // function
-
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-mysqlpo.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-mysqlpo.inc.php
deleted file mode 100644
index 9077301..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-mysqlpo.inc.php
+++ /dev/null
@@ -1,136 +0,0 @@
-
-
- Requires mysql client. Works on Windows and Unix.
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-include_once(ADODB_DIR."/drivers/adodb-mysql.inc.php");
-
-
-class ADODB_mysqlt extends ADODB_mysql {
- var $databaseType = 'mysqlt';
- var $ansiOuter = true; // for Version 3.23.17 or later
- var $hasTransactions = true;
- var $autoRollback = true; // apparently mysql does not autorollback properly
-
- function ADODB_mysqlt()
- {
- global $ADODB_EXTENSION; if ($ADODB_EXTENSION) $this->rsPrefix .= 'ext_';
- }
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
- $this->transCnt += 1;
- $this->Execute('SET AUTOCOMMIT=0');
- $this->Execute('BEGIN');
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
-
- if ($this->transCnt) $this->transCnt -= 1;
- $this->Execute('COMMIT');
- $this->Execute('SET AUTOCOMMIT=1');
- return true;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $this->Execute('ROLLBACK');
- $this->Execute('SET AUTOCOMMIT=1');
- return true;
- }
-
- function RowLock($tables,$where='',$col='1 as adodbignore')
- {
- if ($this->transCnt==0) $this->BeginTrans();
- if ($where) $where = ' where '.$where;
- $rs = $this->Execute("select $col from $tables $where for update");
- return !empty($rs);
- }
-
-}
-
-class ADORecordSet_mysqlt extends ADORecordSet_mysql{
- var $databaseType = "mysqlt";
-
- function ADORecordSet_mysqlt($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
-
- switch ($mode)
- {
- case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
- case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
-
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- default: $this->fetchMode = MYSQL_BOTH; break;
- }
-
- $this->adodbFetchMode = $mode;
- $this->ADORecordSet($queryID);
- }
-
- function MoveNext()
- {
- if (@$this->fields = mysql_fetch_array($this->_queryID,$this->fetchMode)) {
- $this->_currentRow += 1;
- return true;
- }
- if (!$this->EOF) {
- $this->_currentRow += 1;
- $this->EOF = true;
- }
- return false;
- }
-}
-
-class ADORecordSet_ext_mysqlt extends ADORecordSet_mysqlt {
-
- function ADORecordSet_ext_mysqlt($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode)
- {
- case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
- case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
-
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- default:
- $this->fetchMode = MYSQL_BOTH; break;
- }
- $this->adodbFetchMode = $mode;
- $this->ADORecordSet($queryID);
- }
-
- function MoveNext()
- {
- return adodb_movenext($this);
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-mysqlt.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-mysqlt.inc.php
deleted file mode 100644
index 74ee4b4..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-mysqlt.inc.php
+++ /dev/null
@@ -1,153 +0,0 @@
-
-
- Requires mysql client. Works on Windows and Unix.
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-include_once(ADODB_DIR."/drivers/adodb-mysql.inc.php");
-
-
-class ADODB_mysqlt extends ADODB_mysql {
- var $databaseType = 'mysqlt';
- var $ansiOuter = true; // for Version 3.23.17 or later
- var $hasTransactions = true;
- var $autoRollback = true; // apparently mysql does not autorollback properly
-
- function ADODB_mysqlt()
- {
- global $ADODB_EXTENSION; if ($ADODB_EXTENSION) $this->rsPrefix .= 'ext_';
- }
-
- /* set transaction mode
-
- SET [GLOBAL | SESSION] TRANSACTION ISOLATION LEVEL
-{ READ UNCOMMITTED | READ COMMITTED | REPEATABLE READ | SERIALIZABLE }
-
- */
- function SetTransactionMode( $transaction_mode )
- {
- $this->_transmode = $transaction_mode;
- if (empty($transaction_mode)) {
- $this->Execute('SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ');
- return;
- }
- if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
- $this->Execute("SET SESSION TRANSACTION ".$transaction_mode);
- }
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
- $this->transCnt += 1;
- $this->Execute('SET AUTOCOMMIT=0');
- $this->Execute('BEGIN');
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
-
- if ($this->transCnt) $this->transCnt -= 1;
- $ok = $this->Execute('COMMIT');
- $this->Execute('SET AUTOCOMMIT=1');
- return $ok ? true : false;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $ok = $this->Execute('ROLLBACK');
- $this->Execute('SET AUTOCOMMIT=1');
- return $ok ? true : false;
- }
-
- function RowLock($tables,$where='',$col='1 as adodbignore')
- {
- if ($this->transCnt==0) $this->BeginTrans();
- if ($where) $where = ' where '.$where;
- $rs = $this->Execute("select $col from $tables $where for update");
- return !empty($rs);
- }
-
-}
-
-class ADORecordSet_mysqlt extends ADORecordSet_mysql{
- var $databaseType = "mysqlt";
-
- function ADORecordSet_mysqlt($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
-
- switch ($mode)
- {
- case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
- case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
-
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- default: $this->fetchMode = MYSQL_BOTH; break;
- }
-
- $this->adodbFetchMode = $mode;
- $this->ADORecordSet($queryID);
- }
-
- function MoveNext()
- {
- if (@$this->fields = mysql_fetch_array($this->_queryID,$this->fetchMode)) {
- $this->_currentRow += 1;
- return true;
- }
- if (!$this->EOF) {
- $this->_currentRow += 1;
- $this->EOF = true;
- }
- return false;
- }
-}
-
-class ADORecordSet_ext_mysqlt extends ADORecordSet_mysqlt {
-
- function ADORecordSet_ext_mysqlt($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode)
- {
- case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
- case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
-
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- default:
- $this->fetchMode = MYSQL_BOTH; break;
- }
- $this->adodbFetchMode = $mode;
- $this->ADORecordSet($queryID);
- }
-
- function MoveNext()
- {
- return adodb_movenext($this);
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-netezza.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-netezza.inc.php
deleted file mode 100644
index 7c1631b..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-netezza.inc.php
+++ /dev/null
@@ -1,169 +0,0 @@
- 0 ORDER BY attnum";
- var $metaColumnsSQL1 = "SELECT attname, atttype FROM _v_relation_column_def WHERE name = '%s' AND attnum > 0 ORDER BY attnum";
- // netezza doesn't have keys. it does have distributions, so maybe this is
- // something that can be pulled from the system tables
- var $metaKeySQL = "";
- var $hasAffectedRows = true;
- var $hasLimit = true;
- var $true = 't'; // string that represents TRUE for a database
- var $false = 'f'; // string that represents FALSE for a database
- var $fmtDate = "'Y-m-d'"; // used by DBDate() as the default date format used by the database
- var $fmtTimeStamp = "'Y-m-d G:i:s'"; // used by DBTimeStamp as the default timestamp fmt.
- var $ansiOuter = true;
- var $autoRollback = true; // apparently pgsql does not autorollback properly before 4.3.4
- // http://bugs.php.net/bug.php?id=25404
-
-
- function ADODB_netezza()
- {
-
- }
-
- function MetaColumns($table,$upper=true)
- {
-
- // Changed this function to support Netezza which has no concept of keys
- // could posisbly work on other things from the system table later.
-
- global $ADODB_FETCH_MODE;
-
- $table = strtolower($table);
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
-
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table,$table));
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- if ($rs === false) return false;
-
- $retarr = array();
- while (!$rs->EOF) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
-
- // since we're returning type and length as one string,
- // split them out here.
-
- if ($first = strstr($rs->fields[1], "(")) {
- $fld->max_length = trim($first, "()");
- } else {
- $fld->max_length = -1;
- }
-
- if ($first = strpos($rs->fields[1], "(")) {
- $fld->type = substr($rs->fields[1], 0, $first);
- } else {
- $fld->type = $rs->fields[1];
- }
-
- switch ($fld->type) {
- case "byteint":
- case "boolean":
- $fld->max_length = 1;
- break;
- case "smallint":
- $fld->max_length = 2;
- break;
- case "integer":
- case "numeric":
- case "date":
- $fld->max_length = 4;
- break;
- case "bigint":
- case "time":
- case "timestamp":
- $fld->max_length = 8;
- break;
- case "timetz":
- case "time with time zone":
- $fld->max_length = 12;
- break;
- }
-
- if ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] = $fld;
- else $retarr[($upper) ? strtoupper($fld->name) : $fld->name] = $fld;
-
- $rs->MoveNext();
- }
- $rs->Close();
- return $retarr;
-
- }
-
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_netezza extends ADORecordSet_postgres64
-{
- var $databaseType = "netezza";
- var $canSeek = true;
-
- function ADORecordSet_netezza($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode)
- {
- case ADODB_FETCH_NUM: $this->fetchMode = PGSQL_NUM; break;
- case ADODB_FETCH_ASSOC:$this->fetchMode = PGSQL_ASSOC; break;
-
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- default: $this->fetchMode = PGSQL_BOTH; break;
- }
- $this->adodbFetchMode = $mode;
- $this->ADORecordSet($queryID);
- }
-
- // _initrs modified to disable blob handling
- function _initrs()
- {
- global $ADODB_COUNTRECS;
- $this->_numOfRows = ($ADODB_COUNTRECS)? @pg_numrows($this->_queryID):-1;
- $this->_numOfFields = @pg_numfields($this->_queryID);
- }
-
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-oci8.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-oci8.inc.php
deleted file mode 100644
index 6eac31a..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-oci8.inc.php
+++ /dev/null
@@ -1,1669 +0,0 @@
-
-
- 13 Nov 2000 jlim - removed all ora_* references.
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-/*
-NLS_Date_Format
-Allows you to use a date format other than the Oracle Lite default. When a literal
-character string appears where a date value is expected, the Oracle Lite database
-tests the string to see if it matches the formats of Oracle, SQL-92, or the value
-specified for this parameter in the POLITE.INI file. Setting this parameter also
-defines the default format used in the TO_CHAR or TO_DATE functions when no
-other format string is supplied.
-
-For Oracle the default is dd-mon-yy or dd-mon-yyyy, and for SQL-92 the default is
-yy-mm-dd or yyyy-mm-dd.
-
-Using 'RR' in the format forces two-digit years less than or equal to 49 to be
-interpreted as years in the 21st century (2000-2049), and years over 50 as years in
-the 20th century (1950-1999). Setting the RR format as the default for all two-digit
-year entries allows you to become year-2000 compliant. For example:
-NLS_DATE_FORMAT='RR-MM-DD'
-
-You can also modify the date format using the ALTER SESSION command.
-*/
-
-# define the LOB descriptor type for the given type
-# returns false if no LOB descriptor
-function oci_lob_desc($type) {
- switch ($type) {
- case OCI_B_BFILE: $result = OCI_D_FILE; break;
- case OCI_B_CFILEE: $result = OCI_D_FILE; break;
- case OCI_B_CLOB: $result = OCI_D_LOB; break;
- case OCI_B_BLOB: $result = OCI_D_LOB; break;
- case OCI_B_ROWID: $result = OCI_D_ROWID; break;
- default: $result = false; break;
- }
- return $result;
-}
-
-class ADODB_oci8 extends ADOConnection {
- var $databaseType = 'oci8';
- var $dataProvider = 'oci8';
- var $replaceQuote = "''"; // string to use to replace quotes
- var $concat_operator='||';
- var $sysDate = "TRUNC(SYSDATE)";
- var $sysTimeStamp = 'SYSDATE'; // requires oracle 9 or later, otherwise use SYSDATE
- var $metaDatabasesSQL = "SELECT USERNAME FROM ALL_USERS WHERE USERNAME NOT IN ('SYS','SYSTEM','DBSNMP','OUTLN') ORDER BY 1";
- var $_stmt;
- var $_commit = OCI_COMMIT_ON_SUCCESS;
- var $_initdate = true; // init date to YYYY-MM-DD
- var $metaTablesSQL = "select table_name,table_type from cat where table_type in ('TABLE','VIEW') and table_name not like 'BIN\$%'"; // bin$ tables are recycle bin tables
- var $metaColumnsSQL = "select cname,coltype,width, SCALE, PRECISION, NULLS, DEFAULTVAL from col where tname='%s' order by colno"; //changed by smondino@users.sourceforge. net
- var $metaColumnsSQL2 = "select column_name,data_type,data_length, data_scale, data_precision,
- case when nullable = 'Y' then 'NULL'
- else 'NOT NULL' end as nulls,
- data_default from all_tab_cols
- where owner='%s' and table_name='%s' order by column_id"; // when there is a schema
- var $_bindInputArray = true;
- var $hasGenID = true;
- var $_genIDSQL = "SELECT (%s.nextval) FROM DUAL";
- var $_genSeqSQL = "
-DECLARE
- PRAGMA AUTONOMOUS_TRANSACTION;
-BEGIN
- execute immediate 'CREATE SEQUENCE %s START WITH %s';
-END;
-";
-
- var $_dropSeqSQL = "DROP SEQUENCE %s";
- var $hasAffectedRows = true;
- var $random = "abs(mod(DBMS_RANDOM.RANDOM,10000001)/10000000)";
- 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
- var $session_sharing_force_blob = false; // alter session on updateblob if set to true
- var $firstrows = true; // enable first rows optimization on SelectLimit()
- var $selectOffsetAlg1 = 1000; // when to use 1st algorithm of selectlimit.
- var $NLS_DATE_FORMAT = 'YYYY-MM-DD'; // To include time, use 'RRRR-MM-DD HH24:MI:SS'
- var $dateformat = 'YYYY-MM-DD'; // DBDate format
- var $useDBDateFormatForTextInput=false;
- var $datetime = false; // MetaType('DATE') returns 'D' (datetime==false) or 'T' (datetime == true)
- var $_refLOBs = array();
-
- // var $ansiOuter = true; // if oracle9
-
- function ADODB_oci8()
- {
- $this->_hasOciFetchStatement = ADODB_PHPVER >= 0x4200;
- if (defined('ADODB_EXTENSION')) $this->rsPrefix .= 'ext_';
- }
-
- /* function MetaColumns($table, $normalize=true) added by smondino@users.sourceforge.net*/
- function MetaColumns($table, $normalize=true)
- {
- global $ADODB_FETCH_MODE;
-
- $schema = '';
- $this->_findschema($table, $schema);
-
- $false = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
-
- if ($schema)
- $rs = $this->Execute(sprintf($this->metaColumnsSQL2, strtoupper($schema), strtoupper($table)));
- else
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,strtoupper($table)));
-
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- if (!$rs) {
- return $false;
- }
- $retarr = array();
- while (!$rs->EOF) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $fld->type = $rs->fields[1];
- $fld->max_length = $rs->fields[2];
- $fld->scale = $rs->fields[3];
- if ($rs->fields[1] == 'NUMBER') {
- if ($rs->fields[3] == 0) $fld->type = 'INT';
- $fld->max_length = $rs->fields[4];
- }
- $fld->not_null = (strncmp($rs->fields[5], 'NOT',3) === 0);
- $fld->binary = (strpos($fld->type,'BLOB') !== false);
- $fld->default_value = $rs->fields[6];
-
- if ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] = $fld;
- else $retarr[strtoupper($fld->name)] = $fld;
- $rs->MoveNext();
- }
- $rs->Close();
- if (empty($retarr))
- return $false;
- else
- return $retarr;
- }
-
- function Time()
- {
- $rs = $this->Execute("select TO_CHAR($this->sysTimeStamp,'YYYY-MM-DD HH24:MI:SS') from dual");
- if ($rs && !$rs->EOF) return $this->UnixTimeStamp(reset($rs->fields));
-
- return false;
- }
-
- /**
- * Multiple modes of connection are supported:
- *
- * a. Local Database
- * $conn->Connect(false,'scott','tiger');
- *
- * b. From tnsnames.ora
- * $conn->Connect($tnsname,'scott','tiger');
- * $conn->Connect(false,'scott','tiger',$tnsname);
- *
- * c. Server + service name
- * $conn->Connect($serveraddress,'scott,'tiger',$service_name);
- *
- * d. Server + SID
- * $conn->connectSID = true;
- * $conn->Connect($serveraddress,'scott,'tiger',$SID);
- *
- * @param string|false $argHostname DB server hostname or TNS name
- * @param string $argUsername
- * @param string $argPassword
- * @param string $argDatabasename Service name, SID (defaults to null)
- * @param int $mode Connection mode, defaults to 0
- * (0 = non-persistent, 1 = persistent, 2 = force new connection)
- *
- * @return bool
- */
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename=null, $mode=0)
- {
- if (!function_exists('oci_pconnect')) return null;
- #adodb_backtrace();
-
- $this->_errorMsg = false;
- $this->_errorCode = false;
-
- if($argHostname) { // added by Jorma Tuomainen
- if (empty($argDatabasename)) $argDatabasename = $argHostname;
- else {
- if(strpos($argHostname,":")) {
- $argHostinfo=explode(":",$argHostname);
- $argHostname=$argHostinfo[0];
- $argHostport=$argHostinfo[1];
- } else {
- $argHostport = empty($this->port)? "1521" : $this->port;
- }
-
- if (strncasecmp($argDatabasename,'SID=',4) == 0) {
- $argDatabasename = substr($argDatabasename,4);
- $this->connectSID = true;
- }
-
- if ($this->connectSID) {
- $argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname
- .")(PORT=$argHostport))(CONNECT_DATA=(SID=$argDatabasename)))";
- } else
- $argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname
- .")(PORT=$argHostport))(CONNECT_DATA=(SERVICE_NAME=$argDatabasename)))";
- }
- }
-
- //if ($argHostname) print "Connect: 1st argument should be left blank for $this->databaseType
";
- if ($mode==1) {
- $this->_connectionID = ($this->charSet)
- ? oci_pconnect($argUsername,$argPassword, $argDatabasename,$this->charSet)
- : oci_pconnect($argUsername,$argPassword, $argDatabasename);
- if ($this->_connectionID && $this->autoRollback) oci_rollback($this->_connectionID);
- } else if ($mode==2) {
- $this->_connectionID = ($this->charSet)
- ? oci_new_connect($argUsername,$argPassword, $argDatabasename,$this->charSet)
- : oci_new_connect($argUsername,$argPassword, $argDatabasename);
- } else {
- $this->_connectionID = ($this->charSet)
- ? oci_connect($argUsername,$argPassword, $argDatabasename,$this->charSet)
- : oci_connect($argUsername,$argPassword, $argDatabasename);
- }
- if (!$this->_connectionID) {
- return false;
- }
-
- if ($this->_initdate) {
- $this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='".$this->NLS_DATE_FORMAT."'");
- }
-
- // looks like:
- // Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production With the Partitioning option JServer Release 8.1.7.0.0 - Production
- // $vers = oci_server_version($this->_connectionID);
- // if (strpos($vers,'8i') !== false) $this->ansiOuter = true;
- return true;
- }
-
- function ServerInfo()
- {
- $arr['compat'] = $this->GetOne('select value from sys.database_compatible_level');
- $arr['description'] = @oci_server_version($this->_connectionID);
- $arr['version'] = ADOConnection::_findvers($arr['description']);
- return $arr;
- }
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename,1);
- }
-
- // returns true or false
- function _nconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename,2);
- }
-
- function _affectedrows()
- {
- if (is_resource($this->_stmt)) return @oci_num_rows($this->_stmt);
- return 0;
- }
-
- function IfNull( $field, $ifNull )
- {
- return " NVL($field, $ifNull) "; // if Oracle
- }
-
- // format and return date string in database date format
- function DBDate($d,$isfld=false)
- {
- if (empty($d) && $d !== 0) return 'null';
-
- if ($isfld) {
- $d = _adodb_safedate($d);
- return 'TO_DATE('.$d.",'".$this->dateformat."')";
- }
-
- if (is_string($d)) $d = ADORecordSet::UnixDate($d);
-
- if (is_object($d)) $ds = $d->format($this->fmtDate);
- else $ds = adodb_date($this->fmtDate,$d);
-
- return "TO_DATE(".$ds.",'".$this->dateformat."')";
- }
-
- function BindDate($d)
- {
- $d = ADOConnection::DBDate($d);
- if (strncmp($d,"'",1)) return $d;
-
- return substr($d,1,strlen($d)-2);
- }
-
- function BindTimeStamp($ts)
- {
- if (empty($ts) && $ts !== 0) return 'null';
- if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
-
- if (is_object($ts)) $tss = $ts->format("'Y-m-d H:i:s'");
- else $tss = adodb_date("'Y-m-d H:i:s'",$ts);
-
- return $tss;
- }
-
- // format and return date string in database timestamp format
- function DBTimeStamp($ts,$isfld=false)
- {
- if (empty($ts) && $ts !== 0) return 'null';
- if ($isfld) return 'TO_DATE(substr('.$ts.",1,19),'RRRR-MM-DD, HH24:MI:SS')";
- if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
-
- if (is_object($ts)) $tss = $ts->format("'Y-m-d H:i:s'");
- else $tss = date("'Y-m-d H:i:s'",$ts);
-
- return 'TO_DATE('.$tss.",'RRRR-MM-DD, HH24:MI:SS')";
- }
-
- function RowLock($tables,$where,$col='1 as adodbignore')
- {
- if ($this->autoCommit) $this->BeginTrans();
- return $this->GetOne("select $col from $tables where $where for update");
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- if ($mask) {
- $save = $this->metaTablesSQL;
- $mask = $this->qstr(strtoupper($mask));
- $this->metaTablesSQL .= " AND upper(table_name) like $mask";
- }
- $ret = ADOConnection::MetaTables($ttype,$showSchema);
-
- if ($mask) {
- $this->metaTablesSQL = $save;
- }
- return $ret;
- }
-
- // Mark Newnham
- function MetaIndexes ($table, $primary = FALSE, $owner=false)
- {
- // save old fetch mode
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- // get index details
- $table = strtoupper($table);
-
- // get Primary index
- $primary_key = '';
-
- $false = false;
- $rs = $this->Execute(sprintf("SELECT * FROM ALL_CONSTRAINTS WHERE UPPER(TABLE_NAME)='%s' AND CONSTRAINT_TYPE='P'",$table));
- if (!is_object($rs)) {
- if (isset($savem))
- $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- return $false;
- }
-
- if ($row = $rs->FetchRow())
- $primary_key = $row[1]; //constraint_name
-
- if ($primary==TRUE && $primary_key=='') {
- if (isset($savem))
- $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- return $false; //There is no primary key
- }
-
- $rs = $this->Execute(sprintf("SELECT ALL_INDEXES.INDEX_NAME, ALL_INDEXES.UNIQUENESS, ALL_IND_COLUMNS.COLUMN_POSITION, ALL_IND_COLUMNS.COLUMN_NAME FROM ALL_INDEXES,ALL_IND_COLUMNS WHERE UPPER(ALL_INDEXES.TABLE_NAME)='%s' AND ALL_IND_COLUMNS.INDEX_NAME=ALL_INDEXES.INDEX_NAME",$table));
-
-
- if (!is_object($rs)) {
- if (isset($savem))
- $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- return $false;
- }
-
- $indexes = array ();
- // parse index data into array
-
- while ($row = $rs->FetchRow()) {
- if ($primary && $row[0] != $primary_key) continue;
- if (!isset($indexes[$row[0]])) {
- $indexes[$row[0]] = array(
- 'unique' => ($row[1] == 'UNIQUE'),
- 'columns' => array()
- );
- }
- $indexes[$row[0]]['columns'][$row[2] - 1] = $row[3];
- }
-
- // sort columns by order in the index
- foreach ( array_keys ($indexes) as $index ) {
- ksort ($indexes[$index]['columns']);
- }
-
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- }
- return $indexes;
- }
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
- $this->transCnt += 1;
- $this->autoCommit = false;
- $this->_commit = OCI_DEFAULT;
-
- if ($this->_transmode) $ok = $this->Execute("SET TRANSACTION ".$this->_transmode);
- else $ok = true;
-
- return $ok ? true : false;
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
-
- if ($this->transCnt) $this->transCnt -= 1;
- $ret = oci_commit($this->_connectionID);
- $this->_commit = OCI_COMMIT_ON_SUCCESS;
- $this->autoCommit = true;
- return $ret;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $ret = oci_rollback($this->_connectionID);
- $this->_commit = OCI_COMMIT_ON_SUCCESS;
- $this->autoCommit = true;
- return $ret;
- }
-
-
- function SelectDB($dbName)
- {
- return false;
- }
-
- function ErrorMsg()
- {
- if ($this->_errorMsg !== false) return $this->_errorMsg;
-
- if (is_resource($this->_stmt)) $arr = @oci_error($this->_stmt);
- if (empty($arr)) {
- if (is_resource($this->_connectionID)) $arr = @oci_error($this->_connectionID);
- else $arr = @oci_error();
- if ($arr === false) return '';
- }
- $this->_errorMsg = $arr['message'];
- $this->_errorCode = $arr['code'];
- return $this->_errorMsg;
- }
-
- function ErrorNo()
- {
- if ($this->_errorCode !== false) return $this->_errorCode;
-
- if (is_resource($this->_stmt)) $arr = @oci_error($this->_stmt);
- if (empty($arr)) {
- $arr = @oci_error($this->_connectionID);
- if ($arr == false) $arr = @oci_error();
- if ($arr == false) return '';
- }
-
- $this->_errorMsg = $arr['message'];
- $this->_errorCode = $arr['code'];
-
- return $arr['code'];
- }
-
- /**
- * Format date column in sql string given an input format that understands Y M D
- */
- function SQLDate($fmt, $col=false)
- {
- if (!$col) $col = $this->sysTimeStamp;
- $s = 'TO_CHAR('.$col.",'";
-
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- $ch = $fmt[$i];
- switch($ch) {
- case 'Y':
- case 'y':
- $s .= 'YYYY';
- break;
- case 'Q':
- case 'q':
- $s .= 'Q';
- break;
-
- case 'M':
- $s .= 'Mon';
- break;
-
- case 'm':
- $s .= 'MM';
- break;
- case 'D':
- case 'd':
- $s .= 'DD';
- break;
-
- case 'H':
- $s.= 'HH24';
- break;
-
- case 'h':
- $s .= 'HH';
- break;
-
- case 'i':
- $s .= 'MI';
- break;
-
- case 's':
- $s .= 'SS';
- break;
-
- case 'a':
- case 'A':
- $s .= 'AM';
- break;
-
- case 'w':
- $s .= 'D';
- break;
-
- case 'l':
- $s .= 'DAY';
- break;
-
- case 'W':
- $s .= 'WW';
- break;
-
- default:
- // handle escape characters...
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- if (strpos('-/.:;, ',$ch) !== false) $s .= $ch;
- else $s .= '"'.$ch.'"';
-
- }
- }
- return $s. "')";
- }
-
- function GetRandRow($sql, $arr = false)
- {
- $sql = "SELECT * FROM ($sql ORDER BY dbms_random.value) WHERE rownum = 1";
-
- return $this->GetRow($sql,$arr);
- }
-
- /**
- * This algorithm makes use of
- *
- * a. FIRST_ROWS hint
- * The FIRST_ROWS hint explicitly chooses the approach to optimize response
- * time, that is, minimum resource usage to return the first row. Results
- * will be returned as soon as they are identified.
- *
- * b. Uses rownum tricks to obtain only the required rows from a given offset.
- * As this uses complicated sql statements, we only use this if $offset >= 100.
- * This idea by Tomas V V Cox.
- *
- * This implementation does not appear to work with oracle 8.0.5 or earlier.
- * Comment out this function then, and the slower SelectLimit() in the base
- * class will be used.
- */
- function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
- {
- // seems that oracle only supports 1 hint comment in 8i
- if ($this->firstrows) {
- if ($nrows > 500 && $nrows < 1000) $hint = "FIRST_ROWS($nrows)";
- else $hint = 'FIRST_ROWS';
-
- if (strpos($sql,'/*+') !== false)
- $sql = str_replace('/*+ ',"/*+$hint ",$sql);
- else
- $sql = preg_replace('/^[ \t\n]*select/i',"SELECT /*+$hint*/",$sql);
- $hint = "/*+ $hint */";
- } else
- $hint = '';
-
- if ($offset == -1 || ($offset < $this->selectOffsetAlg1 && 0 < $nrows && $nrows < 1000)) {
- if ($nrows > 0) {
- if ($offset > 0) $nrows += $offset;
- //$inputarr['adodb_rownum'] = $nrows;
- if ($this->databaseType == 'oci8po') {
- $sql = "select * from (".$sql.") where rownum <= ?";
- } else {
- $sql = "select * from (".$sql.") where rownum <= :adodb_offset";
- }
- $inputarr['adodb_offset'] = $nrows;
- $nrows = -1;
- }
- // note that $nrows = 0 still has to work ==> no rows returned
-
- $rs = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
- return $rs;
-
- } else {
- // Algorithm by Tomas V V Cox, from PEAR DB oci8.php
-
- // Let Oracle return the name of the columns
- $q_fields = "SELECT * FROM (".$sql.") WHERE NULL = NULL";
-
- $false = false;
- if (! $stmt_arr = $this->Prepare($q_fields)) {
- return $false;
- }
- $stmt = $stmt_arr[1];
-
- if (is_array($inputarr)) {
- foreach($inputarr as $k => $v) {
- if (is_array($v)) {
- if (sizeof($v) == 2) // suggested by g.giunta@libero.
- oci_bind_by_name($stmt,":$k",$inputarr[$k][0],$v[1]);
- else
- oci_bind_by_name($stmt,":$k",$inputarr[$k][0],$v[1],$v[2]);
- } else {
- $len = -1;
- if ($v === ' ') $len = 1;
- if (isset($bindarr)) { // is prepared sql, so no need to oci_bind_by_name again
- $bindarr[$k] = $v;
- } else { // dynamic sql, so rebind every time
- oci_bind_by_name($stmt,":$k",$inputarr[$k],$len);
- }
- }
- }
- }
-
- if (!oci_execute($stmt, OCI_DEFAULT)) {
- oci_free_statement($stmt);
- return $false;
- }
-
- $ncols = oci_num_fields($stmt);
- for ( $i = 1; $i <= $ncols; $i++ ) {
- $cols[] = '"'.oci_field_name($stmt, $i).'"';
- }
- $result = false;
-
- oci_free_statement($stmt);
- $fields = implode(',', $cols);
- if ($nrows <= 0) $nrows = 999999999999;
- else $nrows += $offset;
- $offset += 1; // in Oracle rownum starts at 1
-
- if ($this->databaseType == 'oci8po') {
- $sql = "SELECT $hint $fields FROM".
- "(SELECT rownum as adodb_rownum, $fields FROM".
- " ($sql) WHERE rownum <= ?".
- ") WHERE adodb_rownum >= ?";
- } else {
- $sql = "SELECT $hint $fields FROM".
- "(SELECT rownum as adodb_rownum, $fields FROM".
- " ($sql) WHERE rownum <= :adodb_nrows".
- ") WHERE adodb_rownum >= :adodb_offset";
- }
- $inputarr['adodb_nrows'] = $nrows;
- $inputarr['adodb_offset'] = $offset;
-
- if ($secs2cache>0) $rs = $this->CacheExecute($secs2cache, $sql,$inputarr);
- else $rs = $this->Execute($sql,$inputarr);
- return $rs;
- }
- }
-
- /**
- * Usage:
- * Store BLOBs and CLOBs
- *
- * Example: to store $var in a blob
- * $conn->Execute('insert into TABLE (id,ablob) values(12,empty_blob())');
- * $conn->UpdateBlob('TABLE', 'ablob', $varHoldingBlob, 'ID=12', 'BLOB');
- *
- * $blobtype supports 'BLOB' and 'CLOB', but you need to change to 'empty_clob()'.
- *
- * to get length of LOB:
- * select DBMS_LOB.GETLENGTH(ablob) from TABLE
- *
- * If you are using CURSOR_SHARING = force, it appears this will case a segfault
- * under oracle 8.1.7.0. Run:
- * $db->Execute('ALTER SESSION SET CURSOR_SHARING=EXACT');
- * before UpdateBlob() then...
- */
- function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
- {
-
- //if (strlen($val) < 4000) return $this->Execute("UPDATE $table SET $column=:blob WHERE $where",array('blob'=>$val)) != false;
-
- switch(strtoupper($blobtype)) {
- default: ADOConnection::outp("UpdateBlob : Unknown blobtype=$blobtype"); return false;
- case 'BLOB': $type = OCI_B_BLOB; break;
- case 'CLOB': $type = OCI_B_CLOB; break;
- }
-
- if ($this->databaseType == 'oci8po')
- $sql = "UPDATE $table set $column=EMPTY_{$blobtype}() WHERE $where RETURNING $column INTO ?";
- else
- $sql = "UPDATE $table set $column=EMPTY_{$blobtype}() WHERE $where RETURNING $column INTO :blob";
-
- $desc = oci_new_descriptor($this->_connectionID, OCI_D_LOB);
- $arr['blob'] = array($desc,-1,$type);
- if ($this->session_sharing_force_blob) $this->Execute('ALTER SESSION SET CURSOR_SHARING=EXACT');
- $commit = $this->autoCommit;
- if ($commit) $this->BeginTrans();
- $rs = $this->_Execute($sql,$arr);
- if ($rez = !empty($rs)) $desc->save($val);
- $desc->free();
- if ($commit) $this->CommitTrans();
- if ($this->session_sharing_force_blob) $this->Execute('ALTER SESSION SET CURSOR_SHARING=FORCE');
-
- if ($rez) $rs->Close();
- return $rez;
- }
-
- /**
- * Usage: store file pointed to by $val in a blob
- */
- function UpdateBlobFile($table,$column,$val,$where,$blobtype='BLOB')
- {
- switch(strtoupper($blobtype)) {
- default: ADOConnection::outp( "UpdateBlob : Unknown blobtype=$blobtype"); return false;
- case 'BLOB': $type = OCI_B_BLOB; break;
- case 'CLOB': $type = OCI_B_CLOB; break;
- }
-
- if ($this->databaseType == 'oci8po')
- $sql = "UPDATE $table set $column=EMPTY_{$blobtype}() WHERE $where RETURNING $column INTO ?";
- else
- $sql = "UPDATE $table set $column=EMPTY_{$blobtype}() WHERE $where RETURNING $column INTO :blob";
-
- $desc = oci_new_descriptor($this->_connectionID, OCI_D_LOB);
- $arr['blob'] = array($desc,-1,$type);
-
- $this->BeginTrans();
- $rs = ADODB_oci8::Execute($sql,$arr);
- if ($rez = !empty($rs)) $desc->savefile($val);
- $desc->free();
- $this->CommitTrans();
-
- if ($rez) $rs->Close();
- return $rez;
- }
-
- /**
- * Execute SQL
- *
- * @param sql SQL statement to execute, or possibly an array holding prepared statement ($sql[0] will hold sql text)
- * @param [inputarr] holds the input data to bind to. Null elements will be set to null.
- * @return RecordSet or false
- */
- function Execute($sql,$inputarr=false)
- {
- if ($this->fnExecute) {
- $fn = $this->fnExecute;
- $ret = $fn($this,$sql,$inputarr);
- if (isset($ret)) return $ret;
- }
- if ($inputarr !== false) {
- if (!is_array($inputarr)) $inputarr = array($inputarr);
-
- $element0 = reset($inputarr);
- $array2d = $this->bulkBind && is_array($element0) && !is_object(reset($element0));
-
- # see http://phplens.com/lens/lensforum/msgs.php?id=18786
- if ($array2d || !$this->_bindInputArray) {
-
- # is_object check because oci8 descriptors can be passed in
- if ($array2d && $this->_bindInputArray) {
- if (is_string($sql))
- $stmt = $this->Prepare($sql);
- else
- $stmt = $sql;
-
- foreach($inputarr as $arr) {
- $ret = $this->_Execute($stmt,$arr);
- if (!$ret) return $ret;
- }
- return $ret;
- } else {
- $sqlarr = explode(':',$sql);
- $sql = '';
- $lastnomatch = -2;
- #var_dump($sqlarr);echo " ";var_dump($inputarr);echo" ";
- foreach($sqlarr as $k => $str) {
- if ($k == 0) { $sql = $str; continue; }
- // we need $lastnomatch because of the following datetime,
- // eg. '10:10:01', which causes code to think that there is bind param :10 and :1
- $ok = preg_match('/^([0-9]*)/', $str, $arr);
-
- if (!$ok) $sql .= $str;
- else {
- $at = $arr[1];
- if (isset($inputarr[$at]) || is_null($inputarr[$at])) {
- if ((strlen($at) == strlen($str) && $k < sizeof($arr)-1)) {
- $sql .= ':'.$str;
- $lastnomatch = $k;
- } else if ($lastnomatch == $k-1) {
- $sql .= ':'.$str;
- } else {
- if (is_null($inputarr[$at])) $sql .= 'null';
- else $sql .= $this->qstr($inputarr[$at]);
- $sql .= substr($str, strlen($at));
- }
- } else {
- $sql .= ':'.$str;
- }
-
- }
- }
- $inputarr = false;
- }
- }
- $ret = $this->_Execute($sql,$inputarr);
-
-
- } else {
- $ret = $this->_Execute($sql,false);
- }
-
- return $ret;
- }
-
- /*
- * Example of usage:
- * $stmt = $this->Prepare('insert into emp (empno, ename) values (:empno, :ename)');
- */
- function Prepare($sql,$cursor=false)
- {
- static $BINDNUM = 0;
-
- $stmt = oci_parse($this->_connectionID,$sql);
-
- if (!$stmt) {
- $this->_errorMsg = false;
- $this->_errorCode = false;
- $arr = @oci_error($this->_connectionID);
- if ($arr === false) return false;
-
- $this->_errorMsg = $arr['message'];
- $this->_errorCode = $arr['code'];
- return false;
- }
-
- $BINDNUM += 1;
-
- $sttype = @oci_statement_type($stmt);
- if ($sttype == 'BEGIN' || $sttype == 'DECLARE') {
- return array($sql,$stmt,0,$BINDNUM, ($cursor) ? oci_new_cursor($this->_connectionID) : false);
- }
- return array($sql,$stmt,0,$BINDNUM);
- }
-
- /*
- Call an oracle stored procedure and returns a cursor variable as a recordset.
- Concept by Robert Tuttle robert@ud.com
-
- Example:
- Note: we return a cursor variable in :RS2
- $rs = $db->ExecuteCursor("BEGIN adodb.open_tab(:RS2); END;",'RS2');
-
- $rs = $db->ExecuteCursor(
- "BEGIN :RS2 = adodb.getdata(:VAR1); END;",
- 'RS2',
- array('VAR1' => 'Mr Bean'));
-
- */
- function ExecuteCursor($sql,$cursorName='rs',$params=false)
- {
- if (is_array($sql)) $stmt = $sql;
- else $stmt = ADODB_oci8::Prepare($sql,true); # true to allocate oci_new_cursor
-
- if (is_array($stmt) && sizeof($stmt) >= 5) {
- $hasref = true;
- $ignoreCur = false;
- $this->Parameter($stmt, $ignoreCur, $cursorName, false, -1, OCI_B_CURSOR);
- if ($params) {
- foreach($params as $k => $v) {
- $this->Parameter($stmt,$params[$k], $k);
- }
- }
- } else
- $hasref = false;
-
- $rs = $this->Execute($stmt);
- if ($rs) {
- if ($rs->databaseType == 'array') oci_free_cursor($stmt[4]);
- else if ($hasref) $rs->_refcursor = $stmt[4];
- }
- return $rs;
- }
-
- /**
- * Bind a variable -- very, very fast for executing repeated statements in oracle.
- *
- * Better than using
- * for ($i = 0; $i < $max; $i++) {
- * $p1 = ?; $p2 = ?; $p3 = ?;
- * $this->Execute("insert into table (col0, col1, col2) values (:0, :1, :2)", array($p1,$p2,$p3));
- * }
- *
- * Usage:
- * $stmt = $DB->Prepare("insert into table (col0, col1, col2) values (:0, :1, :2)");
- * $DB->Bind($stmt, $p1);
- * $DB->Bind($stmt, $p2);
- * $DB->Bind($stmt, $p3);
- * for ($i = 0; $i < $max; $i++) {
- * $p1 = ?; $p2 = ?; $p3 = ?;
- * $DB->Execute($stmt);
- * }
- *
- * Some timings to insert 1000 records, test table has 3 cols, and 1 index.
- * - Time 0.6081s (1644.60 inserts/sec) with direct oci_parse/oci_execute
- * - Time 0.6341s (1577.16 inserts/sec) with ADOdb Prepare/Bind/Execute
- * - Time 1.5533s ( 643.77 inserts/sec) with pure SQL using Execute
- *
- * Now if PHP only had batch/bulk updating like Java or PL/SQL...
- *
- * Note that the order of parameters differs from oci_bind_by_name,
- * because we default the names to :0, :1, :2
- */
- function Bind(&$stmt,&$var,$size=4000,$type=false,$name=false,$isOutput=false)
- {
-
- if (!is_array($stmt)) return false;
-
- if (($type == OCI_B_CURSOR) && sizeof($stmt) >= 5) {
- return oci_bind_by_name($stmt[1],":".$name,$stmt[4],$size,$type);
- }
-
- if ($name == false) {
- if ($type !== false) $rez = oci_bind_by_name($stmt[1],":".$stmt[2],$var,$size,$type);
- else $rez = oci_bind_by_name($stmt[1],":".$stmt[2],$var,$size); // +1 byte for null terminator
- $stmt[2] += 1;
- } else if (oci_lob_desc($type)) {
- if ($this->debug) {
- ADOConnection::outp("Bind : name = $name");
- }
- //we have to create a new Descriptor here
- $numlob = count($this->_refLOBs);
- $this->_refLOBs[$numlob]['LOB'] = oci_new_descriptor($this->_connectionID, oci_lob_desc($type));
- $this->_refLOBs[$numlob]['TYPE'] = $isOutput;
-
- $tmp = $this->_refLOBs[$numlob]['LOB'];
- $rez = oci_bind_by_name($stmt[1], ":".$name, $tmp, -1, $type);
- if ($this->debug) {
- ADOConnection::outp("Bind : descriptor has been allocated, var (".$name.") binded");
- }
-
- // if type is input then write data to lob now
- if ($isOutput == false) {
- $var = $this->BlobEncode($var);
- $tmp->WriteTemporary($var);
- $this->_refLOBs[$numlob]['VAR'] = &$var;
- if ($this->debug) {
- ADOConnection::outp("Bind : LOB has been written to temp");
- }
- } else {
- $this->_refLOBs[$numlob]['VAR'] = &$var;
- }
- $rez = $tmp;
- } else {
- if ($this->debug)
- ADOConnection::outp("Bind : name = $name");
-
- if ($type !== false) $rez = oci_bind_by_name($stmt[1],":".$name,$var,$size,$type);
- else $rez = oci_bind_by_name($stmt[1],":".$name,$var,$size); // +1 byte for null terminator
- }
-
- return $rez;
- }
-
- function Param($name,$type='C')
- {
- return ':'.$name;
- }
-
- /**
- * Usage:
- * $stmt = $db->Prepare('select * from table where id =:myid and group=:group');
- * $db->Parameter($stmt,$id,'myid');
- * $db->Parameter($stmt,$group,'group');
- * $db->Execute($stmt);
- *
- * @param $stmt Statement returned by Prepare() or PrepareSP().
- * @param $var PHP variable to bind to
- * @param $name Name of stored procedure variable name to bind to.
- * @param [$isOutput] Indicates direction of parameter 0/false=IN 1=OUT 2= IN/OUT. This is ignored in oci8.
- * @param [$maxLen] Holds an maximum length of the variable.
- * @param [$type] The data type of $var. Legal values depend on driver.
- *
- * @link http://php.net/oci_bind_by_name
- */
- function Parameter(&$stmt,&$var,$name,$isOutput=false,$maxLen=4000,$type=false)
- {
- if ($this->debug) {
- $prefix = ($isOutput) ? 'Out' : 'In';
- $ztype = (empty($type)) ? 'false' : $type;
- ADOConnection::outp( "{$prefix}Parameter(\$stmt, \$php_var='$var', \$name='$name', \$maxLen=$maxLen, \$type=$ztype);");
- }
- return $this->Bind($stmt,$var,$maxLen,$type,$name,$isOutput);
- }
-
- /**
- * returns query ID if successful, otherwise false
- * this version supports:
- *
- * 1. $db->execute('select * from table');
- *
- * 2. $db->prepare('insert into table (a,b,c) values (:0,:1,:2)');
- * $db->execute($prepared_statement, array(1,2,3));
- *
- * 3. $db->execute('insert into table (a,b,c) values (:a,:b,:c)',array('a'=>1,'b'=>2,'c'=>3));
- *
- * 4. $db->prepare('insert into table (a,b,c) values (:0,:1,:2)');
- * $db->bind($stmt,1); $db->bind($stmt,2); $db->bind($stmt,3);
- * $db->execute($stmt);
- */
- function _query($sql,$inputarr=false)
- {
- if (is_array($sql)) { // is prepared sql
- $stmt = $sql[1];
-
- // we try to bind to permanent array, so that oci_bind_by_name is persistent
- // and carried out once only - note that max array element size is 4000 chars
- if (is_array($inputarr)) {
- $bindpos = $sql[3];
- if (isset($this->_bind[$bindpos])) {
- // all tied up already
- $bindarr = $this->_bind[$bindpos];
- } else {
- // one statement to bind them all
- $bindarr = array();
- foreach($inputarr as $k => $v) {
- $bindarr[$k] = $v;
- oci_bind_by_name($stmt,":$k",$bindarr[$k],is_string($v) && strlen($v)>4000 ? -1 : 4000);
- }
- $this->_bind[$bindpos] = $bindarr;
- }
- }
- } else {
- $stmt=oci_parse($this->_connectionID,$sql);
- }
-
- $this->_stmt = $stmt;
- if (!$stmt) return false;
-
- if (defined('ADODB_PREFETCH_ROWS')) @oci_set_prefetch($stmt,ADODB_PREFETCH_ROWS);
-
- if (is_array($inputarr)) {
- foreach($inputarr as $k => $v) {
- if (is_array($v)) {
- if (sizeof($v) == 2) // suggested by g.giunta@libero.
- oci_bind_by_name($stmt,":$k",$inputarr[$k][0],$v[1]);
- else
- oci_bind_by_name($stmt,":$k",$inputarr[$k][0],$v[1],$v[2]);
-
- if ($this->debug==99) {
- if (is_object($v[0]))
- echo "name=:$k",' len='.$v[1],' type='.$v[2],' ';
- else
- echo "name=:$k",' var='.$inputarr[$k][0],' len='.$v[1],' type='.$v[2],' ';
-
- }
- } else {
- $len = -1;
- if ($v === ' ') $len = 1;
- if (isset($bindarr)) { // is prepared sql, so no need to oci_bind_by_name again
- $bindarr[$k] = $v;
- } else { // dynamic sql, so rebind every time
- oci_bind_by_name($stmt,":$k",$inputarr[$k],$len);
- }
- }
- }
- }
-
- $this->_errorMsg = false;
- $this->_errorCode = false;
- if (oci_execute($stmt,$this->_commit)) {
-
- if (count($this -> _refLOBs) > 0) {
-
- foreach ($this -> _refLOBs as $key => $value) {
- if ($this -> _refLOBs[$key]['TYPE'] == true) {
- $tmp = $this -> _refLOBs[$key]['LOB'] -> load();
- if ($this -> debug) {
- ADOConnection::outp("OUT LOB : LOB has been loaded. ");
- }
- //$_GLOBALS[$this -> _refLOBs[$key]['VAR']] = $tmp;
- $this -> _refLOBs[$key]['VAR'] = $tmp;
- } else {
- $this->_refLOBs[$key]['LOB']->save($this->_refLOBs[$key]['VAR']);
- $this -> _refLOBs[$key]['LOB']->free();
- unset($this -> _refLOBs[$key]);
- if ($this->debug) {
- ADOConnection::outp("IN LOB : LOB has been saved. ");
- }
- }
- }
- }
-
- switch (@oci_statement_type($stmt)) {
- case "SELECT":
- return $stmt;
-
- case 'DECLARE':
- case "BEGIN":
- if (is_array($sql) && !empty($sql[4])) {
- $cursor = $sql[4];
- if (is_resource($cursor)) {
- $ok = oci_execute($cursor);
- return $cursor;
- }
- return $stmt;
- } else {
- if (is_resource($stmt)) {
- oci_free_statement($stmt);
- return true;
- }
- return $stmt;
- }
- break;
- default :
-
- return true;
- }
- }
- return false;
- }
-
- // From Oracle Whitepaper: PHP Scalability and High Availability
- function IsConnectionError($err)
- {
- switch($err) {
- case 378: /* buffer pool param incorrect */
- case 602: /* core dump */
- case 603: /* fatal error */
- case 609: /* attach failed */
- case 1012: /* not logged in */
- case 1033: /* init or shutdown in progress */
- case 1043: /* Oracle not available */
- case 1089: /* immediate shutdown in progress */
- case 1090: /* shutdown in progress */
- case 1092: /* instance terminated */
- case 3113: /* disconnect */
- case 3114: /* not connected */
- case 3122: /* closing window */
- case 3135: /* lost contact */
- case 12153: /* TNS: not connected */
- case 27146: /* fatal or instance terminated */
- case 28511: /* Lost RPC */
- return true;
- }
- return false;
- }
-
- // returns true or false
- function _close()
- {
- if (!$this->_connectionID) return;
-
- if (!$this->autoCommit) oci_rollback($this->_connectionID);
- if (count($this->_refLOBs) > 0) {
- foreach ($this ->_refLOBs as $key => $value) {
- $this->_refLOBs[$key]['LOB']->free();
- unset($this->_refLOBs[$key]);
- }
- }
- oci_close($this->_connectionID);
-
- $this->_stmt = false;
- $this->_connectionID = false;
- }
-
- function MetaPrimaryKeys($table, $owner=false,$internalKey=false)
- {
- if ($internalKey) return array('ROWID');
-
- // tested with oracle 8.1.7
- $table = strtoupper($table);
- if ($owner) {
- $owner_clause = "AND ((a.OWNER = b.OWNER) AND (a.OWNER = UPPER('$owner')))";
- $ptab = 'ALL_';
- } else {
- $owner_clause = '';
- $ptab = 'USER_';
- }
- $sql = "
-SELECT /*+ RULE */ distinct b.column_name
- FROM {$ptab}CONSTRAINTS a
- , {$ptab}CONS_COLUMNS b
- WHERE ( UPPER(b.table_name) = ('$table'))
- AND (UPPER(a.table_name) = ('$table') and a.constraint_type = 'P')
- $owner_clause
- AND (a.constraint_name = b.constraint_name)";
-
- $rs = $this->Execute($sql);
- if ($rs && !$rs->EOF) {
- $arr = $rs->GetArray();
- $a = array();
- foreach($arr as $v) {
- $a[] = reset($v);
- }
- return $a;
- }
- else return false;
- }
-
- /**
- * returns assoc array where keys are tables, and values are foreign keys
- *
- * @param str $table
- * @param str $owner [optional][default=NULL]
- * @param bool $upper [optional][discarded]
- * @return mixed[] Array of foreign key information
- *
- * @link http://gis.mit.edu/classes/11.521/sqlnotes/referential_integrity.html
- */
- function MetaForeignKeys($table, $owner=false, $upper=false)
- {
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $table = $this->qstr(strtoupper($table));
- if (!$owner) {
- $owner = $this->user;
- $tabp = 'user_';
- } else
- $tabp = 'all_';
-
- $owner = ' and owner='.$this->qstr(strtoupper($owner));
-
- $sql =
-"select constraint_name,r_owner,r_constraint_name
- from {$tabp}constraints
- where constraint_type = 'R' and table_name = $table $owner";
-
- $constraints = $this->GetArray($sql);
- $arr = false;
- foreach($constraints as $constr) {
- $cons = $this->qstr($constr[0]);
- $rowner = $this->qstr($constr[1]);
- $rcons = $this->qstr($constr[2]);
- $cols = $this->GetArray("select column_name from {$tabp}cons_columns where constraint_name=$cons $owner order by position");
- $tabcol = $this->GetArray("select table_name,column_name from {$tabp}cons_columns where owner=$rowner and constraint_name=$rcons order by position");
-
- if ($cols && $tabcol)
- for ($i=0, $max=sizeof($cols); $i < $max; $i++) {
- $arr[$tabcol[$i][0]] = $cols[$i][0].'='.$tabcol[$i][1];
- }
- }
- $ADODB_FETCH_MODE = $save;
-
- return $arr;
- }
-
-
- function CharMax()
- {
- return 4000;
- }
-
- function TextMax()
- {
- return 4000;
- }
-
- /**
- * Quotes a string.
- * An example is $db->qstr("Don't bother",magic_quotes_runtime());
- *
- * @param string $s the string to quote
- * @param bool $magic_quotes if $s is GET/POST var, set to get_magic_quotes_gpc().
- * This undoes the stupidity of magic quotes for GPC.
- *
- * @return string quoted string to be sent back to database
- */
- function qstr($s,$magic_quotes=false)
- {
- //$nofixquotes=false;
-
- if ($this->noNullStrings && strlen($s)==0)$s = ' ';
- if (!$magic_quotes) {
- if ($this->replaceQuote[0] == '\\'){
- $s = str_replace('\\','\\\\',$s);
- }
- return "'".str_replace("'",$this->replaceQuote,$s)."'";
- }
-
- // undo magic quotes for " unless sybase is on
- if (!ini_get('magic_quotes_sybase')) {
- $s = str_replace('\\"','"',$s);
- $s = str_replace('\\\\','\\',$s);
- return "'".str_replace("\\'",$this->replaceQuote,$s)."'";
- } else {
- return "'".$s."'";
- }
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordset_oci8 extends ADORecordSet {
-
- var $databaseType = 'oci8';
- var $bind=false;
- var $_fieldobjs;
-
- //var $_arr = false;
-
- function ADORecordset_oci8($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode)
- {
- case ADODB_FETCH_ASSOC:$this->fetchMode = OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:$this->fetchMode = OCI_NUM+OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
- case ADODB_FETCH_NUM:
- default:
- $this->fetchMode = OCI_NUM+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
- }
-
- $this->adodbFetchMode = $mode;
- $this->_queryID = $queryID;
- }
-
-
- function Init()
- {
- if ($this->_inited) return;
-
- $this->_inited = true;
- if ($this->_queryID) {
-
- $this->_currentRow = 0;
- @$this->_initrs();
- if ($this->_numOfFields) $this->EOF = !$this->_fetch();
- else $this->EOF = true;
-
- /*
- // based on idea by Gaetano Giunta to detect unusual oracle errors
- // see http://phplens.com/lens/lensforum/msgs.php?id=6771
- $err = oci_error($this->_queryID);
- if ($err && $this->connection->debug) ADOConnection::outp($err);
- */
-
- if (!is_array($this->fields)) {
- $this->_numOfRows = 0;
- $this->fields = array();
- }
- } else {
- $this->fields = array();
- $this->_numOfRows = 0;
- $this->_numOfFields = 0;
- $this->EOF = true;
- }
- }
-
- function _initrs()
- {
- $this->_numOfRows = -1;
- $this->_numOfFields = oci_num_fields($this->_queryID);
- if ($this->_numOfFields>0) {
- $this->_fieldobjs = array();
- $max = $this->_numOfFields;
- for ($i=0;$i<$max; $i++) $this->_fieldobjs[] = $this->_FetchField($i);
- }
- }
-
- /**
- * Get column information in the Recordset object.
- * fetchField() can be used in order to obtain information about fields
- * in a certain query result. If the field offset isn't specified, the next
- * field that wasn't yet retrieved by fetchField() is retrieved
- *
- * @return object containing field information
- */
- function _FetchField($fieldOffset = -1)
- {
- $fld = new ADOFieldObject;
- $fieldOffset += 1;
- $fld->name =oci_field_name($this->_queryID, $fieldOffset);
- $fld->type = oci_field_type($this->_queryID, $fieldOffset);
- $fld->max_length = oci_field_size($this->_queryID, $fieldOffset);
-
- switch($fld->type) {
- case 'NUMBER':
- $p = oci_field_precision($this->_queryID, $fieldOffset);
- $sc = oci_field_scale($this->_queryID, $fieldOffset);
- if ($p != 0 && $sc == 0) $fld->type = 'INT';
- $fld->scale = $p;
- break;
-
- case 'CLOB':
- case 'NCLOB':
- case 'BLOB':
- $fld->max_length = -1;
- break;
- }
- return $fld;
- }
-
- /* For some reason, oci_field_name fails when called after _initrs() so we cache it */
- function FetchField($fieldOffset = -1)
- {
- return $this->_fieldobjs[$fieldOffset];
- }
-
-
-/*
- // 10% speedup to move MoveNext to child class
- function _MoveNext()
- {
- //global $ADODB_EXTENSION;if ($ADODB_EXTENSION) return @adodb_movenext($this);
-
- if ($this->EOF) return false;
-
- $this->_currentRow++;
- if($this->fields = @oci_fetch_array($this->_queryID,$this->fetchMode))
- return true;
- $this->EOF = true;
-
- return false;
- }
-*/
-
-
- function MoveNext()
- {
- if ($this->fields = @oci_fetch_array($this->_queryID,$this->fetchMode)) {
- $this->_currentRow += 1;
- return true;
- }
- if (!$this->EOF) {
- $this->_currentRow += 1;
- $this->EOF = true;
- }
- return false;
- }
-
-/*
- # does not work as first record is retrieved in _initrs(), so is not included in GetArray()
- function GetArray($nRows = -1)
- {
- global $ADODB_OCI8_GETARRAY;
-
- if (true || !empty($ADODB_OCI8_GETARRAY)) {
- # does not support $ADODB_ANSI_PADDING_OFF
-
- //OCI_RETURN_NULLS and OCI_RETURN_LOBS is set by oci_fetch_all
- switch($this->adodbFetchMode) {
- case ADODB_FETCH_NUM:
-
- $ncols = @oci_fetch_all($this->_queryID, $results, 0, $nRows, oci_fetch_all_BY_ROW+OCI_NUM);
- $results = array_merge(array($this->fields),$results);
- return $results;
-
- case ADODB_FETCH_ASSOC:
- if (ADODB_ASSOC_CASE != 2 || $this->databaseType != 'oci8') break;
-
- $ncols = @oci_fetch_all($this->_queryID, $assoc, 0, $nRows, oci_fetch_all_BY_ROW);
- $results = array_merge(array($this->fields),$assoc);
- return $results;
-
- default:
- break;
- }
- }
-
- $results = ADORecordSet::GetArray($nRows);
- return $results;
-
- }
-*/
-
- // Optimize SelectLimit() by using oci_fetch()
- function GetArrayLimit($nrows,$offset=-1)
- {
- if ($offset <= 0) {
- $arr = $this->GetArray($nrows);
- return $arr;
- }
- $arr = array();
- for ($i=1; $i < $offset; $i++)
- if (!@oci_fetch($this->_queryID)) return $arr;
-
- if (!$this->fields = @oci_fetch_array($this->_queryID,$this->fetchMode)) return $arr;;
- $results = array();
- $cnt = 0;
- while (!$this->EOF && $nrows != $cnt) {
- $results[$cnt++] = $this->fields;
- $this->MoveNext();
- }
-
- return $results;
- }
-
-
- // Use associative array to get fields array
- function Fields($colname)
- {
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
-
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
-
-
- function _seek($row)
- {
- return false;
- }
-
- function _fetch()
- {
- return $this->fields = @oci_fetch_array($this->_queryID,$this->fetchMode);
- }
-
- /**
- * close() only needs to be called if you are worried about using too much
- * memory while your script is running. All associated result memory for the
- * specified result identifier will automatically be freed.
- */
- function _close()
- {
- if ($this->connection->_stmt === $this->_queryID) $this->connection->_stmt = false;
- if (!empty($this->_refcursor)) {
- oci_free_cursor($this->_refcursor);
- $this->_refcursor = false;
- }
- @oci_free_statement($this->_queryID);
- $this->_queryID = false;
- }
-
- /**
- * not the fastest implementation - quick and dirty - jlim
- * for best performance, use the actual $rs->MetaType().
- *
- * @param mixed $t
- * @param int $len [optional] Length of blobsize
- * @param bool $fieldobj [optional][discarded]
- * @return str The metatype of the field
- */
- function MetaType($t, $len=-1, $fieldobj=false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
-
- switch (strtoupper($t)) {
- case 'VARCHAR':
- case 'VARCHAR2':
- case 'CHAR':
- case 'VARBINARY':
- case 'BINARY':
- case 'NCHAR':
- case 'NVARCHAR':
- case 'NVARCHAR2':
- if ($len <= $this->blobSize) return 'C';
-
- case 'NCLOB':
- case 'LONG':
- case 'LONG VARCHAR':
- case 'CLOB':
- return 'X';
-
- case 'LONG RAW':
- case 'LONG VARBINARY':
- case 'BLOB':
- return 'B';
-
- case 'DATE':
- return ($this->connection->datetime) ? 'T' : 'D';
-
-
- case 'TIMESTAMP': return 'T';
-
- case 'INT':
- case 'SMALLINT':
- case 'INTEGER':
- return 'I';
-
- default:
- return 'N';
- }
- }
-}
-
-class ADORecordSet_ext_oci8 extends ADORecordSet_oci8 {
- function ADORecordSet_ext_oci8($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode)
- {
- case ADODB_FETCH_ASSOC:$this->fetchMode = OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:$this->fetchMode = OCI_NUM+OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
- case ADODB_FETCH_NUM:
- default: $this->fetchMode = OCI_NUM+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
- }
- $this->adodbFetchMode = $mode;
- $this->_queryID = $queryID;
- }
-
- function MoveNext()
- {
- return adodb_movenext($this);
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-oci805.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-oci805.inc.php
deleted file mode 100644
index 7dd5fa6..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-oci805.inc.php
+++ /dev/null
@@ -1,58 +0,0 @@
-ADODB_oci8();
- }
-
- function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
- {
- // seems that oracle only supports 1 hint comment in 8i
- if (strpos($sql,'/*+') !== false)
- $sql = str_replace('/*+ ','/*+FIRST_ROWS ',$sql);
- else
- $sql = preg_replace('/^[ \t\n]*select/i','SELECT /*+FIRST_ROWS*/',$sql);
-
- /*
- The following is only available from 8.1.5 because order by in inline views not
- available before then...
- http://www.jlcomp.demon.co.uk/faq/top_sql.html
- if ($nrows > 0) {
- if ($offset > 0) $nrows += $offset;
- $sql = "select * from ($sql) where rownum <= $nrows";
- $nrows = -1;
- }
- */
-
- return ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
- }
-}
-
-class ADORecordset_oci805 extends ADORecordset_oci8 {
- var $databaseType = "oci805";
- function ADORecordset_oci805($id,$mode=false)
- {
- $this->ADORecordset_oci8($id,$mode);
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-oci8po.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-oci8po.inc.php
deleted file mode 100644
index fc3aba5..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-oci8po.inc.php
+++ /dev/null
@@ -1,220 +0,0 @@
-
-
- Should some emulation of RecordCount() be implemented?
-
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-include_once(ADODB_DIR.'/drivers/adodb-oci8.inc.php');
-
-class ADODB_oci8po extends ADODB_oci8 {
- var $databaseType = 'oci8po';
- var $dataProvider = 'oci8';
- var $metaColumnsSQL = "select lower(cname),coltype,width, SCALE, PRECISION, NULLS, DEFAULTVAL from col where tname='%s' order by colno"; //changed by smondino@users.sourceforge. net
- var $metaTablesSQL = "select lower(table_name),table_type from cat where table_type in ('TABLE','VIEW')";
-
- function ADODB_oci8po()
- {
- $this->_hasOCIFetchStatement = ADODB_PHPVER >= 0x4200;
- # oci8po does not support adodb extension: adodb_movenext()
- }
-
- function Param($name,$type='C')
- {
- return '?';
- }
-
- function Prepare($sql,$cursor=false)
- {
- $sqlarr = explode('?',$sql);
- $sql = $sqlarr[0];
- for ($i = 1, $max = sizeof($sqlarr); $i < $max; $i++) {
- $sql .= ':'.($i-1) . $sqlarr[$i];
- }
- return ADODB_oci8::Prepare($sql,$cursor);
- }
-
- function Execute($sql,$inputarr=false)
- {
- return ADOConnection::Execute($sql,$inputarr);
- }
-
- // emulate handling of parameters ? ?, replacing with :bind0 :bind1
- function _query($sql,$inputarr=false)
- {
- if (is_array($inputarr)) {
- $i = 0;
- if (is_array($sql)) {
- foreach($inputarr as $v) {
- $arr['bind'.$i++] = $v;
- }
- } else {
- $sqlarr = explode('?',$sql);
- $sql = $sqlarr[0];
- foreach($inputarr as $k => $v) {
- $sql .= ":$k" . $sqlarr[++$i];
- }
- }
- }
- return ADODB_oci8::_query($sql,$inputarr);
- }
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordset_oci8po extends ADORecordset_oci8 {
-
- var $databaseType = 'oci8po';
-
- function ADORecordset_oci8po($queryID,$mode=false)
- {
- $this->ADORecordset_oci8($queryID,$mode);
- }
-
- function Fields($colname)
- {
- if ($this->fetchMode & OCI_ASSOC) return $this->fields[$colname];
-
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- // lowercase field names...
- function _FetchField($fieldOffset = -1)
- {
- $fld = new ADOFieldObject;
- $fieldOffset += 1;
- $fld->name = OCIcolumnname($this->_queryID, $fieldOffset);
- if (ADODB_ASSOC_CASE == 0) $fld->name = strtolower($fld->name);
- $fld->type = OCIcolumntype($this->_queryID, $fieldOffset);
- $fld->max_length = OCIcolumnsize($this->_queryID, $fieldOffset);
- if ($fld->type == 'NUMBER') {
- //$p = OCIColumnPrecision($this->_queryID, $fieldOffset);
- $sc = OCIColumnScale($this->_queryID, $fieldOffset);
- if ($sc == 0) $fld->type = 'INT';
- }
- return $fld;
- }
- /*
- function MoveNext()
- {
- if (@OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode)) {
- $this->_currentRow += 1;
- return true;
- }
- if (!$this->EOF) {
- $this->_currentRow += 1;
- $this->EOF = true;
- }
- return false;
- }*/
-
- // 10% speedup to move MoveNext to child class
- function MoveNext()
- {
- if(@OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode)) {
- global $ADODB_ANSI_PADDING_OFF;
- $this->_currentRow++;
-
- if ($this->fetchMode & OCI_ASSOC) $this->_updatefields();
- if (!empty($ADODB_ANSI_PADDING_OFF)) {
- foreach($this->fields as $k => $v) {
- if (is_string($v)) $this->fields[$k] = rtrim($v);
- }
- }
- return true;
- }
- if (!$this->EOF) {
- $this->EOF = true;
- $this->_currentRow++;
- }
- return false;
- }
-
- /* Optimize SelectLimit() by using OCIFetch() instead of OCIFetchInto() */
- function GetArrayLimit($nrows,$offset=-1)
- {
- if ($offset <= 0) {
- $arr = $this->GetArray($nrows);
- return $arr;
- }
- for ($i=1; $i < $offset; $i++)
- if (!@OCIFetch($this->_queryID)) {
- $arr = array();
- return $arr;
- }
- if (!@OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode)) {
- $arr = array();
- return $arr;
- }
- if ($this->fetchMode & OCI_ASSOC) $this->_updatefields();
- $results = array();
- $cnt = 0;
- while (!$this->EOF && $nrows != $cnt) {
- $results[$cnt++] = $this->fields;
- $this->MoveNext();
- }
-
- return $results;
- }
-
- // Create associative array
- function _updatefields()
- {
- if (ADODB_ASSOC_CASE == 2) return; // native
-
- $arr = array();
- $lowercase = (ADODB_ASSOC_CASE == 0);
-
- foreach($this->fields as $k => $v) {
- if (is_integer($k)) $arr[$k] = $v;
- else {
- if ($lowercase)
- $arr[strtolower($k)] = $v;
- else
- $arr[strtoupper($k)] = $v;
- }
- }
- $this->fields = $arr;
- }
-
- function _fetch()
- {
- $ret = @OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode);
- if ($ret) {
- global $ADODB_ANSI_PADDING_OFF;
-
- if ($this->fetchMode & OCI_ASSOC) $this->_updatefields();
- if (!empty($ADODB_ANSI_PADDING_OFF)) {
- foreach($this->fields as $k => $v) {
- if (is_string($v)) $this->fields[$k] = rtrim($v);
- }
- }
- }
- return $ret;
- }
-
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-oci8quercus.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-oci8quercus.inc.php
deleted file mode 100644
index 3029bc7..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-oci8quercus.inc.php
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
- Should some emulation of RecordCount() be implemented?
-
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-include_once(ADODB_DIR.'/drivers/adodb-oci8.inc.php');
-
-class ADODB_oci8quercus extends ADODB_oci8 {
- var $databaseType = 'oci8quercus';
- var $dataProvider = 'oci8';
-
- function ADODB_oci8quercus()
- {
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordset_oci8quercus extends ADORecordset_oci8 {
-
- var $databaseType = 'oci8quercus';
-
- function ADORecordset_oci8quercus($queryID,$mode=false)
- {
- $this->ADORecordset_oci8($queryID,$mode);
- }
-
- function _FetchField($fieldOffset = -1)
- {
- global $QUERCUS;
- $fld = new ADOFieldObject;
-
- if (!empty($QUERCUS)) {
- $fld->name = oci_field_name($this->_queryID, $fieldOffset);
- $fld->type = oci_field_type($this->_queryID, $fieldOffset);
- $fld->max_length = oci_field_size($this->_queryID, $fieldOffset);
-
- //if ($fld->name == 'VAL6_NUM_12_4') $fld->type = 'NUMBER';
- switch($fld->type) {
- case 'string': $fld->type = 'VARCHAR'; break;
- case 'real': $fld->type = 'NUMBER'; break;
- }
- } else {
- $fieldOffset += 1;
- $fld->name = oci_field_name($this->_queryID, $fieldOffset);
- $fld->type = oci_field_type($this->_queryID, $fieldOffset);
- $fld->max_length = oci_field_size($this->_queryID, $fieldOffset);
- }
- switch($fld->type) {
- case 'NUMBER':
- $p = oci_field_precision($this->_queryID, $fieldOffset);
- $sc = oci_field_scale($this->_queryID, $fieldOffset);
- if ($p != 0 && $sc == 0) $fld->type = 'INT';
- $fld->scale = $p;
- break;
-
- case 'CLOB':
- case 'NCLOB':
- case 'BLOB':
- $fld->max_length = -1;
- break;
- }
-
- return $fld;
- }
-
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-odbc.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-odbc.inc.php
deleted file mode 100644
index 0b271a4..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-odbc.inc.php
+++ /dev/null
@@ -1,736 +0,0 @@
-_haserrorfunctions = ADODB_PHPVER >= 0x4050;
- $this->_has_stupid_odbc_fetch_api_change = ADODB_PHPVER >= 0x4200;
- }
-
- // returns true or false
- function _connect($argDSN, $argUsername, $argPassword, $argDatabasename)
- {
- global $php_errormsg;
-
- if (!function_exists('odbc_connect')) return null;
-
- if (!empty($argDatabasename) && stristr($argDSN, 'Database=') === false) {
- $argDSN = trim($argDSN);
- $endDSN = substr($argDSN, strlen($argDSN) - 1);
- if ($endDSN != ';') $argDSN .= ';';
- $argDSN .= 'Database='.$argDatabasename;
- }
-
- if (isset($php_errormsg)) $php_errormsg = '';
- if ($this->curmode === false) $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword);
- else $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword,$this->curmode);
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
-
- return $this->_connectionID != false;
- }
-
- // returns true or false
- function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
- {
- global $php_errormsg;
-
- if (!function_exists('odbc_connect')) return null;
-
- if (isset($php_errormsg)) $php_errormsg = '';
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- if ($this->debug && $argDatabasename) {
- ADOConnection::outp("For odbc PConnect(), $argDatabasename is not used. Place dsn in 1st parameter.");
- }
- // print "dsn=$argDSN u=$argUsername p=$argPassword "; flush();
- if ($this->curmode === false) $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword);
- else $this->_connectionID = odbc_pconnect($argDSN,$argUsername,$argPassword,$this->curmode);
-
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- if ($this->_connectionID && $this->autoRollback) @odbc_rollback($this->_connectionID);
- if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
-
- return $this->_connectionID != false;
- }
-
-
- function ServerInfo()
- {
-
- if (!empty($this->host) && ADODB_PHPVER >= 0x4300) {
- $dsn = strtoupper($this->host);
- $first = true;
- $found = false;
-
- if (!function_exists('odbc_data_source')) return false;
-
- while(true) {
-
- $rez = @odbc_data_source($this->_connectionID,
- $first ? SQL_FETCH_FIRST : SQL_FETCH_NEXT);
- $first = false;
- if (!is_array($rez)) break;
- if (strtoupper($rez['server']) == $dsn) {
- $found = true;
- break;
- }
- }
- if (!$found) return ADOConnection::ServerInfo();
- if (!isset($rez['version'])) $rez['version'] = '';
- return $rez;
- } else {
- return ADOConnection::ServerInfo();
- }
- }
-
-
- function CreateSequence($seqname='adodbseq',$start=1)
- {
- 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)");
- }
-
- var $_dropSeqSQL = 'drop table %s';
- function DropSequence($seqname)
- {
- if (empty($this->_dropSeqSQL)) return false;
- return $this->Execute(sprintf($this->_dropSeqSQL,$seqname));
- }
-
- /*
- This algorithm is not very efficient, but works even if table locking
- is not available.
-
- Will return false if unable to generate an ID after $MAXLOOPS attempts.
- */
- function GenID($seq='adodbseq',$start=1)
- {
- // if you have to modify the parameter below, your database is overloaded,
- // or you need to implement generation of id's yourself!
- $MAXLOOPS = 100;
- //$this->debug=1;
- 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;
- return $num;
- } elseif ($this->affected_rows() == 0) {
- // some drivers do not return a valid value => try with another method
- $value = $this->GetOne("select id from $seq");
- if ($value == $num + 1) {
- return $value;
- }
- }
- }
- 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 @odbc_errormsg();
- return @odbc_errormsg($this->_connectionID);
- } else return ADOConnection::ErrorMsg();
- }
-
- function ErrorNo()
- {
-
- if ($this->_haserrorfunctions) {
- if ($this->_errorCode !== false) {
- // bug in 4.0.6, error number can be corrupted string (should be 6 digits)
- return (strlen($this->_errorCode)<=2) ? 0 : $this->_errorCode;
- }
-
- if (empty($this->_connectionID)) $e = @odbc_error();
- else $e = @odbc_error($this->_connectionID);
-
- // bug in 4.0.6, error number can be corrupted string (should be 6 digits)
- // so we check and patch
- if (strlen($e)<=2) return 0;
- return $e;
- } else return ADOConnection::ErrorNo();
- }
-
-
-
- function BeginTrans()
- {
- if (!$this->hasTransactions) return false;
- if ($this->transOff) return true;
- $this->transCnt += 1;
- $this->_autocommit = false;
- return odbc_autocommit($this->_connectionID,false);
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
- if ($this->transCnt) $this->transCnt -= 1;
- $this->_autocommit = true;
- $ret = odbc_commit($this->_connectionID);
- odbc_autocommit($this->_connectionID,true);
- return $ret;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $this->_autocommit = true;
- $ret = odbc_rollback($this->_connectionID);
- odbc_autocommit($this->_connectionID,true);
- return $ret;
- }
-
- function MetaPrimaryKeys($table,$owner=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 = @odbc_primarykeys($this->_connectionID,'',$schema,$table);
-
- if (!$qid) {
- $ADODB_FETCH_MODE = $savem;
- return false;
- }
- $rs = new ADORecordSet_odbc($qid);
- $ADODB_FETCH_MODE = $savem;
-
- if (!$rs) return false;
- $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
-
- $arr = $rs->GetArray();
- $rs->Close();
- //print_r($arr);
- $arr2 = array();
- for ($i=0; $i < sizeof($arr); $i++) {
- if ($arr[$i][3]) $arr2[] = $arr[$i][3];
- }
- return $arr2;
- }
-
-
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- global $ADODB_FETCH_MODE;
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $qid = odbc_tables($this->_connectionID);
-
- $rs = new ADORecordSet_odbc($qid);
-
- $ADODB_FETCH_MODE = $savem;
- if (!$rs) {
- $false = false;
- return $false;
- }
- $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
-
- $arr = $rs->GetArray();
- //print_r($arr);
-
- $rs->Close();
- $arr2 = array();
-
- if ($ttype) {
- $isview = strncmp($ttype,'V',1) === 0;
- }
- for ($i=0; $i < sizeof($arr); $i++) {
- if (!$arr[$i][2]) continue;
- $type = $arr[$i][3];
- 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];
- }
- return $arr2;
- }
-
-/*
-See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcdatetime_data_type_changes.asp
-/ SQL data type codes /
-#define SQL_UNKNOWN_TYPE 0
-#define SQL_CHAR 1
-#define SQL_NUMERIC 2
-#define SQL_DECIMAL 3
-#define SQL_INTEGER 4
-#define SQL_SMALLINT 5
-#define SQL_FLOAT 6
-#define SQL_REAL 7
-#define SQL_DOUBLE 8
-#if (ODBCVER >= 0x0300)
-#define SQL_DATETIME 9
-#endif
-#define SQL_VARCHAR 12
-
-
-/ One-parameter shortcuts for date/time data types /
-#if (ODBCVER >= 0x0300)
-#define SQL_TYPE_DATE 91
-#define SQL_TYPE_TIME 92
-#define SQL_TYPE_TIMESTAMP 93
-
-#define SQL_UNICODE (-95)
-#define SQL_UNICODE_VARCHAR (-96)
-#define SQL_UNICODE_LONGVARCHAR (-97)
-*/
- function ODBCTypes($t)
- {
- switch ((integer)$t) {
- case 1:
- case 12:
- case 0:
- case -95:
- case -96:
- return 'C';
- case -97:
- case -1: //text
- return 'X';
- case -4: //image
- return 'B';
-
- case 9:
- case 91:
- return 'D';
-
- case 10:
- case 11:
- case 92:
- case 93:
- return 'T';
-
- case 4:
- case 5:
- case -6:
- return 'I';
-
- case -11: // uniqidentifier
- return 'R';
- case -7: //bit
- return 'L';
-
- default:
- return 'N';
- }
- }
-
- function MetaColumns($table, $normalize=true)
- {
- global $ADODB_FETCH_MODE;
-
- $false = false;
- if ($this->uCaseTables) $table = strtoupper($table);
- $schema = '';
- $this->_findschema($table,$schema);
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- /*if (false) { // after testing, confirmed that the following does not work becoz of a bug
- $qid2 = odbc_tables($this->_connectionID);
- $rs = new ADORecordSet_odbc($qid2);
- $ADODB_FETCH_MODE = $savem;
- if (!$rs) return false;
- $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
- $rs->_fetch();
-
- while (!$rs->EOF) {
- if ($table == strtoupper($rs->fields[2])) {
- $q = $rs->fields[0];
- $o = $rs->fields[1];
- break;
- }
- $rs->MoveNext();
- }
- $rs->Close();
-
- $qid = odbc_columns($this->_connectionID,$q,$o,strtoupper($table),'%');
- } */
-
- switch ($this->databaseType) {
- case 'access':
- case 'vfp':
- $qid = odbc_columns($this->_connectionID);#,'%','',strtoupper($table),'%');
- break;
-
-
- case 'db2':
- $colname = "%";
- $qid = odbc_columns($this->_connectionID, "", $schema, $table, $colname);
- break;
-
- default:
- $qid = @odbc_columns($this->_connectionID,'%','%',strtoupper($table),'%');
- if (empty($qid)) $qid = odbc_columns($this->_connectionID);
- break;
- }
- if (empty($qid)) return $false;
-
- $rs = new ADORecordSet_odbc($qid);
- $ADODB_FETCH_MODE = $savem;
-
- if (!$rs) return $false;
- $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
- $rs->_fetch();
-
- $retarr = array();
-
- /*
- $rs->fields indices
- 0 TABLE_QUALIFIER
- 1 TABLE_SCHEM
- 2 TABLE_NAME
- 3 COLUMN_NAME
- 4 DATA_TYPE
- 5 TYPE_NAME
- 6 PRECISION
- 7 LENGTH
- 8 SCALE
- 9 RADIX
- 10 NULLABLE
- 11 REMARKS
- */
- while (!$rs->EOF) {
- // adodb_pr($rs->fields);
- if (strtoupper(trim($rs->fields[2])) == $table && (!$schema || strtoupper($rs->fields[1]) == $schema)) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[3];
- $fld->type = $this->ODBCTypes($rs->fields[4]);
-
- // ref: http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/dnaraccgen/html/msdn_odk.asp
- // access uses precision to store length for char/varchar
- if ($fld->type == 'C' or $fld->type == 'X') {
- if ($this->databaseType == 'access')
- $fld->max_length = $rs->fields[6];
- else if ($rs->fields[4] <= -95) // UNICODE
- $fld->max_length = $rs->fields[7]/2;
- else
- $fld->max_length = $rs->fields[7];
- } else
- $fld->max_length = $rs->fields[7];
- $fld->not_null = !empty($rs->fields[10]);
- $fld->scale = $rs->fields[8];
- $retarr[strtoupper($fld->name)] = $fld;
- } else if (sizeof($retarr)>0)
- break;
- $rs->MoveNext();
- }
- $rs->Close(); //-- crashes 4.03pl1 -- why?
-
- if (empty($retarr)) $retarr = false;
- return $retarr;
- }
-
- function Prepare($sql)
- {
- if (! $this->_bindInputArray) return $sql; // no binding
- $stmt = odbc_prepare($this->_connectionID,$sql);
- if (!$stmt) {
- // we don't know whether odbc driver is parsing prepared stmts, so just return sql
- return $sql;
- }
- return array($sql,$stmt,false);
- }
-
- /* returns queryID or false */
- function _query($sql,$inputarr=false)
- {
- GLOBAL $php_errormsg;
- if (isset($php_errormsg)) $php_errormsg = '';
- $this->_error = '';
-
- if ($inputarr) {
- if (is_array($sql)) {
- $stmtid = $sql[1];
- } else {
- $stmtid = odbc_prepare($this->_connectionID,$sql);
-
- if ($stmtid == false) {
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- return false;
- }
- }
-
- if (! odbc_execute($stmtid,$inputarr)) {
- //@odbc_free_result($stmtid);
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = odbc_errormsg();
- $this->_errorCode = odbc_error();
- }
- return false;
- }
-
- } else if (is_array($sql)) {
- $stmtid = $sql[1];
- if (!odbc_execute($stmtid)) {
- //@odbc_free_result($stmtid);
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = odbc_errormsg();
- $this->_errorCode = odbc_error();
- }
- return false;
- }
- } else
- $stmtid = odbc_exec($this->_connectionID,$sql);
-
- $this->_lastAffectedRows = 0;
- if ($stmtid) {
- if (@odbc_num_fields($stmtid) == 0) {
- $this->_lastAffectedRows = odbc_num_rows($stmtid);
- $stmtid = true;
- } else {
- $this->_lastAffectedRows = 0;
- odbc_binmode($stmtid,$this->binmode);
- odbc_longreadlen($stmtid,$this->maxblobsize);
- }
-
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = '';
- $this->_errorCode = 0;
- } else
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- } else {
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = odbc_errormsg();
- $this->_errorCode = odbc_error();
- } else
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- }
- return $stmtid;
- }
-
- /*
- Insert a null into the blob field of the table first.
- Then use UpdateBlob to store the blob.
-
- Usage:
-
- $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)');
- $conn->UpdateBlob('blobtable','blobcol',$blob,'id=1');
- */
- function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
- {
- return $this->Execute("UPDATE $table SET $column=? WHERE $where",array($val)) != false;
- }
-
- // returns true or false
- function _close()
- {
- $ret = @odbc_close($this->_connectionID);
- $this->_connectionID = false;
- return $ret;
- }
-
- function _affectedrows()
- {
- return $this->_lastAffectedRows;
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_odbc extends ADORecordSet {
-
- var $bind = false;
- var $databaseType = "odbc";
- var $dataProvider = "odbc";
- var $useFetchArray;
- var $_has_stupid_odbc_fetch_api_change;
-
- function ADORecordSet_odbc($id,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- $this->fetchMode = $mode;
-
- $this->_queryID = $id;
-
- // the following is required for mysql odbc driver in 4.3.1 -- why?
- $this->EOF = false;
- $this->_currentRow = -1;
- //$this->ADORecordSet($id);
- }
-
-
- // returns the field object
- function FetchField($fieldOffset = -1)
- {
-
- $off=$fieldOffset+1; // offsets begin at 1
-
- $o= new ADOFieldObject();
- $o->name = @odbc_field_name($this->_queryID,$off);
- $o->type = @odbc_field_type($this->_queryID,$off);
- $o->max_length = @odbc_field_len($this->_queryID,$off);
- if (ADODB_ASSOC_CASE == 0) $o->name = strtolower($o->name);
- else if (ADODB_ASSOC_CASE == 1) $o->name = strtoupper($o->name);
- return $o;
- }
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) return $this->fields[$colname];
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
-
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
-
- function _initrs()
- {
- global $ADODB_COUNTRECS;
- $this->_numOfRows = ($ADODB_COUNTRECS) ? @odbc_num_rows($this->_queryID) : -1;
- $this->_numOfFields = @odbc_num_fields($this->_queryID);
- // some silly drivers such as db2 as/400 and intersystems cache return _numOfRows = 0
- if ($this->_numOfRows == 0) $this->_numOfRows = -1;
- //$this->useFetchArray = $this->connection->useFetchArray;
- $this->_has_stupid_odbc_fetch_api_change = ADODB_PHPVER >= 0x4200;
- }
-
- function _seek($row)
- {
- return false;
- }
-
- // speed up SelectLimit() by switching to ADODB_FETCH_NUM as ADODB_FETCH_ASSOC is emulated
- function GetArrayLimit($nrows,$offset=-1)
- {
- if ($offset <= 0) {
- $rs = $this->GetArray($nrows);
- return $rs;
- }
- $savem = $this->fetchMode;
- $this->fetchMode = ADODB_FETCH_NUM;
- $this->Move($offset);
- $this->fetchMode = $savem;
-
- if ($this->fetchMode & ADODB_FETCH_ASSOC) {
- $this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE);
- }
-
- $results = array();
- $cnt = 0;
- while (!$this->EOF && $nrows != $cnt) {
- $results[$cnt++] = $this->fields;
- $this->MoveNext();
- }
-
- return $results;
- }
-
-
- function MoveNext()
- {
- if ($this->_numOfRows != 0 && !$this->EOF) {
- $this->_currentRow++;
- if( $this->_fetch() ) {
- return true;
- }
- }
- $this->fields = false;
- $this->EOF = true;
- return false;
- }
-
- function _fetch()
- {
- $this->fields = false;
- if ($this->_has_stupid_odbc_fetch_api_change)
- $rez = @odbc_fetch_into($this->_queryID,$this->fields);
- else {
- $row = 0;
- $rez = @odbc_fetch_into($this->_queryID,$row,$this->fields);
- }
- if ($rez) {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) {
- $this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE);
- }
- return true;
- }
- return false;
- }
-
- function _close()
- {
- return @odbc_free_result($this->_queryID);
- }
-
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-odbc_db2.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-odbc_db2.inc.php
deleted file mode 100644
index 217ecb3..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-odbc_db2.inc.php
+++ /dev/null
@@ -1,367 +0,0 @@
-curMode = SQL_CUR_USE_ODBC;
-$db->Connect($dsn, $userid, $pwd);
-
-
-
-USING CLI INTERFACE
-===================
-
-I have had reports that the $host and $database params have to be reversed in
-Connect() when using the CLI interface. From Halmai Csongor csongor.halmai#nexum.hu:
-
-> The symptom is that if I change the database engine from postgres or any other to DB2 then the following
-> connection command becomes wrong despite being described this version to be correct in the docs.
->
-> $connection_object->Connect( $DATABASE_HOST, $DATABASE_AUTH_USER_NAME, $DATABASE_AUTH_PASSWORD, $DATABASE_NAME )
->
-> In case of DB2 I had to swap the first and last arguments in order to connect properly.
-
-
-System Error 5
-==============
-IF you get a System Error 5 when trying to Connect/Load, it could be a permission problem. Give the user connecting
-to DB2 full rights to the DB2 SQLLIB directory, and place the user in the DBUSERS group.
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-if (!defined('_ADODB_ODBC_LAYER')) {
- include(ADODB_DIR."/drivers/adodb-odbc.inc.php");
-}
-if (!defined('ADODB_ODBC_DB2')){
-define('ADODB_ODBC_DB2',1);
-
-class ADODB_ODBC_DB2 extends ADODB_odbc {
- var $databaseType = "db2";
- var $concat_operator = '||';
- var $sysTime = 'CURRENT TIME';
- var $sysDate = 'CURRENT DATE';
- var $sysTimeStamp = 'CURRENT TIMESTAMP';
- // The complete string representation of a timestamp has the form
- // yyyy-mm-dd-hh.mm.ss.nnnnnn.
- var $fmtTimeStamp = "'Y-m-d-H.i.s'";
- var $ansiOuter = true;
- var $identitySQL = 'values IDENTITY_VAL_LOCAL()';
- var $_bindInputArray = true;
- var $hasInsertID = true;
- var $rsPrefix = 'ADORecordset_odbc_';
-
- function ADODB_DB2()
- {
- if (strncmp(PHP_OS,'WIN',3) === 0) $this->curmode = SQL_CUR_USE_ODBC;
- $this->ADODB_odbc();
- }
-
- function IfNull( $field, $ifNull )
- {
- return " COALESCE($field, $ifNull) "; // if DB2 UDB
- }
-
- function ServerInfo()
- {
- //odbc_setoption($this->_connectionID,1,101 /*SQL_ATTR_ACCESS_MODE*/, 1 /*SQL_MODE_READ_ONLY*/);
- $vers = $this->GetOne('select versionnumber from sysibm.sysversions');
- //odbc_setoption($this->_connectionID,1,101, 0 /*SQL_MODE_READ_WRITE*/);
- return array('description'=>'DB2 ODBC driver', 'version'=>$vers);
- }
-
- function _insertid()
- {
- return $this->GetOne($this->identitySQL);
- }
-
- function RowLock($tables,$where,$col='1 as adodbignore')
- {
- if ($this->_autocommit) $this->BeginTrans();
- return $this->GetOne("select $col from $tables where $where for update");
- }
-
- function MetaTables($ttype=false,$showSchema=false, $qtable="%", $qschema="%")
- {
- global $ADODB_FETCH_MODE;
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $qid = odbc_tables($this->_connectionID, "", $qschema, $qtable, "");
-
- $rs = new ADORecordSet_odbc($qid);
-
- $ADODB_FETCH_MODE = $savem;
- if (!$rs) {
- $false = false;
- return $false;
- }
- $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
-
- $arr = $rs->GetArray();
- //print_r($arr);
-
- $rs->Close();
- $arr2 = array();
-
- if ($ttype) {
- $isview = strncmp($ttype,'V',1) === 0;
- }
- for ($i=0; $i < sizeof($arr); $i++) {
-
- if (!$arr[$i][2]) continue;
- if (strncmp($arr[$i][1],'SYS',3) === 0) continue;
-
- $type = $arr[$i][3];
-
- if ($showSchema) $arr[$i][2] = $arr[$i][1].'.'.$arr[$i][2];
-
- if ($ttype) {
- if ($isview) {
- if (strncmp($type,'V',1) === 0) $arr2[] = $arr[$i][2];
- } else if (strncmp($type,'T',1) === 0) $arr2[] = $arr[$i][2];
- } else if (strncmp($type,'S',1) !== 0) $arr2[] = $arr[$i][2];
- }
- return $arr2;
- }
-
- function MetaIndexes ($table, $primary = FALSE, $owner=false)
- {
- // save old fetch mode
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
- $false = false;
- // get index details
- $table = strtoupper($table);
- $SQL="SELECT NAME, UNIQUERULE, COLNAMES FROM SYSIBM.SYSINDEXES WHERE TBNAME='$table'";
- if ($primary)
- $SQL.= " AND UNIQUERULE='P'";
- $rs = $this->Execute($SQL);
- if (!is_object($rs)) {
- if (isset($savem))
- $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- return $false;
- }
- $indexes = array ();
- // parse index data into array
- while ($row = $rs->FetchRow()) {
- $indexes[$row[0]] = array(
- 'unique' => ($row[1] == 'U' || $row[1] == 'P'),
- 'columns' => array()
- );
- $cols = ltrim($row[2],'+');
- $indexes[$row[0]]['columns'] = explode('+', $cols);
- }
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- }
- return $indexes;
- }
-
- // 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;
- $s = '';
-
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- if ($s) $s .= '||';
- $ch = $fmt[$i];
- switch($ch) {
- case 'Y':
- case 'y':
- $s .= "char(year($col))";
- break;
- case 'M':
- $s .= "substr(monthname($col),1,3)";
- break;
- case 'm':
- $s .= "right(digits(month($col)),2)";
- break;
- case 'D':
- case 'd':
- $s .= "right(digits(day($col)),2)";
- break;
- case 'H':
- case 'h':
- if ($col != $this->sysDate) $s .= "right(digits(hour($col)),2)";
- else $s .= "''";
- break;
- case 'i':
- case 'I':
- if ($col != $this->sysDate)
- $s .= "right(digits(minute($col)),2)";
- else $s .= "''";
- break;
- case 'S':
- case 's':
- if ($col != $this->sysDate)
- $s .= "right(digits(second($col)),2)";
- else $s .= "''";
- break;
- default:
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- $s .= $this->qstr($ch);
- }
- }
- return $s;
- }
-
-
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputArr=false)
- {
- $nrows = (integer) $nrows;
- if ($offset <= 0) {
- // could also use " OPTIMIZE FOR $nrows ROWS "
- if ($nrows >= 0) $sql .= " FETCH FIRST $nrows ROWS ONLY ";
- $rs = $this->Execute($sql,$inputArr);
- } else {
- if ($offset > 0 && $nrows < 0);
- else {
- $nrows += $offset;
- $sql .= " FETCH FIRST $nrows ROWS ONLY ";
- }
- $rs = ADOConnection::SelectLimit($sql,-1,$offset,$inputArr);
- }
-
- return $rs;
- }
-
-};
-
-
-class ADORecordSet_odbc_db2 extends ADORecordSet_odbc {
-
- var $databaseType = "db2";
-
- function ADORecordSet_db2($id,$mode=false)
- {
- $this->ADORecordSet_odbc($id,$mode);
- }
-
- function MetaType($t,$len=-1,$fieldobj=false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
-
- switch (strtoupper($t)) {
- case 'VARCHAR':
- case 'CHAR':
- case 'CHARACTER':
- case 'C':
- if ($len <= $this->blobSize) return 'C';
-
- case 'LONGCHAR':
- case 'TEXT':
- case 'CLOB':
- case 'DBCLOB': // double-byte
- case 'X':
- return 'X';
-
- case 'BLOB':
- case 'GRAPHIC':
- case 'VARGRAPHIC':
- return 'B';
-
- case 'DATE':
- case 'D':
- return 'D';
-
- case 'TIME':
- case 'TIMESTAMP':
- case 'T':
- return 'T';
-
- //case 'BOOLEAN':
- //case 'BIT':
- // return 'L';
-
- //case 'COUNTER':
- // return 'R';
-
- case 'INT':
- case 'INTEGER':
- case 'BIGINT':
- case 'SMALLINT':
- case 'I':
- return 'I';
-
- default: return 'N';
- }
- }
-}
-
-} //define
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-odbc_mssql.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-odbc_mssql.inc.php
deleted file mode 100644
index d6894cd..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-odbc_mssql.inc.php
+++ /dev/null
@@ -1,361 +0,0 @@
- 'master'";
- var $metaTablesSQL="select name,case when type='U' then 'T' else 'V' end from sysobjects where (type='U' or type='V') and (name not in ('sysallocations','syscolumns','syscomments','sysdepends','sysfilegroups','sysfiles','sysfiles1','sysforeignkeys','sysfulltextcatalogs','sysindexes','sysindexkeys','sysmembers','sysobjects','syspermissions','sysprotects','sysreferences','systypes','sysusers','sysalternates','sysconstraints','syssegments','REFERENTIAL_CONSTRAINTS','CHECK_CONSTRAINTS','CONSTRAINT_TABLE_USAGE','CONSTRAINT_COLUMN_USAGE','VIEWS','VIEW_TABLE_USAGE','VIEW_COLUMN_USAGE','SCHEMATA','TABLES','TABLE_CONSTRAINTS','TABLE_PRIVILEGES','COLUMNS','COLUMN_DOMAIN_USAGE','COLUMN_PRIVILEGES','DOMAINS','DOMAIN_CONSTRAINTS','KEY_COLUMN_USAGE'))";
- var $metaColumnsSQL = # xtype==61 is datetime
- "select c.name,t.name,c.length,c.isnullable, c.status,
- (case when c.xusertype=61 then 0 else c.xprec end),
- (case when c.xusertype=61 then 0 else c.xscale end)
- from syscolumns c join systypes t on t.xusertype=c.xusertype join sysobjects o on o.id=c.id where o.name='%s'";
- var $hasTop = 'top'; // support mssql/interbase SELECT TOP 10 * FROM TABLE
- var $sysDate = 'GetDate()';
- var $sysTimeStamp = 'GetDate()';
- var $leftOuter = '*=';
- var $rightOuter = '=*';
- var $substr = 'substring';
- var $length = 'len';
- var $ansiOuter = true; // for mssql7 or later
- var $identitySQL = 'select SCOPE_IDENTITY()'; // 'select SCOPE_IDENTITY'; # for mssql 2000
- var $hasInsertID = true;
- var $connectStmt = 'SET CONCAT_NULL_YIELDS_NULL OFF'; # When SET CONCAT_NULL_YIELDS_NULL is ON,
- # concatenating a null value with a string yields a NULL result
-
- function ADODB_odbc_mssql()
- {
- $this->ADODB_odbc();
- //$this->curmode = SQL_CUR_USE_ODBC;
- }
-
- // crashes php...
- function ServerInfo()
- {
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $row = $this->GetRow("execute sp_server_info 2");
- $ADODB_FETCH_MODE = $save;
- if (!is_array($row)) return false;
- $arr['description'] = $row[2];
- $arr['version'] = ADOConnection::_findvers($arr['description']);
- return $arr;
- }
-
- function IfNull( $field, $ifNull )
- {
- return " ISNULL($field, $ifNull) "; // if MS SQL Server
- }
-
- function _insertid()
- {
- // SCOPE_IDENTITY()
- // Returns the last IDENTITY value inserted into an IDENTITY column in
- // the same scope. A scope is a module -- a stored procedure, trigger,
- // function, or batch. Thus, two statements are in the same scope if
- // they are in the same stored procedure, function, or batch.
- return $this->GetOne($this->identitySQL);
- }
-
-
- function MetaForeignKeys($table, $owner=false, $upper=false)
- {
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $table = $this->qstr(strtoupper($table));
-
- $sql =
-"select object_name(constid) as constraint_name,
- col_name(fkeyid, fkey) as column_name,
- object_name(rkeyid) as referenced_table_name,
- col_name(rkeyid, rkey) as referenced_column_name
-from sysforeignkeys
-where upper(object_name(fkeyid)) = $table
-order by constraint_name, referenced_table_name, keyno";
-
- $constraints = $this->GetArray($sql);
-
- $ADODB_FETCH_MODE = $save;
-
- $arr = false;
- foreach($constraints as $constr) {
- //print_r($constr);
- $arr[$constr[0]][$constr[2]][] = $constr[1].'='.$constr[3];
- }
- if (!$arr) return false;
-
- $arr2 = false;
-
- foreach($arr as $k => $v) {
- foreach($v as $a => $b) {
- if ($upper) $a = strtoupper($a);
- $arr2[$a] = $b;
- }
- }
- return $arr2;
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- if ($mask) {//$this->debug=1;
- $save = $this->metaTablesSQL;
- $mask = $this->qstr($mask);
- $this->metaTablesSQL .= " AND name like $mask";
- }
- $ret = ADOConnection::MetaTables($ttype,$showSchema);
-
- if ($mask) {
- $this->metaTablesSQL = $save;
- }
- return $ret;
- }
-
- function MetaColumns($table, $normalize=true)
- {
-
- $this->_findschema($table,$schema);
- if ($schema) {
- $dbName = $this->database;
- $this->SelectDB($schema);
- }
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
-
- if ($schema) {
- $this->SelectDB($dbName);
- }
-
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- if (!is_object($rs)) {
- $false = false;
- return $false;
- }
-
- $retarr = array();
- while (!$rs->EOF){
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $fld->type = $rs->fields[1];
-
- $fld->not_null = (!$rs->fields[3]);
- $fld->auto_increment = ($rs->fields[4] == 128); // sys.syscolumns status field. 0x80 = 128 ref: http://msdn.microsoft.com/en-us/library/ms186816.aspx
-
-
- if (isset($rs->fields[5]) && $rs->fields[5]) {
- if ($rs->fields[5]>0) $fld->max_length = $rs->fields[5];
- $fld->scale = $rs->fields[6];
- if ($fld->scale>0) $fld->max_length += 1;
- } else
- $fld->max_length = $rs->fields[2];
-
-
- if ($save == ADODB_FETCH_NUM) {
- $retarr[] = $fld;
- } else {
- $retarr[strtoupper($fld->name)] = $fld;
- }
- $rs->MoveNext();
- }
-
- $rs->Close();
- return $retarr;
-
- }
-
-
- function MetaIndexes($table,$primary=false, $owner=false)
- {
- $table = $this->qstr($table);
-
- $sql = "SELECT i.name AS ind_name, C.name AS col_name, USER_NAME(O.uid) AS Owner, c.colid, k.Keyno,
- CASE WHEN I.indid BETWEEN 1 AND 254 AND (I.status & 2048 = 2048 OR I.Status = 16402 AND O.XType = 'V') THEN 1 ELSE 0 END AS IsPK,
- CASE WHEN I.status & 2 = 2 THEN 1 ELSE 0 END AS IsUnique
- FROM dbo.sysobjects o INNER JOIN dbo.sysindexes I ON o.id = i.id
- INNER JOIN dbo.sysindexkeys K ON I.id = K.id AND I.Indid = K.Indid
- INNER JOIN dbo.syscolumns c ON K.id = C.id AND K.colid = C.Colid
- WHERE LEFT(i.name, 8) <> '_WA_Sys_' AND o.status >= 0 AND O.Name LIKE $table
- ORDER BY O.name, I.Name, K.keyno";
-
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- $rs = $this->Execute($sql);
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- if (!is_object($rs)) {
- return FALSE;
- }
-
- $indexes = array();
- while ($row = $rs->FetchRow()) {
- if (!$primary && $row[5]) continue;
-
- $indexes[$row[0]]['unique'] = $row[6];
- $indexes[$row[0]]['columns'][] = $row[1];
- }
- return $indexes;
- }
-
- function _query($sql,$inputarr=false)
- {
- if (is_string($sql)) $sql = str_replace('||','+',$sql);
- return ADODB_odbc::_query($sql,$inputarr);
- }
-
- function SetTransactionMode( $transaction_mode )
- {
- $this->_transmode = $transaction_mode;
- if (empty($transaction_mode)) {
- $this->Execute('SET TRANSACTION ISOLATION LEVEL READ COMMITTED');
- return;
- }
- if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
- $this->Execute("SET TRANSACTION ".$transaction_mode);
- }
-
- // "Stein-Aksel Basma"
- // tested with MSSQL 2000
- function MetaPrimaryKeys($table)
- {
- global $ADODB_FETCH_MODE;
-
- $schema = '';
- $this->_findschema($table,$schema);
- //if (!$schema) $schema = $this->database;
- if ($schema) $schema = "and k.table_catalog like '$schema%'";
-
- $sql = "select distinct k.column_name,ordinal_position from information_schema.key_column_usage k,
- information_schema.table_constraints tc
- where tc.constraint_name = k.constraint_name and tc.constraint_type =
- 'PRIMARY KEY' and k.table_name = '$table' $schema order by ordinal_position ";
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- $a = $this->GetCol($sql);
- $ADODB_FETCH_MODE = $savem;
-
- if ($a && sizeof($a)>0) return $a;
- $false = false;
- return $false;
- }
-
- function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
- {
- if ($nrows > 0 && $offset <= 0) {
- $sql = preg_replace(
- '/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop." $nrows ",$sql);
- $rs = $this->Execute($sql,$inputarr);
- } else
- $rs = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
-
- return $rs;
- }
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- if (!$col) $col = $this->sysTimeStamp;
- $s = '';
-
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- if ($s) $s .= '+';
- $ch = $fmt[$i];
- switch($ch) {
- case 'Y':
- case 'y':
- $s .= "datename(yyyy,$col)";
- break;
- case 'M':
- $s .= "convert(char(3),$col,0)";
- break;
- case 'm':
- $s .= "replace(str(month($col),2),' ','0')";
- break;
- case 'Q':
- case 'q':
- $s .= "datename(quarter,$col)";
- break;
- case 'D':
- case 'd':
- $s .= "replace(str(day($col),2),' ','0')";
- break;
- case 'h':
- $s .= "substring(convert(char(14),$col,0),13,2)";
- break;
-
- case 'H':
- $s .= "replace(str(datepart(hh,$col),2),' ','0')";
- break;
-
- case 'i':
- $s .= "replace(str(datepart(mi,$col),2),' ','0')";
- break;
- case 's':
- $s .= "replace(str(datepart(ss,$col),2),' ','0')";
- break;
- case 'a':
- case 'A':
- $s .= "substring(convert(char(19),$col,0),18,2)";
- break;
-
- default:
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- $s .= $this->qstr($ch);
- break;
- }
- }
- return $s;
- }
-
-}
-
-class ADORecordSet_odbc_mssql extends ADORecordSet_odbc {
-
- var $databaseType = 'odbc_mssql';
-
- function ADORecordSet_odbc_mssql($id,$mode=false)
- {
- return $this->ADORecordSet_odbc($id,$mode);
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-odbc_oracle.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-odbc_oracle.inc.php
deleted file mode 100644
index 222e772..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-odbc_oracle.inc.php
+++ /dev/null
@@ -1,114 +0,0 @@
-ADODB_odbc();
- }
-
- function MetaTables()
- {
- $false = false;
- $rs = $this->Execute($this->metaTablesSQL);
- if ($rs === false) return $false;
- $arr = $rs->GetArray();
- $arr2 = array();
- for ($i=0; $i < sizeof($arr); $i++) {
- $arr2[] = $arr[$i][0];
- }
- $rs->Close();
- return $arr2;
- }
-
- function MetaColumns($table, $normalize=true)
- {
- global $ADODB_FETCH_MODE;
-
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,strtoupper($table)));
- if ($rs === false) {
- $false = false;
- return $false;
- }
- $retarr = array();
- while (!$rs->EOF) { //print_r($rs->fields);
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $fld->type = $rs->fields[1];
- $fld->max_length = $rs->fields[2];
-
-
- if ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] = $fld;
- else $retarr[strtoupper($fld->name)] = $fld;
-
- $rs->MoveNext();
- }
- $rs->Close();
- return $retarr;
- }
-
- // returns true or false
- function _connect($argDSN, $argUsername, $argPassword, $argDatabasename)
- {
- global $php_errormsg;
-
- $php_errormsg = '';
- $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword,SQL_CUR_USE_ODBC );
- $this->_errorMsg = $php_errormsg;
-
- $this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'");
- //if ($this->_connectionID) odbc_autocommit($this->_connectionID,true);
- return $this->_connectionID != false;
- }
- // returns true or false
- function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
- {
- global $php_errormsg;
- $php_errormsg = '';
- $this->_connectionID = odbc_pconnect($argDSN,$argUsername,$argPassword,SQL_CUR_USE_ODBC );
- $this->_errorMsg = $php_errormsg;
-
- $this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'");
- //if ($this->_connectionID) odbc_autocommit($this->_connectionID,true);
- return $this->_connectionID != false;
- }
-}
-
-class ADORecordSet_odbc_oracle extends ADORecordSet_odbc {
-
- var $databaseType = 'odbc_oracle';
-
- function ADORecordSet_odbc_oracle($id,$mode=false)
- {
- return $this->ADORecordSet_odbc($id,$mode);
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-odbtp.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-odbtp.inc.php
deleted file mode 100644
index 2209b6c..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-odbtp.inc.php
+++ /dev/null
@@ -1,838 +0,0 @@
-
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-define("_ADODB_ODBTP_LAYER", 2 );
-
-class ADODB_odbtp extends ADOConnection{
- var $databaseType = "odbtp";
- var $dataProvider = "odbtp";
- var $fmtDate = "'Y-m-d'";
- var $fmtTimeStamp = "'Y-m-d, h:i:sA'";
- var $replaceQuote = "''"; // string to use to replace quotes
- var $odbc_driver = 0;
- var $hasAffectedRows = true;
- var $hasInsertID = false;
- var $hasGenID = true;
- var $hasMoveFirst = true;
-
- var $_genSeqSQL = "create table %s (seq_name char(30) not null unique , seq_value integer not null)";
- var $_dropSeqSQL = "delete from adodb_seq where seq_name = '%s'";
- var $_bindInputArray = false;
- var $_useUnicodeSQL = false;
- var $_canPrepareSP = false;
- var $_dontPoolDBC = true;
-
- function ADODB_odbtp()
- {
- }
-
- function ServerInfo()
- {
- return array('description' => @odbtp_get_attr( ODB_ATTR_DBMSNAME, $this->_connectionID),
- 'version' => @odbtp_get_attr( ODB_ATTR_DBMSVER, $this->_connectionID));
- }
-
- function ErrorMsg()
- {
- if ($this->_errorMsg !== false) return $this->_errorMsg;
- if (empty($this->_connectionID)) return @odbtp_last_error();
- return @odbtp_last_error($this->_connectionID);
- }
-
- function ErrorNo()
- {
- if ($this->_errorCode !== false) return $this->_errorCode;
- if (empty($this->_connectionID)) return @odbtp_last_error_state();
- return @odbtp_last_error_state($this->_connectionID);
- }
-/*
- function DBDate($d,$isfld=false)
- {
- if (empty($d) && $d !== 0) return 'null';
- if ($isfld) return "convert(date, $d, 120)";
-
- if (is_string($d)) $d = ADORecordSet::UnixDate($d);
- $d = adodb_date($this->fmtDate,$d);
- return "convert(date, $d, 120)";
- }
-
- function DBTimeStamp($d,$isfld=false)
- {
- if (empty($d) && $d !== 0) return 'null';
- if ($isfld) return "convert(datetime, $d, 120)";
-
- if (is_string($d)) $d = ADORecordSet::UnixDate($d);
- $d = adodb_date($this->fmtDate,$d);
- return "convert(datetime, $d, 120)";
- }
-*/
-
- function _insertid()
- {
- // SCOPE_IDENTITY()
- // Returns the last IDENTITY value inserted into an IDENTITY column in
- // the same scope. A scope is a module -- a stored procedure, trigger,
- // function, or batch. Thus, two statements are in the same scope if
- // they are in the same stored procedure, function, or batch.
- return $this->GetOne($this->identitySQL);
- }
-
- function _affectedrows()
- {
- if ($this->_queryID) {
- return @odbtp_affected_rows ($this->_queryID);
- } else
- return 0;
- }
-
- function CreateSequence($seqname='adodbseq',$start=1)
- {
- //verify existence
- $num = $this->GetOne("select seq_value from adodb_seq");
- $seqtab='adodb_seq';
- if( $this->odbc_driver == ODB_DRIVER_FOXPRO ) {
- $path = @odbtp_get_attr( ODB_ATTR_DATABASENAME, $this->_connectionID );
- //if using vfp dbc file
- if( !strcasecmp(strrchr($path, '.'), '.dbc') )
- $path = substr($path,0,strrpos($path,'\/'));
- $seqtab = $path . '/' . $seqtab;
- }
- if($num == false) {
- if (empty($this->_genSeqSQL)) return false;
- $ok = $this->Execute(sprintf($this->_genSeqSQL ,$seqtab));
- }
- $num = $this->GetOne("select seq_value from adodb_seq where seq_name='$seqname'");
- if ($num) {
- return false;
- }
- $start -= 1;
- return $this->Execute("insert into adodb_seq values('$seqname',$start)");
- }
-
- function DropSequence($seqname)
- {
- if (empty($this->_dropSeqSQL)) return false;
- return $this->Execute(sprintf($this->_dropSeqSQL,$seqname));
- }
-
- function GenID($seq='adodbseq',$start=1)
- {
- $seqtab='adodb_seq';
- if( $this->odbc_driver == ODB_DRIVER_FOXPRO) {
- $path = @odbtp_get_attr( ODB_ATTR_DATABASENAME, $this->_connectionID );
- //if using vfp dbc file
- if( !strcasecmp(strrchr($path, '.'), '.dbc') )
- $path = substr($path,0,strrpos($path,'\/'));
- $seqtab = $path . '/' . $seqtab;
- }
- $MAXLOOPS = 100;
- while (--$MAXLOOPS>=0) {
- $num = $this->GetOne("select seq_value from adodb_seq where seq_name='$seq'");
- if ($num === false) {
- //verify if abodb_seq table exist
- $ok = $this->GetOne("select seq_value from adodb_seq ");
- if(!$ok) {
- //creating the sequence table adodb_seq
- $this->Execute(sprintf($this->_genSeqSQL ,$seqtab));
- }
- $start -= 1;
- $num = '0';
- $ok = $this->Execute("insert into adodb_seq values('$seq',$start)");
- if (!$ok) return false;
- }
- $ok = $this->Execute("update adodb_seq set seq_value=seq_value+1 where seq_name='$seq'");
- if($ok) {
- $num += 1;
- $this->genID = $num;
- return $num;
- }
- }
- if ($fn = $this->raiseErrorFn) {
- $fn($this->databaseType,'GENID',-32000,"Unable to generate unique id after $MAXLOOPS attempts",$seq,$num);
- }
- return false;
- }
-
- //example for $UserOrDSN
- //for visual fox : DRIVER={Microsoft Visual FoxPro Driver};SOURCETYPE=DBF;SOURCEDB=c:\YourDbfFileDir;EXCLUSIVE=NO;
- //for visual fox dbc: DRIVER={Microsoft Visual FoxPro Driver};SOURCETYPE=DBC;SOURCEDB=c:\YourDbcFileDir\mydb.dbc;EXCLUSIVE=NO;
- //for access : DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\path_to_access_db\base_test.mdb;UID=root;PWD=;
- //for mssql : DRIVER={SQL Server};SERVER=myserver;UID=myuid;PWD=mypwd;DATABASE=OdbtpTest;
- //if uid & pwd can be separate
- function _connect($HostOrInterface, $UserOrDSN='', $argPassword='', $argDatabase='')
- {
- if ($argPassword && stripos($UserOrDSN,'DRIVER=') !== false) {
- $this->_connectionID = odbtp_connect($HostOrInterface,$UserOrDSN.';PWD='.$argPassword);
- } else
- $this->_connectionID = odbtp_connect($HostOrInterface,$UserOrDSN,$argPassword,$argDatabase);
- if ($this->_connectionID === false) {
- $this->_errorMsg = $this->ErrorMsg() ;
- return false;
- }
-
- odbtp_convert_datetime($this->_connectionID,true);
-
- if ($this->_dontPoolDBC) {
- if (function_exists('odbtp_dont_pool_dbc'))
- @odbtp_dont_pool_dbc($this->_connectionID);
- }
- else {
- $this->_dontPoolDBC = true;
- }
- $this->odbc_driver = @odbtp_get_attr(ODB_ATTR_DRIVER, $this->_connectionID);
- $dbms = strtolower(@odbtp_get_attr(ODB_ATTR_DBMSNAME, $this->_connectionID));
- $this->odbc_name = $dbms;
-
- // Account for inconsistent DBMS names
- if( $this->odbc_driver == ODB_DRIVER_ORACLE )
- $dbms = 'oracle';
- else if( $this->odbc_driver == ODB_DRIVER_SYBASE )
- $dbms = 'sybase';
-
- // Set DBMS specific attributes
- switch( $dbms ) {
- case 'microsoft sql server':
- $this->databaseType = 'odbtp_mssql';
- $this->fmtDate = "'Y-m-d'";
- $this->fmtTimeStamp = "'Y-m-d h:i:sA'";
- $this->sysDate = 'convert(datetime,convert(char,GetDate(),102),102)';
- $this->sysTimeStamp = 'GetDate()';
- $this->ansiOuter = true;
- $this->leftOuter = '*=';
- $this->rightOuter = '=*';
- $this->hasTop = 'top';
- $this->hasInsertID = true;
- $this->hasTransactions = true;
- $this->_bindInputArray = true;
- $this->_canSelectDb = true;
- $this->substr = "substring";
- $this->length = 'len';
- $this->identitySQL = 'select SCOPE_IDENTITY()';
- $this->metaDatabasesSQL = "select name from master..sysdatabases where name <> 'master'";
- $this->_canPrepareSP = true;
- break;
- case 'access':
- $this->databaseType = 'odbtp_access';
- $this->fmtDate = "#Y-m-d#";
- $this->fmtTimeStamp = "#Y-m-d h:i:sA#";
- $this->sysDate = "FORMAT(NOW,'yyyy-mm-dd')";
- $this->sysTimeStamp = 'NOW';
- $this->hasTop = 'top';
- $this->hasTransactions = false;
- $this->_canPrepareSP = true; // For MS Access only.
- break;
- case 'visual foxpro':
- $this->databaseType = 'odbtp_vfp';
- $this->fmtDate = "{^Y-m-d}";
- $this->fmtTimeStamp = "{^Y-m-d, h:i:sA}";
- $this->sysDate = 'date()';
- $this->sysTimeStamp = 'datetime()';
- $this->ansiOuter = true;
- $this->hasTop = 'top';
- $this->hasTransactions = false;
- $this->replaceQuote = "'+chr(39)+'";
- $this->true = '.T.';
- $this->false = '.F.';
-
- break;
- case 'oracle':
- $this->databaseType = 'odbtp_oci8';
- $this->fmtDate = "'Y-m-d 00:00:00'";
- $this->fmtTimeStamp = "'Y-m-d h:i:sA'";
- $this->sysDate = 'TRUNC(SYSDATE)';
- $this->sysTimeStamp = 'SYSDATE';
- $this->hasTransactions = true;
- $this->_bindInputArray = true;
- $this->concat_operator = '||';
- break;
- case 'sybase':
- $this->databaseType = 'odbtp_sybase';
- $this->fmtDate = "'Y-m-d'";
- $this->fmtTimeStamp = "'Y-m-d H:i:s'";
- $this->sysDate = 'GetDate()';
- $this->sysTimeStamp = 'GetDate()';
- $this->leftOuter = '*=';
- $this->rightOuter = '=*';
- $this->hasInsertID = true;
- $this->hasTransactions = true;
- $this->identitySQL = 'select SCOPE_IDENTITY()';
- break;
- default:
- $this->databaseType = 'odbtp';
- if( @odbtp_get_attr(ODB_ATTR_TXNCAPABLE, $this->_connectionID) )
- $this->hasTransactions = true;
- else
- $this->hasTransactions = false;
- }
- @odbtp_set_attr(ODB_ATTR_FULLCOLINFO, TRUE, $this->_connectionID );
-
- if ($this->_useUnicodeSQL )
- @odbtp_set_attr(ODB_ATTR_UNICODESQL, TRUE, $this->_connectionID);
-
- return true;
- }
-
- function _pconnect($HostOrInterface, $UserOrDSN='', $argPassword='', $argDatabase='')
- {
- $this->_dontPoolDBC = false;
- return $this->_connect($HostOrInterface, $UserOrDSN, $argPassword, $argDatabase);
- }
-
- function SelectDB($dbName)
- {
- if (!@odbtp_select_db($dbName, $this->_connectionID)) {
- return false;
- }
- $this->database = $dbName;
- $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions
- return true;
- }
-
- function MetaTables($ttype='',$showSchema=false,$mask=false)
- {
- global $ADODB_FETCH_MODE;
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== false) $savefm = $this->SetFetchMode(false);
-
- $arr = $this->GetArray("||SQLTables||||$ttype");
-
- if (isset($savefm)) $this->SetFetchMode($savefm);
- $ADODB_FETCH_MODE = $savem;
-
- $arr2 = array();
- for ($i=0; $i < sizeof($arr); $i++) {
- if ($arr[$i][3] == 'SYSTEM TABLE' ) continue;
- if ($arr[$i][2])
- $arr2[] = $showSchema && $arr[$i][1]? $arr[$i][1].'.'.$arr[$i][2] : $arr[$i][2];
- }
- return $arr2;
- }
-
- function MetaColumns($table,$upper=true)
- {
- global $ADODB_FETCH_MODE;
-
- $schema = false;
- $this->_findschema($table,$schema);
- if ($upper) $table = strtoupper($table);
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== false) $savefm = $this->SetFetchMode(false);
-
- $rs = $this->Execute( "||SQLColumns||$schema|$table" );
-
- if (isset($savefm)) $this->SetFetchMode($savefm);
- $ADODB_FETCH_MODE = $savem;
-
- if (!$rs || $rs->EOF) {
- $false = false;
- return $false;
- }
- $retarr = array();
- while (!$rs->EOF) {
- //print_r($rs->fields);
- if (strtoupper($rs->fields[2]) == $table) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[3];
- $fld->type = $rs->fields[5];
- $fld->max_length = $rs->fields[6];
- $fld->not_null = !empty($rs->fields[9]);
- $fld->scale = $rs->fields[7];
- if (isset($rs->fields[12])) // vfp does not have field 12
- if (!is_null($rs->fields[12])) {
- $fld->has_default = true;
- $fld->default_value = $rs->fields[12];
- }
- $retarr[strtoupper($fld->name)] = $fld;
- } else if (!empty($retarr))
- break;
- $rs->MoveNext();
- }
- $rs->Close();
-
- return $retarr;
- }
-
- function MetaPrimaryKeys($table, $owner='')
- {
- global $ADODB_FETCH_MODE;
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $arr = $this->GetArray("||SQLPrimaryKeys||$owner|$table");
- $ADODB_FETCH_MODE = $savem;
-
- //print_r($arr);
- $arr2 = array();
- for ($i=0; $i < sizeof($arr); $i++) {
- if ($arr[$i][3]) $arr2[] = $arr[$i][3];
- }
- return $arr2;
- }
-
- function MetaForeignKeys($table, $owner='', $upper=false)
- {
- global $ADODB_FETCH_MODE;
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $constraints = $this->GetArray("||SQLForeignKeys|||||$owner|$table");
- $ADODB_FETCH_MODE = $savem;
-
- $arr = false;
- foreach($constraints as $constr) {
- //print_r($constr);
- $arr[$constr[11]][$constr[2]][] = $constr[7].'='.$constr[3];
- }
- if (!$arr) {
- $false = false;
- return $false;
- }
-
- $arr2 = array();
-
- foreach($arr as $k => $v) {
- foreach($v as $a => $b) {
- if ($upper) $a = strtoupper($a);
- $arr2[$a] = $b;
- }
- }
- return $arr2;
- }
-
- function BeginTrans()
- {
- if (!$this->hasTransactions) return false;
- if ($this->transOff) return true;
- $this->transCnt += 1;
- $this->autoCommit = false;
- if (defined('ODB_TXN_DEFAULT'))
- $txn = ODB_TXN_DEFAULT;
- else
- $txn = ODB_TXN_READUNCOMMITTED;
- $rs = @odbtp_set_attr(ODB_ATTR_TRANSACTIONS,$txn,$this->_connectionID);
- if(!$rs) return false;
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
- if ($this->transCnt) $this->transCnt -= 1;
- $this->autoCommit = true;
- if( ($ret = @odbtp_commit($this->_connectionID)) )
- $ret = @odbtp_set_attr(ODB_ATTR_TRANSACTIONS, ODB_TXN_NONE, $this->_connectionID);//set transaction off
- return $ret;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $this->autoCommit = true;
- if( ($ret = @odbtp_rollback($this->_connectionID)) )
- $ret = @odbtp_set_attr(ODB_ATTR_TRANSACTIONS, ODB_TXN_NONE, $this->_connectionID);//set transaction off
- return $ret;
- }
-
- function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
- {
- // TOP requires ORDER BY for Visual FoxPro
- if( $this->odbc_driver == ODB_DRIVER_FOXPRO ) {
- if (!preg_match('/ORDER[ \t\r\n]+BY/is',$sql)) $sql .= ' ORDER BY 1';
- }
- $ret = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
- return $ret;
- }
-
- function Prepare($sql)
- {
- if (! $this->_bindInputArray) return $sql; // no binding
-
- $this->_errorMsg = false;
- $this->_errorCode = false;
-
- $stmt = @odbtp_prepare($sql,$this->_connectionID);
- if (!$stmt) {
- // print "Prepare Error for ($sql) ".$this->ErrorMsg()." ";
- return $sql;
- }
- return array($sql,$stmt,false);
- }
-
- function PrepareSP($sql)
- {
- if (!$this->_canPrepareSP) return $sql; // Can't prepare procedures
-
- $this->_errorMsg = false;
- $this->_errorCode = false;
-
- $stmt = @odbtp_prepare_proc($sql,$this->_connectionID);
- if (!$stmt) return false;
- return array($sql,$stmt);
- }
-
- /*
- Usage:
- $stmt = $db->PrepareSP('SP_RUNSOMETHING'); -- takes 2 params, @myid and @group
-
- # note that the parameter does not have @ in front!
- $db->Parameter($stmt,$id,'myid');
- $db->Parameter($stmt,$group,'group',false,64);
- $db->Parameter($stmt,$group,'photo',false,100000,ODB_BINARY);
- $db->Execute($stmt);
-
- @param $stmt Statement returned by Prepare() or PrepareSP().
- @param $var PHP variable to bind to. Can set to null (for isNull support).
- @param $name Name of stored procedure variable name to bind to.
- @param [$isOutput] Indicates direction of parameter 0/false=IN 1=OUT 2= IN/OUT. This is ignored in odbtp.
- @param [$maxLen] Holds an maximum length of the variable.
- @param [$type] The data type of $var. Legal values depend on driver.
-
- See odbtp_attach_param documentation at http://odbtp.sourceforge.net.
- */
- function Parameter(&$stmt, &$var, $name, $isOutput=false, $maxLen=0, $type=0)
- {
- if ( $this->odbc_driver == ODB_DRIVER_JET ) {
- $name = '['.$name.']';
- if( !$type && $this->_useUnicodeSQL
- && @odbtp_param_bindtype($stmt[1], $name) == ODB_CHAR )
- {
- $type = ODB_WCHAR;
- }
- }
- else {
- $name = '@'.$name;
- }
- return @odbtp_attach_param($stmt[1], $name, $var, $type, $maxLen);
- }
-
- /*
- Insert a null into the blob field of the table first.
- Then use UpdateBlob to store the blob.
-
- Usage:
-
- $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)');
- $conn->UpdateBlob('blobtable','blobcol',$blob,'id=1');
- */
-
- function UpdateBlob($table,$column,$val,$where,$blobtype='image')
- {
- $sql = "UPDATE $table SET $column = ? WHERE $where";
- if( !($stmt = @odbtp_prepare($sql, $this->_connectionID)) )
- return false;
- if( !@odbtp_input( $stmt, 1, ODB_BINARY, 1000000, $blobtype ) )
- return false;
- if( !@odbtp_set( $stmt, 1, $val ) )
- return false;
- return @odbtp_execute( $stmt ) != false;
- }
-
- function MetaIndexes($table,$primary=false, $owner=false)
- {
- switch ( $this->odbc_driver) {
- case ODB_DRIVER_MSSQL:
- return $this->MetaIndexes_mssql($table, $primary);
- default:
- return array();
- }
- }
-
- function MetaIndexes_mssql($table,$primary=false, $owner = false)
- {
- $table = strtolower($this->qstr($table));
-
- $sql = "SELECT i.name AS ind_name, C.name AS col_name, USER_NAME(O.uid) AS Owner, c.colid, k.Keyno,
- CASE WHEN I.indid BETWEEN 1 AND 254 AND (I.status & 2048 = 2048 OR I.Status = 16402 AND O.XType = 'V') THEN 1 ELSE 0 END AS IsPK,
- CASE WHEN I.status & 2 = 2 THEN 1 ELSE 0 END AS IsUnique
- FROM dbo.sysobjects o INNER JOIN dbo.sysindexes I ON o.id = i.id
- INNER JOIN dbo.sysindexkeys K ON I.id = K.id AND I.Indid = K.Indid
- INNER JOIN dbo.syscolumns c ON K.id = C.id AND K.colid = C.Colid
- WHERE LEFT(i.name, 8) <> '_WA_Sys_' AND o.status >= 0 AND lower(O.Name) = $table
- ORDER BY O.name, I.Name, K.keyno";
-
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- $rs = $this->Execute($sql);
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- if (!is_object($rs)) {
- return FALSE;
- }
-
- $indexes = array();
- while ($row = $rs->FetchRow()) {
- if ($primary && !$row[5]) continue;
-
- $indexes[$row[0]]['unique'] = $row[6];
- $indexes[$row[0]]['columns'][] = $row[1];
- }
- return $indexes;
- }
-
- function IfNull( $field, $ifNull )
- {
- switch( $this->odbc_driver ) {
- case ODB_DRIVER_MSSQL:
- return " ISNULL($field, $ifNull) ";
- case ODB_DRIVER_JET:
- return " IIF(IsNull($field), $ifNull, $field) ";
- }
- return " CASE WHEN $field is null THEN $ifNull ELSE $field END ";
- }
-
- function _query($sql,$inputarr=false)
- {
- global $php_errormsg;
-
- $this->_errorMsg = false;
- $this->_errorCode = false;
-
- if ($inputarr) {
- if (is_array($sql)) {
- $stmtid = $sql[1];
- } else {
- $stmtid = @odbtp_prepare($sql,$this->_connectionID);
- if ($stmtid == false) {
- $this->_errorMsg = $php_errormsg;
- return false;
- }
- }
- $num_params = @odbtp_num_params( $stmtid );
- /*
- for( $param = 1; $param <= $num_params; $param++ ) {
- @odbtp_input( $stmtid, $param );
- @odbtp_set( $stmtid, $param, $inputarr[$param-1] );
- }*/
-
- $param = 1;
- foreach($inputarr as $v) {
- @odbtp_input( $stmtid, $param );
- @odbtp_set( $stmtid, $param, $v );
- $param += 1;
- if ($param > $num_params) break;
- }
-
- if (!@odbtp_execute($stmtid) ) {
- return false;
- }
- } else if (is_array($sql)) {
- $stmtid = $sql[1];
- if (!@odbtp_execute($stmtid)) {
- return false;
- }
- } else {
- $stmtid = odbtp_query($sql,$this->_connectionID);
- }
- $this->_lastAffectedRows = 0;
- if ($stmtid) {
- $this->_lastAffectedRows = @odbtp_affected_rows($stmtid);
- }
- return $stmtid;
- }
-
- function _close()
- {
- $ret = @odbtp_close($this->_connectionID);
- $this->_connectionID = false;
- return $ret;
- }
-}
-
-class ADORecordSet_odbtp extends ADORecordSet {
-
- var $databaseType = 'odbtp';
- var $canSeek = true;
-
- function ADORecordSet_odbtp($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- $this->fetchMode = $mode;
- $this->ADORecordSet($queryID);
- }
-
- function _initrs()
- {
- $this->_numOfFields = @odbtp_num_fields($this->_queryID);
- if (!($this->_numOfRows = @odbtp_num_rows($this->_queryID)))
- $this->_numOfRows = -1;
-
- if (!$this->connection->_useUnicodeSQL) return;
-
- if ($this->connection->odbc_driver == ODB_DRIVER_JET) {
- if (!@odbtp_get_attr(ODB_ATTR_MAPCHARTOWCHAR,
- $this->connection->_connectionID))
- {
- for ($f = 0; $f < $this->_numOfFields; $f++) {
- if (@odbtp_field_bindtype($this->_queryID, $f) == ODB_CHAR)
- @odbtp_bind_field($this->_queryID, $f, ODB_WCHAR);
- }
- }
- }
- }
-
- function FetchField($fieldOffset = 0)
- {
- $off=$fieldOffset; // offsets begin at 0
- $o= new ADOFieldObject();
- $o->name = @odbtp_field_name($this->_queryID,$off);
- $o->type = @odbtp_field_type($this->_queryID,$off);
- $o->max_length = @odbtp_field_length($this->_queryID,$off);
- if (ADODB_ASSOC_CASE == 0) $o->name = strtolower($o->name);
- else if (ADODB_ASSOC_CASE == 1) $o->name = strtoupper($o->name);
- return $o;
- }
-
- function _seek($row)
- {
- return @odbtp_data_seek($this->_queryID, $row);
- }
-
- function fields($colname)
- {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) return $this->fields[$colname];
-
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $name = @odbtp_field_name( $this->_queryID, $i );
- $this->bind[strtoupper($name)] = $i;
- }
- }
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- function _fetch_odbtp($type=0)
- {
- switch ($this->fetchMode) {
- case ADODB_FETCH_NUM:
- $this->fields = @odbtp_fetch_row($this->_queryID, $type);
- break;
- case ADODB_FETCH_ASSOC:
- $this->fields = @odbtp_fetch_assoc($this->_queryID, $type);
- break;
- default:
- $this->fields = @odbtp_fetch_array($this->_queryID, $type);
- }
- if ($this->databaseType = 'odbtp_vfp') {
- if ($this->fields)
- foreach($this->fields as $k => $v) {
- if (strncmp($v,'1899-12-30',10) == 0) $this->fields[$k] = '';
- }
- }
- return is_array($this->fields);
- }
-
- function _fetch()
- {
- return $this->_fetch_odbtp();
- }
-
- function MoveFirst()
- {
- if (!$this->_fetch_odbtp(ODB_FETCH_FIRST)) return false;
- $this->EOF = false;
- $this->_currentRow = 0;
- return true;
- }
-
- function MoveLast()
- {
- if (!$this->_fetch_odbtp(ODB_FETCH_LAST)) return false;
- $this->EOF = false;
- $this->_currentRow = $this->_numOfRows - 1;
- return true;
- }
-
- function NextRecordSet()
- {
- if (!@odbtp_next_result($this->_queryID)) return false;
- $this->_inited = false;
- $this->bind = false;
- $this->_currentRow = -1;
- $this->Init();
- return true;
- }
-
- function _close()
- {
- return @odbtp_free_query($this->_queryID);
- }
-}
-
-class ADORecordSet_odbtp_mssql extends ADORecordSet_odbtp {
-
- var $databaseType = 'odbtp_mssql';
-
- function ADORecordSet_odbtp_mssql($id,$mode=false)
- {
- return $this->ADORecordSet_odbtp($id,$mode);
- }
-}
-
-class ADORecordSet_odbtp_access extends ADORecordSet_odbtp {
-
- var $databaseType = 'odbtp_access';
-
- function ADORecordSet_odbtp_access($id,$mode=false)
- {
- return $this->ADORecordSet_odbtp($id,$mode);
- }
-}
-
-class ADORecordSet_odbtp_vfp extends ADORecordSet_odbtp {
-
- var $databaseType = 'odbtp_vfp';
-
- function ADORecordSet_odbtp_vfp($id,$mode=false)
- {
- return $this->ADORecordSet_odbtp($id,$mode);
- }
-}
-
-class ADORecordSet_odbtp_oci8 extends ADORecordSet_odbtp {
-
- var $databaseType = 'odbtp_oci8';
-
- function ADORecordSet_odbtp_oci8($id,$mode=false)
- {
- return $this->ADORecordSet_odbtp($id,$mode);
- }
-}
-
-class ADORecordSet_odbtp_sybase extends ADORecordSet_odbtp {
-
- var $databaseType = 'odbtp_sybase';
-
- function ADORecordSet_odbtp_sybase($id,$mode=false)
- {
- return $this->ADORecordSet_odbtp($id,$mode);
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-odbtp_unicode.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-odbtp_unicode.inc.php
deleted file mode 100644
index 0db4408..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-odbtp_unicode.inc.php
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-/*
- Because the ODBTP server sends and reads UNICODE text data using UTF-8
- encoding, the following HTML meta tag must be included within the HTML
- head section of every HTML form and script page:
-
-
-
- Also, all SQL query strings must be submitted as UTF-8 encoded text.
-*/
-
-if (!defined('_ADODB_ODBTP_LAYER')) {
- include(ADODB_DIR."/drivers/adodb-odbtp.inc.php");
-}
-
-class ADODB_odbtp_unicode extends ADODB_odbtp {
- var $databaseType = 'odbtp';
- var $_useUnicodeSQL = true;
-
- function ADODB_odbtp_unicode()
- {
- $this->ADODB_odbtp();
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-oracle.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-oracle.inc.php
deleted file mode 100644
index a92d84e..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-oracle.inc.php
+++ /dev/null
@@ -1,341 +0,0 @@
-format($this->fmtDate);
- else $ds = adodb_date($this->fmtDate,$d);
- return 'TO_DATE('.$ds.",'YYYY-MM-DD')";
- }
-
- // format and return date string in database timestamp format
- function DBTimeStamp($ts)
- {
-
- if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
- if (is_object($ts)) $ds = $ts->format($this->fmtDate);
- else $ds = adodb_date($this->fmtTimeStamp,$ts);
- return 'TO_DATE('.$ds.",'RRRR-MM-DD, HH:MI:SS AM')";
- }
-
-
- function BindDate($d)
- {
- $d = ADOConnection::DBDate($d);
- if (strncmp($d,"'",1)) return $d;
-
- return substr($d,1,strlen($d)-2);
- }
-
- function BindTimeStamp($d)
- {
- $d = ADOConnection::DBTimeStamp($d);
- if (strncmp($d,"'",1)) return $d;
-
- return substr($d,1,strlen($d)-2);
- }
-
-
-
- function BeginTrans()
- {
- $this->autoCommit = false;
- ora_commitoff($this->_connectionID);
- return true;
- }
-
-
- function CommitTrans($ok=true)
- {
- if (!$ok) return $this->RollbackTrans();
- $ret = ora_commit($this->_connectionID);
- ora_commiton($this->_connectionID);
- return $ret;
- }
-
-
- function RollbackTrans()
- {
- $ret = ora_rollback($this->_connectionID);
- ora_commiton($this->_connectionID);
- return $ret;
- }
-
-
- /* there seems to be a bug in the oracle extension -- always returns ORA-00000 - no error */
- function ErrorMsg()
- {
- if ($this->_errorMsg !== false) return $this->_errorMsg;
-
- if (is_resource($this->_curs)) $this->_errorMsg = @ora_error($this->_curs);
- if (empty($this->_errorMsg)) $this->_errorMsg = @ora_error($this->_connectionID);
- return $this->_errorMsg;
- }
-
-
- function ErrorNo()
- {
- if ($this->_errorCode !== false) return $this->_errorCode;
-
- if (is_resource($this->_curs)) $this->_errorCode = @ora_errorcode($this->_curs);
- if (empty($this->_errorCode)) $this->_errorCode = @ora_errorcode($this->_connectionID);
- return $this->_errorCode;
- }
-
-
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename, $mode=0)
- {
- if (!function_exists('ora_plogon')) return null;
-
- // Reset error messages before connecting
- $this->_errorMsg = false;
- $this->_errorCode = false;
-
- // G. Giunta 2003/08/13 - This looks danegrously suspicious: why should we want to set
- // the oracle home to the host name of remote DB?
-// if ($argHostname) putenv("ORACLE_HOME=$argHostname");
-
- if($argHostname) { // code copied from version submitted for oci8 by Jorma Tuomainen
- if (empty($argDatabasename)) $argDatabasename = $argHostname;
- else {
- if(strpos($argHostname,":")) {
- $argHostinfo=explode(":",$argHostname);
- $argHostname=$argHostinfo[0];
- $argHostport=$argHostinfo[1];
- } else {
- $argHostport="1521";
- }
-
-
- if ($this->connectSID) {
- $argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname
- .")(PORT=$argHostport))(CONNECT_DATA=(SID=$argDatabasename)))";
- } else
- $argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname
- .")(PORT=$argHostport))(CONNECT_DATA=(SERVICE_NAME=$argDatabasename)))";
- }
-
- }
-
- if ($argDatabasename) $argUsername .= "@$argDatabasename";
-
- //if ($argHostname) print "Connect: 1st argument should be left blank for $this->databaseType
";
- if ($mode == 1)
- $this->_connectionID = ora_plogon($argUsername,$argPassword);
- else
- $this->_connectionID = ora_logon($argUsername,$argPassword);
- if ($this->_connectionID === false) return false;
- if ($this->autoCommit) ora_commiton($this->_connectionID);
- if ($this->_initdate) {
- $rs = $this->_query("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD'");
- if ($rs) ora_close($rs);
- }
-
- return true;
- }
-
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename, 1);
- }
-
-
- // returns query ID if successful, otherwise false
- function _query($sql,$inputarr=false)
- {
- // Reset error messages before executing
- $this->_errorMsg = false;
- $this->_errorCode = false;
-
- $curs = ora_open($this->_connectionID);
-
- if ($curs === false) return false;
- $this->_curs = $curs;
- if (!ora_parse($curs,$sql)) return false;
- if (ora_exec($curs)) return $curs;
- // before we close the cursor, we have to store the error message
- // that we can obtain ONLY from the cursor (and not from the connection)
- $this->_errorCode = @ora_errorcode($curs);
- $this->_errorMsg = @ora_error($curs);
- //
- @ora_close($curs);
- return false;
- }
-
-
- // returns true or false
- function _close()
- {
- return @ora_logoff($this->_connectionID);
- }
-
-
-
-}
-
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordset_oracle extends ADORecordSet {
-
- var $databaseType = "oracle";
- var $bind = false;
-
- function ADORecordset_oracle($queryID,$mode=false)
- {
-
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- $this->fetchMode = $mode;
-
- $this->_queryID = $queryID;
-
- $this->_inited = true;
- $this->fields = array();
- if ($queryID) {
- $this->_currentRow = 0;
- $this->EOF = !$this->_fetch();
- @$this->_initrs();
- } else {
- $this->_numOfRows = 0;
- $this->_numOfFields = 0;
- $this->EOF = true;
- }
-
- return $this->_queryID;
- }
-
-
-
- /* Returns: an object containing field information.
- Get column information in the Recordset object. fetchField() can be used in order to obtain information about
- fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by
- fetchField() is retrieved. */
-
- function FetchField($fieldOffset = -1)
- {
- $fld = new ADOFieldObject;
- $fld->name = ora_columnname($this->_queryID, $fieldOffset);
- $fld->type = ora_columntype($this->_queryID, $fieldOffset);
- $fld->max_length = ora_columnsize($this->_queryID, $fieldOffset);
- return $fld;
- }
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
-
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- function _initrs()
- {
- $this->_numOfRows = -1;
- $this->_numOfFields = @ora_numcols($this->_queryID);
- }
-
-
- function _seek($row)
- {
- return false;
- }
-
- function _fetch($ignore_fields=false) {
-// should remove call by reference, but ora_fetch_into requires it in 4.0.3pl1
- if ($this->fetchMode & ADODB_FETCH_ASSOC)
- return @ora_fetch_into($this->_queryID,$this->fields,ORA_FETCHINTO_NULLS|ORA_FETCHINTO_ASSOC);
- else
- return @ora_fetch_into($this->_queryID,$this->fields,ORA_FETCHINTO_NULLS);
- }
-
- /* close() only needs to be called if you are worried about using too much memory while your script
- is running. All associated result memory for the specified result identifier will automatically be freed. */
-
- function _close()
-{
- return @ora_close($this->_queryID);
- }
-
- function MetaType($t,$len=-1)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
-
- switch (strtoupper($t)) {
- case 'VARCHAR':
- case 'VARCHAR2':
- case 'CHAR':
- case 'VARBINARY':
- case 'BINARY':
- if ($len <= $this->blobSize) return 'C';
- case 'LONG':
- case 'LONG VARCHAR':
- case 'CLOB':
- return 'X';
- case 'LONG RAW':
- case 'LONG VARBINARY':
- case 'BLOB':
- return 'B';
-
- case 'DATE': return 'D';
-
- //case 'T': return 'T';
-
- case 'BIT': return 'L';
- case 'INT':
- case 'SMALLINT':
- case 'INTEGER': return 'I';
- default: return 'N';
- }
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-pdo.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-pdo.inc.php
deleted file mode 100644
index 4ac6164..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-pdo.inc.php
+++ /dev/null
@@ -1,625 +0,0 @@
-_driver;
- $this->fmtDate = $d->fmtDate;
- $this->fmtTimeStamp = $d->fmtTimeStamp;
- $this->replaceQuote = $d->replaceQuote;
- $this->sysDate = $d->sysDate;
- $this->sysTimeStamp = $d->sysTimeStamp;
- $this->random = $d->random;
- $this->concat_operator = $d->concat_operator;
- $this->nameQuote = $d->nameQuote;
-
- $this->hasGenID = $d->hasGenID;
- $this->_genIDSQL = $d->_genIDSQL;
- $this->_genSeqSQL = $d->_genSeqSQL;
- $this->_dropSeqSQL = $d->_dropSeqSQL;
-
- $d->_init($this);
- }
-
- function Time()
- {
- if (!empty($this->_driver->_hasdual)) $sql = "select $this->sysTimeStamp from dual";
- else $sql = "select $this->sysTimeStamp";
-
- $rs = $this->_Execute($sql);
- if ($rs && !$rs->EOF) return $this->UnixTimeStamp(reset($rs->fields));
-
- return false;
- }
-
- // returns true or false
- function _connect($argDSN, $argUsername, $argPassword, $argDatabasename, $persist=false)
- {
- $at = strpos($argDSN,':');
- $this->dsnType = substr($argDSN,0,$at);
-
- if ($argDatabasename) {
- $argDSN .= ';dbname='.$argDatabasename;
- }
- try {
- $this->_connectionID = new PDO($argDSN, $argUsername, $argPassword);
- } catch (Exception $e) {
- $this->_connectionID = false;
- $this->_errorno = -1;
- //var_dump($e);
- $this->_errormsg = 'Connection attempt failed: '.$e->getMessage();
- return false;
- }
-
- if ($this->_connectionID) {
- switch(ADODB_ASSOC_CASE){
- case 0: $m = PDO::CASE_LOWER; break;
- case 1: $m = PDO::CASE_UPPER; break;
- default:
- case 2: $m = PDO::CASE_NATURAL; break;
- }
-
- //$this->_connectionID->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_SILENT );
- $this->_connectionID->setAttribute(PDO::ATTR_CASE,$m);
-
- $class = 'ADODB_pdo_'.$this->dsnType;
- //$this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,true);
- switch($this->dsnType) {
- case 'oci':
- case 'mysql':
- case 'pgsql':
- case 'mssql':
- case 'sqlite':
- include_once(ADODB_DIR.'/drivers/adodb-pdo_'.$this->dsnType.'.inc.php');
- break;
- }
- if (class_exists($class))
- $this->_driver = new $class();
- else
- $this->_driver = new ADODB_pdo_base();
-
- $this->_driver->_connectionID = $this->_connectionID;
- $this->_UpdatePDO();
- return true;
- }
- $this->_driver = new ADODB_pdo_base();
- return false;
- }
-
- function Concat()
- {
- $args = func_get_args();
- if(method_exists($this->_driver, 'Concat'))
- return call_user_func_array(array($this->_driver, 'Concat'), $args);
-
- if (PHP_VERSION >= 5.3) return call_user_func_array('parent::Concat', $args);
- return call_user_func_array(array($this,'parent::Concat'), $args);
- }
-
- // returns true or false
- function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
- {
- return $this->_connect($argDSN, $argUsername, $argPassword, $argDatabasename, true);
- }
-
- /*------------------------------------------------------------------------------*/
-
-
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
- {
- $save = $this->_driver->fetchMode;
- $this->_driver->fetchMode = $this->fetchMode;
- $this->_driver->debug = $this->debug;
- $ret = $this->_driver->SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
- $this->_driver->fetchMode = $save;
- return $ret;
- }
-
-
- function ServerInfo()
- {
- return $this->_driver->ServerInfo();
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- return $this->_driver->MetaTables($ttype,$showSchema,$mask);
- }
-
- function MetaColumns($table,$normalize=true)
- {
- return $this->_driver->MetaColumns($table,$normalize);
- }
-
- function InParameter(&$stmt,&$var,$name,$maxLen=4000,$type=false)
- {
- $obj = $stmt[1];
- if ($type) $obj->bindParam($name,$var,$type,$maxLen);
- else $obj->bindParam($name, $var);
- }
-
- function OffsetDate($dayFraction,$date=false)
- {
- return $this->_driver->OffsetDate($dayFraction,$date);
- }
-
- function ErrorMsg()
- {
- if ($this->_errormsg !== false) return $this->_errormsg;
- if (!empty($this->_stmt)) $arr = $this->_stmt->errorInfo();
- else if (!empty($this->_connectionID)) $arr = $this->_connectionID->errorInfo();
- else return 'No Connection Established';
-
-
- if ($arr) {
- if (sizeof($arr)<2) return '';
- if ((integer)$arr[0]) return $arr[2];
- else return '';
- } else return '-1';
- }
-
-
- function ErrorNo()
- {
- if ($this->_errorno !== false) return $this->_errorno;
- if (!empty($this->_stmt)) $err = $this->_stmt->errorCode();
- else if (!empty($this->_connectionID)) {
- $arr = $this->_connectionID->errorInfo();
- if (isset($arr[0])) $err = $arr[0];
- else $err = -1;
- } else
- return 0;
-
- if ($err == '00000') return 0; // allows empty check
- return $err;
- }
-
- function SetTransactionMode($transaction_mode)
- {
- if(method_exists($this->_driver, 'SetTransactionMode'))
- return $this->_driver->SetTransactionMode($transaction_mode);
-
- return parent::SetTransactionMode($seqname);
- }
-
- function BeginTrans()
- {
- if(method_exists($this->_driver, 'BeginTrans'))
- return $this->_driver->BeginTrans();
-
- if (!$this->hasTransactions) return false;
- if ($this->transOff) return true;
- $this->transCnt += 1;
- $this->_autocommit = false;
- $this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,false);
- return $this->_connectionID->beginTransaction();
- }
-
- function CommitTrans($ok=true)
- {
- if(method_exists($this->_driver, 'CommitTrans'))
- return $this->_driver->CommitTrans($ok);
-
- if (!$this->hasTransactions) return false;
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
- if ($this->transCnt) $this->transCnt -= 1;
- $this->_autocommit = true;
-
- $ret = $this->_connectionID->commit();
- $this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,true);
- return $ret;
- }
-
- function RollbackTrans()
- {
- if(method_exists($this->_driver, 'RollbackTrans'))
- return $this->_driver->RollbackTrans();
-
- if (!$this->hasTransactions) return false;
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $this->_autocommit = true;
-
- $ret = $this->_connectionID->rollback();
- $this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,true);
- return $ret;
- }
-
- function Prepare($sql)
- {
- $this->_stmt = $this->_connectionID->prepare($sql);
- if ($this->_stmt) return array($sql,$this->_stmt);
-
- return false;
- }
-
- function PrepareStmt($sql)
- {
- $stmt = $this->_connectionID->prepare($sql);
- if (!$stmt) return false;
- $obj = new ADOPDOStatement($stmt,$this);
- return $obj;
- }
-
- function CreateSequence($seqname='adodbseq',$startID=1)
- {
- if(method_exists($this->_driver, 'CreateSequence'))
- return $this->_driver->CreateSequence($seqname, $startID);
-
- return parent::CreateSequence($seqname, $startID);
- }
-
- function DropSequence($seqname='adodbseq')
- {
- if(method_exists($this->_driver, 'DropSequence'))
- return $this->_driver->DropSequence($seqname);
-
- return parent::DropSequence($seqname);
- }
-
- function GenID($seqname='adodbseq',$startID=1)
- {
- if(method_exists($this->_driver, 'GenID'))
- return $this->_driver->GenID($seqname, $startID);
-
- return parent::GenID($seqname, $startID);
- }
-
-
- /* returns queryID or false */
- function _query($sql,$inputarr=false)
- {
- if (is_array($sql)) {
- $stmt = $sql[1];
- } 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);
- else $ok = $stmt->execute();
- }
-
-
- $this->_errormsg = false;
- $this->_errorno = false;
-
- if ($ok) {
- $this->_stmt = $stmt;
- return $stmt;
- }
-
- if ($stmt) {
-
- $arr = $stmt->errorinfo();
- if ((integer)$arr[1]) {
- $this->_errormsg = $arr[2];
- $this->_errorno = $arr[1];
- }
-
- } else {
- $this->_errormsg = false;
- $this->_errorno = false;
- }
- return false;
- }
-
- // returns true or false
- function _close()
- {
- $this->_stmt = false;
- return true;
- }
-
- function _affectedrows()
- {
- return ($this->_stmt) ? $this->_stmt->rowCount() : 0;
- }
-
- function _insertid()
- {
- return ($this->_connectionID) ? $this->_connectionID->lastInsertId() : 0;
- }
-}
-
-class ADODB_pdo_base extends ADODB_pdo {
-
- var $sysDate = "'?'";
- var $sysTimeStamp = "'?'";
-
-
- function _init($parentDriver)
- {
- $parentDriver->_bindInputArray = true;
- #$parentDriver->_connectionID->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,true);
- }
-
- function ServerInfo()
- {
- return ADOConnection::ServerInfo();
- }
-
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
- {
- $ret = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
- return $ret;
- }
-
- function MetaTables()
- {
- return false;
- }
-
- function MetaColumns()
- {
- return false;
- }
-}
-
-class ADOPDOStatement {
-
- var $databaseType = "pdo";
- var $dataProvider = "pdo";
- var $_stmt;
- var $_connectionID;
-
- function ADOPDOStatement($stmt,$connection)
- {
- $this->_stmt = $stmt;
- $this->_connectionID = $connection;
- }
-
- function Execute($inputArr=false)
- {
- $savestmt = $this->_connectionID->_stmt;
- $rs = $this->_connectionID->Execute(array(false,$this->_stmt),$inputArr);
- $this->_connectionID->_stmt = $savestmt;
- return $rs;
- }
-
- function InParameter(&$var,$name,$maxLen=4000,$type=false)
- {
-
- if ($type) $this->_stmt->bindParam($name,$var,$type,$maxLen);
- else $this->_stmt->bindParam($name, $var);
- }
-
- function Affected_Rows()
- {
- return ($this->_stmt) ? $this->_stmt->rowCount() : 0;
- }
-
- function ErrorMsg()
- {
- if ($this->_stmt) $arr = $this->_stmt->errorInfo();
- else $arr = $this->_connectionID->errorInfo();
-
- if (is_array($arr)) {
- if ((integer) $arr[0] && isset($arr[2])) return $arr[2];
- else return '';
- } else return '-1';
- }
-
- function NumCols()
- {
- return ($this->_stmt) ? $this->_stmt->columnCount() : 0;
- }
-
- function ErrorNo()
- {
- if ($this->_stmt) return $this->_stmt->errorCode();
- else return $this->_connectionID->errorInfo();
- }
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_pdo extends ADORecordSet {
-
- var $bind = false;
- var $databaseType = "pdo";
- var $dataProvider = "pdo";
-
- function ADORecordSet_pdo($id,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- $this->adodbFetchMode = $mode;
- switch($mode) {
- case ADODB_FETCH_NUM: $mode = PDO::FETCH_NUM; break;
- case ADODB_FETCH_ASSOC: $mode = PDO::FETCH_ASSOC; break;
-
- case ADODB_FETCH_BOTH:
- default: $mode = PDO::FETCH_BOTH; break;
- }
- $this->fetchMode = $mode;
-
- $this->_queryID = $id;
- $this->ADORecordSet($id);
- }
-
-
- function Init()
- {
- if ($this->_inited) return;
- $this->_inited = true;
- if ($this->_queryID) @$this->_initrs();
- else {
- $this->_numOfRows = 0;
- $this->_numOfFields = 0;
- }
- if ($this->_numOfRows != 0 && $this->_currentRow == -1) {
- $this->_currentRow = 0;
- if ($this->EOF = ($this->_fetch() === false)) {
- $this->_numOfRows = 0; // _numOfRows could be -1
- }
- } else {
- $this->EOF = true;
- }
- }
-
- function _initrs()
- {
- global $ADODB_COUNTRECS;
-
- $this->_numOfRows = ($ADODB_COUNTRECS) ? @$this->_queryID->rowCount() : -1;
- if (!$this->_numOfRows) $this->_numOfRows = -1;
- $this->_numOfFields = $this->_queryID->columnCount();
- }
-
- // returns the field object
- function FetchField($fieldOffset = -1)
- {
- $off=$fieldOffset+1; // offsets begin at 1
-
- $o= new ADOFieldObject();
- $arr = @$this->_queryID->getColumnMeta($fieldOffset);
- if (!$arr) {
- $o->name = 'bad getColumnMeta()';
- $o->max_length = -1;
- $o->type = 'VARCHAR';
- $o->precision = 0;
- # $false = false;
- return $o;
- }
- //adodb_pr($arr);
- $o->name = $arr['name'];
- if (isset($arr['native_type']) && $arr['native_type'] <> "null") $o->type = $arr['native_type'];
- else $o->type = adodb_pdo_type($arr['pdo_type']);
- $o->max_length = $arr['len'];
- $o->precision = $arr['precision'];
-
- if (ADODB_ASSOC_CASE == 0) $o->name = strtolower($o->name);
- else if (ADODB_ASSOC_CASE == 1) $o->name = strtoupper($o->name);
- return $o;
- }
-
- function _seek($row)
- {
- return false;
- }
-
- function _fetch()
- {
- if (!$this->_queryID) return false;
-
- $this->fields = $this->_queryID->fetch($this->fetchMode);
- return !empty($this->fields);
- }
-
- function _close()
- {
- $this->_queryID = false;
- }
-
- function Fields($colname)
- {
- if ($this->adodbFetchMode != ADODB_FETCH_NUM) return @$this->fields[$colname];
-
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-pdo_mssql.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-pdo_mssql.inc.php
deleted file mode 100644
index 0b1ba8b..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-pdo_mssql.inc.php
+++ /dev/null
@@ -1,60 +0,0 @@
-hasTransactions = false; ## <<< BUG IN PDO mssql driver
- $parentDriver->_bindInputArray = false;
- $parentDriver->hasInsertID = true;
- }
-
- function ServerInfo()
- {
- return ADOConnection::ServerInfo();
- }
-
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
- {
- $ret = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
- return $ret;
- }
-
- function SetTransactionMode( $transaction_mode )
- {
- $this->_transmode = $transaction_mode;
- if (empty($transaction_mode)) {
- $this->Execute('SET TRANSACTION ISOLATION LEVEL READ COMMITTED');
- return;
- }
- if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
- $this->Execute("SET TRANSACTION ".$transaction_mode);
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- return false;
- }
-
- function MetaColumns($table,$normalize=true)
- {
- return false;
- }
-
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-pdo_mysql.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-pdo_mysql.inc.php
deleted file mode 100644
index 524d149..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-pdo_mysql.inc.php
+++ /dev/null
@@ -1,181 +0,0 @@
-hasTransactions = false;
- #$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 Concat()
- {
- $s = "";
- $arr = func_get_args();
-
- // suggestion by andrew005#mnogo.ru
- $s = implode(',',$arr);
- if (strlen($s) > 0) return "CONCAT($s)"; return '';
- }
-
- function ServerInfo()
- {
- $arr['description'] = ADOConnection::GetOne("select version()");
- $arr['version'] = ADOConnection::_findvers($arr['description']);
- return $arr;
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- $save = $this->metaTablesSQL;
- if ($showSchema && is_string($showSchema)) {
- $this->metaTablesSQL .= " from $showSchema";
- }
-
- if ($mask) {
- $mask = $this->qstr($mask);
- $this->metaTablesSQL .= " like $mask";
- }
- $ret = ADOConnection::MetaTables($ttype,$showSchema);
-
- $this->metaTablesSQL = $save;
- return $ret;
- }
-
- function SetTransactionMode( $transaction_mode )
- {
- $this->_transmode = $transaction_mode;
- if (empty($transaction_mode)) {
- $this->Execute('SET TRANSACTION ISOLATION LEVEL REPEATABLE READ');
- return;
- }
- if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
- $this->Execute("SET SESSION TRANSACTION ".$transaction_mode);
- }
-
- function MetaColumns($table,$normalize=true)
- {
- $this->_findschema($table,$schema);
- if ($schema) {
- $dbName = $this->database;
- $this->SelectDB($schema);
- }
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
-
- if ($schema) {
- $this->SelectDB($dbName);
- }
-
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- if (!is_object($rs)) {
- $false = false;
- return $false;
- }
-
- $retarr = array();
- while (!$rs->EOF){
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $type = $rs->fields[1];
-
- // split type into type(length):
- $fld->scale = null;
- if (preg_match("/^(.+)\((\d+),(\d+)/", $type, $query_array)) {
- $fld->type = $query_array[1];
- $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
- $fld->scale = is_numeric($query_array[3]) ? $query_array[3] : -1;
- } elseif (preg_match("/^(.+)\((\d+)/", $type, $query_array)) {
- $fld->type = $query_array[1];
- $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
- } elseif (preg_match("/^(enum)\((.*)\)$/i", $type, $query_array)) {
- $fld->type = $query_array[1];
- $arr = explode(",",$query_array[2]);
- $fld->enums = $arr;
- $zlen = max(array_map("strlen",$arr)) - 2; // PHP >= 4.0.6
- $fld->max_length = ($zlen > 0) ? $zlen : 1;
- } else {
- $fld->type = $type;
- $fld->max_length = -1;
- }
- $fld->not_null = ($rs->fields[2] != 'YES');
- $fld->primary_key = ($rs->fields[3] == 'PRI');
- $fld->auto_increment = (strpos($rs->fields[5], 'auto_increment') !== false);
- $fld->binary = (strpos($type,'blob') !== false);
- $fld->unsigned = (strpos($type,'unsigned') !== false);
-
- if (!$fld->binary) {
- $d = $rs->fields[4];
- if ($d != '' && $d != 'NULL') {
- $fld->has_default = true;
- $fld->default_value = $d;
- } else {
- $fld->has_default = false;
- }
- }
-
- if ($save == ADODB_FETCH_NUM) {
- $retarr[] = $fld;
- } else {
- $retarr[strtoupper($fld->name)] = $fld;
- }
- $rs->MoveNext();
- }
-
- $rs->Close();
- return $retarr;
- }
-
-
- // parameters use PostgreSQL convention, not MySQL
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs=0)
- {
- $offsetStr =($offset>=0) ? "$offset," : '';
- // jason judge, see http://phplens.com/lens/lensforum/msgs.php?id=9220
- if ($nrows < 0) $nrows = '18446744073709551615';
-
- if ($secs)
- $rs = $this->CacheExecute($secs,$sql." LIMIT $offsetStr$nrows",$inputarr);
- else
- $rs = $this->Execute($sql." LIMIT $offsetStr$nrows",$inputarr);
- return $rs;
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-pdo_oci.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-pdo_oci.inc.php
deleted file mode 100644
index 2ff56f5..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-pdo_oci.inc.php
+++ /dev/null
@@ -1,91 +0,0 @@
-_bindInputArray = true;
- $parentDriver->_nestedSQL = true;
- if ($this->_initdate) {
- $parentDriver->Execute("ALTER SESSION SET NLS_DATE_FORMAT='".$this->NLS_DATE_FORMAT."'");
- }
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- if ($mask) {
- $save = $this->metaTablesSQL;
- $mask = $this->qstr(strtoupper($mask));
- $this->metaTablesSQL .= " AND table_name like $mask";
- }
- $ret = ADOConnection::MetaTables($ttype,$showSchema);
-
- if ($mask) {
- $this->metaTablesSQL = $save;
- }
- return $ret;
- }
-
- function MetaColumns($table,$normalize=true)
- {
- global $ADODB_FETCH_MODE;
-
- $false = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
-
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,strtoupper($table)));
-
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- if (!$rs) {
- return $false;
- }
- $retarr = array();
- while (!$rs->EOF) { //print_r($rs->fields);
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $fld->type = $rs->fields[1];
- $fld->max_length = $rs->fields[2];
- $fld->scale = $rs->fields[3];
- if ($rs->fields[1] == 'NUMBER' && $rs->fields[3] == 0) {
- $fld->type ='INT';
- $fld->max_length = $rs->fields[4];
- }
- $fld->not_null = (strncmp($rs->fields[5], 'NOT',3) === 0);
- $fld->binary = (strpos($fld->type,'BLOB') !== false);
- $fld->default_value = $rs->fields[6];
-
- if ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] = $fld;
- else $retarr[strtoupper($fld->name)] = $fld;
- $rs->MoveNext();
- }
- $rs->Close();
- if (empty($retarr))
- return $false;
- else
- return $retarr;
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-pdo_pgsql.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-pdo_pgsql.inc.php
deleted file mode 100644
index 671ceab..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-pdo_pgsql.inc.php
+++ /dev/null
@@ -1,228 +0,0 @@
- 0 AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum";
-
- // used when schema defined
- var $metaColumnsSQL1 = "SELECT a.attname, t.typname, a.attlen, a.atttypmod, a.attnotnull, a.atthasdef, a.attnum
-FROM pg_class c, pg_attribute a, pg_type t, pg_namespace n
-WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s'))
- and c.relnamespace=n.oid and n.nspname='%s'
- and a.attname not like '....%%' AND a.attnum > 0
- AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum";
-
- // get primary key etc -- from Freek Dijkstra
- var $metaKeySQL = "SELECT ic.relname AS index_name, a.attname AS column_name,i.indisunique AS unique_key, i.indisprimary AS primary_key
- FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a WHERE bc.oid = i.indrelid AND ic.oid = i.indexrelid AND (i.indkey[0] = a.attnum OR i.indkey[1] = a.attnum OR i.indkey[2] = a.attnum OR i.indkey[3] = a.attnum OR i.indkey[4] = a.attnum OR i.indkey[5] = a.attnum OR i.indkey[6] = a.attnum OR i.indkey[7] = a.attnum) AND a.attrelid = bc.oid AND bc.relname = '%s'";
-
- var $hasAffectedRows = true;
- var $hasLimit = false; // set to true for pgsql 7 only. support pgsql/mysql SELECT * FROM TABLE LIMIT 10
- // below suggested by Freek Dijkstra
- var $true = 't'; // string that represents TRUE for a database
- var $false = 'f'; // string that represents FALSE for a database
- var $fmtDate = "'Y-m-d'"; // used by DBDate() as the default date format used by the database
- var $fmtTimeStamp = "'Y-m-d G:i:s'"; // used by DBTimeStamp as the default timestamp fmt.
- var $hasMoveFirst = true;
- var $hasGenID = true;
- var $_genIDSQL = "SELECT NEXTVAL('%s')";
- var $_genSeqSQL = "CREATE SEQUENCE %s START %s";
- var $_dropSeqSQL = "DROP SEQUENCE %s";
- var $metaDefaultsSQL = "SELECT d.adnum as num, d.adsrc as def from pg_attrdef d, pg_class c where d.adrelid=c.oid and c.relname='%s' order by d.adnum";
- var $random = 'random()'; /// random function
- var $concat_operator='||';
-
- function _init($parentDriver)
- {
-
- $parentDriver->hasTransactions = false; ## <<< BUG IN PDO pgsql driver
- $parentDriver->hasInsertID = true;
- $parentDriver->_nestedSQL = true;
- }
-
- function ServerInfo()
- {
- $arr['description'] = ADOConnection::GetOne("select version()");
- $arr['version'] = ADOConnection::_findvers($arr['description']);
- return $arr;
- }
-
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
- {
- $offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
- $limitStr = ($nrows >= 0) ? " LIMIT $nrows" : '';
- if ($secs2cache)
- $rs = $this->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr);
- else
- $rs = $this->Execute($sql."$limitStr$offsetStr",$inputarr);
-
- return $rs;
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- $info = $this->ServerInfo();
- if ($info['version'] >= 7.3) {
- $this->metaTablesSQL = "select tablename,'T' from pg_tables where tablename not like 'pg\_%'
- and schemaname not in ( 'pg_catalog','information_schema')
- union
- select viewname,'V' from pg_views where viewname not like 'pg\_%' and schemaname not in ( 'pg_catalog','information_schema') ";
- }
- if ($mask) {
- $save = $this->metaTablesSQL;
- $mask = $this->qstr(strtolower($mask));
- if ($info['version']>=7.3)
- $this->metaTablesSQL = "
-select tablename,'T' from pg_tables where tablename like $mask and schemaname not in ( 'pg_catalog','information_schema')
- union
-select viewname,'V' from pg_views where viewname like $mask and schemaname not in ( 'pg_catalog','information_schema') ";
- else
- $this->metaTablesSQL = "
-select tablename,'T' from pg_tables where tablename like $mask
- union
-select viewname,'V' from pg_views where viewname like $mask";
- }
- $ret = ADOConnection::MetaTables($ttype,$showSchema);
-
- if ($mask) {
- $this->metaTablesSQL = $save;
- }
- return $ret;
- }
-
- function MetaColumns($table,$normalize=true)
- {
- global $ADODB_FETCH_MODE;
-
- $schema = false;
- $this->_findschema($table,$schema);
-
- if ($normalize) $table = strtolower($table);
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
-
- if ($schema) $rs = $this->Execute(sprintf($this->metaColumnsSQL1,$table,$table,$schema));
- else $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table,$table));
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- if ($rs === false) {
- $false = false;
- return $false;
- }
- if (!empty($this->metaKeySQL)) {
- // If we want the primary keys, we have to issue a separate query
- // Of course, a modified version of the metaColumnsSQL query using a
- // LEFT JOIN would have been much more elegant, but postgres does
- // not support OUTER JOINS. So here is the clumsy way.
-
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-
- $rskey = $this->Execute(sprintf($this->metaKeySQL,($table)));
- // fetch all result in once for performance.
- $keys = $rskey->GetArray();
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- $rskey->Close();
- unset($rskey);
- }
-
- $rsdefa = array();
- if (!empty($this->metaDefaultsSQL)) {
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- $sql = sprintf($this->metaDefaultsSQL, ($table));
- $rsdef = $this->Execute($sql);
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- if ($rsdef) {
- while (!$rsdef->EOF) {
- $num = $rsdef->fields['num'];
- $s = $rsdef->fields['def'];
- if (strpos($s,'::')===false && substr($s, 0, 1) == "'") { /* quoted strings hack... for now... fixme */
- $s = substr($s, 1);
- $s = substr($s, 0, strlen($s) - 1);
- }
-
- $rsdefa[$num] = $s;
- $rsdef->MoveNext();
- }
- } else {
- ADOConnection::outp( "==> SQL => " . $sql);
- }
- unset($rsdef);
- }
-
- $retarr = array();
- while (!$rs->EOF) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $fld->type = $rs->fields[1];
- $fld->max_length = $rs->fields[2];
- if ($fld->max_length <= 0) $fld->max_length = $rs->fields[3]-4;
- if ($fld->max_length <= 0) $fld->max_length = -1;
- if ($fld->type == 'numeric') {
- $fld->scale = $fld->max_length & 0xFFFF;
- $fld->max_length >>= 16;
- }
- // dannym
- // 5 hasdefault; 6 num-of-column
- $fld->has_default = ($rs->fields[5] == 't');
- if ($fld->has_default) {
- $fld->default_value = $rsdefa[$rs->fields[6]];
- }
-
- //Freek
- if ($rs->fields[4] == $this->true) {
- $fld->not_null = true;
- }
-
- // Freek
- if (is_array($keys)) {
- foreach($keys as $key) {
- if ($fld->name == $key['column_name'] AND $key['primary_key'] == $this->true)
- $fld->primary_key = true;
- if ($fld->name == $key['column_name'] AND $key['unique_key'] == $this->true)
- $fld->unique = true; // What name is more compatible?
- }
- }
-
- if ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] = $fld;
- else $retarr[($normalize) ? strtoupper($fld->name) : $fld->name] = $fld;
-
- $rs->MoveNext();
- }
- $rs->Close();
- if (empty($retarr)) {
- $false = false;
- return $false;
- } else return $retarr;
-
- }
-
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-pdo_sqlite.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-pdo_sqlite.inc.php
deleted file mode 100644
index 05557e2..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-pdo_sqlite.inc.php
+++ /dev/null
@@ -1,202 +0,0 @@
-pdoDriver = $parentDriver;
- $parentDriver->_bindInputArray = true;
- $parentDriver->hasTransactions = false; // // should be set to false because of PDO SQLite driver not supporting changing autocommit mode
- $parentDriver->hasInsertID = true;
- }
-
- function ServerInfo()
- {
- $parent = $this->pdoDriver;
- @($ver = array_pop($parent->GetCol("SELECT sqlite_version()")));
- @($enc = array_pop($parent->GetCol("PRAGMA encoding")));
-
- $arr['version'] = $ver;
- $arr['description'] = 'SQLite ';
- $arr['encoding'] = $enc;
-
- return $arr;
- }
-
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
- {
- $parent = $this->pdoDriver;
- $offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
- $limitStr = ($nrows >= 0) ? " LIMIT $nrows" : ($offset >= 0 ? ' LIMIT 999999999' : '');
- if ($secs2cache)
- $rs = $parent->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr);
- else
- $rs = $parent->Execute($sql."$limitStr$offsetStr",$inputarr);
-
- return $rs;
- }
-
- function GenID($seq='adodbseq',$start=1)
- {
- $parent = $this->pdoDriver;
- // 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 = array_pop($parent->GetCol("SELECT id FROM {$seq}")));
- if ($num === false || !is_numeric($num)) {
- @$parent->Execute(sprintf($this->_genSeqSQL ,$seq));
- $start -= 1;
- $num = '0';
- $cnt = $parent->GetOne(sprintf($this->_genSeqCountSQL,$seq));
- if (!$cnt) {
- $ok = $parent->Execute(sprintf($this->_genSeq2SQL,$seq,$start));
- }
- if (!$ok) return false;
- }
- $parent->Execute(sprintf($this->_genIDSQL,$seq,$num));
-
- if ($parent->affected_rows() > 0) {
- $num += 1;
- $parent->genID = intval($num);
- return intval($num);
- }
- }
- if ($fn = $parent->raiseErrorFn) {
- $fn($parent->databaseType,'GENID',-32000,"Unable to generate unique id after $MAXLOOPS attempts",$seq,$num);
- }
- return false;
- }
-
- function CreateSequence($seqname='adodbseq',$start=1)
- {
- $parent = $this->pdoDriver;
- $ok = $parent->Execute(sprintf($this->_genSeqSQL,$seqname));
- if (!$ok) return false;
- $start -= 1;
- return $parent->Execute("insert into $seqname values($start)");
- }
-
- function SetTransactionMode($transaction_mode)
- {
- $parent = $this->pdoDriver;
- $parent->_transmode = strtoupper($transaction_mode);
- }
-
- function BeginTrans()
- {
- $parent = $this->pdoDriver;
- if ($parent->transOff) return true;
- $parent->transCnt += 1;
- $parent->_autocommit = false;
- return $parent->Execute("BEGIN {$parent->_transmode}");
- }
-
- function CommitTrans($ok=true)
- {
- $parent = $this->pdoDriver;
- if ($parent->transOff) return true;
- if (!$ok) return $parent->RollbackTrans();
- if ($parent->transCnt) $parent->transCnt -= 1;
- $parent->_autocommit = true;
-
- $ret = $parent->Execute('COMMIT');
- return $ret;
- }
-
- function RollbackTrans()
- {
- $parent = $this->pdoDriver;
- if ($parent->transOff) return true;
- if ($parent->transCnt) $parent->transCnt -= 1;
- $parent->_autocommit = true;
-
- $ret = $parent->Execute('ROLLBACK');
- return $ret;
- }
-
-
- // mark newnham
- function MetaColumns($tab,$normalize=true)
- {
- global $ADODB_FETCH_MODE;
-
- $parent = $this->pdoDriver;
- $false = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- if ($parent->fetchMode !== false) $savem = $parent->SetFetchMode(false);
- $rs = $parent->Execute("PRAGMA table_info('$tab')");
- if (isset($savem)) $parent->SetFetchMode($savem);
- if (!$rs) {
- $ADODB_FETCH_MODE = $save;
- return $false;
- }
- $arr = array();
- while ($r = $rs->FetchRow()) {
- $type = explode('(',$r['type']);
- $size = '';
- if (sizeof($type)==2)
- $size = trim($type[1],')');
- $fn = strtoupper($r['name']);
- $fld = new ADOFieldObject;
- $fld->name = $r['name'];
- $fld->type = $type[0];
- $fld->max_length = $size;
- $fld->not_null = $r['notnull'];
- $fld->primary_key = $r['pk'];
- $fld->default_value = $r['dflt_value'];
- $fld->scale = 0;
- if ($save == ADODB_FETCH_NUM) $arr[] = $fld;
- else $arr[strtoupper($fld->name)] = $fld;
- }
- $rs->Close();
- $ADODB_FETCH_MODE = $save;
- return $arr;
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- $parent = $this->pdoDriver;
-
- if ($mask) {
- $save = $this->metaTablesSQL;
- $mask = $this->qstr(strtoupper($mask));
- $this->metaTablesSQL .= " AND name LIKE $mask";
- }
-
- $ret = $parent->GetCol($this->metaTablesSQL);
-
- if ($mask) {
- $this->metaTablesSQL = $save;
- }
- return $ret;
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-postgres.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-postgres.inc.php
deleted file mode 100644
index d3831cd..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-postgres.inc.php
+++ /dev/null
@@ -1,12 +0,0 @@
-
- jlim - changed concat operator to || and data types to MetaType to match documented pgsql types
- see http://www.postgresql.org/devel-corner/docs/postgres/datatype.htm
- 22 Nov 2000 jlim - added changes to FetchField() and MetaTables() contributed by "raser"
- 27 Nov 2000 jlim - added changes to _connect/_pconnect from ideas by "Lennie"
- 15 Dec 2000 jlim - added changes suggested by Additional code changes by "Eric G. Werk" egw@netguide.dk.
- 31 Jan 2002 jlim - finally installed postgresql. testing
- 01 Mar 2001 jlim - Freek Dijkstra changes, also support for text type
-
- See http://www.varlena.com/varlena/GeneralBits/47.php
-
- -- What indexes are on my table?
- select * from pg_indexes where tablename = 'tablename';
-
- -- What triggers are on my table?
- select c.relname as "Table", t.tgname as "Trigger Name",
- t.tgconstrname as "Constraint Name", t.tgenabled as "Enabled",
- t.tgisconstraint as "Is Constraint", cc.relname as "Referenced Table",
- p.proname as "Function Name"
- from pg_trigger t, pg_class c, pg_class cc, pg_proc p
- where t.tgfoid = p.oid and t.tgrelid = c.oid
- and t.tgconstrrelid = cc.oid
- and c.relname = 'tablename';
-
- -- What constraints are on my table?
- select r.relname as "Table", c.conname as "Constraint Name",
- contype as "Constraint Type", conkey as "Key Columns",
- confkey as "Foreign Columns", consrc as "Source"
- from pg_class r, pg_constraint c
- where r.oid = c.conrelid
- and relname = 'tablename';
-
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-function adodb_addslashes($s)
-{
- $len = strlen($s);
- if ($len == 0) return "''";
- if (strncmp($s,"'",1) === 0 && substr($s,$len-1) == "'") return $s; // already quoted
-
- return "'".addslashes($s)."'";
-}
-
-class ADODB_postgres64 extends ADOConnection{
- var $databaseType = 'postgres64';
- var $dataProvider = 'postgres';
- var $hasInsertID = true;
- var $_resultid = false;
- var $concat_operator='||';
- var $metaDatabasesSQL = "select datname from pg_database where datname not in ('template0','template1') order by 1";
- var $metaTablesSQL = "select tablename,'T' from pg_tables where tablename not like 'pg\_%'
- and tablename not in ('sql_features', 'sql_implementation_info', 'sql_languages',
- 'sql_packages', 'sql_sizing', 'sql_sizing_profiles')
- union
- select viewname,'V' from pg_views where viewname not like 'pg\_%'";
- //"select tablename from pg_tables where tablename not like 'pg_%' order by 1";
- var $isoDates = true; // accepts dates in ISO format
- var $sysDate = "CURRENT_DATE";
- var $sysTimeStamp = "CURRENT_TIMESTAMP";
- var $blobEncodeType = 'C';
- var $metaColumnsSQL = "SELECT a.attname,t.typname,a.attlen,a.atttypmod,a.attnotnull,a.atthasdef,a.attnum
- FROM pg_class c, pg_attribute a,pg_type t
- WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s')) and a.attname not like '....%%'
- AND a.attnum > 0 AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum";
-
- // used when schema defined
- var $metaColumnsSQL1 = "SELECT a.attname, t.typname, a.attlen, a.atttypmod, a.attnotnull, a.atthasdef, a.attnum
- FROM pg_class c, pg_attribute a, pg_type t, pg_namespace n
- WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s'))
- and c.relnamespace=n.oid and n.nspname='%s'
- and a.attname not like '....%%' AND a.attnum > 0
- AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum";
-
- // get primary key etc -- from Freek Dijkstra
- var $metaKeySQL = "SELECT ic.relname AS index_name, a.attname AS column_name,i.indisunique AS unique_key, i.indisprimary AS primary_key
- FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a
- WHERE bc.oid = i.indrelid AND ic.oid = i.indexrelid
- AND (i.indkey[0] = a.attnum OR i.indkey[1] = a.attnum OR i.indkey[2] = a.attnum OR i.indkey[3] = a.attnum OR i.indkey[4] = a.attnum OR i.indkey[5] = a.attnum OR i.indkey[6] = a.attnum OR i.indkey[7] = a.attnum)
- AND a.attrelid = bc.oid AND bc.relname = '%s'";
-
- var $hasAffectedRows = true;
- var $hasLimit = false; // set to true for pgsql 7 only. support pgsql/mysql SELECT * FROM TABLE LIMIT 10
- // below suggested by Freek Dijkstra
- var $true = 'TRUE'; // string that represents TRUE for a database
- var $false = 'FALSE'; // string that represents FALSE for a database
- var $fmtDate = "'Y-m-d'"; // used by DBDate() as the default date format used by the database
- var $fmtTimeStamp = "'Y-m-d H:i:s'"; // used by DBTimeStamp as the default timestamp fmt.
- var $hasMoveFirst = true;
- var $hasGenID = true;
- var $_genIDSQL = "SELECT NEXTVAL('%s')";
- var $_genSeqSQL = "CREATE SEQUENCE %s START %s";
- var $_dropSeqSQL = "DROP SEQUENCE %s";
- var $metaDefaultsSQL = "SELECT d.adnum as num, d.adsrc as def from pg_attrdef d, pg_class c where d.adrelid=c.oid and c.relname='%s' order by d.adnum";
- var $random = 'random()'; /// random function
- var $autoRollback = true; // apparently pgsql does not autorollback properly before php 4.3.4
- // http://bugs.php.net/bug.php?id=25404
-
- var $uniqueIisR = true;
- var $_bindInputArray = false; // requires postgresql 7.3+ and ability to modify database
- var $disableBlobs = false; // set to true to disable blob checking, resulting in 2-5% improvement in performance.
-
- var $_pnum = 0;
-
- // The last (fmtTimeStamp is not entirely correct:
- // PostgreSQL also has support for time zones,
- // and writes these time in this format: "2001-03-01 18:59:26+02".
- // There is no code for the "+02" time zone information, so I just left that out.
- // I'm not familiar enough with both ADODB as well as Postgres
- // to know what the concequences are. The other values are correct (wheren't in 0.94)
- // -- Freek Dijkstra
-
- function __construct()
- {
- // changes the metaColumnsSQL, adds columns: attnum[6]
- }
-
- function ServerInfo()
- {
- if (isset($this->version)) return $this->version;
-
- $arr['description'] = $this->GetOne("select version()");
- $arr['version'] = ADOConnection::_findvers($arr['description']);
- $this->version = $arr;
- return $arr;
- }
-
- function IfNull( $field, $ifNull )
- {
- return " coalesce($field, $ifNull) ";
- }
-
- // get the last id - never tested
- function pg_insert_id($tablename,$fieldname)
- {
- $result=pg_exec($this->_connectionID, "SELECT last_value FROM ${tablename}_${fieldname}_seq");
- if ($result) {
- $arr = @pg_fetch_row($result,0);
- pg_freeresult($result);
- if (isset($arr[0])) return $arr[0];
- }
- return false;
- }
-
-/* Warning from http://www.php.net/manual/function.pg-getlastoid.php:
-Using a OID as a unique identifier is not generally wise.
-Unless you are very careful, you might end up with a tuple having
-a different OID if a database must be reloaded. */
- function _insertid($table,$column)
- {
- if (!is_resource($this->_resultid) || get_resource_type($this->_resultid) !== 'pgsql result') return false;
- $oid = pg_getlastoid($this->_resultid);
- // to really return the id, we need the table and column-name, else we can only return the oid != id
- return empty($table) || empty($column) ? $oid : $this->GetOne("SELECT $column FROM $table WHERE oid=".(int)$oid);
- }
-
-// I get this error with PHP before 4.0.6 - jlim
-// Warning: This compilation does not support pg_cmdtuples() in adodb-postgres.inc.php on line 44
- function _affectedrows()
- {
- if (!is_resource($this->_resultid) || get_resource_type($this->_resultid) !== 'pgsql result') return false;
- return pg_cmdtuples($this->_resultid);
- }
-
-
- // returns true/false
- function BeginTrans()
- {
- if ($this->transOff) return true;
- $this->transCnt += 1;
- return @pg_Exec($this->_connectionID, "begin ".$this->_transmode);
- }
-
- function RowLock($tables,$where,$col='1 as adodbignore')
- {
- if (!$this->transCnt) $this->BeginTrans();
- return $this->GetOne("select $col from $tables where $where for update");
- }
-
- // returns true/false.
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
-
- $this->transCnt -= 1;
- return @pg_Exec($this->_connectionID, "commit");
- }
-
- // returns true/false
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- $this->transCnt -= 1;
- return @pg_Exec($this->_connectionID, "rollback");
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- $info = $this->ServerInfo();
- if ($info['version'] >= 7.3) {
- $this->metaTablesSQL = "
- select table_name,'T' from information_schema.tables where table_schema not in ( 'pg_catalog','information_schema')
- union
- select table_name,'V' from information_schema.views where table_schema not in ( 'pg_catalog','information_schema') ";
- }
- if ($mask) {
- $save = $this->metaTablesSQL;
- $mask = $this->qstr(strtolower($mask));
- if ($info['version']>=7.3)
- $this->metaTablesSQL = "
- select table_name,'T' from information_schema.tables where table_name like $mask and table_schema not in ( 'pg_catalog','information_schema')
- union
- select table_name,'V' from information_schema.views where table_name like $mask and table_schema not in ( 'pg_catalog','information_schema') ";
- else
- $this->metaTablesSQL = "
- select tablename,'T' from pg_tables where tablename like $mask
- union
- select viewname,'V' from pg_views where viewname like $mask";
- }
- $ret = ADOConnection::MetaTables($ttype,$showSchema);
-
- if ($mask) {
- $this->metaTablesSQL = $save;
- }
- return $ret;
- }
-
-
- // if magic quotes disabled, use pg_escape_string()
- function qstr($s,$magic_quotes=false)
- {
- if (is_bool($s)) return $s ? 'true' : 'false';
-
- if (!$magic_quotes) {
- if (ADODB_PHPVER >= 0x5200 && $this->_connectionID) {
- return "'".pg_escape_string($this->_connectionID,$s)."'";
- }
- if (ADODB_PHPVER >= 0x4200) {
- return "'".pg_escape_string($s)."'";
- }
- if ($this->replaceQuote[0] == '\\'){
- $s = adodb_str_replace(array('\\',"\0"),array('\\\\',"\\\\000"),$s);
- }
- return "'".str_replace("'",$this->replaceQuote,$s)."'";
- }
-
- // undo magic quotes for "
- $s = str_replace('\\"','"',$s);
- return "'$s'";
- }
-
-
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- if (!$col) $col = $this->sysTimeStamp;
- $s = 'TO_CHAR('.$col.",'";
-
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- $ch = $fmt[$i];
- switch($ch) {
- case 'Y':
- case 'y':
- $s .= 'YYYY';
- break;
- case 'Q':
- case 'q':
- $s .= 'Q';
- break;
-
- case 'M':
- $s .= 'Mon';
- break;
-
- case 'm':
- $s .= 'MM';
- break;
- case 'D':
- case 'd':
- $s .= 'DD';
- break;
-
- case 'H':
- $s.= 'HH24';
- break;
-
- case 'h':
- $s .= 'HH';
- break;
-
- case 'i':
- $s .= 'MI';
- break;
-
- case 's':
- $s .= 'SS';
- break;
-
- case 'a':
- case 'A':
- $s .= 'AM';
- break;
-
- case 'w':
- $s .= 'D';
- break;
-
- case 'l':
- $s .= 'DAY';
- break;
-
- case 'W':
- $s .= 'WW';
- break;
-
- default:
- // handle escape characters...
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- if (strpos('-/.:;, ',$ch) !== false) $s .= $ch;
- else $s .= '"'.$ch.'"';
-
- }
- }
- return $s. "')";
- }
-
-
-
- /*
- * Load a Large Object from a file
- * - the procedure stores the object id in the table and imports the object using
- * postgres proprietary blob handling routines
- *
- * contributed by Mattia Rossi mattia@technologist.com
- * modified for safe mode by juraj chlebec
- */
- function UpdateBlobFile($table,$column,$path,$where,$blobtype='BLOB')
- {
- pg_exec ($this->_connectionID, "begin");
-
- $fd = fopen($path,'r');
- $contents = fread($fd,filesize($path));
- fclose($fd);
-
- $oid = pg_lo_create($this->_connectionID);
- $handle = pg_lo_open($this->_connectionID, $oid, 'w');
- pg_lo_write($handle, $contents);
- pg_lo_close($handle);
-
- // $oid = pg_lo_import ($path);
- pg_exec($this->_connectionID, "commit");
- $rs = ADOConnection::UpdateBlob($table,$column,$oid,$where,$blobtype);
- $rez = !empty($rs);
- return $rez;
- }
-
- /*
- * Deletes/Unlinks a Blob from the database, otherwise it
- * will be left behind
- *
- * Returns TRUE on success or FALSE on failure.
- *
- * contributed by Todd Rogers todd#windfox.net
- */
- function BlobDelete( $blob )
- {
- pg_exec ($this->_connectionID, "begin");
- $result = @pg_lo_unlink($blob);
- pg_exec ($this->_connectionID, "commit");
- return( $result );
- }
-
- /*
- Hueristic - not guaranteed to work.
- */
- function GuessOID($oid)
- {
- if (strlen($oid)>16) return false;
- return is_numeric($oid);
- }
-
- /*
- * If an OID is detected, then we use pg_lo_* to open the oid file and read the
- * real blob from the db using the oid supplied as a parameter. If you are storing
- * blobs using bytea, we autodetect and process it so this function is not needed.
- *
- * contributed by Mattia Rossi mattia@technologist.com
- *
- * see http://www.postgresql.org/idocs/index.php?largeobjects.html
- *
- * Since adodb 4.54, this returns the blob, instead of sending it to stdout. Also
- * added maxsize parameter, which defaults to $db->maxblobsize if not defined.
- */
- function BlobDecode($blob,$maxsize=false,$hastrans=true)
- {
- if (!$this->GuessOID($blob)) return $blob;
-
- if ($hastrans) @pg_exec($this->_connectionID,"begin");
- $fd = @pg_lo_open($this->_connectionID,$blob,"r");
- if ($fd === false) {
- if ($hastrans) @pg_exec($this->_connectionID,"commit");
- return $blob;
- }
- if (!$maxsize) $maxsize = $this->maxblobsize;
- $realblob = @pg_loread($fd,$maxsize);
- @pg_loclose($fd);
- if ($hastrans) @pg_exec($this->_connectionID,"commit");
- return $realblob;
- }
-
- /*
- See http://www.postgresql.org/idocs/index.php?datatype-binary.html
-
- NOTE: SQL string literals (input strings) must be preceded with two backslashes
- due to the fact that they must pass through two parsers in the PostgreSQL
- backend.
- */
- function BlobEncode($blob)
- {
- if (ADODB_PHPVER >= 0x5200) return pg_escape_bytea($this->_connectionID, $blob);
- if (ADODB_PHPVER >= 0x4200) return pg_escape_bytea($blob);
-
- /*92=backslash, 0=null, 39=single-quote*/
- $badch = array(chr(92),chr(0),chr(39)); # \ null '
- $fixch = array('\\\\134','\\\\000','\\\\047');
- return adodb_str_replace($badch,$fixch,$blob);
-
- // note that there is a pg_escape_bytea function only for php 4.2.0 or later
- }
-
- // assumes bytea for blob, and varchar for clob
- function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
- {
- if ($blobtype == 'CLOB') {
- return $this->Execute("UPDATE $table SET $column=" . $this->qstr($val) . " WHERE $where");
- }
- // do not use bind params which uses qstr(), as blobencode() already quotes data
- return $this->Execute("UPDATE $table SET $column='".$this->BlobEncode($val)."'::bytea WHERE $where");
- }
-
- function OffsetDate($dayFraction,$date=false)
- {
- if (!$date) $date = $this->sysDate;
- else if (strncmp($date,"'",1) == 0) {
- $len = strlen($date);
- if (10 <= $len && $len <= 12) $date = 'date '.$date;
- else $date = 'timestamp '.$date;
- }
-
-
- return "($date+interval'".($dayFraction * 1440)." minutes')";
- #return "($date+interval'$dayFraction days')";
- }
-
-
- // for schema support, pass in the $table param "$schema.$tabname".
- // converts field names to lowercase, $upper is ignored
- // see http://phplens.com/lens/lensforum/msgs.php?id=14018 for more info
- function MetaColumns($table,$normalize=true)
- {
- global $ADODB_FETCH_MODE;
-
- $schema = false;
- $false = false;
- $this->_findschema($table,$schema);
-
- if ($normalize) $table = strtolower($table);
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
-
- if ($schema) $rs = $this->Execute(sprintf($this->metaColumnsSQL1,$table,$table,$schema));
- else $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table,$table,$table));
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- if ($rs === false) {
- return $false;
- }
- if (!empty($this->metaKeySQL)) {
- // If we want the primary keys, we have to issue a separate query
- // Of course, a modified version of the metaColumnsSQL query using a
- // LEFT JOIN would have been much more elegant, but postgres does
- // not support OUTER JOINS. So here is the clumsy way.
-
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-
- $rskey = $this->Execute(sprintf($this->metaKeySQL,($table)));
- // fetch all result in once for performance.
- $keys = $rskey->GetArray();
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- $rskey->Close();
- unset($rskey);
- }
-
- $rsdefa = array();
- if (!empty($this->metaDefaultsSQL)) {
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- $sql = sprintf($this->metaDefaultsSQL, ($table));
- $rsdef = $this->Execute($sql);
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- if ($rsdef) {
- while (!$rsdef->EOF) {
- $num = $rsdef->fields['num'];
- $s = $rsdef->fields['def'];
- if (strpos($s,'::')===false && substr($s, 0, 1) == "'") { /* quoted strings hack... for now... fixme */
- $s = substr($s, 1);
- $s = substr($s, 0, strlen($s) - 1);
- }
-
- $rsdefa[$num] = $s;
- $rsdef->MoveNext();
- }
- } else {
- ADOConnection::outp( "==> SQL => " . $sql);
- }
- unset($rsdef);
- }
-
- $retarr = array();
- while (!$rs->EOF) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $fld->type = $rs->fields[1];
- $fld->max_length = $rs->fields[2];
- $fld->attnum = $rs->fields[6];
-
- if ($fld->max_length <= 0) $fld->max_length = $rs->fields[3]-4;
- if ($fld->max_length <= 0) $fld->max_length = -1;
- if ($fld->type == 'numeric') {
- $fld->scale = $fld->max_length & 0xFFFF;
- $fld->max_length >>= 16;
- }
- // dannym
- // 5 hasdefault; 6 num-of-column
- $fld->has_default = ($rs->fields[5] == 't');
- if ($fld->has_default) {
- $fld->default_value = $rsdefa[$rs->fields[6]];
- }
-
- //Freek
- $fld->not_null = $rs->fields[4] == 't';
-
-
- // Freek
- if (is_array($keys)) {
- foreach($keys as $key) {
- if ($fld->name == $key['column_name'] AND $key['primary_key'] == 't')
- $fld->primary_key = true;
- if ($fld->name == $key['column_name'] AND $key['unique_key'] == 't')
- $fld->unique = true; // What name is more compatible?
- }
- }
-
- if ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] = $fld;
- else $retarr[($normalize) ? strtoupper($fld->name) : $fld->name] = $fld;
-
- $rs->MoveNext();
- }
- $rs->Close();
- if (empty($retarr))
- return $false;
- else
- return $retarr;
-
- }
-
- function Param($name,$type='C')
- {
- if ($name) {
- $this->_pnum += 1;
- } else {
- // Reset param num if $name is false
- $this->_pnum = 1;
- }
- return '$'.$this->_pnum;
- }
-
- function MetaIndexes ($table, $primary = FALSE, $owner = false)
- {
- global $ADODB_FETCH_MODE;
-
- $schema = false;
- $this->_findschema($table,$schema);
-
- if ($schema) { // requires pgsql 7.3+ - pg_namespace used.
- $sql = '
- SELECT c.relname as "Name", i.indisunique as "Unique", i.indkey as "Columns"
- FROM pg_catalog.pg_class c
- JOIN pg_catalog.pg_index i ON i.indexrelid=c.oid
- JOIN pg_catalog.pg_class c2 ON c2.oid=i.indrelid
- ,pg_namespace n
- WHERE (c2.relname=\'%s\' or c2.relname=lower(\'%s\'))
- and c.relnamespace=c2.relnamespace
- and c.relnamespace=n.oid
- and n.nspname=\'%s\'';
- } else {
- $sql = '
- SELECT c.relname as "Name", i.indisunique as "Unique", i.indkey as "Columns"
- FROM pg_catalog.pg_class c
- JOIN pg_catalog.pg_index i ON i.indexrelid=c.oid
- JOIN pg_catalog.pg_class c2 ON c2.oid=i.indrelid
- WHERE (c2.relname=\'%s\' or c2.relname=lower(\'%s\'))';
- }
-
- if ($primary == FALSE) {
- $sql .= ' AND i.indisprimary=false;';
- }
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- $rs = $this->Execute(sprintf($sql,$table,$table,$schema));
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- if (!is_object($rs)) {
- $false = false;
- return $false;
- }
-
- $col_names = $this->MetaColumnNames($table,true,true);
- //3rd param is use attnum,
- // see http://sourceforge.net/tracker/index.php?func=detail&aid=1451245&group_id=42718&atid=433976
- $indexes = array();
- while ($row = $rs->FetchRow()) {
- $columns = array();
- foreach (explode(' ', $row[2]) as $col) {
- $columns[] = $col_names[$col];
- }
-
- $indexes[$row[0]] = array(
- 'unique' => ($row[1] == 't'),
- 'columns' => $columns
- );
- }
- return $indexes;
- }
-
- // returns true or false
- //
- // examples:
- // $db->Connect("host=host1 user=user1 password=secret port=4341");
- // $db->Connect('host1','user1','secret');
- function _connect($str,$user='',$pwd='',$db='',$ctype=0)
- {
- if (!function_exists('pg_connect')) return null;
-
- $this->_errorMsg = false;
-
- if ($user || $pwd || $db) {
- $user = adodb_addslashes($user);
- $pwd = adodb_addslashes($pwd);
- if (strlen($db) == 0) $db = 'template1';
- $db = adodb_addslashes($db);
- if ($str) {
- $host = explode(":", $str);
- if ($host[0]) $str = "host=".adodb_addslashes($host[0]);
- else $str = '';
- if (isset($host[1])) $str .= " port=$host[1]";
- else if (!empty($this->port)) $str .= " port=".$this->port;
- }
- if ($user) $str .= " user=".$user;
- if ($pwd) $str .= " password=".$pwd;
- if ($db) $str .= " dbname=".$db;
- }
-
- //if ($user) $linea = "user=$user host=$linea password=$pwd dbname=$db port=5432";
-
- if ($ctype === 1) { // persistent
- $this->_connectionID = pg_pconnect($str);
- } else {
- if ($ctype === -1) { // nconnect, we trick pgsql ext by changing the connection str
- static $ncnt;
-
- if (empty($ncnt)) $ncnt = 1;
- else $ncnt += 1;
-
- $str .= str_repeat(' ',$ncnt);
- }
- $this->_connectionID = pg_connect($str);
- }
- if ($this->_connectionID === false) return false;
- $this->Execute("set datestyle='ISO'");
-
- $info = $this->ServerInfo();
- $this->pgVersion = (float) substr($info['version'],0,3);
- if ($this->pgVersion >= 7.1) { // good till version 999
- $this->_nestedSQL = true;
- }
-
- # PostgreSQL 9.0 changed the default output for bytea from 'escape' to 'hex'
- # PHP does not handle 'hex' properly ('x74657374' is returned as 't657374')
- # https://bugs.php.net/bug.php?id=59831 states this is in fact not a bug,
- # so we manually set bytea_output
- if (version_compare($info['version'], '9.0', '>=')) {
- $this->Execute('set bytea_output=escape');
- }
-
- return true;
- }
-
- function _nconnect($argHostname, $argUsername, $argPassword, $argDatabaseName)
- {
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabaseName,-1);
- }
-
- // returns true or false
- //
- // examples:
- // $db->PConnect("host=host1 user=user1 password=secret port=4341");
- // $db->PConnect('host1','user1','secret');
- function _pconnect($str,$user='',$pwd='',$db='')
- {
- return $this->_connect($str,$user,$pwd,$db,1);
- }
-
-
- // returns queryID or false
- function _query($sql,$inputarr=false)
- {
- $this->_pnum = 0;
- $this->_errorMsg = false;
- if ($inputarr) {
- /*
- It appears that PREPARE/EXECUTE is slower for many queries.
-
- For query executed 1000 times:
- "select id,firstname,lastname from adoxyz
- where firstname not like ? and lastname not like ? and id = ?"
-
- with plan = 1.51861286163 secs
- no plan = 1.26903700829 secs
-
-
-
- */
- $plan = 'P'.md5($sql);
-
- $execp = '';
- foreach($inputarr as $v) {
- if ($execp) $execp .= ',';
- if (is_string($v)) {
- if (strncmp($v,"'",1) !== 0) $execp .= $this->qstr($v);
- } else {
- $execp .= $v;
- }
- }
-
- if ($execp) $exsql = "EXECUTE $plan ($execp)";
- else $exsql = "EXECUTE $plan";
-
-
- $rez = @pg_exec($this->_connectionID,$exsql);
- if (!$rez) {
- # Perhaps plan does not exist? Prepare/compile plan.
- $params = '';
- foreach($inputarr as $v) {
- if ($params) $params .= ',';
- if (is_string($v)) {
- $params .= 'VARCHAR';
- } else if (is_integer($v)) {
- $params .= 'INTEGER';
- } else {
- $params .= "REAL";
- }
- }
- $sqlarr = explode('?',$sql);
- //print_r($sqlarr);
- $sql = '';
- $i = 1;
- foreach($sqlarr as $v) {
- $sql .= $v.' $'.$i;
- $i++;
- }
- $s = "PREPARE $plan ($params) AS ".substr($sql,0,strlen($sql)-2);
- //adodb_pr($s);
- $rez = pg_exec($this->_connectionID,$s);
- //echo $this->ErrorMsg();
- }
- if ($rez)
- $rez = pg_exec($this->_connectionID,$exsql);
- } else {
- //adodb_backtrace();
- $rez = pg_exec($this->_connectionID,$sql);
- }
- // check if no data returned, then no need to create real recordset
- if ($rez && pg_numfields($rez) <= 0) {
- if (is_resource($this->_resultid) && get_resource_type($this->_resultid) === 'pgsql result') {
- pg_freeresult($this->_resultid);
- }
- $this->_resultid = $rez;
- return true;
- }
-
- return $rez;
- }
-
- function _errconnect()
- {
- if (defined('DB_ERROR_CONNECT_FAILED')) return DB_ERROR_CONNECT_FAILED;
- else return 'Database connection failed';
- }
-
- /* Returns: the last error message from previous database operation */
- function ErrorMsg()
- {
- if ($this->_errorMsg !== false) return $this->_errorMsg;
- if (ADODB_PHPVER >= 0x4300) {
- if (!empty($this->_resultid)) {
- $this->_errorMsg = @pg_result_error($this->_resultid);
- if ($this->_errorMsg) return $this->_errorMsg;
- }
-
- if (!empty($this->_connectionID)) {
- $this->_errorMsg = @pg_last_error($this->_connectionID);
- } else $this->_errorMsg = $this->_errconnect();
- } else {
- if (empty($this->_connectionID)) $this->_errconnect();
- else $this->_errorMsg = @pg_errormessage($this->_connectionID);
- }
- return $this->_errorMsg;
- }
-
- function ErrorNo()
- {
- $e = $this->ErrorMsg();
- if (strlen($e)) {
- return ADOConnection::MetaError($e);
- }
- return 0;
- }
-
- // returns true or false
- function _close()
- {
- if ($this->transCnt) $this->RollbackTrans();
- if ($this->_resultid) {
- @pg_freeresult($this->_resultid);
- $this->_resultid = false;
- }
- @pg_close($this->_connectionID);
- $this->_connectionID = false;
- return true;
- }
-
-
- /*
- * Maximum size of C field
- */
- function CharMax()
- {
- return 1000000000; // should be 1 Gb?
- }
-
- /*
- * Maximum size of X field
- */
- function TextMax()
- {
- return 1000000000; // should be 1 Gb?
- }
-
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_postgres64 extends ADORecordSet{
- var $_blobArr;
- var $databaseType = "postgres64";
- var $canSeek = true;
-
- function __construct($queryID, $mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode)
- {
- case ADODB_FETCH_NUM: $this->fetchMode = PGSQL_NUM; break;
- case ADODB_FETCH_ASSOC:$this->fetchMode = PGSQL_ASSOC; break;
-
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- default: $this->fetchMode = PGSQL_BOTH; break;
- }
- $this->adodbFetchMode = $mode;
-
- // Parent's constructor
- $this->ADORecordSet($queryID);
- }
-
- function GetRowAssoc($upper=true)
- {
- if ($this->fetchMode == PGSQL_ASSOC && !$upper) return $this->fields;
- $row = ADORecordSet::GetRowAssoc($upper);
- return $row;
- }
-
-
- function _initrs()
- {
- global $ADODB_COUNTRECS;
- $qid = $this->_queryID;
- $this->_numOfRows = ($ADODB_COUNTRECS)? @pg_numrows($qid):-1;
- $this->_numOfFields = @pg_numfields($qid);
-
- // cache types for blob decode check
- // apparently pg_fieldtype actually performs an sql query on the database to get the type.
- if (empty($this->connection->noBlobs))
- for ($i=0, $max = $this->_numOfFields; $i < $max; $i++) {
- if (pg_fieldtype($qid,$i) == 'bytea') {
- $this->_blobArr[$i] = pg_fieldname($qid,$i);
- }
- }
- }
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- if ($this->fetchMode != PGSQL_NUM) return @$this->fields[$colname];
-
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- function FetchField($off = 0)
- {
- // offsets begin at 0
-
- $o= new ADOFieldObject();
- $o->name = @pg_fieldname($this->_queryID,$off);
- $o->type = @pg_fieldtype($this->_queryID,$off);
- $o->max_length = @pg_fieldsize($this->_queryID,$off);
- return $o;
- }
-
- function _seek($row)
- {
- return @pg_fetch_row($this->_queryID,$row);
- }
-
- function _decode($blob)
- {
- if ($blob === NULL) return NULL;
-// eval('$realblob="'.adodb_str_replace(array('"','$'),array('\"','\$'),$blob).'";');
- return pg_unescape_bytea($blob);
- }
-
- function _fixblobs()
- {
- if ($this->fetchMode == PGSQL_NUM || $this->fetchMode == PGSQL_BOTH) {
- foreach($this->_blobArr as $k => $v) {
- $this->fields[$k] = ADORecordSet_postgres64::_decode($this->fields[$k]);
- }
- }
- if ($this->fetchMode == PGSQL_ASSOC || $this->fetchMode == PGSQL_BOTH) {
- foreach($this->_blobArr as $k => $v) {
- $this->fields[$v] = ADORecordSet_postgres64::_decode($this->fields[$v]);
- }
- }
- }
-
- // 10% speedup to move MoveNext to child class
- function MoveNext()
- {
- if (!$this->EOF) {
- $this->_currentRow++;
- if ($this->_numOfRows < 0 || $this->_numOfRows > $this->_currentRow) {
- $this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);
- if (is_array($this->fields) && $this->fields) {
- if (isset($this->_blobArr)) $this->_fixblobs();
- return true;
- }
- }
- $this->fields = false;
- $this->EOF = true;
- }
- return false;
- }
-
- function _fetch()
- {
-
- if ($this->_currentRow >= $this->_numOfRows && $this->_numOfRows >= 0)
- return false;
-
- $this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);
-
- if ($this->fields && isset($this->_blobArr)) $this->_fixblobs();
-
- return (is_array($this->fields));
- }
-
- function _close()
- {
- return @pg_freeresult($this->_queryID);
- }
-
- function MetaType($t,$len=-1,$fieldobj=false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
- switch (strtoupper($t)) {
- case 'MONEY': // stupid, postgres expects money to be a string
- case 'INTERVAL':
- case 'CHAR':
- case 'CHARACTER':
- case 'VARCHAR':
- case 'NAME':
- case 'BPCHAR':
- case '_VARCHAR':
- case 'INET':
- case 'MACADDR':
- if ($len <= $this->blobSize) return 'C';
-
- case 'TEXT':
- return 'X';
-
- case 'IMAGE': // user defined type
- case 'BLOB': // user defined type
- case 'BIT': // This is a bit string, not a single bit, so don't return 'L'
- case 'VARBIT':
- case 'BYTEA':
- return 'B';
-
- case 'BOOL':
- case 'BOOLEAN':
- return 'L';
-
- case 'DATE':
- return 'D';
-
-
- case 'TIMESTAMP WITHOUT TIME ZONE':
- case 'TIME':
- case 'DATETIME':
- case 'TIMESTAMP':
- case 'TIMESTAMPTZ':
- return 'T';
-
- case 'SMALLINT':
- case 'BIGINT':
- case 'INTEGER':
- case 'INT8':
- case 'INT4':
- case 'INT2':
- if (isset($fieldobj) &&
- empty($fieldobj->primary_key) && (!$this->connection->uniqueIisR || empty($fieldobj->unique))) return 'I';
-
- case 'OID':
- case 'SERIAL':
- return 'R';
-
- default:
- return 'N';
- }
- }
-
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-postgres7.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-postgres7.inc.php
deleted file mode 100644
index 7406502..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-postgres7.inc.php
+++ /dev/null
@@ -1,367 +0,0 @@
- 0 AND
- a.attrelid = c.oid
- ORDER BY a.attnum";
-
- // used when schema defined
- var $metaColumnsSQL1 = "
- SELECT a.attname,
- CASE
- WHEN x.sequence_name != '' THEN 'SERIAL'
- ELSE t.typname
- END AS typname,
- a.attlen, a.atttypmod, a.attnotnull, a.atthasdef, a.attnum
- FROM pg_class c, pg_namespace n, pg_attribute a
- JOIN pg_type t ON a.atttypid = t.oid
- LEFT JOIN
- (SELECT c.relname as sequence_name,
- c1.relname as related_table,
- a.attname as related_column
- FROM pg_class c
- JOIN pg_depend d ON d.objid = c.oid
- LEFT JOIN pg_class c1 ON d.refobjid = c1.oid
- LEFT JOIN pg_attribute a ON (d.refobjid, d.refobjsubid) = (a.attrelid, a.attnum)
- WHERE c.relkind = 'S' AND c1.relname = '%s') x
- ON x.related_column= a.attname
- WHERE c.relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s'))
- AND c.relnamespace=n.oid and n.nspname='%s'
- AND a.attname not like '....%%' AND a.attnum > 0
- AND a.atttypid = t.oid AND a.attrelid = c.oid
- ORDER BY a.attnum";
-
-
- function __construct()
- {
- parent::__construct();
- if (ADODB_ASSOC_CASE !== 2) {
- $this->rsPrefix .= 'assoc_';
- }
- $this->_bindInputArray = PHP_VERSION >= 5.1;
- }
-
-
- // the following should be compat with postgresql 7.2,
- // which makes obsolete the LIMIT limit,offset syntax
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
- {
- $offsetStr = ($offset >= 0) ? " OFFSET ".((integer)$offset) : '';
- $limitStr = ($nrows >= 0) ? " LIMIT ".((integer)$nrows) : '';
- if ($secs2cache)
- $rs = $this->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr);
- else
- $rs = $this->Execute($sql."$limitStr$offsetStr",$inputarr);
-
- return $rs;
- }
- /*
- function Prepare($sql)
- {
- $info = $this->ServerInfo();
- if ($info['version']>=7.3) {
- return array($sql,false);
- }
- return $sql;
- }
- */
-
- /*
- I discovered that the MetaForeignKeys method no longer worked for Postgres 8.3.
- I went ahead and modified it to work for both 8.2 and 8.3.
- Please feel free to include this change in your next release of adodb.
- William Kolodny [William.Kolodny#gt-t.net]
- */
- function MetaForeignKeys($table, $owner=false, $upper=false)
- {
- $sql="
- SELECT fum.ftblname AS lookup_table, split_part(fum.rf, ')'::text, 1) AS lookup_field,
- fum.ltable AS dep_table, split_part(fum.lf, ')'::text, 1) AS dep_field
- FROM (
- SELECT fee.ltable, fee.ftblname, fee.consrc, split_part(fee.consrc,'('::text, 2) AS lf,
- split_part(fee.consrc, '('::text, 3) AS rf
- FROM (
- SELECT foo.relname AS ltable, foo.ftblname,
- pg_get_constraintdef(foo.oid) AS consrc
- FROM (
- SELECT c.oid, c.conname AS name, t.relname, ft.relname AS ftblname
- FROM pg_constraint c
- JOIN pg_class t ON (t.oid = c.conrelid)
- JOIN pg_class ft ON (ft.oid = c.confrelid)
- JOIN pg_namespace nft ON (nft.oid = ft.relnamespace)
- LEFT JOIN pg_description ds ON (ds.objoid = c.oid)
- JOIN pg_namespace n ON (n.oid = t.relnamespace)
- WHERE c.contype = 'f'::\"char\"
- ORDER BY t.relname, n.nspname, c.conname, c.oid
- ) foo
- ) fee) fum
- WHERE fum.ltable='".strtolower($table)."'
- ORDER BY fum.ftblname, fum.ltable, split_part(fum.lf, ')'::text, 1)
- ";
- $rs = $this->Execute($sql);
-
- if (!$rs || $rs->EOF) return false;
-
- $a = array();
- while (!$rs->EOF) {
- if ($upper) {
- $a[strtoupper($rs->Fields('lookup_table'))][] = strtoupper(str_replace('"','',$rs->Fields('dep_field').'='.$rs->Fields('lookup_field')));
- } else {
- $a[$rs->Fields('lookup_table')][] = str_replace('"','',$rs->Fields('dep_field').'='.$rs->Fields('lookup_field'));
- }
- $rs->MoveNext();
- }
-
- return $a;
-
- }
-
- // from Edward Jaramilla, improved version - works on pg 7.4
- function _old_MetaForeignKeys($table, $owner=false, $upper=false)
- {
- $sql = 'SELECT t.tgargs as args
- FROM
- pg_trigger t,pg_class c,pg_proc p
- WHERE
- t.tgenabled AND
- t.tgrelid = c.oid AND
- t.tgfoid = p.oid AND
- p.proname = \'RI_FKey_check_ins\' AND
- c.relname = \''.strtolower($table).'\'
- ORDER BY
- t.tgrelid';
-
- $rs = $this->Execute($sql);
-
- if (!$rs || $rs->EOF) return false;
-
- $arr = $rs->GetArray();
- $a = array();
- foreach($arr as $v) {
- $data = explode(chr(0), $v['args']);
- $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;
- }
-
- function _query($sql,$inputarr=false)
- {
- if (! $this->_bindInputArray) {
- // We don't have native support for parameterized queries, so let's emulate it at the parent
- return ADODB_postgres64::_query($sql, $inputarr);
- }
-
- $this->_pnum = 0;
- $this->_errorMsg = false;
- // -- added Cristiano da Cunha Duarte
- if ($inputarr) {
- $sqlarr = explode('?',trim($sql));
- $sql = '';
- $i = 1;
- $last = sizeof($sqlarr)-1;
- foreach($sqlarr as $v) {
- if ($last < $i) $sql .= $v;
- else $sql .= $v.' $'.$i;
- $i++;
- }
-
- $rez = pg_query_params($this->_connectionID,$sql, $inputarr);
- } else {
- $rez = pg_query($this->_connectionID,$sql);
- }
- // check if no data returned, then no need to create real recordset
- if ($rez && pg_numfields($rez) <= 0) {
- if (is_resource($this->_resultid) && get_resource_type($this->_resultid) === 'pgsql result') {
- pg_freeresult($this->_resultid);
- }
- $this->_resultid = $rez;
- return true;
- }
- return $rez;
- }
-
- // this is a set of functions for managing client encoding - very important if the encodings
- // of your database and your output target (i.e. HTML) don't match
- //for instance, you may have UNICODE database and server it on-site as WIN1251 etc.
- // GetCharSet - get the name of the character set the client is using now
- // the functions should work with Postgres 7.0 and above, the set of charsets supported
- // depends on compile flags of postgres distribution - if no charsets were compiled into the server
- // it will return 'SQL_ANSI' always
- function GetCharSet()
- {
- //we will use ADO's builtin property charSet
- $this->charSet = @pg_client_encoding($this->_connectionID);
- if (!$this->charSet) {
- return false;
- } else {
- return $this->charSet;
- }
- }
-
- // SetCharSet - switch the client encoding
- function SetCharSet($charset_name)
- {
- $this->GetCharSet();
- if ($this->charSet !== $charset_name) {
- $if = pg_set_client_encoding($this->_connectionID, $charset_name);
- if ($if == "0" & $this->GetCharSet() == $charset_name) {
- return true;
- } else return false;
- } else return true;
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_postgres7 extends ADORecordSet_postgres64{
-
- var $databaseType = "postgres7";
-
-
- function __construct($queryID, $mode=false)
- {
- parent::__construct($queryID, $mode);
- }
-
- // 10% speedup to move MoveNext to child class
- function MoveNext()
- {
- if (!$this->EOF) {
- $this->_currentRow++;
- if ($this->_numOfRows < 0 || $this->_numOfRows > $this->_currentRow) {
- $this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);
-
- if (is_array($this->fields)) {
- if ($this->fields && isset($this->_blobArr)) $this->_fixblobs();
- return true;
- }
- }
- $this->fields = false;
- $this->EOF = true;
- }
- return false;
- }
-
-}
-
-class ADORecordSet_assoc_postgres7 extends ADORecordSet_postgres64{
-
- var $databaseType = "postgres7";
-
-
- function __construct($queryID, $mode=false)
- {
- parent::__construct($queryID, $mode);
- }
-
- function _fetch()
- {
- if ($this->_currentRow >= $this->_numOfRows && $this->_numOfRows >= 0)
- return false;
-
- $this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);
-
- if ($this->fields) {
- if (isset($this->_blobArr)) $this->_fixblobs();
- $this->_updatefields();
- }
-
- return (is_array($this->fields));
- }
-
- // Create associative array
- function _updatefields()
- {
- if (ADODB_ASSOC_CASE == 2) return; // native
-
- $arr = array();
- $lowercase = (ADODB_ASSOC_CASE == 0);
-
- foreach($this->fields as $k => $v) {
- if (is_integer($k)) $arr[$k] = $v;
- else {
- if ($lowercase)
- $arr[strtolower($k)] = $v;
- else
- $arr[strtoupper($k)] = $v;
- }
- }
- $this->fields = $arr;
- }
-
- function MoveNext()
- {
- if (!$this->EOF) {
- $this->_currentRow++;
- if ($this->_numOfRows < 0 || $this->_numOfRows > $this->_currentRow) {
- $this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);
-
- if (is_array($this->fields)) {
- if ($this->fields) {
- if (isset($this->_blobArr)) $this->_fixblobs();
-
- $this->_updatefields();
- }
- return true;
- }
- }
-
-
- $this->fields = false;
- $this->EOF = true;
- }
- return false;
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-postgres8.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-postgres8.inc.php
deleted file mode 100644
index 2bd236a..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-postgres8.inc.php
+++ /dev/null
@@ -1,48 +0,0 @@
-GetOne("SELECT lastval()")
- : $this->GetOne("SELECT currval(pg_get_serial_sequence('$table', '$column'))");
- }
-}
-
-class ADORecordSet_postgres8 extends ADORecordSet_postgres7
-{
- var $databaseType = "postgres8";
-}
-
-class ADORecordSet_assoc_postgres8 extends ADORecordSet_assoc_postgres7
-{
- var $databaseType = "postgres8";
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-postgres9.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-postgres9.inc.php
deleted file mode 100644
index 4d4ac8d..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-postgres9.inc.php
+++ /dev/null
@@ -1,30 +0,0 @@
-ADORecordset($id,$mode);
- }
- };
-} // define
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-sapdb.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-sapdb.inc.php
deleted file mode 100644
index 5a51fa2..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-sapdb.inc.php
+++ /dev/null
@@ -1,183 +0,0 @@
-curmode = SQL_CUR_USE_ODBC;
- $this->ADODB_odbc();
- }
-
- function ServerInfo()
- {
- $info = ADODB_odbc::ServerInfo();
- if (!$info['version'] && preg_match('/([0-9.]+)/',$info['description'],$matches)) {
- $info['version'] = $matches[1];
- }
- return $info;
- }
-
- function MetaPrimaryKeys($table)
- {
- $table = $this->Quote(strtoupper($table));
-
- return $this->GetCol("SELECT columnname FROM COLUMNS WHERE tablename=$table AND mode='KEY' ORDER BY pos");
- }
-
- function MetaIndexes ($table, $primary = FALSE, $owner = false)
- {
- $table = $this->Quote(strtoupper($table));
-
- $sql = "SELECT INDEXNAME,TYPE,COLUMNNAME FROM INDEXCOLUMNS ".
- " WHERE TABLENAME=$table".
- " ORDER BY INDEXNAME,COLUMNNO";
-
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- $rs = $this->Execute($sql);
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- if (!is_object($rs)) {
- return FALSE;
- }
-
- $indexes = array();
- while ($row = $rs->FetchRow()) {
- $indexes[$row[0]]['unique'] = $row[1] == 'UNIQUE';
- $indexes[$row[0]]['columns'][] = $row[2];
- }
- if ($primary) {
- $indexes['SYSPRIMARYKEYINDEX'] = array(
- 'unique' => True, // by definition
- 'columns' => $this->GetCol("SELECT columnname FROM COLUMNS WHERE tablename=$table AND mode='KEY' ORDER BY pos"),
- );
- }
- return $indexes;
- }
-
- function MetaColumns ($table)
- {
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
- $table = $this->Quote(strtoupper($table));
-
- $retarr = array();
- foreach($this->GetAll("SELECT COLUMNNAME,DATATYPE,LEN,DEC,NULLABLE,MODE,\"DEFAULT\",CASE WHEN \"DEFAULT\" IS NULL THEN 0 ELSE 1 END AS HAS_DEFAULT FROM COLUMNS WHERE tablename=$table ORDER BY pos") as $column)
- {
- $fld = new ADOFieldObject();
- $fld->name = $column[0];
- $fld->type = $column[1];
- $fld->max_length = $fld->type == 'LONG' ? 2147483647 : $column[2];
- $fld->scale = $column[3];
- $fld->not_null = $column[4] == 'NO';
- $fld->primary_key = $column[5] == 'KEY';
- if ($fld->has_default = $column[7]) {
- if ($fld->primary_key && $column[6] == 'DEFAULT SERIAL (1)') {
- $fld->auto_increment = true;
- $fld->has_default = false;
- } else {
- $fld->default_value = $column[6];
- switch($fld->type) {
- case 'VARCHAR':
- case 'CHARACTER':
- case 'LONG':
- $fld->default_value = $column[6];
- break;
- default:
- $fld->default_value = trim($column[6]);
- break;
- }
- }
- }
- $retarr[$fld->name] = $fld;
- }
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- return $retarr;
- }
-
- function MetaColumnNames($table)
- {
- $table = $this->Quote(strtoupper($table));
-
- return $this->GetCol("SELECT columnname FROM COLUMNS WHERE tablename=$table ORDER BY pos");
- }
-
- // unlike it seems, this depends on the db-session and works in a multiuser environment
- function _insertid($table,$column)
- {
- return empty($table) ? False : $this->GetOne("SELECT $table.CURRVAL FROM DUAL");
- }
-
- /*
- SelectLimit implementation problems:
-
- The following will return random 10 rows as order by performed after "WHERE rowno<10"
- which is not ideal...
-
- select * from table where rowno < 10 order by 1
-
- This means that we have to use the adoconnection base class SelectLimit when
- there is an "order by".
-
- See http://listserv.sap.com/pipermail/sapdb.general/2002-January/010405.html
- */
-
-};
-
-
-class ADORecordSet_sapdb extends ADORecordSet_odbc {
-
- var $databaseType = "sapdb";
-
- function ADORecordSet_sapdb($id,$mode=false)
- {
- $this->ADORecordSet_odbc($id,$mode);
- }
-}
-
-} //define
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-sqlanywhere.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-sqlanywhere.inc.php
deleted file mode 100644
index a0a7b86..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-sqlanywhere.inc.php
+++ /dev/null
@@ -1,168 +0,0 @@
-create_blobvar($blobVarName);
-
- b) load blob var from file. $filename must be complete path
-
- $dbcon->load_blobvar_from_file($blobVarName, $filename);
-
- c) Use the $blobVarName in SQL insert or update statement in the values
- clause:
-
- $recordSet = $dbconn->Execute('INSERT INTO tabname (idcol, blobcol) '
- .
- 'VALUES (\'test\', ' . $blobVarName . ')');
-
- instead of loading blob from a file, you can also load from
- an unformatted (raw) blob variable:
- $dbcon->load_blobvar_from_var($blobVarName, $varName);
-
- d) drop blob variable on db server to free up resources:
- $dbconn->drop_blobvar($blobVarName);
-
- Sybase_SQLAnywhere data driver. Requires ODBC.
-
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-if (!defined('_ADODB_ODBC_LAYER')) {
- include(ADODB_DIR."/drivers/adodb-odbc.inc.php");
-}
-
-if (!defined('ADODB_SYBASE_SQLANYWHERE')){
-
- define('ADODB_SYBASE_SQLANYWHERE',1);
-
- class ADODB_sqlanywhere extends ADODB_odbc {
- var $databaseType = "sqlanywhere";
- var $hasInsertID = true;
-
- function ADODB_sqlanywhere()
- {
- $this->ADODB_odbc();
- }
-
- function _insertid() {
- return $this->GetOne('select @@identity');
- }
-
- function create_blobvar($blobVarName) {
- $this->Execute("create variable $blobVarName long binary");
- return;
- }
-
- function drop_blobvar($blobVarName) {
- $this->Execute("drop variable $blobVarName");
- return;
- }
-
- function load_blobvar_from_file($blobVarName, $filename) {
- $chunk_size = 1000;
-
- $fd = fopen ($filename, "rb");
-
- $integer_chunks = (integer)filesize($filename) / $chunk_size;
- $modulus = filesize($filename) % $chunk_size;
- if ($modulus != 0){
- $integer_chunks += 1;
- }
-
- for($loop=1;$loop<=$integer_chunks;$loop++){
- $contents = fread ($fd, $chunk_size);
- $contents = bin2hex($contents);
-
- $hexstring = '';
-
- for($loop2=0;$loop2qstr($hexstring);
-
- $this->Execute("set $blobVarName = $blobVarName || " . $hexstring);
- }
-
- fclose ($fd);
- return;
- }
-
- function load_blobvar_from_var($blobVarName, &$varName) {
- $chunk_size = 1000;
-
- $integer_chunks = (integer)strlen($varName) / $chunk_size;
- $modulus = strlen($varName) % $chunk_size;
- if ($modulus != 0){
- $integer_chunks += 1;
- }
-
- for($loop=1;$loop<=$integer_chunks;$loop++){
- $contents = substr ($varName, (($loop - 1) * $chunk_size), $chunk_size);
- $contents = bin2hex($contents);
-
- $hexstring = '';
-
- for($loop2=0;$loop2qstr($hexstring);
-
- $this->Execute("set $blobVarName = $blobVarName || " . $hexstring);
- }
-
- return;
- }
-
- /*
- Insert a null into the blob field of the table first.
- Then use UpdateBlob to store the blob.
-
- Usage:
-
- $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)');
- $conn->UpdateBlob('blobtable','blobcol',$blob,'id=1');
- */
- function UpdateBlob($table,$column,&$val,$where,$blobtype='BLOB')
- {
- $blobVarName = 'hold_blob';
- $this->create_blobvar($blobVarName);
- $this->load_blobvar_from_var($blobVarName, $val);
- $this->Execute("UPDATE $table SET $column=$blobVarName WHERE $where");
- $this->drop_blobvar($blobVarName);
- return true;
- }
- }; //class
-
- class ADORecordSet_sqlanywhere extends ADORecordSet_odbc {
-
- var $databaseType = "sqlanywhere";
-
- function ADORecordSet_sqlanywhere($id,$mode=false)
- {
- $this->ADORecordSet_odbc($id,$mode);
- }
-
-
- }; //class
-
-
-} //define
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-sqlite.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-sqlite.inc.php
deleted file mode 100644
index e7cf353..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-sqlite.inc.php
+++ /dev/null
@@ -1,398 +0,0 @@
-fmtDate)."'";
- case 'sysTimeStamp' : return "'".date($this->sysTimeStamp)."'";
- }
- }*/
-
- function ServerInfo()
- {
- $arr['version'] = sqlite_libversion();
- $arr['description'] = 'SQLite ';
- $arr['encoding'] = sqlite_libencoding();
- return $arr;
- }
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
- $ret = $this->Execute("BEGIN TRANSACTION");
- $this->transCnt += 1;
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
- $ret = $this->Execute("COMMIT");
- if ($this->transCnt>0)$this->transCnt -= 1;
- return !empty($ret);
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- $ret = $this->Execute("ROLLBACK");
- if ($this->transCnt>0)$this->transCnt -= 1;
- return !empty($ret);
- }
-
- // mark newnham
- function MetaColumns($table, $normalize=true)
- {
- global $ADODB_FETCH_MODE;
- $false = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
- $rs = $this->Execute("PRAGMA table_info('$table')");
- if (isset($savem)) $this->SetFetchMode($savem);
- if (!$rs) {
- $ADODB_FETCH_MODE = $save;
- return $false;
- }
- $arr = array();
- while ($r = $rs->FetchRow()) {
- $type = explode('(',$r['type']);
- $size = '';
- if (sizeof($type)==2)
- $size = trim($type[1],')');
- $fn = strtoupper($r['name']);
- $fld = new ADOFieldObject;
- $fld->name = $r['name'];
- $fld->type = $type[0];
- $fld->max_length = $size;
- $fld->not_null = $r['notnull'];
- $fld->default_value = $r['dflt_value'];
- $fld->scale = 0;
- if (isset($r['pk']) && $r['pk']) $fld->primary_key=1;
- if ($save == ADODB_FETCH_NUM) $arr[] = $fld;
- else $arr[strtoupper($fld->name)] = $fld;
- }
- $rs->Close();
- $ADODB_FETCH_MODE = $save;
- return $arr;
- }
-
- function _init($parentDriver)
- {
-
- $parentDriver->hasTransactions = false;
- $parentDriver->hasInsertID = true;
- }
-
- function _insertid()
- {
- return sqlite_last_insert_rowid($this->_connectionID);
- }
-
- function _affectedrows()
- {
- return sqlite_changes($this->_connectionID);
- }
-
- function ErrorMsg()
- {
- if ($this->_logsql) return $this->_errorMsg;
- return ($this->_errorNo) ? sqlite_error_string($this->_errorNo) : '';
- }
-
- function ErrorNo()
- {
- return $this->_errorNo;
- }
-
- function SQLDate($fmt, $col=false)
- {
- $fmt = $this->qstr($fmt);
- return ($col) ? "adodb_date2($fmt,$col)" : "adodb_date($fmt)";
- }
-
-
- function _createFunctions()
- {
- @sqlite_create_function($this->_connectionID, 'adodb_date', 'adodb_date', 1);
- @sqlite_create_function($this->_connectionID, 'adodb_date2', 'adodb_date2', 2);
- }
-
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (!function_exists('sqlite_open')) return null;
- if (empty($argHostname) && $argDatabasename) $argHostname = $argDatabasename;
-
- $this->_connectionID = sqlite_open($argHostname);
- if ($this->_connectionID === false) return false;
- $this->_createFunctions();
- return true;
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (!function_exists('sqlite_open')) return null;
- if (empty($argHostname) && $argDatabasename) $argHostname = $argDatabasename;
-
- $this->_connectionID = sqlite_popen($argHostname);
- if ($this->_connectionID === false) return false;
- $this->_createFunctions();
- return true;
- }
-
- // returns query ID if successful, otherwise false
- function _query($sql,$inputarr=false)
- {
- $rez = sqlite_query($sql,$this->_connectionID);
- if (!$rez) {
- $this->_errorNo = sqlite_last_error($this->_connectionID);
- }
-
- return $rez;
- }
-
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
- {
- $offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
- $limitStr = ($nrows >= 0) ? " LIMIT $nrows" : ($offset >= 0 ? ' LIMIT 999999999' : '');
- if ($secs2cache)
- $rs = $this->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr);
- else
- $rs = $this->Execute($sql."$limitStr$offsetStr",$inputarr);
-
- return $rs;
- }
-
- /*
- This algorithm is not very efficient, but works even if table locking
- is not available.
-
- Will return false if unable to generate an ID after $MAXLOOPS attempts.
- */
- var $_genSeqSQL = "create table %s (id integer)";
-
- function GenID($seq='adodbseq',$start=1)
- {
- // if you have to modify the parameter below, your database is overloaded,
- // or you need to implement generation of id's yourself!
- $MAXLOOPS = 100;
- //$this->debug=1;
- 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;
- return $num;
- }
- }
- if ($fn = $this->raiseErrorFn) {
- $fn($this->databaseType,'GENID',-32000,"Unable to generate unique id after $MAXLOOPS attempts",$seq,$num);
- }
- return false;
- }
-
- function CreateSequence($seqname='adodbseq',$start=1)
- {
- 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)");
- }
-
- var $_dropSeqSQL = 'drop table %s';
- function DropSequence($seqname)
- {
- if (empty($this->_dropSeqSQL)) return false;
- return $this->Execute(sprintf($this->_dropSeqSQL,$seqname));
- }
-
- // returns true or false
- function _close()
- {
- return @sqlite_close($this->_connectionID);
- }
-
- function MetaIndexes($table, $primary = FALSE, $owner=false, $owner = false)
- {
- $false = false;
- // save old fetch mode
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
- $SQL=sprintf("SELECT name,sql FROM sqlite_master WHERE type='index' AND tbl_name='%s'", strtolower($table));
- $rs = $this->Execute($SQL);
- if (!is_object($rs)) {
- if (isset($savem))
- $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- return $false;
- }
-
- $indexes = array ();
- while ($row = $rs->FetchRow()) {
- if ($primary && preg_match("/primary/i",$row[1]) == 0) continue;
- if (!isset($indexes[$row[0]])) {
-
- $indexes[$row[0]] = array(
- 'unique' => preg_match("/unique/i",$row[1]),
- 'columns' => array());
- }
- /**
- * There must be a more elegant way of doing this,
- * the index elements appear in the SQL statement
- * in cols[1] between parentheses
- * e.g CREATE UNIQUE INDEX ware_0 ON warehouse (org,warehouse)
- */
- $cols = explode("(",$row[1]);
- $cols = explode(")",$cols[1]);
- array_pop($cols);
- $indexes[$row[0]]['columns'] = $cols;
- }
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- }
- return $indexes;
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordset_sqlite extends ADORecordSet {
-
- var $databaseType = "sqlite";
- var $bind = false;
-
- function ADORecordset_sqlite($queryID,$mode=false)
- {
-
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch($mode) {
- case ADODB_FETCH_NUM: $this->fetchMode = SQLITE_NUM; break;
- case ADODB_FETCH_ASSOC: $this->fetchMode = SQLITE_ASSOC; break;
- default: $this->fetchMode = SQLITE_BOTH; break;
- }
- $this->adodbFetchMode = $mode;
-
- $this->_queryID = $queryID;
-
- $this->_inited = true;
- $this->fields = array();
- if ($queryID) {
- $this->_currentRow = 0;
- $this->EOF = !$this->_fetch();
- @$this->_initrs();
- } else {
- $this->_numOfRows = 0;
- $this->_numOfFields = 0;
- $this->EOF = true;
- }
-
- return $this->_queryID;
- }
-
-
- function FetchField($fieldOffset = -1)
- {
- $fld = new ADOFieldObject;
- $fld->name = sqlite_field_name($this->_queryID, $fieldOffset);
- $fld->type = 'VARCHAR';
- $fld->max_length = -1;
- return $fld;
- }
-
- function _initrs()
- {
- $this->_numOfRows = @sqlite_num_rows($this->_queryID);
- $this->_numOfFields = @sqlite_num_fields($this->_queryID);
- }
-
- function Fields($colname)
- {
- if ($this->fetchMode != SQLITE_NUM) return $this->fields[$colname];
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
-
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- function _seek($row)
- {
- return sqlite_seek($this->_queryID, $row);
- }
-
- function _fetch($ignore_fields=false)
- {
- $this->fields = @sqlite_fetch_array($this->_queryID,$this->fetchMode);
- return !empty($this->fields);
- }
-
- function _close()
- {
- }
-
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-sqlite3.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-sqlite3.inc.php
deleted file mode 100644
index af83517..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-sqlite3.inc.php
+++ /dev/null
@@ -1,430 +0,0 @@
-fmtDate)."'";
- case 'sysTimeStamp' : return "'".date($this->sysTimeStamp)."'";
- }
- }*/
-
- function ServerInfo()
- {
- $arr['version'] = $this->_connectionID->version(); //**tochange
- $arr['description'] = 'SQLite 3'; //**tochange
- //$arr['encoding'] = sqlite_libencoding();//**tochange
- return $arr;
- }
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
- $ret = $this->Execute("BEGIN TRANSACTION");
- $this->transCnt += 1;
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
- $ret = $this->Execute("COMMIT");
- if ($this->transCnt>0)$this->transCnt -= 1;
- return !empty($ret);
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- $ret = $this->Execute("ROLLBACK");
- if ($this->transCnt>0)$this->transCnt -= 1;
- return !empty($ret);
- }
-
- // mark newnham
- function MetaColumns($table, $normalize=true)
- {
- global $ADODB_FETCH_MODE;
- $false = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
- $rs = $this->Execute("PRAGMA table_info('$table')");
- if (isset($savem)) $this->SetFetchMode($savem);
- if (!$rs) {
- $ADODB_FETCH_MODE = $save;
- return $false;
- }
- $arr = array();
- while ($r = $rs->FetchRow()) {
-
- $type = explode('(',$r['type']);
- $size = '';
- if (sizeof($type)==2)
- $size = trim($type[1],')');
- $fn = strtoupper($r['name']);
- $fld = new ADOFieldObject;
- $fld->name = $r['name'];
- $fld->type = $type[0];
- $fld->max_length = $size;
- $fld->not_null = $r['notnull'];
- $fld->default_value = $r['dflt_value'];
- $fld->scale = 0;
- if (isset($r['pk']) && $r['pk']) $fld->primary_key=1;
- if ($save == ADODB_FETCH_NUM) $arr[] = $fld;
- else $arr[strtoupper($fld->name)] = $fld;
- }
- $rs->Close();
- $ADODB_FETCH_MODE = $save;
- return $arr;
- }
-
- function _init($parentDriver)
- {
-
- $parentDriver->hasTransactions = false;
- $parentDriver->hasInsertID = true;
- }
-
- function _insertid()
- {
- //return sqlite_last_insert_rowid($this->_connectionID)->; //**change
- return $this->_connectionID->lastInsertRowID();
- }
-
- function _affectedrows()
- {
- return $this->_connectionID->changes();
- //return sqlite3_changes($this->_connectionID); //**tochange
- }
-
- function ErrorMsg()
- {
- if ($this->_logsql) return $this->_errorMsg;
-
- return ($this->_errorNo) ? $this->ErrorNo() : ''; //**tochange?
- }
-
- function ErrorNo()
- {
- return $this->_connectionID->lastErrorCode(); //**tochange??
- }
-
- function SQLDate($fmt, $col=false)
- {
- $fmt = $this->qstr($fmt);
- return ($col) ? "adodb_date2($fmt,$col)" : "adodb_date($fmt)";
- }
-
-
- function _createFunctions()
- {
- //@sqlite3_create_function($this->_connectionID, 'adodb_date', 'adodb_date', 1); *change
- $this->_connectionID->createFunction('adodb_date', 'adodb_date', 1);
-
- //@sqlite3_create_function($this->_connectionID, 'adodb_date2', 'adodb_date2', 2);**change
- $this->_connectionID->createFunction('adodb_date2', 'adodb_date2', 2);
- }
-
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename) //**tochange: all the function need to be changed, just hacks for the moment
- {
- if (empty($argHostname) && $argDatabasename) $argHostname = $argDatabasename;
- $this->_connectionID = new SQLite3($argDatabasename);
- $this->_createFunctions();
-
- return true; // hack
- /*
- if (!function_exists('sqlite_open')) return null;
- if (empty($argHostname) && $argDatabasename) $argHostname = $argDatabasename;
-
- $this->_connectionID = sqlite_open($argHostname);
- if ($this->_connectionID === false) return false;
- $this->_createFunctions();
- return true;
- */
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) //**tochange
- {
- if (!function_exists('sqlite_open')) return null;
- if (empty($argHostname) && $argDatabasename) $argHostname = $argDatabasename;
-
- $this->_connectionID = sqlite_popen($argHostname);
- if ($this->_connectionID === false) return false;
- $this->_createFunctions();
- return true;
- }
-
- // returns query ID if successful, otherwise false
- function _query($sql,$inputarr=false)
- {
- //$rez = sqlite_query($sql,$this->_connectionID);//**change
- $rez = $this->_connectionID->query($sql);
- if (!$rez) {
- //$this->_errorNo = sqlite3_last_error($this->_connectionID);**change
- $this->_connectionID->lastErrorCode();
- }
-
- return $rez;
- }
-
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
- {
- $offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
- $limitStr = ($nrows >= 0) ? " LIMIT $nrows" : ($offset >= 0 ? ' LIMIT 999999999' : '');
- if ($secs2cache)
- $rs = $this->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr);
- else
- $rs = $this->Execute($sql."$limitStr$offsetStr",$inputarr);
-
- return $rs;
- }
-
- /*
- This algorithm is not very efficient, but works even if table locking
- is not available.
-
- Will return false if unable to generate an ID after $MAXLOOPS attempts.
- */
- var $_genSeqSQL = "create table %s (id integer)";
-
- function GenID($seq='adodbseq',$start=1)
- {
- // if you have to modify the parameter below, your database is overloaded,
- // or you need to implement generation of id's yourself!
- $MAXLOOPS = 100;
- //$this->debug=1;
- 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;
- return $num;
- }
- }
- if ($fn = $this->raiseErrorFn) {
- $fn($this->databaseType,'GENID',-32000,"Unable to generate unique id after $MAXLOOPS attempts",$seq,$num);
- }
- return false;
- }
-
- function CreateSequence($seqname='adodbseq',$start=1)
- {
- 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)");
- }
-
- var $_dropSeqSQL = 'drop table %s';
- function DropSequence($seqname)
- {
- if (empty($this->_dropSeqSQL)) return false;
- return $this->Execute(sprintf($this->_dropSeqSQL,$seqname));
- }
-
- // returns true or false
- function _close()
- {
- //return @sqlite3_close($this->_connectionID);**change
- return $this->_connectionID->close();
- }
-
- function MetaIndexes($table, $primary = FALSE, $owner=false, $owner = false)
- {
- $false = false;
- // save old fetch mode
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
- $SQL=sprintf("SELECT name,sql FROM sqlite_master WHERE type='index' AND tbl_name='%s'", strtolower($table));
- $rs = $this->Execute($SQL);
- if (!is_object($rs)) {
- if (isset($savem))
- $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- return $false;
- }
-
- $indexes = array ();
- while ($row = $rs->FetchRow()) {
- if ($primary && preg_match("/primary/i",$row[1]) == 0) continue;
- if (!isset($indexes[$row[0]])) {
-
- $indexes[$row[0]] = array(
- 'unique' => preg_match("/unique/i",$row[1]),
- 'columns' => array());
- }
- /**
- * There must be a more elegant way of doing this,
- * the index elements appear in the SQL statement
- * in cols[1] between parentheses
- * e.g CREATE UNIQUE INDEX ware_0 ON warehouse (org,warehouse)
- */
- $cols = explode("(",$row[1]);
- $cols = explode(")",$cols[1]);
- array_pop($cols);
- $indexes[$row[0]]['columns'] = $cols;
- }
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- }
- return $indexes;
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-//class ADORecordset_sqlite extends ADORecordSet {**change
-class ADORecordset_sqlite3 extends ADORecordSet {
-
- //var $databaseType = "sqlite";**change
- var $databaseType = "sqlite3";
- var $bind = false;
-
- //function ADORecordset_sqlite($queryID,$mode=false)**change
- function ADORecordset_sqlite3($queryID,$mode=false)
- {
-
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch($mode) {
- //case ADODB_FETCH_NUM: $this->fetchMode = SQLITE_NUM; break;**change
- case ADODB_FETCH_NUM: $this->fetchMode = SQLITE3_NUM; break;
- //case ADODB_FETCH_ASSOC: $this->fetchMode = SQLITE_ASSOC; break;**change
- case ADODB_FETCH_ASSOC: $this->fetchMode = SQLITE3_ASSOC; break;
- //default: $this->fetchMode = SQLITE_BOTH; break;**change
- default: $this->fetchMode = SQLITE3_BOTH; break;
- }
- $this->adodbFetchMode = $mode;
-
- $this->_queryID = $queryID;
-
- $this->_inited = true;
- $this->fields = array();
- if ($queryID) {
- $this->_currentRow = 0;
- $this->EOF = !$this->_fetch();
- @$this->_initrs();
- } else {
- $this->_numOfRows = 0;
- $this->_numOfFields = 0;
- $this->EOF = true;
- }
-
- return $this->_queryID;
- }
-
-
- function FetchField($fieldOffset = -1)
- {
- $fld = new ADOFieldObject;
- //$fld->name = sqlite3_field_name($this->_queryID, $fieldOffset);**change
- $fld->name->columnName($this->_queryID, $fieldOffset);
- $fld->type = 'VARCHAR';
- $fld->max_length = -1;
- return $fld;
- }
-
- function _initrs()
- {
- //$this->_numOfRows = @sqlite_num_rows($this->_queryID); **tochange but sqlite3 doesn't implement this!
- $this->_numOfRows = 1;
- //$this->_numOfFields = @sqlite3_num_fields($this->_queryID);**change
- $this->_numOfFields = $this->_queryID->numColumns();
-
- }
-
- function Fields($colname)
- {
- //if ($this->fetchMode != SQLITE_NUM) return $this->fields[$colname];**change
- if ($this->fetchMode != SQLITE3_NUM) return $this->fields[$colname];
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
-
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- function _seek($row)
- {
- return sqlite3_seek($this->_queryID, $row);//**tochange but sqlite3 seems not to implement seek!
- }
-
- function _fetch($ignore_fields=false)
- {
- //$this->fields = @sqlite3_fetch_array($this->_queryID,$this->fetchMode);**change
- $this->fields = $this->_queryID->fetchArray($this->fetchMode);
- return !empty($this->fields);
- }
-
- function _close()
- {
- }
-
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-sqlitepo.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-sqlitepo.inc.php
deleted file mode 100644
index f1b8b99..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-sqlitepo.inc.php
+++ /dev/null
@@ -1,61 +0,0 @@
-ADODB_sqlite();
- }
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordset_sqlitepo extends ADORecordset_sqlite {
-
- var $databaseType = 'sqlitepo';
-
- function ADORecordset_sqlitepo($queryID,$mode=false)
- {
- $this->ADORecordset_sqlite($queryID,$mode);
- }
-
- // Modified to strip table names from returned fields
- function _fetch($ignore_fields=false)
- {
- $this->fields = array();
- $fields = @sqlite_fetch_array($this->_queryID,$this->fetchMode);
- if(is_array($fields))
- foreach($fields as $n => $v)
- {
- if(($p = strpos($n, ".")) !== false)
- $n = substr($n, $p+1);
- $this->fields[$n] = $v;
- }
-
- return !empty($this->fields);
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-sybase.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-sybase.inc.php
deleted file mode 100644
index d4ad1eb..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-sybase.inc.php
+++ /dev/null
@@ -1,441 +0,0 @@
-GetOne('select @@identity');
- }
- // might require begintrans -- committrans
- function _affectedrows()
- {
- return $this->GetOne('select @@rowcount');
- }
-
-
- function BeginTrans()
- {
-
- if ($this->transOff) return true;
- $this->transCnt += 1;
-
- $this->Execute('BEGIN TRAN');
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
-
- if (!$ok) return $this->RollbackTrans();
-
- $this->transCnt -= 1;
- $this->Execute('COMMIT TRAN');
- return true;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- $this->transCnt -= 1;
- $this->Execute('ROLLBACK TRAN');
- return true;
- }
-
- // http://www.isug.com/Sybase_FAQ/ASE/section6.1.html#6.1.4
- function RowLock($tables,$where,$col='top 1 null as ignore')
- {
- if (!$this->_hastrans) $this->BeginTrans();
- $tables = str_replace(',',' HOLDLOCK,',$tables);
- return $this->GetOne("select $col from $tables HOLDLOCK where $where");
-
- }
-
- function SelectDB($dbName)
- {
- $this->database = $dbName;
- $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions
- if ($this->_connectionID) {
- return @sybase_select_db($dbName);
- }
- else return false;
- }
-
- /* Returns: the last error message from previous database operation
- Note: This function is NOT available for Microsoft SQL Server. */
-
-
- function ErrorMsg()
- {
- if ($this->_logsql) return $this->_errorMsg;
- if (function_exists('sybase_get_last_message'))
- $this->_errorMsg = sybase_get_last_message();
- else
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : 'SYBASE error messages not supported on this platform';
- return $this->_errorMsg;
- }
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (!function_exists('sybase_connect')) return null;
-
- // Sybase connection on custom port
- if ($this->port) {
- $argHostname .= ':' . $this->port;
- }
-
- if ($this->charSet) {
- $this->_connectionID = sybase_connect($argHostname,$argUsername,$argPassword, $this->charSet);
- } else {
- $this->_connectionID = sybase_connect($argHostname,$argUsername,$argPassword);
- }
-
- if ($this->_connectionID === false) return false;
- if ($argDatabasename) return $this->SelectDB($argDatabasename);
- return true;
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (!function_exists('sybase_connect')) return null;
-
- // Sybase connection on custom port
- if ($this->port) {
- $argHostname .= ':' . $this->port;
- }
-
- if ($this->charSet) {
- $this->_connectionID = sybase_pconnect($argHostname,$argUsername,$argPassword, $this->charSet);
- } else {
- $this->_connectionID = sybase_pconnect($argHostname,$argUsername,$argPassword);
- }
-
- if ($this->_connectionID === false) return false;
- if ($argDatabasename) return $this->SelectDB($argDatabasename);
- return true;
- }
-
- // returns query ID if successful, otherwise false
- function _query($sql,$inputarr=false)
- {
- global $ADODB_COUNTRECS;
-
- if ($ADODB_COUNTRECS == false && ADODB_PHPVER >= 0x4300)
- return sybase_unbuffered_query($sql,$this->_connectionID);
- else
- return sybase_query($sql,$this->_connectionID);
- }
-
- // See http://www.isug.com/Sybase_FAQ/ASE/section6.2.html#6.2.12
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
- {
- if ($secs2cache > 0) {// we do not cache rowcount, so we have to load entire recordset
- $rs = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
- return $rs;
- }
-
- $nrows = (integer) $nrows;
- $offset = (integer) $offset;
-
- $cnt = ($nrows >= 0) ? $nrows : 999999999;
- if ($offset > 0 && $cnt) $cnt += $offset;
-
- $this->Execute("set rowcount $cnt");
- $rs = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,0);
- $this->Execute("set rowcount 0");
-
- return $rs;
- }
-
- // returns true or false
- function _close()
- {
- return @sybase_close($this->_connectionID);
- }
-
- static function UnixDate($v)
- {
- return ADORecordSet_array_sybase::UnixDate($v);
- }
-
- static function UnixTimeStamp($v)
- {
- return ADORecordSet_array_sybase::UnixTimeStamp($v);
- }
-
-
-
- # Added 2003-10-05 by Chris Phillipson
- # Used ASA SQL Reference Manual -- http://sybooks.sybase.com/onlinebooks/group-aw/awg0800e/dbrfen8/@ebt-link;pt=16756?target=%25N%15_12018_START_RESTART_N%25
- # to convert similar Microsoft SQL*Server (mssql) API into Sybase compatible version
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- if (!$col) $col = $this->sysTimeStamp;
- $s = '';
-
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- if ($s) $s .= '+';
- $ch = $fmt[$i];
- switch($ch) {
- case 'Y':
- case 'y':
- $s .= "datename(yy,$col)";
- break;
- case 'M':
- $s .= "convert(char(3),$col,0)";
- break;
- case 'm':
- $s .= "str_replace(str(month($col),2),' ','0')";
- break;
- case 'Q':
- case 'q':
- $s .= "datename(qq,$col)";
- break;
- case 'D':
- case 'd':
- $s .= "str_replace(str(datepart(dd,$col),2),' ','0')";
- break;
- case 'h':
- $s .= "substring(convert(char(14),$col,0),13,2)";
- break;
-
- case 'H':
- $s .= "str_replace(str(datepart(hh,$col),2),' ','0')";
- break;
-
- case 'i':
- $s .= "str_replace(str(datepart(mi,$col),2),' ','0')";
- break;
- case 's':
- $s .= "str_replace(str(datepart(ss,$col),2),' ','0')";
- break;
- case 'a':
- case 'A':
- $s .= "substring(convert(char(19),$col,0),18,2)";
- break;
-
- default:
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- $s .= $this->qstr($ch);
- break;
- }
- }
- return $s;
- }
-
- # Added 2003-10-07 by Chris Phillipson
- # Used ASA SQL Reference Manual -- http://sybooks.sybase.com/onlinebooks/group-aw/awg0800e/dbrfen8/@ebt-link;pt=5981;uf=0?target=0;window=new;showtoc=true;book=dbrfen8
- # to convert similar Microsoft SQL*Server (mssql) API into Sybase compatible version
- function MetaPrimaryKeys($table)
- {
- $sql = "SELECT c.column_name " .
- "FROM syscolumn c, systable t " .
- "WHERE t.table_name='$table' AND c.table_id=t.table_id " .
- "AND t.table_type='BASE' " .
- "AND c.pkey = 'Y' " .
- "ORDER BY c.column_id";
-
- $a = $this->GetCol($sql);
- if ($a && sizeof($a)>0) return $a;
- return false;
- }
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-global $ADODB_sybase_mths;
-$ADODB_sybase_mths = array(
- 'JAN'=>1,'FEB'=>2,'MAR'=>3,'APR'=>4,'MAY'=>5,'JUN'=>6,
- 'JUL'=>7,'AUG'=>8,'SEP'=>9,'OCT'=>10,'NOV'=>11,'DEC'=>12);
-
-class ADORecordset_sybase extends ADORecordSet {
-
- var $databaseType = "sybase";
- var $canSeek = true;
- // _mths works only in non-localised system
- var $_mths = array('JAN'=>1,'FEB'=>2,'MAR'=>3,'APR'=>4,'MAY'=>5,'JUN'=>6,'JUL'=>7,'AUG'=>8,'SEP'=>9,'OCT'=>10,'NOV'=>11,'DEC'=>12);
-
- function ADORecordset_sybase($id,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- if (!$mode) $this->fetchMode = ADODB_FETCH_ASSOC;
- else $this->fetchMode = $mode;
- $this->ADORecordSet($id,$mode);
- }
-
- /* Returns: an object containing field information.
- Get column information in the Recordset object. fetchField() can be used in order to obtain information about
- fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by
- fetchField() is retrieved. */
- function FetchField($fieldOffset = -1)
- {
- if ($fieldOffset != -1) {
- $o = @sybase_fetch_field($this->_queryID, $fieldOffset);
- }
- else if ($fieldOffset == -1) { /* The $fieldOffset argument is not provided thus its -1 */
- $o = @sybase_fetch_field($this->_queryID);
- }
- // older versions of PHP did not support type, only numeric
- if ($o && !isset($o->type)) $o->type = ($o->numeric) ? 'float' : 'varchar';
- return $o;
- }
-
- function _initrs()
- {
- global $ADODB_COUNTRECS;
- $this->_numOfRows = ($ADODB_COUNTRECS)? @sybase_num_rows($this->_queryID):-1;
- $this->_numOfFields = @sybase_num_fields($this->_queryID);
- }
-
- function _seek($row)
- {
- return @sybase_data_seek($this->_queryID, $row);
- }
-
- function _fetch($ignore_fields=false)
- {
- if ($this->fetchMode == ADODB_FETCH_NUM) {
- $this->fields = @sybase_fetch_row($this->_queryID);
- } else if ($this->fetchMode == ADODB_FETCH_ASSOC) {
- $this->fields = @sybase_fetch_assoc($this->_queryID);
-
- if (is_array($this->fields)) {
- $this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE);
- return true;
- }
- return false;
- } else {
- $this->fields = @sybase_fetch_array($this->_queryID);
- }
- if ( is_array($this->fields)) {
- return true;
- }
-
- return false;
- }
-
- /* close() only needs to be called if you are worried about using too much memory while your script
- is running. All associated result memory for the specified result identifier will automatically be freed. */
- function _close() {
- return @sybase_free_result($this->_queryID);
- }
-
- // sybase/mssql uses a default date like Dec 30 2000 12:00AM
- static function UnixDate($v)
- {
- return ADORecordSet_array_sybase::UnixDate($v);
- }
-
- static function UnixTimeStamp($v)
- {
- return ADORecordSet_array_sybase::UnixTimeStamp($v);
- }
-}
-
-class ADORecordSet_array_sybase extends ADORecordSet_array {
- function ADORecordSet_array_sybase($id=-1)
- {
- $this->ADORecordSet_array($id);
- }
-
- // sybase/mssql uses a default date like Dec 30 2000 12:00AM
- static function UnixDate($v)
- {
- global $ADODB_sybase_mths;
-
- //Dec 30 2000 12:00AM
- if (!preg_match( "/([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4})/"
- ,$v, $rr)) return parent::UnixDate($v);
-
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $themth = substr(strtoupper($rr[1]),0,3);
- $themth = $ADODB_sybase_mths[$themth];
- if ($themth <= 0) return false;
- // h-m-s-MM-DD-YY
- return adodb_mktime(0,0,0,$themth,$rr[2],$rr[3]);
- }
-
- static function UnixTimeStamp($v)
- {
- global $ADODB_sybase_mths;
- //11.02.2001 Toni Tunkkari toni.tunkkari@finebyte.com
- //Changed [0-9] to [0-9 ] in day conversion
- if (!preg_match( "/([A-Za-z]{3})[-/\. ]([0-9 ]{1,2})[-/\. ]([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})/"
- ,$v, $rr)) return parent::UnixTimeStamp($v);
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $themth = substr(strtoupper($rr[1]),0,3);
- $themth = $ADODB_sybase_mths[$themth];
- if ($themth <= 0) return false;
-
- switch (strtoupper($rr[6])) {
- case 'P':
- if ($rr[4]<12) $rr[4] += 12;
- break;
- case 'A':
- if ($rr[4]==12) $rr[4] = 0;
- break;
- default:
- break;
- }
- // h-m-s-MM-DD-YY
- return adodb_mktime($rr[4],$rr[5],0,$themth,$rr[2],$rr[3]);
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-sybase_ase.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-sybase_ase.inc.php
deleted file mode 100644
index 28de2dd..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-sybase_ase.inc.php
+++ /dev/null
@@ -1,118 +0,0 @@
-metaTablesSQL) {
- // complicated state saving by the need for backward compat
-
- if ($ttype == 'VIEWS'){
- $sql = str_replace('U', 'V', $this->metaTablesSQL);
- }elseif (false === $ttype){
- $sql = str_replace('U',"U' OR type='V", $this->metaTablesSQL);
- }else{ // TABLES OR ANY OTHER
- $sql = $this->metaTablesSQL;
- }
- $rs = $this->Execute($sql);
-
- if ($rs === false || !method_exists($rs, 'GetArray')){
- return $false;
- }
- $arr = $rs->GetArray();
-
- $arr2 = array();
- foreach($arr as $key=>$value){
- $arr2[] = trim($value['name']);
- }
- return $arr2;
- }
- return $false;
- }
-
- function MetaDatabases()
- {
- $arr = array();
- if ($this->metaDatabasesSQL!='') {
- $rs = $this->Execute($this->metaDatabasesSQL);
- if ($rs && !$rs->EOF){
- while (!$rs->EOF){
- $arr[] = $rs->Fields('name');
- $rs->MoveNext();
- }
- return $arr;
- }
- }
- return false;
- }
-
- // fix a bug which prevent the metaColumns query to be executed for Sybase ASE
- function MetaColumns($table,$upper=false)
- {
- $false = false;
- if (!empty($this->metaColumnsSQL)) {
-
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
- if ($rs === false) return $false;
-
- $retarr = array();
- while (!$rs->EOF) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->Fields('field_name');
- $fld->type = $rs->Fields('type');
- $fld->max_length = $rs->Fields('width');
- $retarr[strtoupper($fld->name)] = $fld;
- $rs->MoveNext();
- }
- $rs->Close();
- return $retarr;
- }
- return $false;
- }
-
- function getProcedureList($schema)
- {
- return false;
- }
-
- function ErrorMsg()
- {
- if (!function_exists('sybase_connect')){
- return 'Your PHP doesn\'t contain the Sybase connection module!';
- }
- return parent::ErrorMsg();
- }
-}
-
-class adorecordset_sybase_ase extends ADORecordset_sybase {
-var $databaseType = "sybase_ase";
-function ADORecordset_sybase_ase($id,$mode=false)
- {
- $this->ADORecordSet_sybase($id,$mode);
- }
-
-}
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-text.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-text.inc.php
deleted file mode 100644
index 07fb953..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-text.inc.php
+++ /dev/null
@@ -1,387 +0,0 @@
-Connect($array,[$types],[$colnames]);
-
- Parameter $array is the 2 dimensional array of data. The first row can contain the
- column names. If column names is not defined in first row, you MUST define $colnames,
- the 3rd parameter.
-
- Parameter $types is optional. If defined, it should contain an array matching
- the number of columns in $array, with each element matching the correct type defined
- by MetaType: (B,C,I,L,N). If undefined, we will probe for $this->_proberows rows
- to guess the type. Only C,I and N are recognised.
-
- Parameter $colnames is optional. If defined, it is an array that contains the
- column names of $array. If undefined, we assume the first row of $array holds the
- column names.
-
- The Execute() function will return a recordset. The recordset works like a normal recordset.
- We have partial support for SQL parsing. We process the SQL using the following rules:
-
- 1. SQL order by's always work for the first column ordered. Subsequent cols are ignored
-
- 2. All operations take place on the same table. No joins possible. In fact the FROM clause
- is ignored! You can use any name for the table.
-
- 3. To simplify code, all columns are returned, except when selecting 1 column
-
- $rs = $db->Execute('select col1,col2 from table'); // sql ignored, will generate all cols
-
- We special case handling of 1 column because it is used in filter popups
-
- $rs = $db->Execute('select col1 from table');
- // sql accepted and processed -- any table name is accepted
-
- $rs = $db->Execute('select distinct col1 from table');
- // sql accepted and processed
-
-4. Where clauses are ignored, but searching with the 3rd parameter of Execute is permitted.
- This has to use PHP syntax and we will eval() it. You can even use PHP functions.
-
- $rs = $db->Execute('select * from table',false,"\$COL1='abc' and $\COL2=3")
- // the 3rd param is searched -- make sure that $COL1 is a legal column name
- // and all column names must be in upper case.
-
-4. Group by, having, other clauses are ignored
-
-5. Expression columns, min(), max() are ignored
-
-6. All data is readonly. Only SELECTs permitted.
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-if (! defined("_ADODB_TEXT_LAYER")) {
- define("_ADODB_TEXT_LAYER", 1 );
-
-// for sorting in _query()
-function adodb_cmp($a, $b) {
- if ($a[0] == $b[0]) return 0;
- return ($a[0] < $b[0]) ? -1 : 1;
-}
-// for sorting in _query()
-function adodb_cmpr($a, $b) {
- if ($a[0] == $b[0]) return 0;
- return ($a[0] > $b[0]) ? -1 : 1;
-}
-class ADODB_text extends ADOConnection {
- var $databaseType = 'text';
-
- var $_origarray; // original data
- var $_types;
- var $_proberows = 8;
- var $_colnames;
- var $_skiprow1=false;
- var $readOnly = true;
- var $hasTransactions = false;
-
- var $_rezarray;
- var $_reznames;
- var $_reztypes;
-
- function ADODB_text()
- {
- }
-
- function RSRecordCount()
- {
- if (!empty($this->_rezarray)) return sizeof($this->_rezarray);
-
- return sizeof($this->_origarray);
- }
-
- function _insertid()
- {
- return false;
- }
-
- function _affectedrows()
- {
- return false;
- }
-
- // returns true or false
- function PConnect(&$array, $types = false, $colnames = false)
- {
- return $this->Connect($array, $types, $colnames);
- }
- // returns true or false
- function Connect(&$array, $types = false, $colnames = false)
- {
- if (is_string($array) and $array === 'iluvphplens') return 'me2';
-
- if (!$array) {
- $this->_origarray = false;
- return true;
- }
- $row = $array[0];
- $cols = sizeof($row);
-
-
- if ($colnames) $this->_colnames = $colnames;
- else {
- $this->_colnames = $array[0];
- $this->_skiprow1 = true;
- }
- if (!$types) {
- // probe and guess the type
- $types = array();
- $firstrow = true;
- if ($this->_proberows > sizeof($array)) $max = sizeof($array);
- else $max = $this->_proberows;
- for ($j=($this->_skiprow1)?1:0;$j < $max; $j++) {
- $row = $array[$j];
- if (!$row) break;
- $i = -1;
- foreach($row as $v) {
- $i += 1;
- //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 (isset($types[$i]) && $types[$i]=='C') continue;
- if ($firstrow) {
- // 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[0] = 'C';
- if (strpos($v,'.') !== false) $types[0] = 'N';
- else $types[$i] = 'I';
- continue;
- }
-
- if (strpos($v,'.') !== false) $types[$i] = 'N';
-
- }
- $firstrow = false;
- }
- }
- //print_r($types);
- $this->_origarray = $array;
- $this->_types = $types;
- return true;
- }
-
-
-
- // returns queryID or false
- // We presume that the select statement is on the same table (what else?),
- // with the only difference being the order by.
- //You can filter by using $eval and each clause is stored in $arr .eg. $arr[1] == 'name'
- // also supports SELECT [DISTINCT] COL FROM ... -- only 1 col supported
- function _query($sql,$input_arr,$eval=false)
- {
- if ($this->_origarray === false) return false;
-
- $eval = $this->evalAll;
- $usql = strtoupper(trim($sql));
- $usql = preg_replace("/[\t\n\r]/",' ',$usql);
- $usql = preg_replace('/ *BY/i',' BY',strtoupper($usql));
-
- $eregword ='([A-Z_0-9]*)';
- //print " $sql $eval ";
- if ($eval) {
- $i = 0;
- foreach($this->_colnames as $n) {
- $n = strtoupper(trim($n));
- $eval = str_replace("\$$n","\$arr[$i]",$eval);
-
- $i += 1;
- }
-
- $i = 0;
- $eval = "\$rez=($eval);";
- //print "Eval string = $eval
";
- $where_arr = array();
-
- reset($this->_origarray);
- while (list($k_arr,$arr) = each($this->_origarray)) {
-
- if ($i == 0 && $this->_skiprow1)
- $where_arr[] = $arr;
- else {
- eval($eval);
- //print " $i: result=$rez arr[0]={$arr[0]} arr[1]={$arr[1]} \n ";
- if ($rez) $where_arr[] = $arr;
- }
- $i += 1;
- }
- $this->_rezarray = $where_arr;
- }else
- $where_arr = $this->_origarray;
-
- // THIS PROJECTION CODE ONLY WORKS FOR 1 COLUMN,
- // OTHERWISE IT RETURNS ALL COLUMNS
- if (substr($usql,0,7) == 'SELECT ') {
- $at = strpos($usql,' FROM ');
- $sel = trim(substr($usql,7,$at-7));
-
- $distinct = false;
- if (substr($sel,0,8) == 'DISTINCT') {
- $distinct = true;
- $sel = trim(substr($sel,8,$at));
- }
-
- // $sel holds the selection clause, comma delimited
- // currently we only project if one column is involved
- // this is to support popups in PHPLens
- if (strpos(',',$sel)===false) {
- $colarr = array();
-
- preg_match("/$eregword/",$sel,$colarr);
- $col = $colarr[1];
- $i = 0;
- $n = '';
- reset($this->_colnames);
- while (list($k_n,$n) = each($this->_colnames)) {
-
- if ($col == strtoupper(trim($n))) break;
- $i += 1;
- }
-
- if ($n && $col) {
- $distarr = array();
- $projarray = array();
- $projtypes = array($this->_types[$i]);
- $projnames = array($n);
-
- reset($where_arr);
- while (list($k_a,$a) = each($where_arr)) {
- if ($i == 0 && $this->_skiprow1) {
- $projarray[] = array($n);
- continue;
- }
-
- if ($distinct) {
- $v = strtoupper($a[$i]);
- if (! $distarr[$v]) {
- $projarray[] = array($a[$i]);
- $distarr[$v] = 1;
- }
- } else
- $projarray[] = array($a[$i]);
-
- } //foreach
- //print_r($projarray);
- }
- } // check 1 column in projection
- } // is SELECT
-
- if (empty($projarray)) {
- $projtypes = $this->_types;
- $projarray = $where_arr;
- $projnames = $this->_colnames;
- }
- $this->_rezarray = $projarray;
- $this->_reztypes = $projtypes;
- $this->_reznames = $projnames;
-
-
- $pos = strpos($usql,' ORDER BY ');
- if ($pos === false) return $this;
- $orderby = trim(substr($usql,$pos+10));
-
- preg_match("/$eregword/",$orderby,$arr);
- if (sizeof($arr) < 2) return $this; // actually invalid sql
- $col = $arr[1];
- $at = (integer) $col;
- if ($at == 0) {
- $i = 0;
- reset($projnames);
- while (list($k_n,$n) = each($projnames)) {
- if (strtoupper(trim($n)) == $col) {
- $at = $i+1;
- break;
- }
- $i += 1;
- }
- }
-
- if ($at <= 0 || $at > sizeof($projarray[0])) return $this; // cannot find sort column
- $at -= 1;
-
- // generate sort array consisting of (sortval1, row index1) (sortval2, row index2)...
- $sorta = array();
- $t = $projtypes[$at];
- $num = ($t == 'I' || $t == 'N');
- for ($i=($this->_skiprow1)?1:0, $max = sizeof($projarray); $i < $max; $i++) {
- $row = $projarray[$i];
- $val = ($num)?(float)$row[$at]:$row[$at];
- $sorta[]=array($val,$i);
- }
-
- // check for desc sort
- $orderby = substr($orderby,strlen($col)+1);
- $arr == array();
- preg_match('/([A-Z_0-9]*)/i',$orderby,$arr);
-
- if (trim($arr[1]) == 'DESC') $sortf = 'adodb_cmpr';
- else $sortf = 'adodb_cmp';
-
- // hasta la sorta babe
- usort($sorta, $sortf);
-
- // rearrange original array
- $arr2 = array();
- if ($this->_skiprow1) $arr2[] = $projarray[0];
- foreach($sorta as $v) {
- $arr2[] = $projarray[$v[1]];
- }
-
- $this->_rezarray = $arr2;
- return $this;
- }
-
- /* Returns: the last error message from previous database operation */
- function ErrorMsg()
- {
- return '';
- }
-
- /* Returns: the last error number from previous database operation */
- function ErrorNo()
- {
- return 0;
- }
-
- // returns true or false
- function _close()
- {
- }
-
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-
-class ADORecordSet_text extends ADORecordSet_array
-{
-
- var $databaseType = "text";
-
- function ADORecordSet_text(&$conn,$mode=false)
- {
- $this->ADORecordSet_array();
- $this->InitArray($conn->_rezarray,$conn->_reztypes,$conn->_reznames);
- $conn->_rezarray = false;
- }
-
-} // class ADORecordSet_text
-
-
-} // defined
diff --git a/sources/vendor/adodb/adodb-php/drivers/adodb-vfp.inc.php b/sources/vendor/adodb/adodb-php/drivers/adodb-vfp.inc.php
deleted file mode 100644
index 9b7798b..0000000
--- a/sources/vendor/adodb/adodb-php/drivers/adodb-vfp.inc.php
+++ /dev/null
@@ -1,106 +0,0 @@
-ADODB_odbc();
- }
-
- function Time()
- {
- return time();
- }
-
- function BeginTrans() { return false;}
-
- // quote string to be sent back to database
- function qstr($s,$nofixquotes=false)
- {
- if (!$nofixquotes) return "'".str_replace("\r\n","'+chr(13)+'",str_replace("'",$this->replaceQuote,$s))."'";
- return "'".$s."'";
- }
-
-
- // TOP requires ORDER BY for VFP
- function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
- {
- $this->hasTop = preg_match('/ORDER[ \t\r\n]+BY/is',$sql) ? 'top' : false;
- $ret = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
- return $ret;
- }
-
-
-
-};
-
-
-class ADORecordSet_vfp extends ADORecordSet_odbc {
-
- var $databaseType = "vfp";
-
-
- function ADORecordSet_vfp($id,$mode=false)
- {
- return $this->ADORecordSet_odbc($id,$mode);
- }
-
- function MetaType($t,$len=-1)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
- switch (strtoupper($t)) {
- case 'C':
- if ($len <= $this->blobSize) return 'C';
- case 'M':
- return 'X';
-
- case 'D': return 'D';
-
- case 'T': return 'T';
-
- case 'L': return 'L';
-
- case 'I': return 'I';
-
- default: return 'N';
- }
- }
-}
-
-} //define
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-ar.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-ar.inc.php
deleted file mode 100644
index 2189778..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-ar.inc.php
+++ /dev/null
@@ -1,32 +0,0 @@
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'ar',
- DB_ERROR => ' ',
- DB_ERROR_ALREADY_EXISTS => ' ',
- DB_ERROR_CANNOT_CREATE => ' ',
- DB_ERROR_CANNOT_DELETE => ' ',
- DB_ERROR_CANNOT_DROP => ' ',
- DB_ERROR_CONSTRAINT => ' ',
- DB_ERROR_DIVZERO => ' ',
- DB_ERROR_INVALID => ' ',
- DB_ERROR_INVALID_DATE => ' ',
- DB_ERROR_INVALID_NUMBER => ' ',
- DB_ERROR_MISMATCH => ' ',
- DB_ERROR_NODBSELECTED => ' ',
- DB_ERROR_NOSUCHFIELD => ' ',
- DB_ERROR_NOSUCHTABLE => ' ',
- DB_ERROR_NOT_CAPABLE => ' ',
- DB_ERROR_NOT_FOUND => ' ',
- DB_ERROR_NOT_LOCKED => ' ',
- DB_ERROR_SYNTAX => ' ',
- DB_ERROR_UNSUPPORTED => ' ',
- DB_ERROR_VALUE_COUNT_ON_ROW => ' ',
- DB_ERROR_INVALID_DSN => 'DSN ',
- DB_ERROR_CONNECT_FAILED => ' ',
- 0 => ' ', // DB_OK
- DB_ERROR_NEED_MORE_DATA => ' ',
- DB_ERROR_EXTENSION_NOT_FOUND=> ' ',
- DB_ERROR_NOSUCHDB => ' ',
- DB_ERROR_ACCESS_VIOLATION => ' '
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-bg.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-bg.inc.php
deleted file mode 100644
index c8bf07f..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-bg.inc.php
+++ /dev/null
@@ -1,36 +0,0 @@
-
-*/
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'bg',
- DB_ERROR => ' ',
- DB_ERROR_ALREADY_EXISTS => ' ',
- DB_ERROR_CANNOT_CREATE => ' ',
- DB_ERROR_CANNOT_DELETE => ' ',
- DB_ERROR_CANNOT_DROP => ' ',
- DB_ERROR_CONSTRAINT => ' ',
- DB_ERROR_DIVZERO => ' ',
- DB_ERROR_INVALID => '',
- DB_ERROR_INVALID_DATE => ' ',
- DB_ERROR_INVALID_NUMBER => ' ',
- DB_ERROR_MISMATCH => ' ',
- DB_ERROR_NODBSELECTED => ' ',
- DB_ERROR_NOSUCHFIELD => ' ',
- DB_ERROR_NOSUCHTABLE => ' ',
- DB_ERROR_NOT_CAPABLE => 'DB backend not capable',
- DB_ERROR_NOT_FOUND => ' ',
- DB_ERROR_NOT_LOCKED => ' ',
- DB_ERROR_SYNTAX => ' ',
- DB_ERROR_UNSUPPORTED => ' ',
- DB_ERROR_VALUE_COUNT_ON_ROW => ' ',
- DB_ERROR_INVALID_DSN => ' DSN',
- DB_ERROR_CONNECT_FAILED => ' ',
- 0 => ' ', // DB_OK
- DB_ERROR_NEED_MORE_DATA => ' ',
- DB_ERROR_EXTENSION_NOT_FOUND=> ' ',
- DB_ERROR_NOSUCHDB => ' ',
- DB_ERROR_ACCESS_VIOLATION => ' '
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-bgutf8.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-bgutf8.inc.php
deleted file mode 100644
index 297e6c9..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-bgutf8.inc.php
+++ /dev/null
@@ -1,36 +0,0 @@
-
-*/
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'bgutf8',
- DB_ERROR => 'неизвестна грешка',
- DB_ERROR_ALREADY_EXISTS => 'вече съществува',
- DB_ERROR_CANNOT_CREATE => 'не може да бъде създадена',
- DB_ERROR_CANNOT_DELETE => 'не може да бъде изтрита',
- DB_ERROR_CANNOT_DROP => 'не може да бъде унищожена',
- DB_ERROR_CONSTRAINT => 'нарушено условие',
- DB_ERROR_DIVZERO => 'деление на нула',
- DB_ERROR_INVALID => 'неправилно',
- DB_ERROR_INVALID_DATE => 'некоректна дата или час',
- DB_ERROR_INVALID_NUMBER => 'невалиден номер',
- DB_ERROR_MISMATCH => 'погрешна употреба',
- DB_ERROR_NODBSELECTED => 'не е избрана база данни',
- DB_ERROR_NOSUCHFIELD => 'несъществуващо поле',
- DB_ERROR_NOSUCHTABLE => 'несъществуваща таблица',
- DB_ERROR_NOT_CAPABLE => 'DB backend not capable',
- DB_ERROR_NOT_FOUND => 'не е намерена',
- DB_ERROR_NOT_LOCKED => 'не е заключена',
- DB_ERROR_SYNTAX => 'грешен синтаксис',
- DB_ERROR_UNSUPPORTED => 'не се поддържа',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'некоректен брой колони в реда',
- DB_ERROR_INVALID_DSN => 'невалиден DSN',
- DB_ERROR_CONNECT_FAILED => 'връзката не може да бъде осъществена',
- 0 => 'няма грешки', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'предоставените данни са недостатъчни',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'разширението не е намерено',
- DB_ERROR_NOSUCHDB => 'несъществуваща база данни',
- DB_ERROR_ACCESS_VIOLATION => 'нямате достатъчно права'
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-ca.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-ca.inc.php
deleted file mode 100644
index ea48d43..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-ca.inc.php
+++ /dev/null
@@ -1,33 +0,0 @@
- 'ca',
- DB_ERROR => 'error desconegut',
- DB_ERROR_ALREADY_EXISTS => 'ja existeix',
- DB_ERROR_CANNOT_CREATE => 'no es pot crear',
- DB_ERROR_CANNOT_DELETE => 'no es pot esborrar',
- DB_ERROR_CANNOT_DROP => 'no es pot eliminar',
- DB_ERROR_CONSTRAINT => 'violaci de constraint',
- DB_ERROR_DIVZERO => 'divisi per zero',
- DB_ERROR_INVALID => 'no s vlid',
- DB_ERROR_INVALID_DATE => 'la data o l\'hora no sn vlides',
- DB_ERROR_INVALID_NUMBER => 'el nombre no s vlid',
- DB_ERROR_MISMATCH => 'no hi ha coincidncia',
- DB_ERROR_NODBSELECTED => 'cap base de dades seleccionada',
- DB_ERROR_NOSUCHFIELD => 'camp inexistent',
- DB_ERROR_NOSUCHTABLE => 'taula inexistent',
- DB_ERROR_NOT_CAPABLE => 'l\'execuci secundria de DB no pot',
- DB_ERROR_NOT_FOUND => 'no trobat',
- DB_ERROR_NOT_LOCKED => 'no blocat',
- DB_ERROR_SYNTAX => 'error de sintaxi',
- DB_ERROR_UNSUPPORTED => 'no suportat',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'el nombre de columnes no coincideix amb el nombre de valors en la fila',
- DB_ERROR_INVALID_DSN => 'el DSN no s vlid',
- DB_ERROR_CONNECT_FAILED => 'connexi fallida',
- 0 => 'cap error', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'les dades subministrades sn insuficients',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'extensi no trobada',
- DB_ERROR_NOSUCHDB => 'base de dades inexistent',
- DB_ERROR_ACCESS_VIOLATION => 'permisos insuficients'
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-cn.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-cn.inc.php
deleted file mode 100644
index 34fc114..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-cn.inc.php
+++ /dev/null
@@ -1,34 +0,0 @@
- 'cn',
- DB_ERROR => 'δ֪',
- DB_ERROR_ALREADY_EXISTS => 'Ѿ',
- DB_ERROR_CANNOT_CREATE => 'ܴ',
- DB_ERROR_CANNOT_DELETE => 'ɾ',
- DB_ERROR_CANNOT_DROP => 'ܶ',
- DB_ERROR_CONSTRAINT => 'Լ',
- DB_ERROR_DIVZERO => '0',
- DB_ERROR_INVALID => 'Ч',
- DB_ERROR_INVALID_DATE => 'Чڻʱ',
- DB_ERROR_INVALID_NUMBER => 'Ч',
- DB_ERROR_MISMATCH => 'ƥ',
- DB_ERROR_NODBSELECTED => 'ûݿⱻѡ',
- DB_ERROR_NOSUCHFIELD => 'ûӦֶ',
- DB_ERROR_NOSUCHTABLE => 'ûӦı',
- DB_ERROR_NOT_CAPABLE => 'ݿ̨',
- DB_ERROR_NOT_FOUND => 'ûз',
- DB_ERROR_NOT_LOCKED => 'ûб',
- DB_ERROR_SYNTAX => '',
- DB_ERROR_UNSUPPORTED => '֧',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'ۼֵ',
- DB_ERROR_INVALID_DSN => 'ЧԴ (DSN)',
- DB_ERROR_CONNECT_FAILED => 'ʧ',
- 0 => 'ûд', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'ṩݲܷҪ',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'չûб',
- DB_ERROR_NOSUCHDB => 'ûӦݿ',
- DB_ERROR_ACCESS_VIOLATION => 'ûкʵȨ'
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-cz.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-cz.inc.php
deleted file mode 100644
index 62beacd..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-cz.inc.php
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'cz',
- DB_ERROR => 'neznm chyba',
- DB_ERROR_ALREADY_EXISTS => 'ji? existuje',
- DB_ERROR_CANNOT_CREATE => 'nelze vytvo?it',
- DB_ERROR_CANNOT_DELETE => 'nelze smazat',
- DB_ERROR_CANNOT_DROP => 'nelze odstranit',
- DB_ERROR_CONSTRAINT => 'poru?en omezujc podmnky',
- DB_ERROR_DIVZERO => 'd?len nulou',
- DB_ERROR_INVALID => 'neplatn',
- DB_ERROR_INVALID_DATE => 'neplatn datum nebo ?as',
- DB_ERROR_INVALID_NUMBER => 'neplatn ?slo',
- DB_ERROR_MISMATCH => 'nesouhlas',
- DB_ERROR_NODBSELECTED => '?dn databze nen vybrna',
- DB_ERROR_NOSUCHFIELD => 'pole nenalezeno',
- DB_ERROR_NOSUCHTABLE => 'tabulka nenalezena',
- DB_ERROR_NOT_CAPABLE => 'nepodporovno',
- DB_ERROR_NOT_FOUND => 'nenalezeno',
- DB_ERROR_NOT_LOCKED => 'nezam?eno',
- DB_ERROR_SYNTAX => 'syntaktick chyba',
- DB_ERROR_UNSUPPORTED => 'nepodporovno',
- DB_ERROR_VALUE_COUNT_ON_ROW => '',
- DB_ERROR_INVALID_DSN => 'neplatn DSN',
- DB_ERROR_CONNECT_FAILED => 'p?ipojen selhalo',
- 0 => 'bez chyb', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'mlo zdrojovch dat',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'roz??en nenalezeno',
- DB_ERROR_NOSUCHDB => 'databze neexistuje',
- DB_ERROR_ACCESS_VIOLATION => 'nedostate?n prva'
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-da.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-da.inc.php
deleted file mode 100644
index 3c336fb..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-da.inc.php
+++ /dev/null
@@ -1,32 +0,0 @@
- 'da',
- DB_ERROR => 'ukendt fejl',
- DB_ERROR_ALREADY_EXISTS => 'eksisterer allerede',
- DB_ERROR_CANNOT_CREATE => 'kan ikke oprette',
- DB_ERROR_CANNOT_DELETE => 'kan ikke slette',
- DB_ERROR_CANNOT_DROP => 'kan ikke droppe',
- DB_ERROR_CONSTRAINT => 'begrænsning krænket',
- DB_ERROR_DIVZERO => 'division med nul',
- DB_ERROR_INVALID => 'ugyldig',
- DB_ERROR_INVALID_DATE => 'ugyldig dato eller klokkeslet',
- DB_ERROR_INVALID_NUMBER => 'ugyldigt tal',
- DB_ERROR_MISMATCH => 'mismatch',
- DB_ERROR_NODBSELECTED => 'ingen database valgt',
- DB_ERROR_NOSUCHFIELD => 'felt findes ikke',
- DB_ERROR_NOSUCHTABLE => 'tabel findes ikke',
- DB_ERROR_NOT_CAPABLE => 'DB backend opgav',
- DB_ERROR_NOT_FOUND => 'ikke fundet',
- DB_ERROR_NOT_LOCKED => 'ikke låst',
- DB_ERROR_SYNTAX => 'syntaksfejl',
- DB_ERROR_UNSUPPORTED => 'ikke understøttet',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'resulterende antal felter svarer ikke til forespørgslens antal felter',
- DB_ERROR_INVALID_DSN => 'ugyldig DSN',
- DB_ERROR_CONNECT_FAILED => 'tilslutning mislykkedes',
- 0 => 'ingen fejl', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'utilstrækkelige data angivet',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'udvidelse ikke fundet',
- DB_ERROR_NOSUCHDB => 'database ikke fundet',
- DB_ERROR_ACCESS_VIOLATION => 'utilstrækkelige rettigheder'
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-de.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-de.inc.php
deleted file mode 100644
index 8923e71..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-de.inc.php
+++ /dev/null
@@ -1,32 +0,0 @@
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'de',
- DB_ERROR => 'Unbekannter Fehler',
- DB_ERROR_ALREADY_EXISTS => 'existiert bereits',
- DB_ERROR_CANNOT_CREATE => 'kann nicht erstellen',
- DB_ERROR_CANNOT_DELETE => 'kann nicht löschen',
- DB_ERROR_CANNOT_DROP => 'Tabelle oder Index konnte nicht gelöscht werden',
- DB_ERROR_CONSTRAINT => 'Constraint Verletzung',
- DB_ERROR_DIVZERO => 'Division durch Null',
- DB_ERROR_INVALID => 'ung¨ltig',
- DB_ERROR_INVALID_DATE => 'ung¨ltiges Datum oder Zeit',
- DB_ERROR_INVALID_NUMBER => 'ung¨ltige Zahl',
- DB_ERROR_MISMATCH => 'Unverträglichkeit',
- DB_ERROR_NODBSELECTED => 'keine Dantebank ausgewählt',
- DB_ERROR_NOSUCHFIELD => 'Feld nicht vorhanden',
- DB_ERROR_NOSUCHTABLE => 'Tabelle nicht vorhanden',
- DB_ERROR_NOT_CAPABLE => 'Funktion nicht installiert',
- DB_ERROR_NOT_FOUND => 'nicht gefunden',
- DB_ERROR_NOT_LOCKED => 'nicht gesperrt',
- DB_ERROR_SYNTAX => 'Syntaxfehler',
- DB_ERROR_UNSUPPORTED => 'nicht Unterst¨tzt',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'Anzahl der zur¨ckgelieferten Felder entspricht nicht der Anzahl der Felder in der Abfrage',
- DB_ERROR_INVALID_DSN => 'ung¨ltiger DSN',
- DB_ERROR_CONNECT_FAILED => 'Verbindung konnte nicht hergestellt werden',
- 0 => 'kein Fehler', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'Nicht gen¨gend Daten geliefert',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'erweiterung nicht gefunden',
- DB_ERROR_NOSUCHDB => 'keine Datenbank',
- DB_ERROR_ACCESS_VIOLATION => 'ungen¨gende Rechte'
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-en.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-en.inc.php
deleted file mode 100644
index 0582855..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-en.inc.php
+++ /dev/null
@@ -1,35 +0,0 @@
- 'en',
- DB_ERROR => 'unknown error',
- DB_ERROR_ALREADY_EXISTS => 'already exists',
- DB_ERROR_CANNOT_CREATE => 'can not create',
- DB_ERROR_CANNOT_DELETE => 'can not delete',
- DB_ERROR_CANNOT_DROP => 'can not drop',
- DB_ERROR_CONSTRAINT => 'constraint violation',
- DB_ERROR_DIVZERO => 'division by zero',
- DB_ERROR_INVALID => 'invalid',
- DB_ERROR_INVALID_DATE => 'invalid date or time',
- DB_ERROR_INVALID_NUMBER => 'invalid number',
- DB_ERROR_MISMATCH => 'mismatch',
- DB_ERROR_NODBSELECTED => 'no database selected',
- DB_ERROR_NOSUCHFIELD => 'no such field',
- DB_ERROR_NOSUCHTABLE => 'no such table',
- DB_ERROR_NOT_CAPABLE => 'DB backend not capable',
- DB_ERROR_NOT_FOUND => 'not found',
- DB_ERROR_NOT_LOCKED => 'not locked',
- DB_ERROR_SYNTAX => 'syntax error',
- DB_ERROR_UNSUPPORTED => 'not supported',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'value count on row',
- DB_ERROR_INVALID_DSN => 'invalid DSN',
- DB_ERROR_CONNECT_FAILED => 'connect failed',
- 0 => 'no error', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'insufficient data supplied',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'extension not found',
- DB_ERROR_NOSUCHDB => 'no such database',
- DB_ERROR_ACCESS_VIOLATION => 'insufficient permissions',
- DB_ERROR_DEADLOCK => 'deadlock detected',
- DB_ERROR_STATEMENT_TIMEOUT => 'statement timeout',
- DB_ERROR_SERIALIZATION_FAILURE => 'could not serialize access'
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-es.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-es.inc.php
deleted file mode 100644
index a80a644..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-es.inc.php
+++ /dev/null
@@ -1,32 +0,0 @@
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'es',
- DB_ERROR => 'error desconocido',
- DB_ERROR_ALREADY_EXISTS => 'ya existe',
- DB_ERROR_CANNOT_CREATE => 'imposible crear',
- DB_ERROR_CANNOT_DELETE => 'imposible borrar',
- DB_ERROR_CANNOT_DROP => 'imposible hacer drop',
- DB_ERROR_CONSTRAINT => 'violacion de constraint',
- DB_ERROR_DIVZERO => 'division por cero',
- DB_ERROR_INVALID => 'invalido',
- DB_ERROR_INVALID_DATE => 'fecha u hora invalida',
- DB_ERROR_INVALID_NUMBER => 'numero invalido',
- DB_ERROR_MISMATCH => 'error',
- DB_ERROR_NODBSELECTED => 'no hay base de datos seleccionada',
- DB_ERROR_NOSUCHFIELD => 'campo invalido',
- DB_ERROR_NOSUCHTABLE => 'tabla no existe',
- DB_ERROR_NOT_CAPABLE => 'capacidad invalida para esta DB',
- DB_ERROR_NOT_FOUND => 'no encontrado',
- DB_ERROR_NOT_LOCKED => 'no bloqueado',
- DB_ERROR_SYNTAX => 'error de sintaxis',
- DB_ERROR_UNSUPPORTED => 'no soportado',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'la cantidad de columnas no corresponden a la cantidad de valores',
- DB_ERROR_INVALID_DSN => 'DSN invalido',
- DB_ERROR_CONNECT_FAILED => 'fallo la conexion',
- 0 => 'sin error', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'insuficientes datos',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'extension no encontrada',
- DB_ERROR_NOSUCHDB => 'base de datos no encontrada',
- DB_ERROR_ACCESS_VIOLATION => 'permisos insuficientes'
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-esperanto.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-esperanto.inc.php
deleted file mode 100644
index 2ec1123..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-esperanto.inc.php
+++ /dev/null
@@ -1,34 +0,0 @@
- 'eo',
- DB_ERROR => 'nekonata eraro',
- DB_ERROR_ALREADY_EXISTS => 'jam ekzistas',
- DB_ERROR_CANNOT_CREATE => 'maleblas krei',
- DB_ERROR_CANNOT_DELETE => 'maleblas elimini',
- DB_ERROR_CANNOT_DROP => 'maleblas elimini (drop)',
- DB_ERROR_CONSTRAINT => 'rompo de kondicxoj de provo',
- DB_ERROR_DIVZERO => 'divido per 0 (nul)',
- DB_ERROR_INVALID => 'malregule',
- DB_ERROR_INVALID_DATE => 'malregula dato kaj tempo',
- DB_ERROR_INVALID_NUMBER => 'malregula nombro',
- DB_ERROR_MISMATCH => 'eraro',
- DB_ERROR_NODBSELECTED => 'datumbazo ne elektita',
- DB_ERROR_NOSUCHFIELD => 'ne ekzistas kampo',
- DB_ERROR_NOSUCHTABLE => 'ne ekzistas tabelo',
- DB_ERROR_NOT_CAPABLE => 'DBMS ne povas',
- DB_ERROR_NOT_FOUND => 'ne trovita',
- DB_ERROR_NOT_LOCKED => 'ne blokita',
- DB_ERROR_SYNTAX => 'sintaksa eraro',
- DB_ERROR_UNSUPPORTED => 'ne apogata',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'nombrilo de valoroj en linio',
- DB_ERROR_INVALID_DSN => 'malregula DSN-o',
- DB_ERROR_CONNECT_FAILED => 'konekto malsukcesa',
- 0 => 'cxio bone', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'ne suficxe da datumo',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'etendo ne trovita',
- DB_ERROR_NOSUCHDB => 'datumbazo ne ekzistas',
- DB_ERROR_ACCESS_VIOLATION => 'ne suficxe da rajto por atingo'
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-fa.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-fa.inc.php
deleted file mode 100644
index 7fa4618..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-fa.inc.php
+++ /dev/null
@@ -1,34 +0,0 @@
- */
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'fa',
- DB_ERROR => 'خطای ناشناخته',
- DB_ERROR_ALREADY_EXISTS => 'وجود دارد',
- DB_ERROR_CANNOT_CREATE => 'امکان create وجود ندارد',
- DB_ERROR_CANNOT_DELETE => 'امکان حذف وجود ندارد',
- DB_ERROR_CANNOT_DROP => 'امکان drop وجود ندارد',
- DB_ERROR_CONSTRAINT => 'نقض شرط',
- DB_ERROR_DIVZERO => 'تقسیم بر صفر',
- DB_ERROR_INVALID => 'نامعتبر',
- DB_ERROR_INVALID_DATE => 'زمان یا تاریخ نامعتبر',
- DB_ERROR_INVALID_NUMBER => 'عدد نامعتبر',
- DB_ERROR_MISMATCH => 'عدم مطابقت',
- DB_ERROR_NODBSELECTED => 'بانک اطلاعاتی انتخاب نشده است',
- DB_ERROR_NOSUCHFIELD => 'چنین ستونی وجود ندارد',
- DB_ERROR_NOSUCHTABLE => 'چنین جدولی وجود ندارد',
- DB_ERROR_NOT_CAPABLE => 'backend بانک اطلاعاتی قادر نیست',
- DB_ERROR_NOT_FOUND => 'پیدا نشد',
- DB_ERROR_NOT_LOCKED => 'قفل نشده',
- DB_ERROR_SYNTAX => 'خطای دستوری',
- DB_ERROR_UNSUPPORTED => 'پشتیبانی نمی شود',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'شمارش مقادیر روی ردیف',
- DB_ERROR_INVALID_DSN => 'DSN نامعتبر',
- DB_ERROR_CONNECT_FAILED => 'ارتباط برقرار نشد',
- 0 => 'بدون خطا', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'داده ناکافی است',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'extension پیدا نشد',
- DB_ERROR_NOSUCHDB => 'چنین بانک اطلاعاتی وجود ندارد',
- DB_ERROR_ACCESS_VIOLATION => 'حق دسترسی ناکافی'
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-fr.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-fr.inc.php
deleted file mode 100644
index 3fbc2f4..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-fr.inc.php
+++ /dev/null
@@ -1,32 +0,0 @@
- 'fr',
- DB_ERROR => 'erreur inconnue',
- DB_ERROR_ALREADY_EXISTS => 'existe déjà',
- DB_ERROR_CANNOT_CREATE => 'crétion impossible',
- DB_ERROR_CANNOT_DELETE => 'effacement impossible',
- DB_ERROR_CANNOT_DROP => 'suppression impossible',
- DB_ERROR_CONSTRAINT => 'violation de contrainte',
- DB_ERROR_DIVZERO => 'division par zéro',
- DB_ERROR_INVALID => 'invalide',
- DB_ERROR_INVALID_DATE => 'date ou heure invalide',
- DB_ERROR_INVALID_NUMBER => 'nombre invalide',
- DB_ERROR_MISMATCH => 'erreur de concordance',
- DB_ERROR_NODBSELECTED => 'pas de base de donnéessélectionnée',
- DB_ERROR_NOSUCHFIELD => 'nom de colonne invalide',
- DB_ERROR_NOSUCHTABLE => 'table ou vue inexistante',
- DB_ERROR_NOT_CAPABLE => 'fonction optionnelle non installée',
- DB_ERROR_NOT_FOUND => 'pas trouvé',
- DB_ERROR_NOT_LOCKED => 'non verrouillé',
- DB_ERROR_SYNTAX => 'erreur de syntaxe',
- DB_ERROR_UNSUPPORTED => 'non supporté',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'valeur insérée trop grande pour colonne',
- DB_ERROR_INVALID_DSN => 'DSN invalide',
- DB_ERROR_CONNECT_FAILED => 'échec à la connexion',
- 0 => "pas d'erreur", // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'données fournies insuffisantes',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'extension non trouvée',
- DB_ERROR_NOSUCHDB => 'base de données inconnue',
- DB_ERROR_ACCESS_VIOLATION => 'droits insuffisants'
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-hu.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-hu.inc.php
deleted file mode 100644
index f7c7a6d..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-hu.inc.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'hu',
- DB_ERROR => 'ismeretlen hiba',
- DB_ERROR_ALREADY_EXISTS => 'mr ltezik',
- DB_ERROR_CANNOT_CREATE => 'nem sikerlt ltrehozni',
- DB_ERROR_CANNOT_DELETE => 'nem sikerlt trlni',
- DB_ERROR_CANNOT_DROP => 'nem sikerlt eldobni',
- DB_ERROR_CONSTRAINT => 'szablyok megszegse',
- DB_ERROR_DIVZERO => 'oszts nullval',
- DB_ERROR_INVALID => 'rvnytelen',
- DB_ERROR_INVALID_DATE => 'rvnytelen dtum vagy id',
- DB_ERROR_INVALID_NUMBER => 'rvnytelen szm',
- DB_ERROR_MISMATCH => 'nem megfelel',
- DB_ERROR_NODBSELECTED => 'nincs kivlasztott adatbzis',
- DB_ERROR_NOSUCHFIELD => 'nincs ilyen mez',
- DB_ERROR_NOSUCHTABLE => 'nincs ilyen tbla',
- DB_ERROR_NOT_CAPABLE => 'DB backend nem tmogatja',
- DB_ERROR_NOT_FOUND => 'nem tallhat',
- DB_ERROR_NOT_LOCKED => 'nincs lezrva',
- DB_ERROR_SYNTAX => 'szintaktikai hiba',
- DB_ERROR_UNSUPPORTED => 'nem tmogatott',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'soron vgzett rtk szmlls',
- DB_ERROR_INVALID_DSN => 'hibs DSN',
- DB_ERROR_CONNECT_FAILED => 'sikertelen csatlakozs',
- 0 => 'nincs hiba', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'tl kevs az adat',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'bvtmny nem tallhat',
- DB_ERROR_NOSUCHDB => 'nincs ilyen adatbzis',
- DB_ERROR_ACCESS_VIOLATION => 'nincs jogosultsg'
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-it.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-it.inc.php
deleted file mode 100644
index b7f8048..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-it.inc.php
+++ /dev/null
@@ -1,33 +0,0 @@
- 'it',
- DB_ERROR => 'errore sconosciuto',
- DB_ERROR_ALREADY_EXISTS => 'esiste già',
- DB_ERROR_CANNOT_CREATE => 'non posso creare',
- DB_ERROR_CANNOT_DELETE => 'non posso cancellare',
- DB_ERROR_CANNOT_DROP => 'non posso eliminare',
- DB_ERROR_CONSTRAINT => 'violazione constraint',
- DB_ERROR_DIVZERO => 'divisione per zero',
- DB_ERROR_INVALID => 'non valido',
- DB_ERROR_INVALID_DATE => 'data od ora non valida',
- DB_ERROR_INVALID_NUMBER => 'numero non valido',
- DB_ERROR_MISMATCH => 'diversi',
- DB_ERROR_NODBSELECTED => 'nessun database selezionato',
- DB_ERROR_NOSUCHFIELD => 'nessun campo trovato',
- DB_ERROR_NOSUCHTABLE => 'nessuna tabella trovata',
- DB_ERROR_NOT_CAPABLE => 'DB backend non abilitato',
- DB_ERROR_NOT_FOUND => 'non trovato',
- DB_ERROR_NOT_LOCKED => 'non bloccato',
- DB_ERROR_SYNTAX => 'errore di sintassi',
- DB_ERROR_UNSUPPORTED => 'non supportato',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'valore inserito troppo grande per una colonna',
- DB_ERROR_INVALID_DSN => 'DSN non valido',
- DB_ERROR_CONNECT_FAILED => 'connessione fallita',
- 0 => 'nessun errore', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'dati inseriti insufficienti',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'estensione non trovata',
- DB_ERROR_NOSUCHDB => 'database non trovato',
- DB_ERROR_ACCESS_VIOLATION => 'permessi insufficienti'
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-nl.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-nl.inc.php
deleted file mode 100644
index 43e3ee6..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-nl.inc.php
+++ /dev/null
@@ -1,32 +0,0 @@
- 'nl',
- DB_ERROR => 'onbekende fout',
- DB_ERROR_ALREADY_EXISTS => 'bestaat al',
- DB_ERROR_CANNOT_CREATE => 'kan niet aanmaken',
- DB_ERROR_CANNOT_DELETE => 'kan niet wissen',
- DB_ERROR_CANNOT_DROP => 'kan niet verwijderen',
- DB_ERROR_CONSTRAINT => 'constraint overtreding',
- DB_ERROR_DIVZERO => 'poging tot delen door nul',
- DB_ERROR_INVALID => 'ongeldig',
- DB_ERROR_INVALID_DATE => 'ongeldige datum of tijd',
- DB_ERROR_INVALID_NUMBER => 'ongeldig nummer',
- DB_ERROR_MISMATCH => 'is incorrect',
- DB_ERROR_NODBSELECTED => 'geen database geselecteerd',
- DB_ERROR_NOSUCHFIELD => 'onbekend veld',
- DB_ERROR_NOSUCHTABLE => 'onbekende tabel',
- DB_ERROR_NOT_CAPABLE => 'database systeem is niet tot uitvoer in staat',
- DB_ERROR_NOT_FOUND => 'niet gevonden',
- DB_ERROR_NOT_LOCKED => 'niet vergrendeld',
- DB_ERROR_SYNTAX => 'syntaxis fout',
- DB_ERROR_UNSUPPORTED => 'niet ondersteund',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'waarde telling op rij',
- DB_ERROR_INVALID_DSN => 'ongeldige DSN',
- DB_ERROR_CONNECT_FAILED => 'connectie mislukt',
- 0 => 'geen fout', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'onvoldoende data gegeven',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'extensie niet gevonden',
- DB_ERROR_NOSUCHDB => 'onbekende database',
- DB_ERROR_ACCESS_VIOLATION => 'onvoldoende rechten'
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-pl.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-pl.inc.php
deleted file mode 100644
index 96bc919..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-pl.inc.php
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'pl',
- DB_ERROR => 'niezidentyfikowany bd',
- DB_ERROR_ALREADY_EXISTS => 'ju istniej',
- DB_ERROR_CANNOT_CREATE => 'nie mona stworzy',
- DB_ERROR_CANNOT_DELETE => 'nie mona usun',
- DB_ERROR_CANNOT_DROP => 'nie mona porzuci',
- DB_ERROR_CONSTRAINT => 'pogwacenie uprawnie',
- DB_ERROR_DIVZERO => 'dzielenie przez zero',
- DB_ERROR_INVALID => 'bdny',
- DB_ERROR_INVALID_DATE => 'bdna godzina lub data',
- DB_ERROR_INVALID_NUMBER => 'bdny numer',
- DB_ERROR_MISMATCH => 'niedopasowanie',
- DB_ERROR_NODBSELECTED => 'baza danych nie zostaa wybrana',
- DB_ERROR_NOSUCHFIELD => 'nie znaleziono pola',
- DB_ERROR_NOSUCHTABLE => 'nie znaleziono tabeli',
- DB_ERROR_NOT_CAPABLE => 'nie zdolny',
- DB_ERROR_NOT_FOUND => 'nie znaleziono',
- DB_ERROR_NOT_LOCKED => 'nie zakmnity',
- DB_ERROR_SYNTAX => 'bd skadni',
- DB_ERROR_UNSUPPORTED => 'nie obsuguje',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'warto liczona w szeregu',
- DB_ERROR_INVALID_DSN => 'bdny DSN',
- DB_ERROR_CONNECT_FAILED => 'poczenie nie zostao zrealizowane',
- 0 => 'brak bdw', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'niedostateczna ilo informacji',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'nie znaleziono rozszerzenia',
- DB_ERROR_NOSUCHDB => 'nie znaleziono bazy',
- DB_ERROR_ACCESS_VIOLATION => 'niedostateczne uprawnienia'
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-pt-br.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-pt-br.inc.php
deleted file mode 100644
index 865881f..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-pt-br.inc.php
+++ /dev/null
@@ -1,34 +0,0 @@
- 'pt-br',
- DB_ERROR => 'erro desconhecido',
- DB_ERROR_ALREADY_EXISTS => 'j existe',
- DB_ERROR_CANNOT_CREATE => 'impossvel criar',
- DB_ERROR_CANNOT_DELETE => 'impossvel exclur',
- DB_ERROR_CANNOT_DROP => 'impossvel remover',
- DB_ERROR_CONSTRAINT => 'violao do confinamente',
- DB_ERROR_DIVZERO => 'diviso por zero',
- DB_ERROR_INVALID => 'invlido',
- DB_ERROR_INVALID_DATE => 'data ou hora invlida',
- DB_ERROR_INVALID_NUMBER => 'nmero invlido',
- DB_ERROR_MISMATCH => 'erro',
- DB_ERROR_NODBSELECTED => 'nenhum banco de dados selecionado',
- DB_ERROR_NOSUCHFIELD => 'campo invlido',
- DB_ERROR_NOSUCHTABLE => 'tabela inexistente',
- DB_ERROR_NOT_CAPABLE => 'capacidade invlida para este BD',
- DB_ERROR_NOT_FOUND => 'no encontrado',
- DB_ERROR_NOT_LOCKED => 'no bloqueado',
- DB_ERROR_SYNTAX => 'erro de sintaxe',
- DB_ERROR_UNSUPPORTED =>
-'no suportado',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'a quantidade de colunas no corresponde ao de valores',
- DB_ERROR_INVALID_DSN => 'DSN invlido',
- DB_ERROR_CONNECT_FAILED => 'falha na conexo',
- 0 => 'sem erro', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'dados insuficientes',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'extenso no encontrada',
- DB_ERROR_NOSUCHDB => 'banco de dados no encontrado',
- DB_ERROR_ACCESS_VIOLATION => 'permisso insuficiente'
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-ro.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-ro.inc.php
deleted file mode 100644
index b6ddd31..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-ro.inc.php
+++ /dev/null
@@ -1,34 +0,0 @@
- */
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'ro',
- DB_ERROR => 'eroare necunoscuta',
- DB_ERROR_ALREADY_EXISTS => 'deja exista',
- DB_ERROR_CANNOT_CREATE => 'nu se poate creea',
- DB_ERROR_CANNOT_DELETE => 'nu se poate sterge',
- DB_ERROR_CANNOT_DROP => 'nu se poate executa drop',
- DB_ERROR_CONSTRAINT => 'violare de constrain',
- DB_ERROR_DIVZERO => 'se divide la zero',
- DB_ERROR_INVALID => 'invalid',
- DB_ERROR_INVALID_DATE => 'data sau timp invalide',
- DB_ERROR_INVALID_NUMBER => 'numar invalid',
- DB_ERROR_MISMATCH => 'nepotrivire-mismatch',
- DB_ERROR_NODBSELECTED => 'nu exista baza de date selectata',
- DB_ERROR_NOSUCHFIELD => 'camp inexistent',
- DB_ERROR_NOSUCHTABLE => 'tabela inexistenta',
- DB_ERROR_NOT_CAPABLE => 'functie optionala neinstalata',
- DB_ERROR_NOT_FOUND => 'negasit',
- DB_ERROR_NOT_LOCKED => 'neblocat',
- DB_ERROR_SYNTAX => 'eroare de sintaxa',
- DB_ERROR_UNSUPPORTED => 'nu e suportat',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'valoare prea mare pentru coloana',
- DB_ERROR_INVALID_DSN => 'DSN invalid',
- DB_ERROR_CONNECT_FAILED => 'conectare esuata',
- 0 => 'fara eroare', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'data introduse insuficiente',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'extensie negasita',
- DB_ERROR_NOSUCHDB => 'nu exista baza de date',
- DB_ERROR_ACCESS_VIOLATION => 'permisiuni insuficiente'
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-ru1251.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-ru1251.inc.php
deleted file mode 100644
index c0ce5f2..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-ru1251.inc.php
+++ /dev/null
@@ -1,34 +0,0 @@
- 'ru1251',
- DB_ERROR => ' ',
- DB_ERROR_ALREADY_EXISTS => ' ',
- DB_ERROR_CANNOT_CREATE => ' ',
- DB_ERROR_CANNOT_DELETE => ' ',
- DB_ERROR_CANNOT_DROP => ' (drop)',
- DB_ERROR_CONSTRAINT => ' ',
- DB_ERROR_DIVZERO => ' 0',
- DB_ERROR_INVALID => '',
- DB_ERROR_INVALID_DATE => ' ',
- DB_ERROR_INVALID_NUMBER => ' ',
- DB_ERROR_MISMATCH => '',
- DB_ERROR_NODBSELECTED => ' ',
- DB_ERROR_NOSUCHFIELD => ' ',
- DB_ERROR_NOSUCHTABLE => ' ',
- DB_ERROR_NOT_CAPABLE => ' ',
- DB_ERROR_NOT_FOUND => ' ',
- DB_ERROR_NOT_LOCKED => ' ',
- DB_ERROR_SYNTAX => ' ',
- DB_ERROR_UNSUPPORTED => ' ',
- DB_ERROR_VALUE_COUNT_ON_ROW => ' ',
- DB_ERROR_INVALID_DSN => ' DSN',
- DB_ERROR_CONNECT_FAILED => ' ',
- 0 => ' ', // DB_OK
- DB_ERROR_NEED_MORE_DATA => ' ',
- DB_ERROR_EXTENSION_NOT_FOUND=> ' ',
- DB_ERROR_NOSUCHDB => ' ',
- DB_ERROR_ACCESS_VIOLATION => ' '
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-sv.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-sv.inc.php
deleted file mode 100644
index 37cef4e..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-sv.inc.php
+++ /dev/null
@@ -1,32 +0,0 @@
- 'en',
- DB_ERROR => 'Oknt fel',
- DB_ERROR_ALREADY_EXISTS => 'finns redan',
- DB_ERROR_CANNOT_CREATE => 'kan inte skapa',
- DB_ERROR_CANNOT_DELETE => 'kan inte ta bort',
- DB_ERROR_CANNOT_DROP => 'kan inte slppa',
- DB_ERROR_CONSTRAINT => 'begrnsning krnkt',
- DB_ERROR_DIVZERO => 'division med noll',
- DB_ERROR_INVALID => 'ogiltig',
- DB_ERROR_INVALID_DATE => 'ogiltigt datum eller tid',
- DB_ERROR_INVALID_NUMBER => 'ogiltigt tal',
- DB_ERROR_MISMATCH => 'felaktig matchning',
- DB_ERROR_NODBSELECTED => 'ingen databas vald',
- DB_ERROR_NOSUCHFIELD => 'inget sdant flt',
- DB_ERROR_NOSUCHTABLE => 'ingen sdan tabell',
- DB_ERROR_NOT_CAPABLE => 'DB backend klarar det inte',
- DB_ERROR_NOT_FOUND => 'finns inte',
- DB_ERROR_NOT_LOCKED => 'inte lst',
- DB_ERROR_SYNTAX => 'syntaxfel',
- DB_ERROR_UNSUPPORTED => 'stds ej',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'vrde rknat p rad',
- DB_ERROR_INVALID_DSN => 'ogiltig DSN',
- DB_ERROR_CONNECT_FAILED => 'anslutning misslyckades',
- 0 => 'inget fel', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'otillrckligt med data angivet',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'utkning hittades ej',
- DB_ERROR_NOSUCHDB => 'ingen sdan databas',
- DB_ERROR_ACCESS_VIOLATION => 'otillrckliga rttigheter'
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb-uk1251.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb-uk1251.inc.php
deleted file mode 100644
index 01002b7..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb-uk1251.inc.php
+++ /dev/null
@@ -1,34 +0,0 @@
- 'uk1251',
- DB_ERROR => ' ',
- DB_ERROR_ALREADY_EXISTS => ' ',
- DB_ERROR_CANNOT_CREATE => ' ',
- DB_ERROR_CANNOT_DELETE => ' ',
- DB_ERROR_CANNOT_DROP => ' (drop)',
- DB_ERROR_CONSTRAINT => ' ',
- DB_ERROR_DIVZERO => ' 0',
- DB_ERROR_INVALID => '',
- DB_ERROR_INVALID_DATE => ' ',
- DB_ERROR_INVALID_NUMBER => ' ',
- DB_ERROR_MISMATCH => '',
- DB_ERROR_NODBSELECTED => ' ',
- DB_ERROR_NOSUCHFIELD => ' ',
- DB_ERROR_NOSUCHTABLE => ' ',
- DB_ERROR_NOT_CAPABLE => ' ',
- DB_ERROR_NOT_FOUND => ' ',
- DB_ERROR_NOT_LOCKED => ' ',
- DB_ERROR_SYNTAX => ' ',
- DB_ERROR_UNSUPPORTED => ' ',
- DB_ERROR_VALUE_COUNT_ON_ROW => ' ',
- DB_ERROR_INVALID_DSN => ' DSN',
- DB_ERROR_CONNECT_FAILED => '\' ',
- 0 => ' ', // DB_OK
- DB_ERROR_NEED_MORE_DATA => ' ',
- DB_ERROR_EXTENSION_NOT_FOUND=> ' ',
- DB_ERROR_NOSUCHDB => ' ',
- DB_ERROR_ACCESS_VIOLATION => ' '
-);
diff --git a/sources/vendor/adodb/adodb-php/lang/adodb_th.inc.php b/sources/vendor/adodb/adodb-php/lang/adodb_th.inc.php
deleted file mode 100644
index 9bdc3f8..0000000
--- a/sources/vendor/adodb/adodb-php/lang/adodb_th.inc.php
+++ /dev/null
@@ -1,32 +0,0 @@
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'th',
- DB_ERROR => 'error ไม่รู้สาเหตุ',
- DB_ERROR_ALREADY_EXISTS => 'มี?ล้ว',
- DB_ERROR_CANNOT_CREATE => 'สร้างไม่ได้',
- DB_ERROR_CANNOT_DELETE => 'ลบไม่ได้',
- DB_ERROR_CANNOT_DROP => 'drop ไม่ได้',
- DB_ERROR_CONSTRAINT => 'constraint violation',
- DB_ERROR_DIVZERO => 'หา?ด้วยสู?',
- DB_ERROR_INVALID => 'ไม่ valid',
- DB_ERROR_INVALID_DATE => 'วันที่ เวลา ไม่ valid',
- DB_ERROR_INVALID_NUMBER => 'เลขไม่ valid',
- DB_ERROR_MISMATCH => 'mismatch',
- DB_ERROR_NODBSELECTED => 'ไม่ได้เลือ??านข้อมูล',
- DB_ERROR_NOSUCHFIELD => 'ไม่มีฟีลด์นี้',
- DB_ERROR_NOSUCHTABLE => 'ไม่มีตารางนี้',
- DB_ERROR_NOT_CAPABLE => 'DB backend not capable',
- DB_ERROR_NOT_FOUND => 'ไม่พบ',
- DB_ERROR_NOT_LOCKED => 'ไม่ได้ล๊อ?',
- DB_ERROR_SYNTAX => 'ผิด syntax',
- DB_ERROR_UNSUPPORTED => 'ไม่ support',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'value count on row',
- DB_ERROR_INVALID_DSN => 'invalid DSN',
- DB_ERROR_CONNECT_FAILED => 'ไม่สามารถ connect',
- 0 => 'no error', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'ข้อมูลไม่เพียงพอ',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'ไม่พบ extension',
- DB_ERROR_NOSUCHDB => 'ไม่มีข้อมูลนี้',
- DB_ERROR_ACCESS_VIOLATION => 'permissions ไม่พอ'
-);
diff --git a/sources/vendor/adodb/adodb-php/license.txt b/sources/vendor/adodb/adodb-php/license.txt
deleted file mode 100644
index d90f4e5..0000000
--- a/sources/vendor/adodb/adodb-php/license.txt
+++ /dev/null
@@ -1,182 +0,0 @@
-ADOdb is dual licensed using BSD and LGPL.
-
-In plain English, you do not need to distribute your application in source code form, nor do you need to distribute ADOdb source code, provided you follow the rest of terms of the BSD license.
-
-For more info about ADOdb, visit http://adodb.sourceforge.net/
-
-BSD Style-License
-=================
-
-Copyright (c) 2000, 2001, 2002, 2003, 2004 John Lim
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-Redistributions of source code must retain the above copyright notice, this list
-of conditions and the following disclaimer.
-
-Redistributions in binary form must reproduce the above copyright notice, this list
-of conditions and the following disclaimer in the documentation and/or other materials
-provided with the distribution.
-
-Neither the name of the John Lim nor the names of its contributors may be used to
-endorse or promote products derived from this software without specific prior written
-permission.
-
-DISCLAIMER:
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
-JOHN LIM OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-==========================================================
-GNU LESSER GENERAL PUBLIC LICENSE
-Version 2.1, February 1999
-
-Copyright (C) 1991, 1999 Free Software Foundation, Inc.
-59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-
-Preamble
-The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
-
-This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
-
-When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
-
-To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
-
-For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
-
-We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
-
-To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.
-
-Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.
-
-Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
-
-When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
-
-We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
-
-For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
-
-In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
-
-Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
-
-The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
-
-
-TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".
-
-A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
-
-The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
-
-"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
-
-Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
-
-1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
-
-You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
-
-2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
-
-
-a) The modified work must itself be a software library.
-b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
-c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
-d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
-(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
-
-3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
-
-Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
-
-This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
-
-4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
-
-If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
-
-5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
-
-However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
-
-When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
-
-If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
-
-Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
-
-6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
-
-You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
-
-
-a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
-b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
-c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
-d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
-e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
-For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
-
-It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
-
-7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
-
-
-a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
-b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
-8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
-
-9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
-
-10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
-
-11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
-
-This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
-
-12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
-
-13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
-
-14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
-
-NO WARRANTY
-
-15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-
-END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/sources/vendor/adodb/adodb-php/pear/Auth/Container/ADOdb.php b/sources/vendor/adodb/adodb-php/pear/Auth/Container/ADOdb.php
deleted file mode 100644
index f000fb5..0000000
--- a/sources/vendor/adodb/adodb-php/pear/Auth/Container/ADOdb.php
+++ /dev/null
@@ -1,404 +0,0 @@
-
- Richard Tango-Lowy
-*/
-
-require_once 'Auth/Container.php';
-require_once 'adodb.inc.php';
-require_once 'adodb-pear.inc.php';
-require_once 'adodb-errorpear.inc.php';
-
-/**
- * Storage driver for fetching login data from a database using ADOdb-PHP.
- *
- * This storage driver can use all databases which are supported
- * by the ADBdb DB abstraction layer to fetch login data.
- * See http://php.weblogs.com/adodb for information on ADOdb.
- * NOTE: The ADOdb directory MUST be in your PHP include_path!
- *
- * @author Richard Tango-Lowy
- * @package Auth
- * @version $Revision: 1.3 $
- */
-class Auth_Container_ADOdb extends Auth_Container
-{
-
- /**
- * Additional options for the storage container
- * @var array
- */
- var $options = array();
-
- /**
- * DB object
- * @var object
- */
- var $db = null;
- var $dsn = '';
-
- /**
- * User that is currently selected from the DB.
- * @var string
- */
- var $activeUser = '';
-
- // {{{ Constructor
-
- /**
- * Constructor of the container class
- *
- * Initate connection to the database via PEAR::ADOdb
- *
- * @param string Connection data or DB object
- * @return object Returns an error object if something went wrong
- */
- function Auth_Container_ADOdb($dsn)
- {
- $this->_setDefaults();
-
- if (is_array($dsn)) {
- $this->_parseOptions($dsn);
-
- if (empty($this->options['dsn'])) {
- PEAR::raiseError('No connection parameters specified!');
- }
- } else {
- // Extract db_type from dsn string.
- $this->options['dsn'] = $dsn;
- }
- }
-
- // }}}
- // {{{ _connect()
-
- /**
- * Connect to database by using the given DSN string
- *
- * @access private
- * @param string DSN string
- * @return mixed Object on error, otherwise bool
- */
- function _connect($dsn)
- {
- if (is_string($dsn) || is_array($dsn)) {
- if(!$this->db) {
- $this->db = ADONewConnection($dsn);
- if( $err = ADODB_Pear_error() ) {
- return PEAR::raiseError($err);
- }
- }
-
- } else {
- return PEAR::raiseError('The given dsn was not valid in file ' . __FILE__ . ' at line ' . __LINE__,
- 41,
- PEAR_ERROR_RETURN,
- null,
- null
- );
- }
-
- if(!$this->db) {
- return PEAR::raiseError(ADODB_Pear_error());
- } else {
- return true;
- }
- }
-
- // }}}
- // {{{ _prepare()
-
- /**
- * Prepare database connection
- *
- * This function checks if we have already opened a connection to
- * the database. If that's not the case, a new connection is opened.
- *
- * @access private
- * @return mixed True or a DB error object.
- */
- function _prepare()
- {
- if(!$this->db) {
- $res = $this->_connect($this->options['dsn']);
- }
- return true;
- }
-
- // }}}
- // {{{ query()
-
- /**
- * Prepare query to the database
- *
- * This function checks if we have already opened a connection to
- * the database. If that's not the case, a new connection is opened.
- * After that the query is passed to the database.
- *
- * @access public
- * @param string Query string
- * @return mixed a DB_result object or DB_OK on success, a DB
- * or PEAR error on failure
- */
- function query($query)
- {
- $err = $this->_prepare();
- if ($err !== true) {
- return $err;
- }
- return $this->db->query($query);
- }
-
- // }}}
- // {{{ _setDefaults()
-
- /**
- * Set some default options
- *
- * @access private
- * @return void
- */
- function _setDefaults()
- {
- $this->options['db_type'] = 'mysql';
- $this->options['table'] = 'auth';
- $this->options['usernamecol'] = 'username';
- $this->options['passwordcol'] = 'password';
- $this->options['dsn'] = '';
- $this->options['db_fields'] = '';
- $this->options['cryptType'] = 'md5';
- }
-
- // }}}
- // {{{ _parseOptions()
-
- /**
- * Parse options passed to the container class
- *
- * @access private
- * @param array
- */
- function _parseOptions($array)
- {
- foreach ($array as $key => $value) {
- if (isset($this->options[$key])) {
- $this->options[$key] = $value;
- }
- }
-
- /* Include additional fields if they exist */
- if(!empty($this->options['db_fields'])){
- if(is_array($this->options['db_fields'])){
- $this->options['db_fields'] = join($this->options['db_fields'], ', ');
- }
- $this->options['db_fields'] = ', '.$this->options['db_fields'];
- }
- }
-
- // }}}
- // {{{ fetchData()
-
- /**
- * Get user information from database
- *
- * This function uses the given username to fetch
- * the corresponding login data from the database
- * table. If an account that matches the passed username
- * and password is found, the function returns true.
- * Otherwise it returns false.
- *
- * @param string Username
- * @param string Password
- * @return mixed Error object or boolean
- */
- function fetchData($username, $password)
- {
- // Prepare for a database query
- $err = $this->_prepare();
- if ($err !== true) {
- return PEAR::raiseError($err->getMessage(), $err->getCode());
- }
-
- // Find if db_fields contains a *, i so assume all col are selected
- if(strstr($this->options['db_fields'], '*')){
- $sql_from = "*";
- }
- else{
- $sql_from = $this->options['usernamecol'] . ", ".$this->options['passwordcol'].$this->options['db_fields'];
- }
-
- $query = "SELECT ".$sql_from.
- " FROM ".$this->options['table'].
- " WHERE ".$this->options['usernamecol']." = " . $this->db->Quote($username);
-
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- $rset = $this->db->Execute( $query );
- $res = $rset->fetchRow();
-
- if (DB::isError($res)) {
- return PEAR::raiseError($res->getMessage(), $res->getCode());
- }
- if (!is_array($res)) {
- $this->activeUser = '';
- return false;
- }
- if ($this->verifyPassword(trim($password, "\r\n"),
- trim($res[$this->options['passwordcol']], "\r\n"),
- $this->options['cryptType'])) {
- // Store additional field values in the session
- foreach ($res as $key => $value) {
- if ($key == $this->options['passwordcol'] ||
- $key == $this->options['usernamecol']) {
- continue;
- }
- // Use reference to the auth object if exists
- // This is because the auth session variable can change so a static call to setAuthData does not make sence
- if(is_object($this->_auth_obj)){
- $this->_auth_obj->setAuthData($key, $value);
- } else {
- Auth::setAuthData($key, $value);
- }
- }
-
- return true;
- }
-
- $this->activeUser = $res[$this->options['usernamecol']];
- return false;
- }
-
- // }}}
- // {{{ listUsers()
-
- function listUsers()
- {
- $err = $this->_prepare();
- if ($err !== true) {
- return PEAR::raiseError($err->getMessage(), $err->getCode());
- }
-
- $retVal = array();
-
- // Find if db_fileds contains a *, i so assume all col are selected
- if(strstr($this->options['db_fields'], '*')){
- $sql_from = "*";
- }
- else{
- $sql_from = $this->options['usernamecol'] . ", ".$this->options['passwordcol'].$this->options['db_fields'];
- }
-
- $query = sprintf("SELECT %s FROM %s",
- $sql_from,
- $this->options['table']
- );
- $res = $this->db->getAll($query, null, DB_FETCHMODE_ASSOC);
-
- if (DB::isError($res)) {
- return PEAR::raiseError($res->getMessage(), $res->getCode());
- } else {
- foreach ($res as $user) {
- $user['username'] = $user[$this->options['usernamecol']];
- $retVal[] = $user;
- }
- }
- return $retVal;
- }
-
- // }}}
- // {{{ addUser()
-
- /**
- * Add user to the storage container
- *
- * @access public
- * @param string Username
- * @param string Password
- * @param mixed Additional information that are stored in the DB
- *
- * @return mixed True on success, otherwise error object
- */
- function addUser($username, $password, $additional = "")
- {
- if (function_exists($this->options['cryptType'])) {
- $cryptFunction = $this->options['cryptType'];
- } else {
- $cryptFunction = 'md5';
- }
-
- $additional_key = '';
- $additional_value = '';
-
- if (is_array($additional)) {
- foreach ($additional as $key => $value) {
- $additional_key .= ', ' . $key;
- $additional_value .= ", '" . $value . "'";
- }
- }
-
- $query = sprintf("INSERT INTO %s (%s, %s%s) VALUES ('%s', '%s'%s)",
- $this->options['table'],
- $this->options['usernamecol'],
- $this->options['passwordcol'],
- $additional_key,
- $username,
- $cryptFunction($password),
- $additional_value
- );
-
- $res = $this->query($query);
-
- if (DB::isError($res)) {
- return PEAR::raiseError($res->getMessage(), $res->getCode());
- } else {
- return true;
- }
- }
-
- // }}}
- // {{{ removeUser()
-
- /**
- * Remove user from the storage container
- *
- * @access public
- * @param string Username
- *
- * @return mixed True on success, otherwise error object
- */
- function removeUser($username)
- {
- $query = sprintf("DELETE FROM %s WHERE %s = '%s'",
- $this->options['table'],
- $this->options['usernamecol'],
- $username
- );
-
- $res = $this->query($query);
-
- if (DB::isError($res)) {
- return PEAR::raiseError($res->getMessage(), $res->getCode());
- } else {
- return true;
- }
- }
-
- // }}}
-}
-
-function showDbg( $string ) {
- print "
--- $string";
-}
-function dump( $var, $str, $vardump = false ) {
- print "$str ";
- ( !$vardump ) ? ( print_r( $var )) : ( var_dump( $var ));
- print " ";
-}
diff --git a/sources/vendor/adodb/adodb-php/pear/auth_adodb_example.php b/sources/vendor/adodb/adodb-php/pear/auth_adodb_example.php
deleted file mode 100644
index 3b7cf5e..0000000
--- a/sources/vendor/adodb/adodb-php/pear/auth_adodb_example.php
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
- $dsn, 'table' => 'auth', 'cryptType' => 'none',
- 'usernamecol' => 'username', 'passwordcol' => 'password');
-$a = new Auth("ADOdb", $params, "loginFunction");
-$a->start();
-
-if ($a->getAuth()) {
- echo "Success";
- // * The output of your site goes here.
-}
diff --git a/sources/vendor/adodb/adodb-php/pear/readme.Auth.txt b/sources/vendor/adodb/adodb-php/pear/readme.Auth.txt
deleted file mode 100644
index f5b162c..0000000
--- a/sources/vendor/adodb/adodb-php/pear/readme.Auth.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-From: Rich Tango-Lowy (richtl#arscognita.com)
-Date: Sat, May 29, 2004 11:20 am
-
-OK, I hacked out an ADOdb container for PEAR-Auth. The error handling's
-a bit of a mess, but all the methods work.
-
-Copy ADOdb.php to your pear/Auth/Container/ directory.
-
-Use the ADOdb container exactly as you would the DB
-container, but specify 'ADOdb' instead of 'DB':
-
-$dsn = "mysql://myuser:mypass@localhost/authdb";
-$a = new Auth("ADOdb", $dsn, "loginFunction");
-
-
--------------------
-
-John Lim adds:
-
-See http://pear.php.net/manual/en/package.authentication.php
diff --git a/sources/vendor/adodb/adodb-php/perf/perf-db2.inc.php b/sources/vendor/adodb/adodb-php/perf/perf-db2.inc.php
deleted file mode 100644
index 9eb0c32..0000000
--- a/sources/vendor/adodb/adodb-php/perf/perf-db2.inc.php
+++ /dev/null
@@ -1,106 +0,0 @@
- array('RATIO',
- "SELECT
- case when sum(POOL_DATA_L_READS+POOL_INDEX_L_READS)=0 then 0
- else 100*(1-sum(POOL_DATA_P_READS+POOL_INDEX_P_READS)/sum(POOL_DATA_L_READS+POOL_INDEX_L_READS)) end
- FROM TABLE(SNAPSHOT_APPL('',-2)) as t",
- '=WarnCacheRatio'),
-
- 'Data Cache',
- 'data cache buffers' => array('DATAC',
- 'select sum(npages) from SYSCAT.BUFFERPOOLS',
- 'See tuning reference .' ),
- 'cache blocksize' => array('DATAC',
- 'select avg(pagesize) from SYSCAT.BUFFERPOOLS',
- '' ),
- 'data cache size' => array('DATAC',
- 'select sum(npages*pagesize) from SYSCAT.BUFFERPOOLS',
- '' ),
- 'Connections',
- 'current connections' => array('SESS',
- "SELECT count(*) FROM TABLE(SNAPSHOT_APPL_INFO('',-2)) as t",
- ''),
-
- false
- );
-
-
- function perf_db2(&$conn)
- {
- $this->conn = $conn;
- }
-
- function Explain($sql,$partial=false)
- {
- $save = $this->conn->LogSQL(false);
- if ($partial) {
- $sqlq = $this->conn->qstr($sql.'%');
- $arr = $this->conn->GetArray("select distinct sql1 from adodb_logsql where sql1 like $sqlq");
- if ($arr) {
- foreach($arr as $row) {
- $sql = reset($row);
- if (crc32($sql) == $partial) break;
- }
- }
- }
- $qno = rand();
- $ok = $this->conn->Execute("EXPLAIN PLAN SET QUERYNO=$qno FOR $sql");
- ob_start();
- if (!$ok) echo "Have EXPLAIN tables been created?
";
- else {
- $rs = $this->conn->Execute("select * from explain_statement where queryno=$qno");
- if ($rs) rs2html($rs);
- }
- $s = ob_get_contents();
- ob_end_clean();
- $this->conn->LogSQL($save);
-
- $s .= $this->Tracer($sql);
- return $s;
- }
-
- /**
- * Gets a list of tables
- *
- * @param int $throwaway discarded variable to match the parent method
- * @return string The formatted table list
- */
- function Tables($throwaway=0)
- {
- $rs = $this->conn->Execute("select tabschema,tabname,card as rows,
- npages pages_used,fpages pages_allocated, tbspace tablespace
- from syscat.tables where tabschema not in ('SYSCAT','SYSIBM','SYSSTAT') order by 1,2");
- return rs2html($rs,false,false,false,false);
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/perf/perf-informix.inc.php b/sources/vendor/adodb/adodb-php/perf/perf-informix.inc.php
deleted file mode 100644
index 6de76c7..0000000
--- a/sources/vendor/adodb/adodb-php/perf/perf-informix.inc.php
+++ /dev/null
@@ -1,69 +0,0 @@
- array('RATIOH',
- "select round((1-(wt.value / (rd.value + wr.value)))*100,2)
- from sysmaster:sysprofile wr, sysmaster:sysprofile rd, sysmaster:sysprofile wt
- where rd.name = 'pagreads' and
- wr.name = 'pagwrites' and
- wt.name = 'buffwts'",
- '=WarnCacheRatio'),
- 'IO',
- 'data reads' => array('IO',
- "select value from sysmaster:sysprofile where name='pagreads'",
- 'Page reads'),
-
- 'data writes' => array('IO',
- "select value from sysmaster:sysprofile where name='pagwrites'",
- 'Page writes'),
-
- 'Connections',
- 'current connections' => array('SESS',
- 'select count(*) from sysmaster:syssessions',
- 'Number of sessions'),
-
- false
-
- );
-
- function perf_informix(&$conn)
- {
- $this->conn = $conn;
- }
-
-}
diff --git a/sources/vendor/adodb/adodb-php/perf/perf-mssql.inc.php b/sources/vendor/adodb/adodb-php/perf/perf-mssql.inc.php
deleted file mode 100644
index 2ff4fea..0000000
--- a/sources/vendor/adodb/adodb-php/perf/perf-mssql.inc.php
+++ /dev/null
@@ -1,162 +0,0 @@
- array('RATIO',
- "select round((a.cntr_value*100.0)/b.cntr_value,2) from master.dbo.sysperfinfo a, master.dbo.sysperfinfo b where a.counter_name = 'Buffer cache hit ratio' and b.counter_name='Buffer cache hit ratio base'",
- '=WarnCacheRatio'),
- 'prepared sql hit ratio' => array('RATIO',
- array('dbcc cachestats','Prepared',1,100),
- ''),
- 'adhoc sql hit ratio' => array('RATIO',
- array('dbcc cachestats','Adhoc',1,100),
- ''),
- 'IO',
- 'data reads' => array('IO',
- "select cntr_value from master.dbo.sysperfinfo where counter_name = 'Page reads/sec'"),
- 'data writes' => array('IO',
- "select cntr_value from master.dbo.sysperfinfo where counter_name = 'Page writes/sec'"),
-
- 'Data Cache',
- 'data cache size' => array('DATAC',
- "select cntr_value*8192 from master.dbo.sysperfinfo where counter_name = 'Total Pages' and object_name='SQLServer:Buffer Manager'",
- '' ),
- 'data cache blocksize' => array('DATAC',
- "select 8192",'page size'),
- 'Connections',
- 'current connections' => array('SESS',
- '=sp_who',
- ''),
- 'max connections' => array('SESS',
- "SELECT @@MAX_CONNECTIONS",
- ''),
-
- false
- );
-
-
- function perf_mssql(&$conn)
- {
- if ($conn->dataProvider == 'odbc') {
- $this->sql1 = 'sql1';
- //$this->explain = false;
- }
- $this->conn = $conn;
- }
-
- function Explain($sql,$partial=false)
- {
-
- $save = $this->conn->LogSQL(false);
- if ($partial) {
- $sqlq = $this->conn->qstr($sql.'%');
- $arr = $this->conn->GetArray("select distinct sql1 from adodb_logsql where sql1 like $sqlq");
- if ($arr) {
- foreach($arr as $row) {
- $sql = reset($row);
- if (crc32($sql) == $partial) break;
- }
- }
- }
-
- $s = 'Explain : '.htmlspecialchars($sql).'
';
- $this->conn->Execute("SET SHOWPLAN_ALL ON;");
- $sql = str_replace('?',"''",$sql);
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $rs = $this->conn->Execute($sql);
- //adodb_printr($rs);
- $ADODB_FETCH_MODE = $save;
- if ($rs && !$rs->EOF) {
- $rs->MoveNext();
- $s .= ' Rows IO CPU Plan ';
- while (!$rs->EOF) {
- $s .= ''.round($rs->fields[8],1).' '.round($rs->fields[9],3).' '.round($rs->fields[10],3).' '.htmlspecialchars($rs->fields[0])." \n"; ## NOTE CORRUPT tag is intentional!!!!
- $rs->MoveNext();
- }
- $s .= '
';
-
- $rs->NextRecordSet();
- }
-
- $this->conn->Execute("SET SHOWPLAN_ALL OFF;");
- $this->conn->LogSQL($save);
- $s .= $this->Tracer($sql);
- return $s;
- }
-
- function Tables()
- {
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- //$this->conn->debug=1;
- $s = 'tablename size_in_k index size reserved size ';
- $rs1 = $this->conn->Execute("select distinct name from sysobjects where xtype='U'");
- if ($rs1) {
- while (!$rs1->EOF) {
- $tab = $rs1->fields[0];
- $tabq = $this->conn->qstr($tab);
- $rs2 = $this->conn->Execute("sp_spaceused $tabq");
- if ($rs2) {
- $s .= ''.$tab.' '.$rs2->fields[3].' '.$rs2->fields[4].' '.$rs2->fields[2].' ';
- $rs2->Close();
- }
- $rs1->MoveNext();
- }
- $rs1->Close();
- }
- $ADODB_FETCH_MODE = $save;
- return $s.'
';
- }
-
- function sp_who()
- {
- $arr = $this->conn->GetArray('sp_who');
- return sizeof($arr);
- }
-
- function HealthCheck($cli=false)
- {
-
- $this->conn->Execute('dbcc traceon(3604)');
- $html = adodb_perf::HealthCheck($cli);
- $this->conn->Execute('dbcc traceoff(3604)');
- return $html;
- }
-
-
-}
diff --git a/sources/vendor/adodb/adodb-php/perf/perf-mssqlnative.inc.php b/sources/vendor/adodb/adodb-php/perf/perf-mssqlnative.inc.php
deleted file mode 100644
index b67d370..0000000
--- a/sources/vendor/adodb/adodb-php/perf/perf-mssqlnative.inc.php
+++ /dev/null
@@ -1,162 +0,0 @@
- array('RATIO',
- "select round((a.cntr_value*100.0)/b.cntr_value,2) from master.dbo.sysperfinfo a, master.dbo.sysperfinfo b where a.counter_name = 'Buffer cache hit ratio' and b.counter_name='Buffer cache hit ratio base'",
- '=WarnCacheRatio'),
- 'prepared sql hit ratio' => array('RATIO',
- array('dbcc cachestats','Prepared',1,100),
- ''),
- 'adhoc sql hit ratio' => array('RATIO',
- array('dbcc cachestats','Adhoc',1,100),
- ''),
- 'IO',
- 'data reads' => array('IO',
- "select cntr_value from master.dbo.sysperfinfo where counter_name = 'Page reads/sec'"),
- 'data writes' => array('IO',
- "select cntr_value from master.dbo.sysperfinfo where counter_name = 'Page writes/sec'"),
-
- 'Data Cache',
- 'data cache size' => array('DATAC',
- "select cntr_value*8192 from master.dbo.sysperfinfo where counter_name = 'Total Pages' and object_name='SQLServer:Buffer Manager'",
- '' ),
- 'data cache blocksize' => array('DATAC',
- "select 8192",'page size'),
- 'Connections',
- 'current connections' => array('SESS',
- '=sp_who',
- ''),
- 'max connections' => array('SESS',
- "SELECT @@MAX_CONNECTIONS",
- ''),
-
- false
- );
-
-
- function perf_mssqlnative(&$conn)
- {
- if ($conn->dataProvider == 'odbc') {
- $this->sql1 = 'sql1';
- //$this->explain = false;
- }
- $this->conn =& $conn;
- }
-
- function Explain($sql,$partial=false)
- {
-
- $save = $this->conn->LogSQL(false);
- if ($partial) {
- $sqlq = $this->conn->qstr($sql.'%');
- $arr = $this->conn->GetArray("select distinct sql1 from adodb_logsql where sql1 like $sqlq");
- if ($arr) {
- foreach($arr as $row) {
- $sql = reset($row);
- if (crc32($sql) == $partial) break;
- }
- }
- }
-
- $s = 'Explain : '.htmlspecialchars($sql).'
';
- $this->conn->Execute("SET SHOWPLAN_ALL ON;");
- $sql = str_replace('?',"''",$sql);
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $rs =& $this->conn->Execute($sql);
- //adodb_printr($rs);
- $ADODB_FETCH_MODE = $save;
- if ($rs) {
- $rs->MoveNext();
- $s .= ' Rows IO CPU Plan ';
- while (!$rs->EOF) {
- $s .= ''.round($rs->fields[8],1).' '.round($rs->fields[9],3).' '.round($rs->fields[10],3).' '.htmlspecialchars($rs->fields[0])." \n"; ## NOTE CORRUPT tag is intentional!!!!
- $rs->MoveNext();
- }
- $s .= '
';
-
- $rs->NextRecordSet();
- }
-
- $this->conn->Execute("SET SHOWPLAN_ALL OFF;");
- $this->conn->LogSQL($save);
- $s .= $this->Tracer($sql);
- return $s;
- }
-
- function Tables($orderby='1')
- {
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- //$this->conn->debug=1;
- $s = 'tablename size_in_k index size reserved size ';
- $rs1 = $this->conn->Execute("select distinct name from sysobjects where xtype='U'");
- if ($rs1) {
- while (!$rs1->EOF) {
- $tab = $rs1->fields[0];
- $tabq = $this->conn->qstr($tab);
- $rs2 = $this->conn->Execute("sp_spaceused $tabq");
- if ($rs2) {
- $s .= ''.$tab.' '.$rs2->fields[3].' '.$rs2->fields[4].' '.$rs2->fields[2].' ';
- $rs2->Close();
- }
- $rs1->MoveNext();
- }
- $rs1->Close();
- }
- $ADODB_FETCH_MODE = $save;
- return $s.'
';
- }
-
- function sp_who()
- {
- $arr = $this->conn->GetArray('sp_who');
- return sizeof($arr);
- }
-
- function HealthCheck($cli=false)
- {
-
- $this->conn->Execute('dbcc traceon(3604)');
- $html = adodb_perf::HealthCheck($cli);
- $this->conn->Execute('dbcc traceoff(3604)');
- return $html;
- }
-
-
-}
diff --git a/sources/vendor/adodb/adodb-php/perf/perf-mysql.inc.php b/sources/vendor/adodb/adodb-php/perf/perf-mysql.inc.php
deleted file mode 100644
index 338654d..0000000
--- a/sources/vendor/adodb/adodb-php/perf/perf-mysql.inc.php
+++ /dev/null
@@ -1,314 +0,0 @@
- array('RATIO',
- '=GetKeyHitRatio',
- '=WarnCacheRatio'),
- 'InnoDB cache hit ratio' => array('RATIO',
- '=GetInnoDBHitRatio',
- '=WarnCacheRatio'),
- 'data cache hit ratio' => array('HIDE', # only if called
- '=FindDBHitRatio',
- '=WarnCacheRatio'),
- 'sql cache hit ratio' => array('RATIO',
- '=GetQHitRatio',
- ''),
- 'IO',
- 'data reads' => array('IO',
- '=GetReads',
- 'Number of selects (Key_reads is not accurate)'),
- 'data writes' => array('IO',
- '=GetWrites',
- 'Number of inserts/updates/deletes * coef (Key_writes is not accurate)'),
-
- 'Data Cache',
- 'MyISAM data cache size' => array('DATAC',
- array("show variables", 'key_buffer_size'),
- '' ),
- 'BDB data cache size' => array('DATAC',
- array("show variables", 'bdb_cache_size'),
- '' ),
- 'InnoDB data cache size' => array('DATAC',
- array("show variables", 'innodb_buffer_pool_size'),
- '' ),
- 'Memory Usage',
- 'read buffer size' => array('CACHE',
- array("show variables", 'read_buffer_size'),
- '(per session)'),
- 'sort buffer size' => array('CACHE',
- array("show variables", 'sort_buffer_size'),
- 'Size of sort buffer (per session)' ),
- 'table cache' => array('CACHE',
- array("show variables", 'table_cache'),
- 'Number of tables to keep open'),
- 'Connections',
- 'current connections' => array('SESS',
- array('show status','Threads_connected'),
- ''),
- 'max connections' => array( 'SESS',
- array("show variables",'max_connections'),
- ''),
-
- false
- );
-
- function perf_mysql(&$conn)
- {
- $this->conn = $conn;
- }
-
- function Explain($sql,$partial=false)
- {
-
- if (strtoupper(substr(trim($sql),0,6)) !== 'SELECT') return 'Unable to EXPLAIN non-select statement
';
- $save = $this->conn->LogSQL(false);
- if ($partial) {
- $sqlq = $this->conn->qstr($sql.'%');
- $arr = $this->conn->GetArray("select distinct sql1 from adodb_logsql where sql1 like $sqlq");
- if ($arr) {
- foreach($arr as $row) {
- $sql = reset($row);
- if (crc32($sql) == $partial) break;
- }
- }
- }
- $sql = str_replace('?',"''",$sql);
-
- if ($partial) {
- $sqlq = $this->conn->qstr($sql.'%');
- $sql = $this->conn->GetOne("select sql1 from adodb_logsql where sql1 like $sqlq");
- }
-
- $s = 'Explain : '.htmlspecialchars($sql).'
';
- $rs = $this->conn->Execute('EXPLAIN '.$sql);
- $s .= rs2html($rs,false,false,false,false);
- $this->conn->LogSQL($save);
- $s .= $this->Tracer($sql);
- return $s;
- }
-
- function Tables()
- {
- if (!$this->tablesSQL) return false;
-
- $rs = $this->conn->Execute($this->tablesSQL);
- if (!$rs) return false;
-
- $html = rs2html($rs,false,false,false,false);
- return $html;
- }
-
- function GetReads()
- {
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $rs = $this->conn->Execute('show status');
-
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- if (!$rs) return 0;
- $val = 0;
- while (!$rs->EOF) {
- switch($rs->fields[0]) {
- case 'Com_select':
- $val = $rs->fields[1];
- $rs->Close();
- return $val;
- }
- $rs->MoveNext();
- }
-
- $rs->Close();
-
- return $val;
- }
-
- function GetWrites()
- {
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $rs = $this->conn->Execute('show status');
-
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- if (!$rs) return 0;
- $val = 0.0;
- while (!$rs->EOF) {
- switch($rs->fields[0]) {
- case 'Com_insert':
- $val += $rs->fields[1]; break;
- case 'Com_delete':
- $val += $rs->fields[1]; break;
- case 'Com_update':
- $val += $rs->fields[1]/2;
- $rs->Close();
- return $val;
- }
- $rs->MoveNext();
- }
-
- $rs->Close();
-
- return $val;
- }
-
- function FindDBHitRatio()
- {
- // first find out type of table
- //$this->conn->debug=1;
-
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $rs = $this->conn->Execute('show table status');
-
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- if (!$rs) return '';
- $type = strtoupper($rs->fields[1]);
- $rs->Close();
- switch($type){
- case 'MYISAM':
- case 'ISAM':
- return $this->DBParameter('MyISAM cache hit ratio').' (MyISAM)';
- case 'INNODB':
- return $this->DBParameter('InnoDB cache hit ratio').' (InnoDB)';
- default:
- return $type.' not supported';
- }
-
- }
-
- function GetQHitRatio()
- {
- //Total number of queries = Qcache_inserts + Qcache_hits + Qcache_not_cached
- $hits = $this->_DBParameter(array("show status","Qcache_hits"));
- $total = $this->_DBParameter(array("show status","Qcache_inserts"));
- $total += $this->_DBParameter(array("show status","Qcache_not_cached"));
-
- $total += $hits;
- if ($total) return round(($hits*100)/$total,2);
- return 0;
- }
-
- /*
- Use session variable to store Hit percentage, because MySQL
- does not remember last value of SHOW INNODB STATUS hit ratio
-
- # 1st query to SHOW INNODB STATUS
- 0.00 reads/s, 0.00 creates/s, 0.00 writes/s
- Buffer pool hit rate 1000 / 1000
-
- # 2nd query to SHOW INNODB STATUS
- 0.00 reads/s, 0.00 creates/s, 0.00 writes/s
- No buffer pool activity since the last printout
- */
- function GetInnoDBHitRatio()
- {
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $rs = $this->conn->Execute('show engine innodb status');
-
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- if (!$rs || $rs->EOF) return 0;
- $stat = $rs->fields[0];
- $rs->Close();
- $at = strpos($stat,'Buffer pool hit rate');
- $stat = substr($stat,$at,200);
- if (preg_match('!Buffer pool hit rate\s*([0-9]*) / ([0-9]*)!',$stat,$arr)) {
- $val = 100*$arr[1]/$arr[2];
- $_SESSION['INNODB_HIT_PCT'] = $val;
- return round($val,2);
- } else {
- if (isset($_SESSION['INNODB_HIT_PCT'])) return $_SESSION['INNODB_HIT_PCT'];
- return 0;
- }
- return 0;
- }
-
- function GetKeyHitRatio()
- {
- $hits = $this->_DBParameter(array("show status","Key_read_requests"));
- $reqs = $this->_DBParameter(array("show status","Key_reads"));
- if ($reqs == 0) return 0;
-
- return round(($hits/($reqs+$hits))*100,2);
- }
-
- // start hack
- var $optimizeTableLow = 'CHECK TABLE %s FAST QUICK';
- var $optimizeTableHigh = 'OPTIMIZE TABLE %s';
-
- /**
- * @see adodb_perf#optimizeTable
- */
- function optimizeTable( $table, $mode = ADODB_OPT_LOW)
- {
- if ( !is_string( $table)) return false;
-
- $conn = $this->conn;
- if ( !$conn) return false;
-
- $sql = '';
- switch( $mode) {
- case ADODB_OPT_LOW : $sql = $this->optimizeTableLow; break;
- case ADODB_OPT_HIGH : $sql = $this->optimizeTableHigh; break;
- default :
- {
- // May dont use __FUNCTION__ constant for BC (__FUNCTION__ Added in PHP 4.3.0)
- ADOConnection::outp( sprintf( "%s: '%s' using of undefined mode '%s'
", __CLASS__, __FUNCTION__, $mode));
- return false;
- }
- }
- $sql = sprintf( $sql, $table);
-
- return $conn->Execute( $sql) !== false;
- }
- // end hack
-}
diff --git a/sources/vendor/adodb/adodb-php/perf/perf-oci8.inc.php b/sources/vendor/adodb/adodb-php/perf/perf-oci8.inc.php
deleted file mode 100644
index 5dbd7c8..0000000
--- a/sources/vendor/adodb/adodb-php/perf/perf-oci8.inc.php
+++ /dev/null
@@ -1,701 +0,0 @@
- array('RATIOH',
- "select round((1-(phy.value / (cur.value + con.value)))*100,2)
- from v\$sysstat cur, v\$sysstat con, v\$sysstat phy
- where cur.name = 'db block gets' and
- con.name = 'consistent gets' and
- phy.name = 'physical reads'",
- '=WarnCacheRatio'),
-
- 'sql cache hit ratio' => array( 'RATIOH',
- 'select round(100*(sum(pins)-sum(reloads))/sum(pins),2) from v$librarycache',
- 'increase shared_pool_size if too ratio low'),
-
- 'datadict cache hit ratio' => array('RATIOH',
- "select
- round((1 - (sum(getmisses) / (sum(gets) +
- sum(getmisses))))*100,2)
- from v\$rowcache",
- 'increase shared_pool_size if too ratio low'),
-
- 'memory sort ratio' => array('RATIOH',
- "SELECT ROUND((100 * b.VALUE) /DECODE ((a.VALUE + b.VALUE),
- 0,1,(a.VALUE + b.VALUE)),2)
-FROM v\$sysstat a,
- v\$sysstat b
-WHERE a.name = 'sorts (disk)'
-AND b.name = 'sorts (memory)'",
- "% of memory sorts compared to disk sorts - should be over 95%"),
-
- 'IO',
- 'data reads' => array('IO',
- "select value from v\$sysstat where name='physical reads'"),
-
- 'data writes' => array('IO',
- "select value from v\$sysstat where name='physical writes'"),
-
- 'Data Cache',
-
- 'data cache buffers' => array( 'DATAC',
- "select a.value/b.value from v\$parameter a, v\$parameter b
- where a.name = 'db_cache_size' and b.name= 'db_block_size'",
- 'Number of cache buffers. Tune db_cache_size if the data cache hit ratio is too low.'),
- 'data cache blocksize' => array('DATAC',
- "select value from v\$parameter where name='db_block_size'",
- '' ),
-
- 'Memory Pools',
- 'Mem Max Target (11g+)' => array( 'DATAC',
- "select value from v\$parameter where name = 'memory_max_target'",
- 'The memory_max_size is the maximum value to which memory_target can be set.' ),
- 'Memory target (11g+)' => array( 'DATAC',
- "select value from v\$parameter where name = 'memory_target'",
- 'If memory_target is defined then SGA and PGA targets are consolidated into one memory_target.' ),
- 'SGA Max Size' => array( 'DATAC',
- "select nvl(value,0)/1024.0/1024 || 'M' from v\$parameter where name = 'sga_max_size'",
- 'The sga_max_size is the maximum value to which sga_target can be set.' ),
- 'SGA target' => array( 'DATAC',
- "select nvl(value,0)/1024.0/1024 || 'M' from v\$parameter where name = 'sga_target'",
- 'If sga_target is defined then data cache, shared, java and large pool size can be 0. This is because all these pools are consolidated into one sga_target.' ),
- 'PGA aggr target' => array( 'DATAC',
- "select nvl(value,0)/1024.0/1024 || 'M' from v\$parameter where name = 'pga_aggregate_target'",
- 'If pga_aggregate_target is defined then this is the maximum memory that can be allocated for cursor operations such as sorts, group by, joins, merges. When in doubt, set it to 20% of sga_target.' ),
- 'data cache size' => array('DATAC',
- "select value from v\$parameter where name = 'db_cache_size'",
- 'db_cache_size' ),
- 'shared pool size' => array('DATAC',
- "select value from v\$parameter where name = 'shared_pool_size'",
- 'shared_pool_size, which holds shared sql, stored procedures, dict cache and similar shared structs' ),
- 'java pool size' => array('DATAJ',
- "select value from v\$parameter where name = 'java_pool_size'",
- 'java_pool_size' ),
- 'large pool buffer size' => array('CACHE',
- "select value from v\$parameter where name='large_pool_size'",
- 'this pool is for large mem allocations (not because it is larger than shared pool), for MTS sessions, parallel queries, io buffers (large_pool_size) ' ),
-
- 'dynamic memory usage' => array('CACHE', "select '-' from dual", '=DynMemoryUsage'),
-
- 'Connections',
- 'current connections' => array('SESS',
- 'select count(*) from sys.v_$session where username is not null',
- ''),
- 'max connections' => array( 'SESS',
- "select value from v\$parameter where name='sessions'",
- ''),
-
- 'Memory Utilization',
- 'data cache utilization ratio' => array('RATIOU',
- "select round((1-bytes/sgasize)*100, 2)
- from (select sum(bytes) sgasize from sys.v_\$sgastat) s, sys.v_\$sgastat f
- where name = 'free memory' and pool = 'shared pool'",
- 'Percentage of data cache actually in use - should be over 85%'),
-
- 'shared pool utilization ratio' => array('RATIOU',
- 'select round((sga.bytes/case when p.value=0 then sga.bytes else to_number(p.value) end)*100,2)
- from v$sgastat sga, v$parameter p
- where sga.name = \'free memory\' and sga.pool = \'shared pool\'
- and p.name = \'shared_pool_size\'',
- 'Percentage of shared pool actually used - too low is bad, too high is worse'),
-
- 'large pool utilization ratio' => array('RATIOU',
- "select round((1-bytes/sgasize)*100, 2)
- from (select sum(bytes) sgasize from sys.v_\$sgastat) s, sys.v_\$sgastat f
- where name = 'free memory' and pool = 'large pool'",
- 'Percentage of large_pool actually in use - too low is bad, too high is worse'),
- 'sort buffer size' => array('CACHE',
- "select value from v\$parameter where name='sort_area_size'",
- 'max in-mem sort_area_size (per query), uses memory in pga' ),
-
- /*'pga usage at peak' => array('RATIOU',
- '=PGA','Mb utilization at peak transactions (requires Oracle 9i+)'),*/
- 'Transactions',
- 'rollback segments' => array('ROLLBACK',
- "select count(*) from sys.v_\$rollstat",
- ''),
-
- 'peak transactions' => array('ROLLBACK',
- "select max_utilization tx_hwm
- from sys.v_\$resource_limit
- where resource_name = 'transactions'",
- 'Taken from high-water-mark'),
- 'max transactions' => array('ROLLBACK',
- "select value from v\$parameter where name = 'transactions'",
- 'max transactions / rollback segments < 3.5 (or transactions_per_rollback_segment)'),
- 'Parameters',
- 'cursor sharing' => array('CURSOR',
- "select value from v\$parameter where name = 'cursor_sharing'",
- 'Cursor reuse strategy. Recommended is FORCE (8i+) or SIMILAR (9i+). See cursor_sharing .'),
- /*
- 'cursor reuse' => array('CURSOR',
- "select count(*) from (select sql_text_wo_constants, count(*)
- from t1
- group by sql_text_wo_constants
-having count(*) > 100)",'These are sql statements that should be using bind variables'),*/
- 'index cache cost' => array('COST',
- "select value from v\$parameter where name = 'optimizer_index_caching'",
- '=WarnIndexCost'),
- 'random page cost' => array('COST',
- "select value from v\$parameter where name = 'optimizer_index_cost_adj'",
- '=WarnPageCost'),
- 'Waits',
- 'Recent wait events' => array('WAITS','select \'Top 5 events\' from dual','=TopRecentWaits'),
-// 'Historical wait SQL' => array('WAITS','select \'Last 2 days\' from dual','=TopHistoricalWaits'), -- requires AWR license
- 'Backup',
- 'Achivelog Mode' => array('BACKUP', 'select log_mode from v$database', '=LogMode'),
-
- 'DBID' => array('BACKUP','select dbid from v$database','Primary key of database, used for recovery with an RMAN Recovery Catalog'),
- 'Archive Log Dest' => array('BACKUP', "SELECT NVL(v1.value,v2.value)
-FROM v\$parameter v1, v\$parameter v2 WHERE v1.name='log_archive_dest' AND v2.name='log_archive_dest_10'", ''),
-
- 'Flashback Area' => array('BACKUP', "select nvl(value,'Flashback Area not used') from v\$parameter where name=lower('DB_RECOVERY_FILE_DEST')", 'Flashback area is a folder where all backup data and logs can be stored and managed by Oracle. If Error: message displayed, then it is not in use.'),
-
- 'Flashback Usage' => array('BACKUP', "select nvl('-','Flashback Area not used') from v\$parameter where name=lower('DB_RECOVERY_FILE_DEST')", '=FlashUsage', 'Flashback area usage.'),
-
- 'Control File Keep Time' => array('BACKUP', "select value from v\$parameter where name='control_file_record_keep_time'",'No of days to keep RMAN info in control file. Recommended set to x2 or x3 times the frequency of your full backup.'),
- 'Recent RMAN Jobs' => array('BACKUP', "select '-' from dual", "=RMAN"),
-
- // 'Control File Keep Time' => array('BACKUP', "select value from v\$parameter where name='control_file_record_keep_time'",'No of days to keep RMAN info in control file. I recommend it be set to x2 or x3 times the frequency of your full backup.'),
- 'Storage', 'Tablespaces' => array('TABLESPACE', "select '-' from dual", "=TableSpace"),
- false
-
- );
-
-
- function perf_oci8(&$conn)
- {
- global $gSQLBlockRows;
-
- $gSQLBlockRows = 1000;
- $savelog = $conn->LogSQL(false);
- $this->version = $conn->ServerInfo();
- $conn->LogSQL($savelog);
- $this->conn = $conn;
- }
-
- function LogMode()
- {
- $mode = $this->conn->GetOne("select log_mode from v\$database");
-
- if ($mode == 'ARCHIVELOG') return 'To turn off archivelog:
-
- SQLPLUS> connect sys as sysdba;
- SQLPLUS> shutdown immediate;
-
- SQLPLUS> startup mount exclusive;
- SQLPLUS> alter database noarchivelog;
- SQLPLUS> alter database open;
- ';
-
- return 'To turn on archivelog:
-
- SQLPLUS> connect sys as sysdba;
- SQLPLUS> shutdown immediate;
-
- SQLPLUS> startup mount exclusive;
- SQLPLUS> alter database archivelog;
- SQLPLUS> archive log start;
- SQLPLUS> alter database open;
- ';
- }
-
- function TopRecentWaits()
- {
-
- $rs = $this->conn->Execute("select * from (
- select event, round(100*time_waited/(select sum(time_waited) from v\$system_event where wait_class <> 'Idle'),1) \"% Wait\",
- total_waits,time_waited, average_wait,wait_class from v\$system_event where wait_class <> 'Idle' order by 2 desc
- ) where rownum <=5");
-
- $ret = rs2html($rs,false,false,false,false);
- return " ".$ret."
";
-
- }
-
- function TopHistoricalWaits()
- {
- $days = 2;
-
- $rs = $this->conn->Execute("select * from ( SELECT
- b.wait_class,B.NAME,
- round(sum(wait_time+TIME_WAITED)/1000000) waitsecs,
- parsing_schema_name,
- C.SQL_TEXT, a.sql_id
-FROM V\$ACTIVE_SESSION_HISTORY A
- join V\$EVENT_NAME B on A.EVENT# = B.EVENT#
- join V\$SQLAREA C on A.SQL_ID = C.SQL_ID
-WHERE A.SAMPLE_TIME BETWEEN sysdate-$days and sysdate
- and parsing_schema_name not in ('SYS','SYSMAN','DBSNMP','SYSTEM')
-GROUP BY b.wait_class,parsing_schema_name,C.SQL_TEXT, B.NAME,A.sql_id
-order by 3 desc) where rownum <=10");
-
- $ret = rs2html($rs,false,false,false,false);
- return " ".$ret."
";
-
- }
-
- function TableSpace()
- {
-
- $rs = $this->conn->Execute(
- "select tablespace_name,round(sum(bytes)/1024/1024) as Used_MB,round(sum(maxbytes)/1024/1024) as Max_MB, round(sum(bytes)/sum(maxbytes),4) * 100 as PCT
- from dba_data_files
- group by tablespace_name order by 2 desc");
-
- $ret = "Tablespace ".rs2html($rs,false,false,false,false);
-
- $rs = $this->conn->Execute("select * from dba_data_files order by tablespace_name, 1");
- $ret .= "
Datafile ".rs2html($rs,false,false,false,false);
-
- return "
".$ret."
";
- }
-
- function RMAN()
- {
- $rs = $this->conn->Execute("select * from (select start_time, end_time, operation, status, mbytes_processed, output_device_type
- from V\$RMAN_STATUS order by start_time desc) where rownum <=10");
-
- $ret = rs2html($rs,false,false,false,false);
- return " ".$ret."
";
-
- }
-
- function DynMemoryUsage()
- {
- if (@$this->version['version'] >= 11) {
- $rs = $this->conn->Execute("select component, current_size/1024./1024 as \"CurrSize (M)\" from V\$MEMORY_DYNAMIC_COMPONENTS");
-
- } else
- $rs = $this->conn->Execute("select name, round(bytes/1024./1024,2) as \"CurrSize (M)\" from V\$sgainfo");
-
-
- $ret = rs2html($rs,false,false,false,false);
- return " ".$ret."
";
- }
-
- function FlashUsage()
- {
- $rs = $this->conn->Execute("select * from V\$FLASH_RECOVERY_AREA_USAGE");
- $ret = rs2html($rs,false,false,false,false);
- return " ".$ret."
";
- }
-
- function WarnPageCost($val)
- {
- if ($val == 100 && $this->version['version'] < 10) $s = 'Too High . ';
- else $s = '';
-
- return $s.'Recommended is 20-50 for TP, and 50 for data warehouses. Default is 100. See optimizer_index_cost_adj . ';
- }
-
- function WarnIndexCost($val)
- {
- if ($val == 0 && $this->version['version'] < 10) $s = 'Too Low . ';
- else $s = '';
-
- return $s.'Percentage of indexed data blocks expected in the cache.
- Recommended is 20 (fast disk array) to 30 (slower hard disks). Default is 0.
- See optimizer_index_caching .';
- }
-
- function PGA()
- {
-
- //if ($this->version['version'] < 9) return 'Oracle 9i or later required';
- }
-
- function PGA_Advice()
- {
- $t = "PGA Advice Estimate ";
- if ($this->version['version'] < 9) return $t.'Oracle 9i or later required';
-
- $rs = $this->conn->Execute('select a.MB,
- case when a.targ = 1 then \'<<= Current \'
- when a.targ < 1 or a.pct <= b.pct then null
- else
- \'- BETTER than Current by \'||round(a.pct/b.pct*100-100,2)||\'%\' end as "Percent Improved",
- a.targ as "PGA Size Factor",a.pct "% Perf"
- from
- (select round(pga_target_for_estimate/1024.0/1024.0,0) MB,
- pga_target_factor targ,estd_pga_cache_hit_percentage pct,rownum as r
- from v$pga_target_advice) a left join
- (select round(pga_target_for_estimate/1024.0/1024.0,0) MB,
- pga_target_factor targ,estd_pga_cache_hit_percentage pct,rownum as r
- from v$pga_target_advice) b on
- a.r = b.r+1 where
- b.pct < 100');
- if (!$rs) return $t."Only in 9i or later";
- // $rs->Close();
- if ($rs->EOF) return $t."PGA could be too big";
-
- return $t.rs2html($rs,false,false,true,false);
- }
-
- function Explain($sql,$partial=false)
- {
- $savelog = $this->conn->LogSQL(false);
- $rs = $this->conn->SelectLimit("select ID FROM PLAN_TABLE");
- if (!$rs) {
- echo "Missing PLAN_TABLE
-
-CREATE TABLE PLAN_TABLE (
- STATEMENT_ID VARCHAR2(30),
- TIMESTAMP DATE,
- REMARKS VARCHAR2(80),
- OPERATION VARCHAR2(30),
- OPTIONS VARCHAR2(30),
- OBJECT_NODE VARCHAR2(128),
- OBJECT_OWNER VARCHAR2(30),
- OBJECT_NAME VARCHAR2(30),
- OBJECT_INSTANCE NUMBER(38),
- OBJECT_TYPE VARCHAR2(30),
- OPTIMIZER VARCHAR2(255),
- SEARCH_COLUMNS NUMBER,
- ID NUMBER(38),
- PARENT_ID NUMBER(38),
- POSITION NUMBER(38),
- COST NUMBER(38),
- CARDINALITY NUMBER(38),
- BYTES NUMBER(38),
- OTHER_TAG VARCHAR2(255),
- PARTITION_START VARCHAR2(255),
- PARTITION_STOP VARCHAR2(255),
- PARTITION_ID NUMBER(38),
- OTHER LONG,
- DISTRIBUTION VARCHAR2(30)
-);
- ";
- return false;
- }
-
- $rs->Close();
- // $this->conn->debug=1;
-
- if ($partial) {
- $sqlq = $this->conn->qstr($sql.'%');
- $arr = $this->conn->GetArray("select distinct sql1 from adodb_logsql where sql1 like $sqlq");
- if ($arr) {
- foreach($arr as $row) {
- $sql = reset($row);
- if (crc32($sql) == $partial) break;
- }
- }
- }
-
- $s = "Explain : ".htmlspecialchars($sql)."
";
-
- $this->conn->BeginTrans();
- $id = "ADODB ".microtime();
-
- $rs = $this->conn->Execute("EXPLAIN PLAN SET STATEMENT_ID='$id' FOR $sql");
- $m = $this->conn->ErrorMsg();
- if ($m) {
- $this->conn->RollbackTrans();
- $this->conn->LogSQL($savelog);
- $s .= "$m
";
- return $s;
- }
- $rs = $this->conn->Execute("
- select
- ''||lpad('--', (level-1)*2,'-') || trim(operation) || ' ' || trim(options)||' ' as Operation,
- object_name,COST,CARDINALITY,bytes
- FROM plan_table
-START WITH id = 0 and STATEMENT_ID='$id'
-CONNECT BY prior id=parent_id and statement_id='$id'");
-
- $s .= rs2html($rs,false,false,false,false);
- $this->conn->RollbackTrans();
- $this->conn->LogSQL($savelog);
- $s .= $this->Tracer($sql,$partial);
- return $s;
- }
-
- function CheckMemory()
- {
- if ($this->version['version'] < 9) return 'Oracle 9i or later required';
-
- $rs = $this->conn->Execute("
-select a.name Buffer_Pool, b.size_for_estimate as cache_mb_estimate,
- case when b.size_factor=1 then
- '<<= Current'
- when a.estd_physical_read_factor-b.estd_physical_read_factor > 0.001 and b.estd_physical_read_factor<1 then
- '- BETTER than current by ' || round((1-b.estd_physical_read_factor)/b.estd_physical_read_factor*100,2) || '%'
- else ' ' end as RATING,
- b.estd_physical_read_factor \"Phys. Reads Factor\",
- round((a.estd_physical_read_factor-b.estd_physical_read_factor)/b.estd_physical_read_factor*100,2) as \"% Improve\"
- from (select size_for_estimate,size_factor,estd_physical_read_factor,rownum r,name from v\$db_cache_advice order by name,1) a ,
- (select size_for_estimate,size_factor,estd_physical_read_factor,rownum r,name from v\$db_cache_advice order by name,1) b
- where a.r = b.r-1 and a.name = b.name
- ");
- if (!$rs) return false;
-
- /*
- The v$db_cache_advice utility show the marginal changes in physical data block reads for different sizes of db_cache_size
- */
- $s = "Data Cache Advice Estimate ";
- if ($rs->EOF) {
- $s .= "Cache that is 50% of current size is still too big
";
- } else {
- $s .= "Ideal size of Data Cache is when %BETTER gets close to zero.";
- $s .= rs2html($rs,false,false,false,false);
- }
- return $s.$this->PGA_Advice();
- }
-
- /*
- Generate html for suspicious/expensive sql
- */
- function tohtml(&$rs,$type)
- {
- $o1 = $rs->FetchField(0);
- $o2 = $rs->FetchField(1);
- $o3 = $rs->FetchField(2);
- if ($rs->EOF) return 'None found
';
- $check = '';
- $sql = '';
- $s = "\n\n".$o1->name.' '.$o2->name.' '.$o3->name.' ';
- while (!$rs->EOF) {
- if ($check != $rs->fields[0].'::'.$rs->fields[1]) {
- if ($check) {
- $carr = explode('::',$check);
- $prefix = "';
- $suffix = ' ';
- if (strlen($prefix)>2000) {
- $prefix = '';
- $suffix = '';
- }
-
- $s .= "\n".$carr[0].' '.$carr[1].' '.$prefix.$sql.$suffix.' ';
- }
- $sql = $rs->fields[2];
- $check = $rs->fields[0].'::'.$rs->fields[1];
- } else
- $sql .= $rs->fields[2];
- if (substr($sql,strlen($sql)-1) == "\0") $sql = substr($sql,0,strlen($sql)-1);
- $rs->MoveNext();
- }
- $rs->Close();
-
- $carr = explode('::',$check);
- $prefix = "';
- $suffix = ' ';
- if (strlen($prefix)>2000) {
- $prefix = '';
- $suffix = '';
- }
- $s .= "\n".$carr[0].' '.$carr[1].' '.$prefix.$sql.$suffix.' ';
-
- return $s."
\n\n";
- }
-
- // code thanks to Ixora.
- // http://www.ixora.com.au/scripts/query_opt.htm
- // requires oracle 8.1.7 or later
- function SuspiciousSQL($numsql=10)
- {
- $sql = "
-select
- substr(to_char(s.pct, '99.00'), 2) || '%' load,
- s.executions executes,
- p.sql_text
-from
- (
- select
- address,
- buffer_gets,
- executions,
- pct,
- rank() over (order by buffer_gets desc) ranking
- from
- (
- select
- address,
- buffer_gets,
- executions,
- 100 * ratio_to_report(buffer_gets) over () pct
- from
- sys.v_\$sql
- where
- command_type != 47 and module != 'T.O.A.D.'
- )
- where
- buffer_gets > 50 * executions
- ) s,
- sys.v_\$sqltext p
-where
- s.ranking <= $numsql and
- p.address = s.address
-order by
- 1 desc, s.address, p.piece";
-
- global $ADODB_CACHE_MODE;
- if (isset($_GET['expsixora']) && isset($_GET['sql'])) {
- $partial = empty($_GET['part']);
- echo " ".$this->Explain($_GET['sql'],$partial)."\n";
- }
-
- if (isset($_GET['sql'])) return $this->_SuspiciousSQL($numsql);
-
- $s = '';
- $timer = time();
- $s .= $this->_SuspiciousSQL($numsql);
- $timer = time() - $timer;
-
- if ($timer > $this->noShowIxora) return $s;
- $s .= '';
-
- $save = $ADODB_CACHE_MODE;
- $ADODB_CACHE_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $savelog = $this->conn->LogSQL(false);
- $rs = $this->conn->SelectLimit($sql);
- $this->conn->LogSQL($savelog);
-
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $ADODB_CACHE_MODE = $save;
- if ($rs) {
- $s .= "\n
Ixora Suspicious SQL ";
- $s .= $this->tohtml($rs,'expsixora');
- }
-
- return $s;
- }
-
- // code thanks to Ixora.
- // http://www.ixora.com.au/scripts/query_opt.htm
- // requires oracle 8.1.7 or later
- function ExpensiveSQL($numsql = 10)
- {
- $sql = "
-select
- substr(to_char(s.pct, '99.00'), 2) || '%' load,
- s.executions executes,
- p.sql_text
-from
- (
- select
- address,
- disk_reads,
- executions,
- pct,
- rank() over (order by disk_reads desc) ranking
- from
- (
- select
- address,
- disk_reads,
- executions,
- 100 * ratio_to_report(disk_reads) over () pct
- from
- sys.v_\$sql
- where
- command_type != 47 and module != 'T.O.A.D.'
- )
- where
- disk_reads > 50 * executions
- ) s,
- sys.v_\$sqltext p
-where
- s.ranking <= $numsql and
- p.address = s.address
-order by
- 1 desc, s.address, p.piece
-";
- global $ADODB_CACHE_MODE;
- if (isset($_GET['expeixora']) && isset($_GET['sql'])) {
- $partial = empty($_GET['part']);
- echo " ".$this->Explain($_GET['sql'],$partial)."\n";
- }
- if (isset($_GET['sql'])) {
- $var = $this->_ExpensiveSQL($numsql);
- return $var;
- }
-
- $s = '';
- $timer = time();
- $s .= $this->_ExpensiveSQL($numsql);
- $timer = time() - $timer;
- if ($timer > $this->noShowIxora) return $s;
-
- $s .= '';
- $save = $ADODB_CACHE_MODE;
- $ADODB_CACHE_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $savelog = $this->conn->LogSQL(false);
- $rs = $this->conn->Execute($sql);
- $this->conn->LogSQL($savelog);
-
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $ADODB_CACHE_MODE = $save;
-
- if ($rs) {
- $s .= "\n
Ixora Expensive SQL ";
- $s .= $this->tohtml($rs,'expeixora');
- }
-
- return $s;
- }
-
- function clearsql()
- {
- $perf_table = adodb_perf::table();
- // using the naive "delete from $perf_table where created<".$this->conn->sysTimeStamp will cause the table to lock, possibly
- // for a long time
- $sql =
-"DECLARE cnt pls_integer;
-BEGIN
- cnt := 0;
- FOR rec IN (SELECT ROWID AS rr FROM $perf_table WHERE createdconn->Execute($sql);
- }
-
-}
diff --git a/sources/vendor/adodb/adodb-php/perf/perf-postgres.inc.php b/sources/vendor/adodb/adodb-php/perf/perf-postgres.inc.php
deleted file mode 100644
index 81ae2ff..0000000
--- a/sources/vendor/adodb/adodb-php/perf/perf-postgres.inc.php
+++ /dev/null
@@ -1,152 +0,0 @@
- array('RATIO',
- "select case when count(*)=3 then 'TRUE' else 'FALSE' end from pg_settings where (name='stats_block_level' or name='stats_row_level' or name='stats_start_collector') and setting='on' ",
- 'Value must be TRUE to enable hit ratio statistics (stats_start_collector ,stats_row_level and stats_block_level must be set to true in postgresql.conf)'),
- 'data cache hit ratio' => array('RATIO',
- "select case when blks_hit=0 then 0 else round( ((1-blks_read::float/blks_hit)*100)::numeric, 2) end from pg_stat_database where datname='\$DATABASE'",
- '=WarnCacheRatio'),
- 'IO',
- 'data reads' => array('IO',
- 'select sum(heap_blks_read+toast_blks_read) from pg_statio_user_tables',
- ),
- 'data writes' => array('IO',
- 'select round((sum(n_tup_ins/4.0+n_tup_upd/8.0+n_tup_del/4.0)/16)::numeric,2) from pg_stat_user_tables',
- 'Count of inserts/updates/deletes * coef'),
-
- 'Data Cache',
- 'data cache buffers' => array('DATAC',
- "select setting from pg_settings where name='shared_buffers'",
- 'Number of cache buffers. Tuning '),
- 'cache blocksize' => array('DATAC',
- 'select 8192',
- '(estimate)' ),
- 'data cache size' => array( 'DATAC',
- "select setting::integer*8192 from pg_settings where name='shared_buffers'",
- '' ),
- 'operating system cache size' => array( 'DATA',
- "select setting::integer*8192 from pg_settings where name='effective_cache_size'",
- '(effective cache size)' ),
- 'Memory Usage',
- # Postgres 7.5 changelog: Rename server parameters SortMem and VacuumMem to work_mem and maintenance_work_mem;
- 'sort/work buffer size' => array('CACHE',
- "select setting::integer*1024 from pg_settings where name='sort_mem' or name = 'work_mem' order by name",
- 'Size of sort buffer (per query)' ),
- 'Connections',
- 'current connections' => array('SESS',
- 'select count(*) from pg_stat_activity',
- ''),
- 'max connections' => array('SESS',
- "select setting from pg_settings where name='max_connections'",
- ''),
- 'Parameters',
- 'rollback buffers' => array('COST',
- "select setting from pg_settings where name='wal_buffers'",
- 'WAL buffers'),
- 'random page cost' => array('COST',
- "select setting from pg_settings where name='random_page_cost'",
- 'Cost of doing a seek (default=4). See random_page_cost '),
- false
- );
-
- function perf_postgres(&$conn)
- {
- $this->conn = $conn;
- }
-
- var $optimizeTableLow = 'VACUUM %s';
- var $optimizeTableHigh = 'VACUUM ANALYZE %s';
-
-/**
- * @see adodb_perf#optimizeTable
- */
-
- function optimizeTable($table, $mode = ADODB_OPT_LOW)
- {
- if(! is_string($table)) return false;
-
- $conn = $this->conn;
- if (! $conn) return false;
-
- $sql = '';
- switch($mode) {
- case ADODB_OPT_LOW : $sql = $this->optimizeTableLow; break;
- case ADODB_OPT_HIGH: $sql = $this->optimizeTableHigh; break;
- default :
- {
- ADOConnection::outp(sprintf("%s: '%s' using of undefined mode '%s'
", __CLASS__, 'optimizeTable', $mode));
- return false;
- }
- }
- $sql = sprintf($sql, $table);
-
- return $conn->Execute($sql) !== false;
- }
-
- function Explain($sql,$partial=false)
- {
- $save = $this->conn->LogSQL(false);
-
- if ($partial) {
- $sqlq = $this->conn->qstr($sql.'%');
- $arr = $this->conn->GetArray("select distinct distinct sql1 from adodb_logsql where sql1 like $sqlq");
- if ($arr) {
- foreach($arr as $row) {
- $sql = reset($row);
- if (crc32($sql) == $partial) break;
- }
- }
- }
- $sql = str_replace('?',"''",$sql);
- $s = 'Explain : '.htmlspecialchars($sql).'
';
- $rs = $this->conn->Execute('EXPLAIN '.$sql);
- $this->conn->LogSQL($save);
- $s .= '';
- if ($rs)
- while (!$rs->EOF) {
- $s .= reset($rs->fields)."\n";
- $rs->MoveNext();
- }
- $s .= ' ';
- $s .= $this->Tracer($sql,$partial);
- return $s;
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/pivottable.inc.php b/sources/vendor/adodb/adodb-php/pivottable.inc.php
deleted file mode 100644
index d4695d2..0000000
--- a/sources/vendor/adodb/adodb-php/pivottable.inc.php
+++ /dev/null
@@ -1,186 +0,0 @@
-databaseType,'access') !== false;
- // note - vfp 6 still doesn' work even with IIF enabled || $db->databaseType == 'vfp';
-
- //$hidecnt = false;
-
- if ($where) $where = "\nWHERE $where";
- if (!is_array($colfield)) $colarr = $db->GetCol("select distinct $colfield from $tables $where order by 1");
- if (!$aggfield) $hidecnt = false;
-
- $sel = "$rowfields, ";
- if (is_array($colfield)) {
- foreach ($colfield as $k => $v) {
- $k = trim($k);
- if (!$hidecnt) {
- $sel .= $iif ?
- "\n\t$aggfn(IIF($v,1,0)) AS \"$k\", "
- :
- "\n\t$aggfn(CASE WHEN $v THEN 1 ELSE 0 END) AS \"$k\", ";
- }
- if ($aggfield) {
- $sel .= $iif ?
- "\n\t$aggfn(IIF($v,$aggfield,0)) AS \"$sumlabel$k\", "
- :
- "\n\t$aggfn(CASE WHEN $v THEN $aggfield ELSE 0 END) AS \"$sumlabel$k\", ";
- }
- }
- } else {
- foreach ($colarr as $v) {
- if (!is_numeric($v)) $vq = $db->qstr($v);
- else $vq = $v;
- $v = trim($v);
- if (strlen($v) == 0 ) $v = 'null';
- if (!$hidecnt) {
- $sel .= $iif ?
- "\n\t$aggfn(IIF($colfield=$vq,1,0)) AS \"$v\", "
- :
- "\n\t$aggfn(CASE WHEN $colfield=$vq THEN 1 ELSE 0 END) AS \"$v\", ";
- }
- if ($aggfield) {
- if ($hidecnt) $label = $v;
- else $label = "{$v}_$aggfield";
- $sel .= $iif ?
- "\n\t$aggfn(IIF($colfield=$vq,$aggfield,0)) AS \"$label\", "
- :
- "\n\t$aggfn(CASE WHEN $colfield=$vq THEN $aggfield ELSE 0 END) AS \"$label\", ";
- }
- }
- }
- if ($aggfield && $aggfield != '1'){
- $agg = "$aggfn($aggfield)";
- $sel .= "\n\t$agg as \"$sumlabel$aggfield\", ";
- }
-
- if ($showcount)
- $sel .= "\n\tSUM(1) as Total";
- else
- $sel = substr($sel,0,strlen($sel)-2);
-
-
- // Strip aliases
- $rowfields = preg_replace('/ AS (\w+)/i', '', $rowfields);
-
- $sql = "SELECT $sel \nFROM $tables $where \nGROUP BY $rowfields";
-
- return $sql;
- }
-
-/* EXAMPLES USING MS NORTHWIND DATABASE */
-if (0) {
-
-# example1
-#
-# Query the main "product" table
-# Set the rows to CompanyName and QuantityPerUnit
-# and the columns to the Categories
-# and define the joins to link to lookup tables
-# "categories" and "suppliers"
-#
-
- $sql = PivotTableSQL(
- $gDB, # adodb connection
- 'products p ,categories c ,suppliers s', # tables
- 'CompanyName,QuantityPerUnit', # row fields
- 'CategoryName', # column fields
- 'p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID' # joins/where
-);
- print "$sql";
- $rs = $gDB->Execute($sql);
- rs2html($rs);
-
-/*
-Generated SQL:
-
-SELECT CompanyName,QuantityPerUnit,
- SUM(CASE WHEN CategoryName='Beverages' THEN 1 ELSE 0 END) AS "Beverages",
- SUM(CASE WHEN CategoryName='Condiments' THEN 1 ELSE 0 END) AS "Condiments",
- SUM(CASE WHEN CategoryName='Confections' THEN 1 ELSE 0 END) AS "Confections",
- SUM(CASE WHEN CategoryName='Dairy Products' THEN 1 ELSE 0 END) AS "Dairy Products",
- SUM(CASE WHEN CategoryName='Grains/Cereals' THEN 1 ELSE 0 END) AS "Grains/Cereals",
- SUM(CASE WHEN CategoryName='Meat/Poultry' THEN 1 ELSE 0 END) AS "Meat/Poultry",
- SUM(CASE WHEN CategoryName='Produce' THEN 1 ELSE 0 END) AS "Produce",
- SUM(CASE WHEN CategoryName='Seafood' THEN 1 ELSE 0 END) AS "Seafood",
- SUM(1) as Total
-FROM products p ,categories c ,suppliers s WHERE p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID
-GROUP BY CompanyName,QuantityPerUnit
-*/
-//=====================================================================
-
-# example2
-#
-# Query the main "product" table
-# Set the rows to CompanyName and QuantityPerUnit
-# and the columns to the UnitsInStock for diiferent ranges
-# and define the joins to link to lookup tables
-# "categories" and "suppliers"
-#
- $sql = PivotTableSQL(
- $gDB, # adodb connection
- 'products p ,categories c ,suppliers s', # tables
- 'CompanyName,QuantityPerUnit', # row fields
- # column ranges
-array(
-' 0 ' => 'UnitsInStock <= 0',
-"1 to 5" => '0 < UnitsInStock and UnitsInStock <= 5',
-"6 to 10" => '5 < UnitsInStock and UnitsInStock <= 10',
-"11 to 15" => '10 < UnitsInStock and UnitsInStock <= 15',
-"16+" =>'15 < UnitsInStock'
-),
- ' p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID', # joins/where
- 'UnitsInStock', # sum this field
- 'Sum' # sum label prefix
-);
- print "$sql";
- $rs = $gDB->Execute($sql);
- rs2html($rs);
- /*
- Generated SQL:
-
-SELECT CompanyName,QuantityPerUnit,
- SUM(CASE WHEN UnitsInStock <= 0 THEN UnitsInStock ELSE 0 END) AS "Sum 0 ",
- SUM(CASE WHEN 0 < UnitsInStock and UnitsInStock <= 5 THEN UnitsInStock ELSE 0 END) AS "Sum 1 to 5",
- SUM(CASE WHEN 5 < UnitsInStock and UnitsInStock <= 10 THEN UnitsInStock ELSE 0 END) AS "Sum 6 to 10",
- SUM(CASE WHEN 10 < UnitsInStock and UnitsInStock <= 15 THEN UnitsInStock ELSE 0 END) AS "Sum 11 to 15",
- SUM(CASE WHEN 15 < UnitsInStock THEN UnitsInStock ELSE 0 END) AS "Sum 16+",
- SUM(UnitsInStock) AS "Sum UnitsInStock",
- SUM(1) as Total
-FROM products p ,categories c ,suppliers s WHERE p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID
-GROUP BY CompanyName,QuantityPerUnit
- */
-}
diff --git a/sources/vendor/adodb/adodb-php/replicate/adodb-replicate.inc.php b/sources/vendor/adodb/adodb-php/replicate/adodb-replicate.inc.php
deleted file mode 100644
index 849f597..0000000
--- a/sources/vendor/adodb/adodb-php/replicate/adodb-replicate.inc.php
+++ /dev/null
@@ -1,1181 +0,0 @@
-compat. If compat set to 1.0, then $lastUpdateFld not used during MergeData.
-
-1.0 Apr 2009
-Added support for MFFA
-
-0.9 ? 2008
-First release
-
-
- Note: this code assumes that comments such as / * * / ar`e allowed which works with:
- Note: this code assumes that comments such as / * * / are allowed which works with:
- mssql, postgresql, oracle, mssql
-
- Replication engine to
- - copy table structures and data from different databases (e.g. mysql to oracle)
- for replication purposes
- - generate CREATE TABLE, CREATE INDEX, INSERT ... for installation scripts
-
- Table Structure copying includes
- - fields and limited subset of types
- - optional default values
- - indexes
- - but not constraints
-
-
- Two modes of data copy:
-
- ReplicateData
- - Copy from src to dest, with update of status of copy back to src,
- with configurable src SELECT where clause
-
- MergeData
- - Copy from src to dest based on last mod date field and/or copied flag field
-
- Default settings are
- - do not execute, generate sql ($rep->execute = false)
- - do not delete records in dest table first ($rep->deleteFirst = false).
- if $rep->deleteFirst is true and primary keys are defined,
- then no deletion will occur unless *INSERTONLY* is defined in pkey array
- - only commit once at the end of every ReplicateData ($rep->commitReplicate = true)
- - do not autocommit every x records processed ($rep->commitRecs = -1)
- - even if error occurs on one record, continue copying remaining records ($rep->neverAbort = true)
- - debugging turned off ($rep->debug = false)
-*/
-
-class ADODB_Replicate {
- var $connSrc;
- var $connDest;
-
- var $connSrc2 = false;
- var $connDest2 = false;
- var $ddSrc;
- var $ddDest;
-
- var $execute = false;
- var $debug = false;
- var $deleteFirst = false;
- var $commitReplicate = true; // commit at end of replicatedata
- var $commitRecs = -1; // only commit at end of ReplicateData()
-
- var $selFilter = false;
- var $fieldFilter = false;
- var $indexFilter = false;
- var $updateFilter = false;
- var $insertFilter = false;
- var $updateSrcFn = false;
-
- var $limitRecs = false;
-
- var $neverAbort = true;
- var $copyTableDefaults = false; // turn off because functions defined as defaults will not work when copied
- var $errHandler = false; // name of error handler function, if used.
- var $htmlSpecialChars = true; // if execute false, then output with htmlspecialchars enabled.
- // Will autoconfigure itself. No need to modify
-
- var $trgSuffix = '_mrgTr';
- var $idxSuffix = '_mrgidx';
- var $trLogic = '1 = 1';
- var $datesAreTimeStamps = false;
-
- var $oracleSequence = false;
- var $readUncommitted = false; // read without obeying shared locks for fast select (mssql)
-
- var $compat = false;
- // connSrc2 and connDest2 are only required if the db driver
- // does not allow updates back to src db in first connection (the select connection),
- // so we need 2nd connection
- function ADODB_Replicate($connSrc, $connDest, $connSrc2=false, $connDest2=false)
- {
-
- if (strpos($connSrc->databaseType,'odbtp') !== false) {
- $connSrc->_bindInputArray = false; # bug in odbtp, binding fails
- }
-
- if (strpos($connDest->databaseType,'odbtp') !== false) {
- $connDest->_bindInputArray = false; # bug in odbtp, binding fails
- }
-
- $this->connSrc = $connSrc;
- $this->connDest = $connDest;
-
- $this->connSrc2 = ($connSrc2) ? $connSrc2 : $connSrc;
- $this->connDest2 = ($connDest2) ? $connDest2 : $connDest;
-
- $this->ddSrc = NewDataDictionary($connSrc);
- $this->ddDest = NewDataDictionary($connDest);
- $this->htmlSpecialChars = isset($_SERVER['HTTP_HOST']);
- }
-
- function ExecSQL($sql)
- {
- if (!is_array($sql)) $sql[] = $sql;
-
- $ret = true;
- foreach($sql as $s)
- if (!$this->execute) echo "",$s.";\n ";
- else {
- $ok = $this->connDest->Execute($s);
- if (!$ok)
- if ($this->neverAbort) $ret = false;
- else return false;
- }
-
- return $ret;
- }
-
- /*
- We assume replication between $table and $desttable only works if the field names and types match for both tables.
-
- Also $table and desttable can have different names.
- */
-
- function CopyTableStruct($table,$desttable='')
- {
- $sql = $this->CopyTableStructSQL($table,$desttable);
- if (empty($sql)) return false;
- return $this->ExecSQL($sql);
- }
-
- function RunFieldFilter(&$fld, $mode = '')
- {
- if ($this->fieldFilter) {
- $fn = $this->fieldFilter;
- return $fn($fld, $mode);
- } else
- return $fld;
- }
-
- function RunUpdateFilter($table, $fld, $val)
- {
- if ($this->updateFilter) {
- $fn = $this->updateFilter;
- return $fn($table, $fld, $val);
- } else
- return $val;
- }
-
- function RunInsertFilter($table, $fld, &$val)
- {
- if ($this->insertFilter) {
- $fn = $this->insertFilter;
- return $fn($table, $fld, $val);
- } else
- return $fld;
- }
-
- /*
- $mode = INS or UPD
-
- The lastUpdateFld holds the field that counts the number of updates or the date of last mod. This ensures that
- if the rec was modified after replicatedata retrieves the data but before we update back the src record,
- we don't set the copiedflag='Y' yet.
- */
- function RunUpdateSrcFn($srcdb, $table, $fldoffsets, $row, $where, $mode, $dest_insertid=null, $lastUpdateFld='')
- {
- if (!$this->updateSrcFn) return;
-
- $bindarr = array();
- foreach($fldoffsets as $k) {
- $bindarr[$k] = $row[$k];
- }
- $last = sizeof($row);
-
- if ($lastUpdateFld && $row[$last-1]) {
- $ds = $row[$last-1];
- if (strpos($ds,':') !== false) $s = $srcdb->DBTimeStamp($ds);
- else $s = $srcdb->qstr($ds);
- $where = "WHERE $lastUpdateFld = $s and $where";
- } else
- $where = "WHERE $where";
- $fn = $this->updateSrcFn;
- if (is_array($fn)) {
- if (sizeof($fn) == 1) $set = reset($fn);
- else $set = @$fn[$mode];
- if ($set) {
-
- if (strlen($dest_insertid) == 0) $dest_insertid = 'null';
- $set = str_replace('$INSERT_ID',$dest_insertid,$set);
-
- $sql = "UPDATE $table SET $set $where ";
- $ok = $srcdb->Execute($sql,$bindarr);
- if (!$ok) {
- echo $srcdb->ErrorMsg()," \n";
- die();
- }
- }
- } else $fn($srcdb, $table, $row, $where, $bindarr, $mode, $dest_insertid);
-
- }
-
- function CopyTableStructSQL($table, $desttable='',$dropdest =false)
- {
- if (!$desttable) {
- $desttable = $table;
- $prefixidx = '';
- } else
- $prefixidx = $desttable;
-
- $conn = $this->connSrc;
- $types = $conn->MetaColumns($table);
- if (!$types) {
- echo "$table does not exist in source db \n";
- return array();
- }
- if (!$dropdest && $this->connDest->MetaColumns($desttable)) {
- echo "$desttable already exists in dest db \n";
- return array();
- }
- if ($this->debug) var_dump($types);
- $sa = array();
- $idxcols = array();
-
- foreach($types as $name => $t) {
- $s = '';
- $mt = $this->ddSrc->MetaType($t->type);
- $len = $t->max_length;
- $fldname = $this->RunFieldFilter($t->name,'TABLE');
- if (!$fldname) continue;
-
- $s .= $fldname . ' '.$mt;
- if (isset($t->scale)) $precision = '.'.$t->scale;
- else $precision = '';
- if ($mt == 'C' or $mt == 'X') $s .= "($len)";
- else if ($mt == 'N' && $precision) $s .= "($len$precision)";
-
- if ($mt == 'R') $idxcols[] = $fldname;
-
- if ($this->copyTableDefaults) {
- if (isset($t->default_value)) {
- $v = $t->default_value;
- if ($mt == 'C' or $mt == 'X') $v = $this->connDest->qstr($v); // might not work as this could be function
- $s .= ' DEFAULT '.$v;
- }
- }
-
- $sa[] = $s;
- }
-
- $s = implode(",\n",$sa);
-
- // dump adodb intermediate data dictionary format
- if ($this->debug) echo ''.$s.' ';
-
- $sqla = $this->ddDest->CreateTableSQL($desttable,$s);
-
- /*
- if ($idxcols) {
- $idxoptions = array('UNIQUE'=>1);
- $sqla2 = $this->ddDest->_IndexSQL($table.'_'.$fldname.'_SERIAL', $desttable, $idxcols,$idxoptions);
- $sqla = array_merge($sqla,$sqla2);
- }*/
-
- $idxs = $conn->MetaIndexes($table);
- if ($idxs)
- foreach($idxs as $name => $iarr) {
- $idxoptions = array();
- $fldnames = array();
-
- if(!empty($iarr['unique'])) {
- $idxoptions['UNIQUE'] = 1;
- }
-
- foreach($iarr['columns'] as $fld) {
- $fldnames[] = $this->RunFieldFilter($fld,'TABLE');
- }
-
- $idxname = $prefixidx.str_replace($table,$desttable,$name);
-
- if (!empty($this->indexFilter)) {
- $fn = $this->indexFilter;
- $idxname = $fn($desttable,$idxname,$fldnames,$idxoptions);
- }
- $sqla2 = $this->ddDest->_IndexSQL($idxname, $desttable, $fldnames,$idxoptions);
- $sqla = array_merge($sqla,$sqla2);
- }
-
- return $sqla;
- }
-
- function _clearcache()
- {
-
- }
-
- function _concat($v)
- {
- return $this->connDest->concat("' ","chr(".ord($v).")","'");
- }
-
- function fixupbinary($v)
- {
- return str_replace(
- array("\r","\n"),
- array($this->_concat("\r"),$this->_concat("\n")),
- $v );
- }
-
- function SwapDBs()
- {
- $o = $this->connSrc;
- $this->connSrc = $this->connDest;
- $this->connDest = $o;
-
-
- $o = $this->connSrc2;
- $this->connSrc2 = $this->connDest2;
- $this->connDest2 = $o;
-
- $o = $this->ddSrc;
- $this->ddSrc = $this->ddDest;
- $this->ddDest = $o;
- }
-
- /*
- // if no uniqflds defined, then all desttable recs will be deleted before insert
- // $where clause must include the WHERE word if used
- // if $this->commitRecs is set to a +ve value, then it will autocommit every $this->commitRecs records
- // -- this should never be done with 7x24 db's
-
- Returns an array:
- $arr[0] = true if no error, false if error
- $arr[1] = number of recs processed
- $arr[2] = number of successful inserts
- $arr[3] = number of successful updates
-
- ReplicateData() params:
-
- $table = src table name
- $desttable = dest table name, leave blank to use src table name
- $uniqflds = array() = an array. If set, then inserts and updates will occur. eg. array('PK1', 'PK2');
- To prevent updates to desttable (allow only to src table), add '*INSERTONLY*' or '*ONLYINSERT*' to array.
-
- Sometimes you are replicating a src table with an autoinc primary key.
- You sometimes create recs in the dest table. The dest table has to retrieve the
- src table's autoinc key (stored in a 2nd field) so you can match the two tables.
-
- To define this, and the uniqflds contains nested arrays. Copying from autoinc table to other table:
- array(array($destpkey), array($destfld_holds_src_autoinc_pkey))
-
- Copying from normal table to autoinc table:
- array(array($destpkey), array(), array($srcfld_holds_dest_autoinc_pkey))
-
- $where = where clause for SELECT from $table $where. Include the WHERE reserved word in beginning.
- You can put ORDER BY at the end also
- $ignoreflds = array(), list of fields to ignore. e.g. array('FLD1',FLD2');
- $dstCopyDateFld = date field on $desttable to update with current date
- $extraflds allows you to add additional flds to insert/update. Format
- array(fldname => $fldval)
- $fldval itself can be an array or a string. If an array, then
- $extraflds = array($fldname => array($insertval, $updateval))
-
- Thus we have the following behaviours:
-
- a. Delete all data in $desttable then insert from src $table
-
- $rep->execute = true;
- $rep->ReplicateData($table, $desttable)
-
- b. Update $desttable if record exists (based on $uniqflds), otherwise insert.
-
- $rep->execute = true;
- $rep->ReplicateData($table, $desttable, $array($pkey1, $pkey2))
-
- c. Select from src $table all data modified since a date. Then update $desttable
- if record exists (based on $uniqflds), otherwise insert
-
- $rep->execute = true;
- $rep->ReplicateData($table, $desttable, array($pkey1, $pkey2), "WHERE update_datetime_fld > $LAST_REFRESH")
-
- d. Insert all records into $desttable modified after a certain id (or time) in src $table:
-
- $rep->execute = true;
- $rep->ReplicateData($table, $desttable, false, "WHERE id_fld > $LAST_ID_SAVED", true);
-
-
- For (a) to (d), returns array: array($boolean_ok_fail, $no_recs_selected_from_src_db, $no_recs_inserted, $no_recs_updated);
-
- e. Generate sample SQL:
-
- $rep->execute = false;
- $rep->ReplicateData(....);
-
- This returns $array, which contains:
-
- $array['SEL'] = select stmt from src db
- $array['UPD'] = update stmt to dest db
- $array['INS'] = insert stmt to dest db
-
-
- Error-handling
- ==============
- Default is never abort if error occurs. You can set $rep->neverAbort = false; to force replication to abort if an error occurs.
-
-
- Value Filtering
- ========
- Sometimes you might need to modify/massage the data before the code works. Assume that the value used for True and False is
- 'T' and 'F' in src DB, but is 'Y' and 'N' in dest DB for field[2] in select stmt. You can do this by
-
- $rep->filterSelect = 'filter';
- $rep->ReplicateData(...);
-
- function filter($table,& $fields, $deleteFirst)
- {
- if ($table == 'SOMETABLE') {
- if ($fields[2] == 'T') $fields[2] = 'Y';
- else if ($fields[2] == 'F') $fields[2] = 'N';
- }
- }
-
- We pass in $deleteFirst as that determines the order of the fields (which are numeric-based):
- TRUE: the order of fields matches the src table order
- FALSE: the order of fields is all non-primary key fields first, followed by primary key fields. This is because it needs
- to match the UPDATE statement, which is UPDATE $table SET f2 = ?, f3 = ? ... WHERE f1 = ?
-
- Name Filtering
- =========
- Sometimes field names that are legal in one RDBMS can be illegal in another.
- We allow you to handle this using a field filter.
- Also if you don't want to replicate certain fields, just return false.
-
- $rep->fieldFilter = 'ffilter';
-
- function ffilter(&$fld,$mode)
- {
- $uf = strtoupper($fld);
- switch($uf) {
- case 'GROUP':
- if ($mode == 'SELECT') $fld = '"Group"';
- return 'GroupFld';
-
- case 'PRIVATEFLD': # do not replicate
- return false;
- }
- return $fld;
- }
-
-
- UPDATE FILTERING
- ================
- Sometimes, when we want to update
- UPDATE table SET fld = val WHERE ....
-
- we want to modify val. To do so, define
-
- $rep->updateFilter = 'ufilter';
-
- function ufilter($table, $fld, $val)
- {
- return "nvl($fld, $val)";
- }
-
-
- Sending back audit info back to src Table
- =========================================
-
- Use $rep->updateSrcFn. This can be an array of strings, or the name of a php function to call.
-
- If an array of strings is defined, then it will perform an update statement...
-
- UPDATE srctable SET $string WHERE ....
-
- With $string set to the array you define. If a new record was inserted into desttable, then the
- 'INS' string is used ($INSERT_ID will be replaced with the real INSERT_ID, if any),
- and if an update then use the 'UPD' string.
-
- array(
- 'INS' => 'insertid = $INSERT_ID, copieddate=getdate(), copied = 1',
- 'UPD' => 'copieddate=getdate(), copied = 1'
- )
-
- If a single string array is defined, then it will be used for both insert and update.
- array('copieddate=getdate(), copied = 1')
-
- Note that the where clause is automatically defined by the system.
-
- If $rep->updateSrcFn is a PHP function name, then it will be called with the following params:
-
- $fn($srcConnection, $tableName, $row, $where, $bindarr, $mode, $dest_insertid)
-
- $srcConnection - source db connection
- $tableName - source tablename
- $row - array holding records updated into dest
- $where - where clause to be used (uses bind vars)
- $bindarr - array holding bind variables for where clause
- $mode - INS or UPD
- $dest_insertid - when mode=INS, then the insert_id is stored here.
-
-
- oracle mssql
- ---> insert
- mssqlid <--- insert_id
- ----> update with mssqlid
- <---- update with mssqlid
-
-
- TODO: add src pkey and dest pkey for updates. Also sql stmt needs to be tuned, so dest pkey, src pkey
- */
-
-
- function ReplicateData($table, $desttable = '', $uniqflds = array(), $where = '',$ignore_flds = array(),
- $dstCopyDateFld='', $extraflds = array(), $lastUpdateFld = '')
- {
- if (is_array($where)) {
- $wheresrc = $where[0];
- $wheredest = $where[1];
- } else {
- $wheresrc = $wheredest = $where;
- }
- $dstCopyDateName = $dstCopyDateFld;
- $dstCopyDateFld = strtoupper($dstCopyDateFld);
-
- $this->_clearcache();
- if (is_string($uniqflds) && strlen($uniqflds)) $uniqflds = array($uniqflds);
- if (!$desttable) $desttable = $table;
-
- $uniq = array();
- if ($uniqflds) {
- if (is_array(reset($uniqflds))) {
- /*
- primary key of src and dest tables differ. This means when we perform the select stmts
- we retrieve both keys. Then any insert statement will have to ignore one array element.
- Any update statement will need to use a different where clause
- */
- $destuniqflds = $uniqflds[0];
- if (sizeof($uniqflds)>1 && $uniqflds[1]) // srckey field name in dest table
- $srcuniqflds = $uniqflds[1];
- else
- $srcuniqflds = array();
-
- if (sizeof($uniqflds)>2)
- $srcPKDest = reset($uniqflds[2]);
-
- } else {
- $destuniqflds = $uniqflds;
- $srcuniqflds = array();
- }
- $onlyInsert = false;
- foreach($destuniqflds as $k => $u) {
- if ($u == '*INSERTONLY*' || $u == '*ONLYINSERT*') {
- $onlyInsert = true;
- continue;
- }
- $uniq[strtoupper($u)] = $k;
- }
- $deleteFirst = $this->deleteFirst;
- } else {
- $deleteFirst = true;
- }
-
- if ($deleteFirst) $onlyInsert = true;
-
- if ($ignore_flds) {
- foreach($ignore_flds as $u) {
- $ignoreflds[strtoupper($u)] = 1;
- }
- } else
- $ignoreflds = array();
-
- $src = $this->connSrc;
- $dest = $this->connDest;
- $src2 = $this->connSrc2;
-
- $dest->noNullStrings = false;
- $src->noNullStrings = false;
- $src2->noNullStrings = false;
-
- if ($src === $dest) $this->execute = false;
-
- $types = $src->MetaColumns($table);
- if (!$types) {
- echo "Source $table does not exist \n";
- return array();
- }
- $dtypes = $dest->MetaColumns($desttable);
- if (!$dtypes) {
- echo "Destination $desttable does not exist \n";
- return array();
- }
- $sa = array();
- $selflds = array();
- $wheref = array();
- $wheres = array();
- $srcwheref = array();
- $fldoffsets = array();
- $k = 0;
- foreach($types as $name => $t) {
- $name2 = strtoupper($this->RunFieldFilter($name,'SELECT'));
- // handle quotes
- if ($name2 && $name2[0] == '"' && $name2[strlen($name2)-1] == '"') $name22 = substr($name2,1,strlen($name2)-2);
- elseif ($name2 && $name2[0] == '`' && $name2[strlen($name2)-1] == '`') $name22 = substr($name2,1,strlen($name2)-2);
- else $name22 = $name2;
-
- //else $name22 = $name2; // this causes problem for quotes strip above
-
- if (!isset($dtypes[($name22)]) || !$name2) {
- if ($this->debug) echo " Skipping $name ==> $name2 as not in destination $desttable ";
- continue;
- }
-
- if ($name2 == $dstCopyDateFld) {
- $dstCopyDateName = $t->name;
- continue;
- }
-
- $fld = $t->name;
- $fldval = $t->name;
- $mt = $src->MetaType($t->type);
- if ($this->datesAreTimeStamps && $mt == 'D') $mt = 'T';
- if ($mt == 'D') $fldval = $dest->DBDate($fldval);
- elseif ($mt == 'T') $fldval = $dest->DBTimeStamp($fldval);
- $ufld = strtoupper($fld);
-
- if (isset($ignoreflds[($name2)]) && !isset($uniq[$ufld])) {
- continue;
- }
-
- if ($this->debug) echo " field=$fld type=$mt fldval=$fldval ";
-
- if (!isset($uniq[$ufld])) {
-
- $selfld = $fld;
- $fld = $this->RunFieldFilter($selfld,'SELECT');
- $selflds[] = $selfld;
-
- $p = $dest->Param($k);
-
- if ($mt == 'D') $p = $dest->DBDate($p, true);
- else if ($mt == 'T') $p = $dest->DBTimeStamp($p, true);
-
- # UPDATES
- $sets[] = "$fld = ".$this->RunUpdateFilter($desttable, $fld, $p);
-
- # INSERTS
- $insflds[] = $this->RunInsertFilter($desttable,$fld, $p); $params[] = $p;
- $k++;
- } else {
- $fld = $this->RunFieldFilter($fld);
- $wheref[] = $fld;
- if (!empty($srcuniqflds)) $srcwheref[] = $srcuniqflds[$uniq[$ufld]];
- if ($mt == 'C') { # normally we don't include the primary key in the insert if it is numeric, but ok if varchar
- $insertpkey = true;
- }
- }
- }
-
-
- foreach($extraflds as $fld => $evals) {
- if (!is_array($evals)) $evals = array($evals, $evals);
- $insflds[] = $this->RunInsertFilter($desttable,$fld, $p); $params[] = $evals[0];
- $sets[] = "$fld = ".$evals[1];
- }
-
- if ($dstCopyDateFld) {
- $sets[] = "$dstCopyDateName = ".$dest->sysTimeStamp;
- $insflds[] = $this->RunInsertFilter($desttable,$dstCopyDateName, $p); $params[] = $dest->sysTimeStamp;
- }
-
-
- if (!empty($srcPKDest)) {
- $selflds[] = $srcPKDest;
- $fldoffsets = array($k+1);
- }
-
- foreach($wheref as $uu => $fld) {
-
- $p = $dest->Param($k);
- $sp = $src->Param($k);
- if (!empty($srcuniqflds)) {
- if ($uu > 1) die("Only one primary key for srcuniqflds allowed currently");
- $destsrckey = reset($srcuniqflds);
- $wheres[] = reset($srcuniqflds).' = '.$p;
-
- $insflds[] = $this->RunInsertFilter($desttable,$destsrckey, $p);
- $params[] = $p;
- } else {
- $wheres[] = $fld.' = '.$p;
- if (!isset($ignoreflds[strtoupper($fld)]) || !empty($insertpkey)) {
- $insflds[] = $this->RunInsertFilter($desttable,$fld, $p);
- $params[] = $p;
- }
- }
-
- $selflds[] = $fld;
- $srcwheres[] = $fld.' = '.$sp;
- $fldoffsets[] = $k;
-
- $k++;
- }
-
- if (!empty($srcPKDest)) {
- $fldoffsets = array($k);
- $srcwheres = array($fld.'='.$src->Param($k));
- $k++;
- }
-
- if ($lastUpdateFld) {
- $selflds[] = $lastUpdateFld;
- } else
- $selflds[] = 'null as Z55_DUMMY_LA5TUPD';
-
- $insfldss = implode(', ', $insflds);
- $fldss = implode(', ', $selflds);
- $setss = implode(', ', $sets);
- $paramss = implode(', ', $params);
- $wheress = implode(' AND ', $wheres);
- if (isset($srcwheres))
- $srcwheress = implode(' AND ',$srcwheres);
-
-
- $seltable = $table;
- if ($this->readUncommitted && strpos($src->databaseType,'mssql')) $seltable .= ' with (NOLOCK)';
-
- $sa['SEL'] = "SELECT $fldss FROM $seltable $wheresrc";
- $sa['INS'] = "INSERT INTO $desttable ($insfldss) VALUES ($paramss) /**INS**/";
- $sa['UPD'] = "UPDATE $desttable SET $setss WHERE $wheress /**UPD**/";
-
-
-
- $DB1 = "/* Source DB - sample sql in case you need to adapt code\n\n";
- $DB2 = "/* Dest DB - sample sql in case you need to adapt code\n\n";
-
- if (!$this->execute) echo '/**/
-';
- if ($deleteFirst && $this->deleteFirst) {
- $where = preg_replace('/[ \n\r\t]+order[ \n\r\t]+by.*$/i', '', $where);
- $sql = "DELETE FROM $desttable $wheredest\n";
- if (!$this->execute) echo $DB2,' */',$sql,"\n";
- else $dest->Execute($sql);
- }
-
- global $ADODB_COUNTRECS;
- $err = false;
- $savemode = $src->setFetchMode(ADODB_FETCH_NUM);
- $ADODB_COUNTRECS = false;
-
- if (!$this->execute) {
- echo $DB1,$sa['SEL']," \n*/\n\n";
- echo $DB2,$sa['INS'],"\n*/\n\n";
- $suffix = ($onlyInsert) ? ' PRIMKEY=?' : '';
- echo $DB2,$sa['UPD'],"$suffix\n*/\n\n";
-
- $rs = $src->Execute($sa['SEL']);
- $cnt = 1;
- $upd = 0;
- $ins = 0;
-
- $sqlarr = explode('?',$sa['INS']);
- $nparams = sizeof($sqlarr)-1;
-
- $useQmark = $dest && ($dest->dataProvider != 'oci8');
-
- while ($rs && !$rs->EOF) {
- if ($useQmark) {
- $sql = ''; $i = 0;
- $arr = array_reverse($rs->fields);
- //Use each() instead of foreach to reduce memory usage -mikefedyk
- while(list(, $v) = each($arr)) {
- $sql .= $sqlarr[$i];
- // from Ron Baldwin
- // Only quote string types
- $typ = gettype($v);
- if ($typ == 'string')
- //New memory copy of input created here -mikefedyk
- $sql .= $dest->qstr($v);
- else if ($typ == 'double')
- $sql .= str_replace(',','.',$v); // locales fix so 1.1 does not get converted to 1,1
- else if ($typ == 'boolean')
- $sql .= $v ? $dest->true : $dest->false;
- else if ($typ == 'object') {
- if (method_exists($v, '__toString')) $sql .= $dest->qstr($v->__toString());
- else $sql .= $dest->qstr((string) $v);
- } else if ($v === null)
- $sql .= 'NULL';
- else
- $sql .= $v;
- $i += 1;
-
- if ($i == $nparams) break;
- } // while
-
- if (isset($sqlarr[$i])) {
- $sql .= $sqlarr[$i];
- }
- $INS = $sql;
- } else {
- $INS = $sa['INS'];
- $arr = array_reverse($rs->fields);
- foreach($arr as $k => $v) { // only works on oracle currently
- $k = sizeof($arr)-$k-1;
- $v = str_replace(":","%~%COLON%!%",$v);
- $INS = str_replace(':'.$k,$this->fixupbinary($dest->qstr($v)),$INS);
- }
- $INS = str_replace("%~%COLON%!%",":",$INS);
- if ($this->htmlSpecialChars) $INS = htmlspecialchars($INS);
- }
- echo "-- $cnt\n",$INS,";\n\n";
- $cnt += 1;
- $ins += 1;
- $rs->MoveNext();
- }
- $src->setFetchMode($savemode);
- return $sa;
- } else {
- $saved = $src->debug;
- #$src->debug=1;
- if ($this->limitRecs>100)
- $rs = $src->SelectLimit($sa['SEL'],$this->limitRecs);
- else
- $rs = $src->Execute($sa['SEL']);
- $src->debug = $saved;
- if (!$rs) {
- if ($this->errHandler) $this->_doerr('SEL',array());
- return array(0,0,0,0);
- }
-
-
- if ($this->commitReplicate || $commitRecs > 0) {
- $dest->BeginTrans();
- if ($this->updateSrcFn) $src2->BeginTrans();
- }
-
- if ($this->updateSrcFn && strpos($src2->databaseType,'mssql') !== false) {
- # problem is writers interfere with readers in mssql
- $rs = $src->_rs2rs($rs);
- }
- $cnt = 0;
- $upd = 0;
- $ins = 0;
-
- $sizeofrow = sizeof($selflds);
-
- $fn = $this->selFilter;
- $commitRecs = $this->commitRecs;
-
- $saved = $dest->debug;
-
- if ($this->deleteFirst) $onlyInsert = true;
- while ($origrow = $rs->FetchRow()) {
-
- if ($dest->debug) {flush(); @ob_flush();}
-
- if ($fn) {
- if (!$fn($desttable, $origrow, $deleteFirst, $this, $selflds)) continue;
- }
- $doinsert = true;
- $row = array_slice($origrow,0,$sizeofrow-1);
-
- if (!$onlyInsert) {
- $doinsert = false;
- $upderr = false;
-
- if (isset($srcPKDest)) {
- if (is_null($origrow[$sizeofrow-3])) {
- $doinsert = true;
- $upderr = true;
- }
- }
- if (!$upderr && !$dest->Execute($sa['UPD'],$row)) {
- $err = true;
- $upderr = true;
- if ($this->errHandler) $this->_doerr('UPD',$row);
- if (!$this->neverAbort) break;
- }
-
- if ($upderr || $dest->Affected_Rows() == 0) {
- $doinsert = true;
- } else {
- if (!empty($uniqflds)) $this->RunUpdateSrcFn($src2, $table, $fldoffsets, $origrow, $srcwheress, 'UPD', null, $lastUpdateFld);
- $upd += 1;
- }
- }
-
- if ($doinsert) {
- $inserr = false;
- if (isset($srcPKDest)) {
- $row = array_slice($origrow,0,$sizeofrow-2);
- }
-
- if (! $dest->Execute($sa['INS'],$row)) {
- $err = true;
- $inserr = true;
- if ($this->errHandler) $this->_doerr('INS',$row);
- if ($this->neverAbort) continue;
- else break;
- } else {
- if ($dest->dataProvider == 'oci8') {
- if ($this->oracleSequence) $lastid = $dest->GetOne("select ".$this->oracleSequence.".currVal from dual");
- else $lastid = 'null';
- } else {
- $lastid = $dest->Insert_ID();
- }
-
- if (!$inserr && !empty($uniqflds)) {
- $this->RunUpdateSrcFn($src2, $table, $fldoffsets, $origrow, $srcwheress, 'INS', $lastid,$lastUpdateFld);
- }
- $ins += 1;
- }
- }
- $cnt += 1;
-
- if ($commitRecs > 0 && ($cnt % $commitRecs) == 0) {
- $dest->CommitTrans();
- $dest->BeginTrans();
-
- if ($this->updateSrcFn) {
- $src2->CommitTrans();
- $src2->BeginTrans();
- }
- }
-
- } // while
-
-
- if ($this->commitReplicate || $commitRecs > 0) {
- if (!$this->neverAbort && $err) {
- $dest->RollbackTrans();
- if ($this->updateSrcFn) $src2->RollbackTrans();
- } else {
- $dest->CommitTrans();
- if ($this->updateSrcFn) $src2->CommitTrans();
- }
- }
- }
- if ($cnt != $ins + $upd) echo "ERROR: $cnt != INS $ins + UPD $upd
";
- $src->setFetchMode($savemode);
- return array(!$err, $cnt, $ins, $upd);
- }
- // trigger support only for sql server and oracle
- // need to add
- function MergeSrcSetup($srcTable, $pkeys, $srcUpdateDateFld, $srcCopyDateFld, $srcCopyFlagFld,
- $srcCopyFlagType='C(1)', $srcCopyFlagVals = array('Y','N','P','='))
- {
- $sqla = array();
- $src = $this->connSrc;
- $idx = $srcTable.'_mrgIdx';
- $cols = $src->MetaColumns($srcTable);
- #adodb_pr($cols);
- if (!isset($cols[strtoupper($srcUpdateDateFld)])) {
- $sqla = $this->ddSrc->AddColumnSQL($srcTable, "$srcUpdateDateFld TS DEFTIMESTAMP");
- foreach($sqla as $sql) $src->Execute($sql);
- }
-
- if ($srcCopyDateFld && !isset($cols[strtoupper($srcCopyDateFld)])) {
- $sqla = $this->ddSrc->AddColumnSQL($srcTable, "$srcCopyDateFld TS DEFTIMESTAMP");
- foreach($sqla as $sql) $src->Execute($sql);
- }
-
- $sysdate = $src->sysTimeStamp;
- $arrv0 = $src->qstr($srcCopyFlagVals[0]);
- $arrv1 = $src->qstr($srcCopyFlagVals[1]);
- $arrv2 = $src->qstr($srcCopyFlagVals[2]);
- $arrv3 = $src->qstr($srcCopyFlagVals[3]);
-
- if ($srcCopyFlagFld && !isset($cols[strtoupper($srcCopyFlagFld)])) {
- $sqla = $this->ddSrc->AddColumnSQL($srcTable, "$srcCopyFlagFld $srcCopyFlagType DEFAULT $arrv1");
- foreach($sqla as $sql) $src->Execute($sql);
- }
-
- $sqla = array();
-
-
- $name = "{$srcTable}_mrgTr";
- if (is_array($pkeys) && strpos($src->databaseType,'mssql') !== false) {
- $pk = reset($pkeys);
-
- #$sqla[] = "DROP TRIGGER $name";
- $sqltr = "
- TRIGGER $name
- ON $srcTable /* for data replication and merge */
- AFTER UPDATE
- AS
- UPDATE $srcTable
- SET
- $srcUpdateDateFld = case when I.$srcCopyFlagFld = $arrv2 or I.$srcCopyFlagFld = $arrv3 then I.$srcUpdateDateFld
- else $sysdate end,
- $srcCopyFlagFld = case
- when I.$srcCopyFlagFld = $arrv2 then $arrv0
- when I.$srcCopyFlagFld = $arrv3 then D.$srcCopyFlagFld
- else $arrv1 end
- FROM $srcTable S Join Inserted AS I on I.$pk = S.$pk
- JOIN Deleted as D ON I.$pk = D.$pk
- WHERE I.$srcCopyFlagFld = D.$srcCopyFlagFld or I.$srcCopyFlagFld = $arrv2
- or I.$srcCopyFlagFld = $arrv3 or I.$srcCopyFlagFld is null
- ";
- $sqla[] = 'CREATE '.$sqltr; // first if does not exists
- $sqla[] = 'ALTER '.$sqltr; // second if it already exists
- } else if (strpos($src->databaseType,'oci') !== false) {
-
- if (strlen($srcTable)>22) $tableidx = substr($srcTable,0,16).substr(crc32($srcTable),6);
- else $tableidx = $srcTable;
-
- $name = $tableidx.$this->trgSuffix;
- $idx = $tableidx.$this->idxSuffix;
- $sqla[] = "
-CREATE OR REPLACE TRIGGER $name /* for data replication and merge */
-BEFORE UPDATE ON $srcTable REFERENCING NEW AS NEW OLD AS OLD
-FOR EACH ROW
-BEGIN
- if :new.$srcCopyFlagFld = $arrv2 then
- :new.$srcCopyFlagFld := $arrv0;
- elsif :new.$srcCopyFlagFld = $arrv3 then
- :new.$srcCopyFlagFld := :old.$srcCopyFlagFld;
- elsif :old.$srcCopyFlagFld = :new.$srcCopyFlagFld or :new.$srcCopyFlagFld is null then
- if $this->trLogic then
- :new.$srcUpdateDateFld := $sysdate;
- :new.$srcCopyFlagFld := $arrv1;
- end if;
- end if;
-END;
-";
- }
- foreach($sqla as $sql) $src->Execute($sql);
-
- if ($srcCopyFlagFld) $srcCopyFlagFld .= ', ';
- $src->Execute("CREATE INDEX {$idx} on $srcTable ($srcCopyFlagFld$srcUpdateDateFld)");
- }
-
-
- /*
- Perform Merge by copying all data modified from src to dest
- then update src copied flag if present.
-
- Returns array taken from ReplicateData:
-
- Returns an array:
- $arr[0] = true if no error, false if error
- $arr[1] = number of recs processed
- $arr[2] = number of successful inserts
- $arr[3] = number of successful updates
-
- $srcTable = src table
- $dstTable = dest table
- $pkeys = primary keys array. if empty, then only inserts will occur
- $srcignoreflds = ignore these flds (must be upper cased)
- $setsrc = updateSrcFn string
- $srcUpdateDateFld = field in src with the last update date
- $srcCopyFlagFld = false = optional field that holds the copied indicator
- $flagvals=array('Y','N','P','=') = array of values indicating array(copied, not copied).
- Null is assumed to mean not copied. The 3rd value 'P' indicates that we want to force 'Y', bypassing
- default trigger behaviour to reset the COPIED='N' when the record is replicated from other side.
- The last value '=' is don't change copyflag.
- $srcCopyDateFld = field that holds last copy date in src table, which will be updated on Merge()
- $dstCopyDateFld = field that holds last copy date in dst table, which will be updated on Merge()
- $defaultDestRaiseErrorFn = The adodb raiseErrorFn handler. Default is to not raise an error.
- Just output error message to stdout
-
- */
-
-
- function Merge($srcTable, $dstTable, $pkeys, $srcignoreflds, $setsrc,
- $srcUpdateDateFld,
- $srcCopyFlagFld, $flagvals=array('Y','N','P','='),
- $srcCopyDateFld = false,
- $dstCopyDateFld = false,
- $whereClauses = '',
- $orderBy = '', # MUST INCLUDE THE "ORDER BY" suffix
- $copyDoneFlagIdx = 3,
- $defaultDestRaiseErrorFn = '')
- {
- $src = $this->connSrc;
- $dest = $this->connDest;
-
- $time = $src->Time();
-
- $delfirst = $this->deleteFirst;
- $upd = $this->updateSrcFn;
-
- $this->deleteFirst = false;
- //$this->updateFirst = true;
-
- $srcignoreflds[] = $srcUpdateDateFld;
- $srcignoreflds[] = $srcCopyFlagFld;
- $srcignoreflds[] = $srcCopyDateFld;
-
- if (empty($whereClauses)) $whereClauses = '1=1';
- $where = " WHERE ($whereClauses) and ($srcCopyFlagFld = ".$src->qstr($flagvals[1]).')';
- if ($orderBy) $where .= ' '.$orderBy;
- else $where .= ' ORDER BY '.$srcUpdateDateFld;
-
- if ($setsrc) $set[] = $setsrc;
- else $set = array();
-
- if ($srcCopyFlagFld) $set[] = "$srcCopyFlagFld = ".$src->qstr($flagvals[2]);
- if ($srcCopyDateFld) $set[]= "$srcCopyDateFld = ".$src->sysTimeStamp;
- if ($set) $this->updateSrcFn = array(implode(', ',$set));
- else $this->updateSrcFn = '';
-
-
- $extra[$srcCopyFlagFld] = array($dest->qstr($flagvals[0]),$dest->qstr($flagvals[$copyDoneFlagIdx]));
-
- $saveraise = $dest->raiseErrorFn;
- $dest->raiseErrorFn = '';
-
- if ($this->compat && $this->compat == 1.0) $srcUpdateDateFld = '';
- $arr = $this->ReplicateData($srcTable, $dstTable, $pkeys, $where, $srcignoreflds,
- $dstCopyDateFld,$extra,$srcUpdateDateFld);
-
- $dest->raiseErrorFn = $saveraise;
-
- $this->updateSrcFn = $upd;
- $this->deleteFirst = $delfirst;
-
- return $arr;
- }
- /*
- If doing a 2 way merge, then call
- $rep->Merge()
- to save without modifying the COPIEDFLAG ('=').
-
- Then can the following to set the COPIEDFLAG to 'P' which forces the COPIEDFLAG = 'Y'
- $rep->MergeDone()
- */
-
- function MergeDone($srcTable, $dstTable, $pkeys, $srcignoreflds, $setsrc,
- $srcUpdateDateFld,
- $srcCopyFlagFld, $flagvals=array('Y','N','P','='),
- $srcCopyDateFld = false,
- $dstCopyDateFld = false,
- $whereClauses = '',
- $orderBy = '', # MUST INCLUDE THE "ORDER BY" suffix
- $copyDoneFlagIdx = 2,
- $defaultDestRaiseErrorFn = '')
- {
- return $this->Merge($srcTable, $dstTable, $pkeys, $srcignoreflds, $setsrc,
- $srcUpdateDateFld,
- $srcCopyFlagFld, $flagvals,
- $srcCopyDateFld,
- $dstCopyDateFld,
- $whereClauses,
- $orderBy, # MUST INCLUDE THE "ORDER BY" suffix
- $copyDoneFlagIdx,
- $defaultDestRaiseErrorFn);
- }
-
- function _doerr($reason, $selflds)
- {
- $fn = $this->errHandler;
- if ($fn) $fn($this, $reason, $selflds); // set $this->neverAbort to true or false as required inside $fn
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/replicate/replicate-steps.php b/sources/vendor/adodb/adodb-php/replicate/replicate-steps.php
deleted file mode 100644
index 5b69656..0000000
--- a/sources/vendor/adodb/adodb-php/replicate/replicate-steps.php
+++ /dev/null
@@ -1,137 +0,0 @@
-Connect($HOST,$USER,$PWD,$DBASE);
-if (!$ok) return;
-
-
-#$DB->debug=1;
-
-$bkup = 'tmp'.date('ymd_His');
-
-
-if ($BA) {
- $QTY_BA = " and qu_bacode='$BA'";
- if (1) $STP_BA = " and s_stagecat in (select stg_stagecat from kbstage where stg_bacode='$BA')"; # OLDER KBSTEP
- else $STP_BA = " and s_bacode='$BA'"; # LATEST KBSTEP format
- $STG_BA = " and stg_bacode='$BA'";
-} else {
- $QTY_BA = "";
- $STP_BA = "";
- $STG_BA = "";
-}
-
-if ($STAGES) {
-
- $STAGES = explode(',',$STAGES);
- $STAGES = "'".implode("','",$STAGES)."'";
- $QTY_STG = " and qu_stagecat in ($STAGES)";
- $STP_STG = " and s_stagecat in ($STAGES)";
- $STG_STG = " and stg_stagecat in ($STAGES)";
-} else {
- $QTY_STG = "";
- $STP_STG = "";
- $STG_STG = "";
-}
-
-echo "
-
-/******************************************************************************
-
- Migrate stages, steps and qtypes for the following
-
- business area: $BA
- and stages: $STAGES
-
-
- WARNING: DO NOT 'Ignore All Errors'.
- If any error occurs, make sure you stop and check the reason and fix it.
- Otherwise you could corrupt everything!!!
-
- Connected to $USER@$DBASE $HOST;
-
-*******************************************************************************/
-
--- BACKUP
-create table kbstage_$bkup as select * from kbstage;
-create table kbstep_$bkup as select * from kbstep;
-create table kbqtype_$bkup as select * from kbqtype;
-
-
--- IF CODE FAILS, REMEMBER TO RENABLE ALL TRIGGERS and following CONSTRAINT
-ALTER TABLE kbstage DISABLE all triggers;
-ALTER TABLE kbstep DISABLE all triggers;
-ALTER TABLE kbqtype DISABLE all triggers;
-ALTER TABLE jqueue DISABLE CONSTRAINT QUEUE_MUST_HAVE_TYPE;
-
-
--- NOW DELETE OLD STEPS/STAGES/QUEUES
-delete from kbqtype where qu_mode in ('STAGE','STEP') $QTY_BA $QTY_STG;
-delete from kbstep where (1=1) $STP_BA$STP_STG;
-delete from kbstage where (1=1)$STG_BA$STG_STG;
-
-
-
-SET DEFINE OFF; -- disable variable handling by sqlplus
-/
-/* Assume kbstrategy and business areas are compatible for steps and stages to be copied */
-
-
-";
-
-
-$rep = new ADODB_Replicate($DB,$DB);
-$rep->execute = false;
-$rep->deleteFirst = false;
-
- // src table name, dst table name, primary key, where condition
-$rep->ReplicateData('KBSTAGE', 'KBSTAGE', array(), " where (1=1)$STG_BA$STG_STG");
-$rep->ReplicateData('KBSTEP', 'KBSTEP', array(), " where (1=1)$STP_BA$STP_STG");
-$rep->ReplicateData('KBQTYPE','KBQTYPE',array()," where qu_mode in ('STAGE','STEP')$QTY_BA$QTY_STG");
-
-echo "
-
--- Check for QUEUES not in KBQTYPE and FIX by copying from kbqtype_$bkup
-begin
-for rec in (select distinct q_type from jqueue where q_type not in (select qu_code from kbqtype)) loop
- insert into kbqtype select * from kbqtype_$bkup where qu_code = rec.q_type;
- update kbqtype set qu_name=substr('MISSING.'||qu_name,1,64) where qu_code=rec.q_type;
-end loop;
-end;
-/
-
-commit;
-
-
-ALTER TABLE kbstage ENABLE all triggers;
-ALTER TABLE kbstep ENABLE all triggers;
-ALTER TABLE kbqtype ENABLE all triggers;
-ALTER TABLE jqueue ENABLE CONSTRAINT QUEUE_MUST_HAVE_TYPE;
-
-/*
--- REMEMBER TO COMMIT
- commit;
- begin Juris.UpdateQCounts; end;
-
--- To check for bad queues after conversion, run this
- select * from kbqtype where qu_name like 'MISSING%'
-*/
-/
-";
diff --git a/sources/vendor/adodb/adodb-php/replicate/test-tnb.php b/sources/vendor/adodb/adodb-php/replicate/test-tnb.php
deleted file mode 100644
index f163ff4..0000000
--- a/sources/vendor/adodb/adodb-php/replicate/test-tnb.php
+++ /dev/null
@@ -1,421 +0,0 @@
- 28) $idxname = substr($idxname,0,24).rand(1000,9999);
- return $idxname;
-}
-
-function SelFilter($table, &$arr, $delfirst)
-{
- return true;
-}
-
-function updatefilter($table, $fld, $val)
-{
- return "nvl($fld, $val)";
-}
-
-
-function FieldFilter(&$fld,$mode)
-{
- $uf = strtoupper($fld);
- switch($uf) {
- case 'SIZEFLD':
- return 'Size';
-
- case 'GROUPFLD':
- return 'Group';
-
- case 'GROUP':
- if ($mode == 'SELECT') $fld = '"Group"';
- return 'GroupFld';
- case 'SIZE':
- if ($mode == 'SELECT') $fld = '"Size"';
- return 'SizeFld';
- }
- return $fld;
-}
-
-function ParseTable(&$table, &$pkey)
-{
- $table = trim($table);
- if (strlen($table) == 0) return false;
- if (strpos($table, '#') !== false) {
- $at = strpos($table, '#');
- $table = trim(substr($table,0,$at));
- if (strlen($table) == 0) return false;
- }
-
- $tabarr = explode(',',$table);
- if (sizeof($tabarr) == 1) {
- $table = $tabarr[0];
- $pkey = '';
- echo "No primary key for $table **** **** ";
- } else {
- $table = trim($tabarr[0]);
- $pkey = trim($tabarr[1]);
- if (strpos($pkey,' ') !== false) echo "Bad PKEY for $table $pkey ";
- }
-
- return true;
-}
-
-global $TARR;
-
-function TableStats($rep, $table, $pkey)
-{
-global $TARR;
-
- if (empty($TARR)) $TARR = array();
- $cnt = $rep->connSrc->GetOne("select count(*) from $table");
- if (isset($TARR[$table])) echo "Table $table repeated twice ";
- $TARR[$table] = $cnt;
-
- if ($pkey) {
- $ok = $rep->connSrc->SelectLimit("select $pkey from $table",1);
- if (!$ok) echo "$table: $pkey does not exist ";
- } else
- echo "$table: no primary key ";
-}
-
-function CreateTable($rep, $table)
-{
-## CREATE TABLE
- #$DB2->Execute("drop table $table");
-
- $rep->execute = true;
- $ok = $rep->CopyTableStruct($table);
- if ($ok) echo "Table Created \n";
- else {
- echo " Error: Cannot Create Table \n";
- }
- flush();@ob_flush();
-}
-
-function CopyData($rep, $table, $pkey)
-{
- $dtable = $table;
-
- $rep->execute = true;
- $rep->deleteFirst = true;
-
- $secs = time();
- $rows = $rep->ReplicateData($table,$dtable,array($pkey));
- $secs = time() - $secs;
- if (!$rows || !$rows[0] || !$rows[1] || $rows[1] != $rows[2]+$rows[3]) {
- echo " Error: "; var_dump($rows); echo " (secs=$secs) \n";
- } else
- echo date('H:i:s'),': ',$rows[1]," record(s) copied, ",$rows[2]," inserted, ",$rows[3]," updated (secs=$secs) \n";
- flush();@ob_flush();
-}
-
-function MergeDataJohnTest($rep, $table, $pkey)
-{
- $rep->SwapDBs();
-
- $dtable = $table;
- $rep->oracleSequence = 'LGBSEQUENCE';
-
-# $rep->MergeSrcSetup($table, array($pkey),'UpdatedOn','CopiedFlag');
- if (strpos($rep->connDest->databaseType,'mssql') !== false) { # oracle ==> mssql
- $ignoreflds = array($pkey);
- $ignoreflds[] = 'MSSQL_ID';
- $set = 'MSSQL_ID=nvl($INSERT_ID,MSSQL_ID)';
- $pkeyarr = array(array($pkey),false,array('MSSQL_ID'));# array('MSSQL_ID', 'ORA_ID'));
- } else { # mssql ==> oracle
- $ignoreflds = array($pkey);
- $ignoreflds[] = 'ORA_ID';
- $set = '';
- #$set = 'ORA_ID=isnull($INSERT_ID,ORA_ID)';
- $pkeyarr = array(array($pkey),array('MSSQL_ID'));
- }
- $rep->execute = true;
- #$rep->updateFirst = false;
- $ok = $rep->Merge($table, $dtable, $pkeyarr, $ignoreflds, $set, 'UpdatedOn','CopiedFlag',array('Y','N','P','='), 'CopyDate');
- var_dump($ok);
-
- #$rep->connSrc->Execute("update JohnTest set name='Apple' where id=4");
-}
-
-$DB = ADONewConnection('odbtp');
-#$ok = $DB->Connect('localhost','root','','northwind');
-$ok = $DB->Connect('192.168.0.1','DRIVER={SQL Server};SERVER=(local);UID=sa;PWD=natsoft;DATABASE=OIR;','','');
-$DB->_bindInputArray = false;
-
-$DB2 = ADONewConnection('oci8');
-$ok2 = $DB2->Connect('192.168.0.2','tnb','natsoft','RAPTOR','');
-
-if (!$ok || !$ok2) die("Failed connection DB=$ok DB2=$ok2 ");
-
-$tables =
-"
-JohnTest,id
-";
-
-# net* are ERMS, need last updated field from LGBnet
-# tblRep* are tables insert or update from Juris, need last updated field also
-# The rest are lookup tables, can copy all from LGBnet
-
-$tablesOrig =
-"
-SysVoltSubLevel,id
-# Lookup table for Restoration Details screen
-sysefi,ID # (not identity)
-sysgenkva,ID #(not identity)
-sysrestoredby,ID #(not identity)
-# Sel* table added on 24 Oct
-SELSGManufacturer,ID
-SelABCCondSizeLV,ID
-SelABCCondSizeMV,ID
-SelArchingHornSize,ID
-SelBallastSize,ID
-SelBallastType,ID
-SelBatteryType,ID #(not identity)
-SelBreakerCapacity,ID
-SelBreakerType,ID #(not identity)
-SelCBreakerManuf,ID
-SelCTRatio,ID #(not identity)
-SelCableBrand,ID
-SelCableSize,ID
-SelCableSizeLV,ID # (not identity)
-SelCapacitorSize,ID
-SelCapacitorType,ID
-SelColourCode,ID
-SelCombineSealingChamberSize,ID
-SelConductorBrand,ID
-SelConductorSize4,ID
-SelConductorSizeLV,ID
-SelConductorSizeMV,ID
-SelContactorSize,ID
-SelContractor,ID
-SelCoverType,ID
-SelCraddleSize,ID
-SelDeadEndClampBrand,ID
-SelDeadEndClampSize,ID
-SelDevTermination,ID
-SelFPManuf,ID
-SelFPillarRating,ID
-SelFalseTrue,ID
-SelFuseManuf,ID
-SelFuseType,ID
-SelIPCBrand,ID
-SelIPCSize,ID
-SelIgnitorSize,ID
-SelIgnitorType,ID
-SelInsulatorBrand,ID
-SelJoint,ID
-SelJointBrand,ID
-SelJunctionBoxBrand,ID
-SelLVBoardBrand,ID
-SelLVBoardSize,ID
-SelLVOHManuf,ID
-SelLVVoltage,ID
-SelLightningArresterBrand,ID
-SelLightningShieldwireSize,ID
-SelLineTapSize,ID
-SelLocation,ID
-SelMVVoltage,ID
-SelMidSpanConnectorsSize,ID
-SelMidSpanJointSize,ID
-SelNERManuf,ID
-SelNERType,ID
-SelNLinkSize,ID
-SelPVCCondSizeLV,ID
-SelPoleBrand,ID
-SelPoleConcreteSize,ID
-SelPoleSize,ID
-SelPoleSpunConcreteSize,ID
-SelPoleSteelSize,ID
-SelPoleType,ID
-SelPoleWoodSize,ID
-SelPorcelainFuseSize,ID
-SelRatedFaultCurrentBreaker,ID
-SelRatedVoltageSG,ID #(not identity)
-SelRelayType,ID # (not identity)
-SelResistanceValue,ID
-SelSGEquipmentType,ID # (not identity)
-SelSGInsulationType,ID # (not identity)
-SelSGManufacturer,ID
-SelStayInsulatorSize,ID
-SelSuspensionClampBrand,ID
-SelSuspensionClampSize,ID
-SelTSwitchType,ID
-SelTowerType,ID
-SelTransformerCapacity,ID
-SelTransformerManuf,ID
-SelTransformerType,ID #(not identity)
-SelTypeOfArchingHorn,ID
-SelTypeOfCable,ID #(not identity)
-SelTypeOfConductor,ID # (not identity)
-SelTypeOfInsulationCB,ID # (not identity)
-SelTypeOfMidSpanJoint,ID
-SelTypeOfSTJoint,ID
-SelTypeSTCable,ID
-SelUGVoltage,ID # (not identity)
-SelVoltageInOut,ID
-SelWireSize,ID
-SelWireType,ID
-SelWonpieceBrand,ID
-#
-# Net* tables added on 24 Oct
-NetArchingHorn,Idx
-NetBatteryBank,Idx # identity, FunctLocation Pri
-NetBiMetal,Idx
-NetBoxFuse,Idx
-NetCable,Idx # identity, FunctLocation Pri
-NetCapacitorBank,Idx # identity, FunctLocation Pri
-NetCircuitBreaker,Idx # identity, FunctLocation Pri
-NetCombineSealingChamber,Idx
-NetCommunication,Idx
-NetCompInfras,Idx
-NetControl,Idx
-NetCraddle,Idx
-NetDeadEndClamp,Idx
-NetEarthing,Idx
-NetFaultIndicator,Idx
-NetFeederPillar,Idx # identity, FunctLocation Pri
-NetGenCable,Idx # identity , FunctLocation Not Null
-NetGenerator,Idx
-NetGrid,Idx
-NetHVOverhead,Idx #identity, FunctLocation Pri
-NetHVUnderground,Idx #identity, FunctLocation Pri
-NetIPC,Idx
-NetInductorBank,Idx
-NetInsulator,Idx
-NetJoint,Idx
-NetJunctionBox,Idx
-NetLVDB,Idx #identity, FunctLocation Pri
-NetLVOverhead,Idx
-NetLVUnderground,Idx # identity, FunctLocation Not Null
-NetLightningArrester,Idx
-NetLineTap,Idx
-NetMidSpanConnectors,Idx
-NetMidSpanJoint,Idx
-NetNER,Idx # identity , FunctLocation Pri
-NetOilPump,Idx
-NetOtherComponent,Idx
-NetPole,Idx
-NetRMU,Idx # identity, FunctLocation Pri
-NetStreetLight,Idx
-NetStrucSupp,Idx
-NetSuspensionClamp,Idx
-NetSwitchGear,Idx # identity, FunctLocation Pri
-NetTermination,Idx
-NetTransition,Idx
-NetWonpiece,Idx
-#
-# comment1
-SelMVFuseType,ID
-selFuseSize,ID
-netRelay,Idx # identity, FunctLocation Pri
-SysListVolt,ID
-sysVoltLevel,ID_SVL
-sysRestoration,ID_SRE
-sysRepairMethod,ID_SRM # (not identity)
-
-sysInterruptionType,ID_SIN
-netTransformer,Idx # identity, FunctLocation Pri
-#
-#
-sysComponent,ID_SC
-sysCodecibs #-- no idea, UpdatedOn(the only column is unique),Ermscode,Cibscode is unique but got null value
-sysCodeno,id
-sysProtection,ID_SP
-sysEquipment,ID_SEQ
-sysAddress #-- no idea, ID_SAD(might be auto gen No)
-sysWeather,ID_SW
-sysEnvironment,ID_SE
-sysPhase,ID_SPH
-sysFailureCause,ID_SFC
-sysFailureMode,ID_SFM
-SysSchOutageMode,ID_SSM
-SysOutageType,ID_SOT
-SysInstallation,ID_SI
-SysInstallationCat,ID_SIC
-SysInstallationType,ID_SIT
-SysFaultCategory,ID_SF #(not identity)
-SysResponsible,ID_SR
-SysProtectionOperation,ID_SPO #(not identity)
-netCodename,CodeNo #(not identity)
-netSubstation,Idx #identity, FunctLocation Pri
-netLvFeeder,Idx # identity, FunctLocation Pri
-#
-#
-tblReport,ReportNo
-tblRepRestoration,ID_RR
-tblRepResdetail,ID_RRD
-tblRepFailureMode,ID_RFM
-tblRepFailureCause,ID_RFC
-tblRepRepairMethod,ReportNo # (not identity)
-tblInterruptionType,ID_TIN
-tblProtType,ID_PT #--capital letter
-tblRepProtection,ID_RP
-tblRepComponent,ID_RC
-tblRepWeather,ID_RW
-tblRepEnvironment,ID_RE
-tblRepSubstation,ID_RSS
-tblInstallationType,ID_TIT
-tblInstallationCat,ID_TIC
-tblFailureCause,ID_TFC
-tblFailureMode,ID_TFM
-tblProtection,ID_TP
-tblComponent,ID_TC
-tblProtdetail,Id # (Id)--capital letter for I
-tblInstallation,ID_TI
-#
-";
-
-
-$tables = explode("\n",$tables);
-
-$rep = new ADODB_Replicate($DB,$DB2);
-$rep->fieldFilter = 'FieldFilter';
-$rep->selFilter = 'SELFILTER';
-$rep->indexFilter = 'IndexFilter';
-
-if (1) {
- $rep->debug = 1;
- $DB->debug=1;
- $DB2->debug=1;
-}
-
-# $rep->SwapDBs();
-
-$cnt = sizeof($tables);
-foreach($tables as $k => $table) {
- $pkey = '';
- if (!ParseTable($table, $pkey)) continue;
-
- #######################
-
- $kcnt = $k+1;
- echo "($kcnt/$cnt) $table -- $pkey \n";
- flush();@ob_flush();
-
- CreateTable($rep,$table);
-
-
- # COPY DATA
-
-
- TableStats($rep, $table, $pkey);
-
- if ($table == 'JohnTest') MergeDataJohnTest($rep, $table, $pkey);
- else CopyData($rep, $table, $pkey);
-
-}
-
-
-if (!empty($TARR)) {
- ksort($TARR);
- adodb_pr($TARR);
- asort($TARR);
- adodb_pr($TARR);
-}
-
-echo " ",date('H:i:s'),": Done";
diff --git a/sources/vendor/adodb/adodb-php/rsfilter.inc.php b/sources/vendor/adodb/adodb-php/rsfilter.inc.php
deleted file mode 100644
index f3cd533..0000000
--- a/sources/vendor/adodb/adodb-php/rsfilter.inc.php
+++ /dev/null
@@ -1,60 +0,0 @@
- $v) {
- $arr[$k] = ucwords($v);
- }
- }
- $rs = RSFilter($rs,'do_ucwords');
- */
-function RSFilter($rs,$fn)
-{
- if ($rs->databaseType != 'array') {
- if (!$rs->connection) return false;
-
- $rs = $rs->connection->_rs2rs($rs);
- }
- $rows = $rs->RecordCount();
- for ($i=0; $i < $rows; $i++) {
- if (is_array ($fn)) {
- $obj = $fn[0];
- $method = $fn[1];
- $obj->$method ($rs->_array[$i],$rs);
- } else {
- $fn($rs->_array[$i],$rs);
- }
-
- }
- if (!$rs->EOF) {
- $rs->_currentRow = 0;
- $rs->fields = $rs->_array[0];
- }
-
- return $rs;
-}
diff --git a/sources/vendor/adodb/adodb-php/scripts/.gitignore b/sources/vendor/adodb/adodb-php/scripts/.gitignore
deleted file mode 100644
index 3e0e62b..0000000
--- a/sources/vendor/adodb/adodb-php/scripts/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-# Python byte code
-*.pyc
diff --git a/sources/vendor/adodb/adodb-php/scripts/TARADO5.BAT b/sources/vendor/adodb/adodb-php/scripts/TARADO5.BAT
deleted file mode 100644
index bf25ef9..0000000
--- a/sources/vendor/adodb/adodb-php/scripts/TARADO5.BAT
+++ /dev/null
@@ -1,49 +0,0 @@
-@rem REQUIRES P:\INSTALLS\CMDUTILS
-
-echo Don't forget to strip LF's !!!!!!!!!!!
-pause
-
-
-set VER=518a
-
-d:
-cd \inetpub\wwwroot\php
-
-@del /s /q zadodb\*.*
-@mkdir zadodb
-
-@REM not for release -- make sure in VSS
-attrib -r adodb5\drivers\adodb-text.inc.php
-del adodb5\*.bak
-del adodb5\drivers\*.bak
-del adodb5\hs~*.*
-del adodb5\drivers\hs~*.*
-del adodb5\tests\hs~*.*
-del adodb5\drivers\adodb-text.inc.php
-del adodb5\.#*
-del adodb5\replicate\replicate-steps.php
-del adodb5\replicate\test*.php
-del adodb5\adodb-lite.inc.php
-attrib -r adodb5\*.php
-del adodb5\cute_icons_for_site\*.png
-
-del tmp.tar
-del adodb5*.tgz
-del adodb5*.zip
-
-@mkdir adodb5\docs
-move /y adodb5\*.htm adodb5\docs
-
-@rem CREATE TAR FILE
-tar -f adodb%VER%.tar -c adodb5/*.* adodb5/perf/*.* adodb5/session/*.* adodb5/pear/*.txt adodb5/pear/Auth/Container/ADOdb.php adodb5/session/old/*.* adodb5/drivers/*.* adodb5/lang/*.* adodb5/tests/*.* adodb5/cute_icons_for_site/*.* adodb5/datadict/*.* adodb5/contrib/*.* adodb5/xsl/*.* adodb5/docs/*.*
-
-@rem CREATE ZIP FILE
-cd zadodb
-tar -xf ..\adodb%VER%.TAR
-zip -r ..\adodb%VER%.zip adodb5
-cd ..
-
-@rem CREATE TGZ FILE, THE RENAME CHANGES UPPERCASE TO LOWERCASE
-gzip -v ADODB%VER%.tar -S .tgz -9
-rename ADODB%VER%.tar.TGZ adodb%VER%.tgz
-
diff --git a/sources/vendor/adodb/adodb-php/scripts/buildrelease.py b/sources/vendor/adodb/adodb-php/scripts/buildrelease.py
deleted file mode 100755
index 4df1445..0000000
--- a/sources/vendor/adodb/adodb-php/scripts/buildrelease.py
+++ /dev/null
@@ -1,216 +0,0 @@
-#!/usr/bin/python -u
-'''
- ADOdb release build script
-'''
-
-import errno
-import getopt
-import re
-import os
-from os import path
-import shutil
-import subprocess
-import sys
-import tempfile
-
-import updateversion
-
-
-# ADOdb Repository reference
-origin_repo = "git://git.code.sf.net/p/adodb/git adodb-git"
-release_branch = "master"
-release_prefix = "adodb"
-
-# Directories and files to exclude from release tarballs
-exclude_list = (".git*",
- "replicate",
- "scripts",
- # There are no png files in there...
- # "cute_icons_for_site/*.png",
- "hs~*.*",
- "adodb-text.inc.php",
- # This file does not exist in current repo
- # 'adodb-lite.inc.php'
- )
-
-# Command-line options
-options = "hfks:"
-long_options = ["help", "fresh", "keep"]
-
-
-def usage():
- print '''Usage: %s [options] version release_path
-
- Parameters:
- version ADOdb version to bundle (e.g. v5.19)
- release_path Where to save the release tarballs
-
- Options:
- -h | --help Show this usage message
-
- -f | --fresh Create a fresh clone of the repository
- -k | --keep Keep build directories after completion
- (useful for debugging)
-''' % (
- path.basename(__file__)
- )
-#end usage()
-
-
-def main():
- # Get command-line options
- try:
- opts, args = getopt.gnu_getopt(sys.argv[1:], options, long_options)
- except getopt.GetoptError, err:
- print str(err)
- usage()
- sys.exit(2)
-
- if len(args) < 2:
- usage()
- print "ERROR: please specify the version and release_path"
- sys.exit(1)
-
- fresh_clone = False
- cleanup = True
-
- for opt, val in opts:
- if opt in ("-h", "--help"):
- usage()
- sys.exit(0)
-
- elif opt in ("-f", "--fresh"):
- fresh_clone = True
-
- elif opt in ("-k", "--keep"):
- cleanup = False
-
- # Mandatory parameters
- version = updateversion.version_check(args[0])
- release_path = args[1]
-
- global release_prefix
- release_prefix += version.split(".")[0]
-
- # Start the build
- print "Building ADOdb release %s into '%s'\n" % (
- version,
- release_path
- )
-
- if fresh_clone:
- # Create a new repo clone
- print "Cloning a new repository"
- repo_path = tempfile.mkdtemp(prefix=release_prefix + "-",
- suffix=".git")
- subprocess.call(
- "git clone %s %s" % (origin_repo, repo_path),
- shell=True
- )
- os.chdir(repo_path)
- else:
- repo_path = '.'
-
- # Check for any uncommitted changes
- try:
- subprocess.check_output(
- "git diff --exit-code && "
- "git diff --cached --exit-code",
- shell=True
- )
- except:
- print "ERROR: there are uncommitted changes in the repository"
- sys.exit(3)
-
- # Update the repository
- print "Updating repository in '%s'" % os.getcwd()
- try:
- subprocess.check_output("git fetch", shell=True)
- except:
- print "ERROR: unable to fetch\n"
- sys.exit(3)
-
- # Check existence of Tag for version in repo, create if not found
- try:
- updateversion.tag_check(version)
- except:
- # Checkout release branch
- subprocess.call("git checkout %s" % release_branch, shell=True)
-
- # Make sure we're up-to-date
- ret = subprocess.check_output(
- "git status --branch --porcelain",
- shell=True
- )
- if not re.search(release_branch + "$", ret):
- print "\nERROR: branch must be aligned with upstream"
- sys.exit(4)
-
- # Update the code, create commit and tag
- updateversion.version_set(version)
-
- # Make sure we don't delete the modified repo
- if fresh_clone:
- cleanup = False
-
- # Copy files to release dir
- release_tmp_dir = path.join(release_path, release_prefix)
- print "Copying files to '%s'" % release_path
- retry = True
- while True:
- try:
- shutil.copytree(
- repo_path,
- release_tmp_dir,
- ignore=shutil.ignore_patterns(*exclude_list)
- )
- break
- except OSError, err:
- # First try and file exists, try to delete dir
- if retry and err.errno == errno.EEXIST:
- print "WARNING: Directory '%s' exists, delete it and retry" % (
- release_tmp_dir
- )
- shutil.rmtree(release_tmp_dir)
- retry = False
- continue
- else:
- # We already tried to delete or some other error occured
- raise
-
- # Create tarballs
- print "Creating release tarballs..."
- release_name = release_prefix + version.split(".")[1]
-
- os.chdir(release_path)
- subprocess.call(
- "tar czf %s.tgz %s" % (release_name, release_prefix),
- shell=True
- )
- subprocess.call(
- "zip -rq %s.zip %s" % (release_name, release_prefix),
- shell=True
- )
-
- if cleanup:
- print "Deleting working directories"
- shutil.rmtree(release_tmp_dir)
- if fresh_clone:
- shutil.rmtree(repo_path)
- else:
- print "\nThe following working directories were kept:"
- if fresh_clone:
- print "- '%s' (repo clone)" % repo_path
- print "- '%s' (release temp dir)" % release_tmp_dir
- print "Delete them manually when they are no longer needed."
-
- # Done
- print "\nADOdb release %s build complete, tarballs saved in '%s'." % (
- version,
- release_tmp_dir
- )
-
-#end main()
-
-if __name__ == "__main__":
- main()
diff --git a/sources/vendor/adodb/adodb-php/scripts/updateversion.py b/sources/vendor/adodb/adodb-php/scripts/updateversion.py
deleted file mode 100755
index 3c1e548..0000000
--- a/sources/vendor/adodb/adodb-php/scripts/updateversion.py
+++ /dev/null
@@ -1,272 +0,0 @@
-#!/usr/bin/python -u
-'''
- ADOdb version update script
-
- Updates the version number, date and copyright year in
- all php, txt and htm files
-'''
-
-from datetime import date
-import getopt
-import os
-from os import path
-import re
-import subprocess
-import sys
-
-
-# ADOdb version validation regex
-_version_dev = "dev"
-_version_regex = "[Vv]?[0-9]\.[0-9]+(%s|[a-z])?" % _version_dev
-_release_date_regex = "[0-9?]+.*[0-9]+"
-
-_tag_prefix = "v"
-
-
-# Command-line options
-options = "hct"
-long_options = ["help", "commit", "tag"]
-
-
-def usage():
- print '''Usage: %s version
-
- Parameters:
- version ADOdb version, format: [v]X.YY[a-z|dev]
-
- Options:
- -c | --commit Automatically commit the changes
- -t | --tag Create a tag for the new release
- -h | --help Show this usage message
-''' % (
- path.basename(__file__)
- )
-#end usage()
-
-
-def version_check(version):
- ''' Checks that the given version is valid, exits with error if not.
- Returns the version without the "v" prefix
- '''
- if not re.search("^%s$" % _version_regex, version):
- usage()
- print "ERROR: invalid version ! \n"
- sys.exit(1)
-
- return version.lstrip("Vv")
-
-
-def release_date(version):
- ''' Returns the release date in DD-MMM-YYYY format
- For development releases, DD-MMM will be ??-???
- '''
- # Development release
- if version.endswith(_version_dev):
- date_format = "??-???-%Y"
- else:
- date_format = "%d-%b-%Y"
-
- # Define release date
- return date.today().strftime(date_format)
-
-
-def sed_script(version):
- ''' Builds sed script to update version information in source files
- '''
- copyright_string = "\(c\)"
-
- # - Part 1: version number and release date
- script = "s/%s\s+%s\s+(%s)/V%s %s \\2/\n" % (
- _version_regex,
- _release_date_regex,
- copyright_string,
- version,
- release_date(version)
- )
-
- # - Part 2: copyright year
- script += "s/(%s)\s*%s(.*Lim)/\\1 \\2-%s\\3/" % (
- copyright_string,
- "([0-9]+)-[0-9]+", # copyright years
- date.today().strftime("%Y")
- )
-
- return script
-
-
-def sed_filelist():
- ''' Build list of files to update
- '''
- def sed_filter(name):
- return name.lower().endswith((".php", ".htm", ".txt"))
-
- dirlist = []
- for root, dirs, files in os.walk(".", topdown=True):
- for name in filter(sed_filter, files):
- dirlist.append(path.join(root, name))
-
- return dirlist
-
-
-def tag_name(version):
- return _tag_prefix + version
-
-
-def tag_check(version):
- ''' Checks if the tag for the specified version exists in the repository
- by attempting to check it out
- Throws exception if not
- '''
- subprocess.check_call(
- "git checkout --quiet " + tag_name(version),
- stderr=subprocess.PIPE,
- shell=True)
- print "Tag '%s' already exists" % tag_name(version)
-
-
-def tag_create(version):
- ''' Creates the tag for the specified version
- Returns True if tag created
- '''
- print "Creating release tag '%s'" % tag_name(version)
- result = subprocess.call(
- "git tag --sign --message '%s' %s" % (
- "ADOdb version %s released %s" % (
- version,
- release_date(version)
- ),
- tag_name(version)
- ),
- shell=True
- )
- return result == 0
-
-
-def update_changelog(version):
- ''' Updates the release date in the Change Log
- '''
- print "Updating Changelog"
-
- # Development release
- if version.endswith(_version_dev):
- version_release = version[:-len(_version_dev)]
-
- version_previous = version_release.split(".")
- version_previous[1] = str(int(version_previous[1]) - 1)
- version_previous = ".".join(version_previous)
-
- print " Inserting new section for v%s" % version_release
- script = "/name={0}/i {1} - {2} \\n".format(
- version_previous,
- version_release,
- release_date(version))
-
- # Stable release
- else:
- print " Updating release date for v%s" % version
- script = "/name={0}/s/({0})[ -]+{1}/\\1 - {2}/".format(
- version,
- _release_date_regex,
- release_date(version))
-
- subprocess.call(
- "sed -r -i '%s' %s " % (
- script,
- "docs/docs-adodb.htm"
- ),
- shell=True
- )
-#end update_changelog
-
-
-def version_set(version, do_commit=True, do_tag=True):
- ''' Bump version number and set release date in source files
- '''
- print "Preparing version bump commit"
-
- update_changelog(version)
-
- print "Updating version and date in source files"
- subprocess.call(
- "sed -r -i '%s' %s " % (
- sed_script(version),
- " ".join(sed_filelist())
- ),
- shell=True
- )
- print "Version set to %s" % version
-
- if do_commit:
- # Commit changes
- print "Committing"
- commit_ok = subprocess.call(
- "git commit --all --message '%s'" % (
- "Bump version to %s" % version
- ),
- shell=True
- )
-
- if do_tag:
- tag_ok = tag_create(version)
- else:
- tag_ok = False
-
- if commit_ok == 0:
- print '''
-NOTE: you should carefully review the new commit, making sure updates
-to the files are correct and no additional changes are required.
-If everything is fine, then the commit can be pushed upstream;
-otherwise:
- - Make the required corrections
- - Amend the commit ('git commit --all --amend' ) or create a new one'''
-
- if tag_ok:
- print ''' - Drop the tag ('git tag --delete %s')
- - run this script again
-''' % (
- tag_name(version)
- )
-
- else:
- print "Note: changes have been staged but not committed."
-#end version_set()
-
-
-def main():
- # Get command-line options
- try:
- opts, args = getopt.gnu_getopt(sys.argv[1:], options, long_options)
- except getopt.GetoptError, err:
- print str(err)
- usage()
- sys.exit(2)
-
- if len(args) < 1:
- usage()
- print "ERROR: please specify the version"
- sys.exit(1)
-
- do_commit = False
- do_tag = False
-
- for opt, val in opts:
- if opt in ("-h", "--help"):
- usage()
- sys.exit(0)
-
- elif opt in ("-c", "--commit"):
- do_commit = True
-
- elif opt in ("-t", "--tag"):
- do_tag = True
-
- # Mandatory parameters
- version = version_check(args[0])
-
- # Let's do it
- version_set(version, do_commit, do_tag)
-#end main()
-
-
-if __name__ == "__main__":
- main()
diff --git a/sources/vendor/adodb/adodb-php/server.php b/sources/vendor/adodb/adodb-php/server.php
deleted file mode 100644
index f067476..0000000
--- a/sources/vendor/adodb/adodb-php/server.php
+++ /dev/null
@@ -1,98 +0,0 @@
-Connect($host,$uid,$pwd,$database)) err($conn->ErrorNo(). $sep . $conn->ErrorMsg());
-$sql = undomq($_REQUEST['sql']);
-
-if (isset($_REQUEST['fetch']))
- $ADODB_FETCH_MODE = $_REQUEST['fetch'];
-
-if (isset($_REQUEST['nrows'])) {
- $nrows = $_REQUEST['nrows'];
- $offset = isset($_REQUEST['offset']) ? $_REQUEST['offset'] : -1;
- $rs = $conn->SelectLimit($sql,$nrows,$offset);
-} else
- $rs = $conn->Execute($sql);
-if ($rs){
- //$rs->timeToLive = 1;
- echo _rs2serialize($rs,$conn,$sql);
- $rs->Close();
-} else
- err($conn->ErrorNo(). $sep .$conn->ErrorMsg());
diff --git a/sources/vendor/adodb/adodb-php/session/adodb-compress-bzip2.php b/sources/vendor/adodb/adodb-php/session/adodb-compress-bzip2.php
deleted file mode 100644
index 65c258a..0000000
--- a/sources/vendor/adodb/adodb-php/session/adodb-compress-bzip2.php
+++ /dev/null
@@ -1,116 +0,0 @@
-_block_size;
- }
-
- /**
- */
- function setBlockSize($block_size) {
- assert('$block_size >= 1');
- assert('$block_size <= 9');
- $this->_block_size = (int) $block_size;
- }
-
- /**
- */
- function getWorkLevel() {
- return $this->_work_level;
- }
-
- /**
- */
- function setWorkLevel($work_level) {
- assert('$work_level >= 0');
- assert('$work_level <= 250');
- $this->_work_level = (int) $work_level;
- }
-
- /**
- */
- function getMinLength() {
- return $this->_min_length;
- }
-
- /**
- */
- function setMinLength($min_length) {
- assert('$min_length >= 0');
- $this->_min_length = (int) $min_length;
- }
-
- /**
- */
- function ADODB_Compress_Bzip2($block_size = null, $work_level = null, $min_length = null) {
- if (!is_null($block_size)) {
- $this->setBlockSize($block_size);
- }
-
- if (!is_null($work_level)) {
- $this->setWorkLevel($work_level);
- }
-
- if (!is_null($min_length)) {
- $this->setMinLength($min_length);
- }
- }
-
- /**
- */
- function write($data, $key) {
- if (strlen($data) < $this->_min_length) {
- return $data;
- }
-
- if (!is_null($this->_block_size)) {
- if (!is_null($this->_work_level)) {
- return bzcompress($data, $this->_block_size, $this->_work_level);
- } else {
- return bzcompress($data, $this->_block_size);
- }
- }
-
- return bzcompress($data);
- }
-
- /**
- */
- function read($data, $key) {
- return $data ? bzdecompress($data) : $data;
- }
-
-}
-
-return 1;
diff --git a/sources/vendor/adodb/adodb-php/session/adodb-compress-gzip.php b/sources/vendor/adodb/adodb-php/session/adodb-compress-gzip.php
deleted file mode 100644
index 0d6324f..0000000
--- a/sources/vendor/adodb/adodb-php/session/adodb-compress-gzip.php
+++ /dev/null
@@ -1,91 +0,0 @@
-_level;
- }
-
- /**
- */
- function setLevel($level) {
- assert('$level >= 0');
- assert('$level <= 9');
- $this->_level = (int) $level;
- }
-
- /**
- */
- function getMinLength() {
- return $this->_min_length;
- }
-
- /**
- */
- function setMinLength($min_length) {
- assert('$min_length >= 0');
- $this->_min_length = (int) $min_length;
- }
-
- /**
- */
- function ADODB_Compress_Gzip($level = null, $min_length = null) {
- if (!is_null($level)) {
- $this->setLevel($level);
- }
-
- if (!is_null($min_length)) {
- $this->setMinLength($min_length);
- }
- }
-
- /**
- */
- function write($data, $key) {
- if (strlen($data) < $this->_min_length) {
- return $data;
- }
-
- if (!is_null($this->_level)) {
- return gzcompress($data, $this->_level);
- } else {
- return gzcompress($data);
- }
- }
-
- /**
- */
- function read($data, $key) {
- return $data ? gzuncompress($data) : $data;
- }
-
-}
-
-return 1;
diff --git a/sources/vendor/adodb/adodb-php/session/adodb-cryptsession.php b/sources/vendor/adodb/adodb-php/session/adodb-cryptsession.php
deleted file mode 100644
index 59f0523..0000000
--- a/sources/vendor/adodb/adodb-php/session/adodb-cryptsession.php
+++ /dev/null
@@ -1,25 +0,0 @@
-_cipher;
- }
-
- /**
- */
- function setCipher($cipher) {
- $this->_cipher = $cipher;
- }
-
- /**
- */
- function getMode() {
- return $this->_mode;
- }
-
- /**
- */
- function setMode($mode) {
- $this->_mode = $mode;
- }
-
- /**
- */
- function getSource() {
- return $this->_source;
- }
-
- /**
- */
- function setSource($source) {
- $this->_source = $source;
- }
-
- /**
- */
- function ADODB_Encrypt_MCrypt($cipher = null, $mode = null, $source = null) {
- if (!$cipher) {
- $cipher = MCRYPT_RIJNDAEL_256;
- }
- if (!$mode) {
- $mode = MCRYPT_MODE_ECB;
- }
- if (!$source) {
- $source = MCRYPT_RAND;
- }
-
- $this->_cipher = $cipher;
- $this->_mode = $mode;
- $this->_source = $source;
- }
-
- /**
- */
- function write($data, $key) {
- $iv_size = mcrypt_get_iv_size($this->_cipher, $this->_mode);
- $iv = mcrypt_create_iv($iv_size, $this->_source);
- return mcrypt_encrypt($this->_cipher, $key, $data, $this->_mode, $iv);
- }
-
- /**
- */
- function read($data, $key) {
- $iv_size = mcrypt_get_iv_size($this->_cipher, $this->_mode);
- $iv = mcrypt_create_iv($iv_size, $this->_source);
- $rv = mcrypt_decrypt($this->_cipher, $key, $data, $this->_mode, $iv);
- return rtrim($rv, "\0");
- }
-
-}
-
-return 1;
diff --git a/sources/vendor/adodb/adodb-php/session/adodb-encrypt-md5.php b/sources/vendor/adodb/adodb-php/session/adodb-encrypt-md5.php
deleted file mode 100644
index 0965d53..0000000
--- a/sources/vendor/adodb/adodb-php/session/adodb-encrypt-md5.php
+++ /dev/null
@@ -1,37 +0,0 @@
-encrypt($data, $key);
- }
-
- /**
- */
- function read($data, $key) {
- $md5crypt = new MD5Crypt();
- return $md5crypt->decrypt($data, $key);
- }
-
-}
-
-return 1;
diff --git a/sources/vendor/adodb/adodb-php/session/adodb-encrypt-secret.php b/sources/vendor/adodb/adodb-php/session/adodb-encrypt-secret.php
deleted file mode 100644
index 078c02d..0000000
--- a/sources/vendor/adodb/adodb-php/session/adodb-encrypt-secret.php
+++ /dev/null
@@ -1,46 +0,0 @@
-encrypt($data, $key);
-
- }
-
-
- function read($data, $key)
- {
- $sha1crypt = new SHA1Crypt();
- return $sha1crypt->decrypt($data, $key);
-
- }
-}
-
-
-
-return 1;
diff --git a/sources/vendor/adodb/adodb-php/session/adodb-sess.txt b/sources/vendor/adodb/adodb-php/session/adodb-sess.txt
deleted file mode 100644
index c6c7685..0000000
--- a/sources/vendor/adodb/adodb-php/session/adodb-sess.txt
+++ /dev/null
@@ -1,131 +0,0 @@
-John,
-
-I have been an extremely satisfied ADODB user for several years now.
-
-To give you something back for all your hard work, I've spent the last 3
-days rewriting the adodb-session.php code.
-
-----------
-What's New
-----------
-
-Here's a list of the new code's benefits:
-
-* Combines the functionality of the three files:
-
-adodb-session.php
-adodb-session-clob.php
-adodb-cryptsession.php
-
-each with very similar functionality, into a single file adodb-session.php.
-This will ease maintenance and support issues.
-
-* Supports multiple encryption and compression schemes.
- Currently, we support:
-
- MD5Crypt (crypt.inc.php)
- MCrypt
- Secure (Horde's emulation of MCrypt, if MCrypt module is not available.)
- GZip
- BZip2
-
-These can be stacked, so if you want to compress and then encrypt your
-session data, it's easy.
-Also, the built-in MCrypt functions will be *much* faster, and more secure,
-than the MD5Crypt code.
-
-* adodb-session.php contains a single class ADODB_Session that encapsulates
-all functionality.
- This eliminates the use of global vars and defines (though they are
-supported for backwards compatibility).
-
-* All user defined parameters are now static functions in the ADODB_Session
-class.
-
-New parameters include:
-
-* encryptionKey(): Define the encryption key used to encrypt the session.
-Originally, it was a hard coded string.
-
-* persist(): Define if the database will be opened in persistent mode.
-Originally, the user had to call adodb_sess_open().
-
-* dataFieldName(): Define the field name used to store the session data, as
-'DATA' appears to be a reserved word in the following cases:
- ANSI SQL
- IBM DB2
- MS SQL Server
- Postgres
- SAP
-
-* filter(): Used to support multiple, simulataneous encryption/compression
-schemes.
-
-* Debug support is improved thru _rsdump() function, which is called after
-every database call.
-
-------------
-What's Fixed
-------------
-
-The new code includes several bug fixes and enhancements:
-
-* sesskey is compared in BINARY mode for MySQL, to avoid problems with
-session keys that differ only by case.
- Of course, the user should define the sesskey field as BINARY, to
-correctly fix this problem, otherwise performance will suffer.
-
-* In ADODB_Session::gc(), if $expire_notify is true, the multiple DELETES in
-the original code have been optimized to a single DELETE.
-
-* In ADODB_Session::destroy(), since "SELECT expireref, sesskey FROM $table
-WHERE sesskey = $qkey" will only return a single value, we don't loop on the
-result, we simply process the row, if any.
-
-* We close $rs after every use.
-
----------------
-What's the Same
----------------
-
-I know backwards compatibility is *very* important to you. Therefore, the
-new code is 100% backwards compatible.
-
-If you like my code, but don't "trust" it's backwards compatible, maybe we
-offer it as beta code, in a new directory for a release or two?
-
-------------
-What's To Do
-------------
-
-I've vascillated over whether to use a single function to get/set
-parameters:
-
-$user = ADODB_Session::user(); // get
-ADODB_Session::user($user); // set
-
-or to use separate functions (which is the PEAR/Java way):
-
-$user = ADODB_Session::getUser();
-ADODB_Session::setUser($user);
-
-I've chosen the former as it's makes for a simpler API, and reduces the
-amount of code, but I'd be happy to change it to the latter.
-
-Also, do you think the class should be a singleton class, versus a static
-class?
-
-Let me know if you find this code useful, and will be including it in the
-next release of ADODB.
-
-If so, I will modify the current documentation to detail the new
-functionality. To that end, what file(s) contain the documentation? Please
-send them to me if they are not publically available.
-
-Also, if there is *anything* in the code that you like to see changed, let
-me know.
-
-Thanks,
-
-Ross
-
diff --git a/sources/vendor/adodb/adodb-php/session/adodb-session-clob.php b/sources/vendor/adodb/adodb-php/session/adodb-session-clob.php
deleted file mode 100644
index 24304f2..0000000
--- a/sources/vendor/adodb/adodb-php/session/adodb-session-clob.php
+++ /dev/null
@@ -1,22 +0,0 @@
-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_schema.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 = 'xphplens_2';
- 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 "Session Error: PHP.INI setting session.gc_maxlifetime not set: $lifetime ";
- $_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 = 'sessions';
- 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) {
- static $_sync_seconds = 60;
- static $set = false;
-
- if (!is_null($sync_seconds)) {
- $_sync_seconds = (int) $sync_seconds;
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (defined('ADODB_SESSION_SYNCH_SECS')) {
- return ADODB_SESSION_SYNCH_SECS;
- }
- }
-
- return $_sync_seconds;
- }
-
- /*!
- */
- 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) {
- static $_data_field_name = 'data';
-
- if (!is_null($data_field_name)) {
- $_data_field_name = trim($data_field_name);
- }
-
- return $_data_field_name;
- }
-
- /*!
- */
- 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 " \$rs is null or false \n";
- return;
- }
-
- //echo " \nAffected_Rows=",$conn->Affected_Rows()," \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 pwd=$password 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('Session: connection failed
', 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();
- $data = ADODB_Session::dataFieldName();
- $filter = ADODB_Session::filter();
- $table = ADODB_Session::table();
-
- if (!$conn) {
- return '';
- }
-
- //assert('$table');
-
- $qkey = $conn->quote($key);
- $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : '';
-
- $sql = "SELECT $data FROM $table WHERE sesskey = $binary $qkey AND expiry >= " . time();
- /* 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(), $data);
- #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();
- $data = ADODB_Session::dataFieldName();
- $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;
- }
- $qkey = $conn->qstr($key);
-
- //assert('$table');
-
- $expiry = time() + $lifetime;
-
- $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) {
- ADOConnection::outp( 'Session: Only updating date - crc32 not changed
');
- }
-
- $expirevar = '';
- if ($expire_notify) {
- $var = reset($expire_notify);
- global $$var;
- if (isset($$var)) {
- $expirevar = $$var;
- }
- }
-
-
- $sql = "UPDATE $table SET expiry = ".$conn->Param('0').",expireref=".$conn->Param('1')." WHERE $binary sesskey = ".$conn->Param('2')." AND expiry >= ".$conn->Param('3');
- $rs = $conn->Execute($sql,array($expiry,$expirevar,$key,time()));
- return true;
- }
- $val = rawurlencode($val);
- foreach ($filter as $f) {
- if (is_object($f)) {
- $val = $f->write($val, ADODB_Session::_sessionKey());
- }
- }
-
- $arr = array('sesskey' => $key, 'expiry' => $expiry, $data => $val, 'expireref' => '');
- if ($expire_notify) {
- $var = reset($expire_notify);
- global $$var;
- if (isset($$var)) {
- $arr['expireref'] = $$var;
- }
- }
-
- if (!$clob) { // no lobs, simply use replace()
- $arr[$data] = $val;
- $rs = $conn->Replace($table, $arr, 'sesskey', $autoQuote = true);
-
- } 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();
- $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");
- if ($rs && reset($rs->fields) > 0) {
- $sql = "UPDATE $table SET expiry = $expiry, $data = $lob_value, expireref=$expiryref WHERE sesskey = $qkey";
- } else {
- $sql = "INSERT INTO $table (expiry, $data, sesskey,expireref) VALUES ($expiry, $lob_value, $qkey,$expiryref)";
- }
- if ($rs)$rs->Close();
-
-
- $err = '';
- $rs1 = $conn->Execute($sql);
- if (!$rs1) $err = $conn->ErrorMsg()."\n";
-
- $rs2 = $conn->UpdateBlob($table, $data, $val, " sesskey=$qkey", strtoupper($clob));
- if (!$rs2) $err .= $conn->ErrorMsg()."\n";
-
- $rs = ($rs && $rs2) ? true : false;
- $conn->CompleteTrans();
- }
-
- if (!$rs) {
- ADOConnection::outp('Session Replace: ' . $conn->ErrorMsg() . '
', 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);
-
- return $rs ? true : false;
- }
-
- /*!
- */
- function gc($maxlifetime)
- {
- $conn = ADODB_Session::_conn();
- $debug = ADODB_Session::debug();
- $expire_notify = ADODB_Session::expireNotify();
- $optimize = ADODB_Session::optimize();
- $sync_seconds = ADODB_Session::syncSeconds();
- $table = ADODB_Session::table();
-
- if (!$conn) {
- return false;
- }
-
-
- $time = time();
- $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 (1) {
- $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(reset($row)));
- }
- } else {
- $sql = "DELETE FROM $table WHERE expiry < $time";
- $rs = $conn->Execute($sql);
- ADODB_Session::_dumprs($rs);
- if ($rs) $rs->Close();
- }
- if ($debug) {
- ADOConnection::outp("Garbage Collection : $sql
");
- }
- }
-
- // suggested by Cameron, "GaM3R"
- 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);
- }
- }
-
- if ($sync_seconds) {
- $sql = 'SELECT ';
- if ($conn->dataProvider === 'oci8') {
- $sql .= "TO_CHAR({$conn->sysTimeStamp}, 'RRRR-MM-DD HH24:MI:SS')";
- } else {
- $sql .= $conn->sysTimeStamp;
- }
- $sql .= " FROM $table";
-
- $rs = $conn->SelectLimit($sql, 1);
- if ($rs && !$rs->EOF) {
- $dbts = reset($rs->fields);
- $rs->Close();
- $dbt = $conn->UnixTimeStamp($dbts);
- $t = time();
-
- if (abs($dbt - $t) >= $sync_seconds) {
- $msg = __FILE__ .
- ": Server time for webserver {$_SERVER['HTTP_HOST']} not in synch with database: " .
- " database=$dbt ($dbts), webserver=$t (diff=". (abs($dbt - $t) / 60) . ' minutes)';
- error_log($msg);
- if ($debug) {
- ADOConnection::outp("$msg
");
- }
- }
- }
- }
-
- 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);
-}
diff --git a/sources/vendor/adodb/adodb-php/session/adodb-session2.php b/sources/vendor/adodb/adodb-php/session/adodb-session2.php
deleted file mode 100644
index 5e5e6d5..0000000
--- a/sources/vendor/adodb/adodb-php/session/adodb-session2.php
+++ /dev/null
@@ -1,935 +0,0 @@
-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;
- }
- */
- /*!
- */
- static 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;
- }
-
- /*!
- */
- static 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;
- }
-
- /*!
- */
- static 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;
- }
-
- /*!
- */
- static 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;
- }
-
- /*!
- */
- static 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;
- }
-
- /*!
- */
- static function persist($persist = null)
- {
- static $_persist = true;
-
- if (!is_null($persist)) {
- $_persist = trim($persist);
- }
-
- return $_persist;
- }
-
- /*!
- */
- static 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 "Session Error: PHP.INI setting session.gc_maxlifetime not set: $lifetime ";
- $_lifetime = 1440;
- }
- }
-
- return $_lifetime;
- }
-
- /*!
- */
- static 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;
- }
-
- /*!
- */
- static 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;
- }
-
- /*!
- */
- static 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;
- }
-
- /*!
- */
- static 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;
- }
-
- /*!
- */
- static function syncSeconds($sync_seconds = null) {
- //echo ("WARNING: ADODB_SESSION::syncSeconds is longer used, please remove this function for your code
");
-
- return 0;
- }
-
- /*!
- */
- static 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;
- }
-
- /*!
- */
- static function dataFieldName($data_field_name = null) {
- //echo ("WARNING: ADODB_SESSION::dataFieldName() is longer used, please remove this function for your code
");
- return '';
- }
-
- /*!
- */
- static function filter($filter = null) {
- static $_filter = array();
-
- if (!is_null($filter)) {
- if (!is_array($filter)) {
- $filter = array($filter);
- }
- $_filter = $filter;
- }
-
- return $_filter;
- }
-
- /*!
- */
- static 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
- /////////////////////
-
- /*!
- */
- static function _conn($conn=null) {
- return isset($GLOBALS['ADODB_SESS_CONN']) ? $GLOBALS['ADODB_SESS_CONN'] : false;
- }
-
- /*!
- */
- static function _crc($crc = null) {
- static $_crc = false;
-
- if (!is_null($crc)) {
- $_crc = $crc;
- }
-
- return $_crc;
- }
-
- /*!
- */
- static 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')
- );
- }
-
-
- /*!
- */
- static 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());
- }
-
- /*!
- */
- static function _dumprs(&$rs) {
- $conn = ADODB_Session::_conn();
- $debug = ADODB_Session::debug();
-
- if (!$conn) {
- return;
- }
-
- if (!$debug) {
- return;
- }
-
- if (!$rs) {
- echo " \$rs is null or false \n";
- return;
- }
-
- //echo " \nAffected_Rows=",$conn->Affected_Rows()," \n";
-
- if (!is_object($rs)) {
- return;
- }
- $rs = $conn->_rs2rs($rs);
-
- require_once ADODB_SESSION.'/../tohtml.inc.php';
- rs2html($rs);
- $rs->MoveFirst();
- }
-
- /////////////////////
- // public methods
- /////////////////////
-
- static 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 (strncmp($driver, 'oci8', 4) == 0) $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
- */
- static 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 (empty($conn->_connectionID)) { // not dsn
- 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('Session: connection failed
', false);
-
-
- return $ok;
- }
-
- /*!
- Close the connection
- */
- static function close()
- {
-/*
- $conn = ADODB_Session::_conn();
- if ($conn) $conn->Close();
-*/
- return true;
- }
-
- /*
- Slurp in the session variables and return the serialized string
- */
- static function read($key)
- {
- $conn = ADODB_Session::_conn();
- $filter = ADODB_Session::filter();
- $table = ADODB_Session::table();
-
- if (!$conn) {
- return '';
- }
-
- //assert('$table');
-
- $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : '';
-
- global $ADODB_SESSION_SELECT_FIELDS;
- if (!isset($ADODB_SESSION_SELECT_FIELDS)) $ADODB_SESSION_SELECT_FIELDS = 'sessdata';
- $sql = "SELECT $ADODB_SESSION_SELECT_FIELDS FROM $table WHERE sesskey = $binary ".$conn->Param(0)." 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, array($key));
- //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.
- */
- static function write($key, $oval)
- {
- 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;
- }
- if ($debug) $conn->debug = 1;
- $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 !== '00' && $crc !== false && $crc == (strlen($oval) . crc32($oval))) {
- if ($debug) {
- echo 'Session: Only updating date - crc32 not changed
';
- }
-
- $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($oval);
- 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?
- if (strncmp($driver, 'oci8', 4) == 0) $lob_value = sprintf('empty_%s()', strtolower($clob));
- else $lob_value = 'null';
-
- $conn->StartTrans();
-
- $rs = $conn->Execute("SELECT COUNT(*) AS cnt FROM $table WHERE $binary sesskey = ".$conn->Param(0),array($key));
-
- 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));
- if ($debug) echo " ",htmlspecialchars($oval), " ";
- $rs = @$conn->CompleteTrans();
-
-
- }
-
- if (!$rs) {
- ADOConnection::outp('Session Replace: ' . $conn->ErrorMsg() . '
', 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;
- }
-
- /*!
- */
- static function destroy($key) {
- $conn = ADODB_Session::_conn();
- $table = ADODB_Session::table();
- $expire_notify = ADODB_Session::expireNotify();
-
- if (!$conn) {
- return false;
- }
- $debug = ADODB_Session::debug();
- if ($debug) $conn->debug = 1;
- //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);
- if ($rs) {
- $rs->Close();
- }
-
- return $rs ? true : false;
- }
-
- /*!
- */
- static 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;
- }
-
-
- $debug = ADODB_Session::debug();
- if ($debug) {
- $conn->debug = 1;
- $COMMITNUM = 2;
- } else {
- $COMMITNUM = 20;
- }
-
- //assert('$table');
-
- $time = $conn->OffsetDate(-$maxlifetime/24/3600,$conn->sysTimeStamp);
- $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : '';
-
- if ($expire_notify) {
- reset($expire_notify);
- $fn = next($expire_notify);
- } else {
- $fn = false;
- }
-
- $savem = $conn->SetFetchMode(ADODB_FETCH_NUM);
- $sql = "SELECT expireref, sesskey FROM $table WHERE expiry < $time ORDER BY 2"; # add order by to prevent deadlock
- $rs = $conn->SelectLimit($sql,1000);
- if ($debug) ADODB_Session::_dumprs($rs);
- $conn->SetFetchMode($savem);
- if ($rs) {
- $tr = $conn->hasTransactions;
- if ($tr) $conn->BeginTrans();
- $keys = array();
- $ccnt = 0;
- while (!$rs->EOF) {
- $ref = $rs->fields[0];
- $key = $rs->fields[1];
- if ($fn) $fn($ref, $key);
- $del = $conn->Execute("DELETE FROM $table WHERE sesskey=".$conn->Param('0'),array($key));
- $rs->MoveNext();
- $ccnt += 1;
- if ($tr && $ccnt % $COMMITNUM == 0) {
- if ($debug) echo "Commit \n";
- $conn->CommitTrans();
- $conn->BeginTrans();
- }
- }
- $rs->Close();
-
- if ($tr) $conn->CommitTrans();
- }
-
-
- // suggested by Cameron, "GaM3R"
- 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);
-}
diff --git a/sources/vendor/adodb/adodb-php/session/adodb-sessions.mysql.sql b/sources/vendor/adodb/adodb-php/session/adodb-sessions.mysql.sql
deleted file mode 100644
index f90de44..0000000
--- a/sources/vendor/adodb/adodb-php/session/adodb-sessions.mysql.sql
+++ /dev/null
@@ -1,16 +0,0 @@
--- $CVSHeader$
-
-CREATE DATABASE /*! IF NOT EXISTS */ adodb_sessions;
-
-USE adodb_sessions;
-
-DROP TABLE /*! IF EXISTS */ sessions;
-
-CREATE TABLE /*! IF NOT EXISTS */ sessions (
- sesskey CHAR(32) /*! BINARY */ NOT NULL DEFAULT '',
- expiry INT(11) /*! UNSIGNED */ NOT NULL DEFAULT 0,
- expireref VARCHAR(64) DEFAULT '',
- data LONGTEXT DEFAULT '',
- PRIMARY KEY (sesskey),
- INDEX expiry (expiry)
-);
diff --git a/sources/vendor/adodb/adodb-php/session/adodb-sessions.oracle.clob.sql b/sources/vendor/adodb/adodb-php/session/adodb-sessions.oracle.clob.sql
deleted file mode 100644
index c5c4f2d..0000000
--- a/sources/vendor/adodb/adodb-php/session/adodb-sessions.oracle.clob.sql
+++ /dev/null
@@ -1,15 +0,0 @@
--- $CVSHeader$
-
-DROP TABLE adodb_sessions;
-
-CREATE TABLE sessions (
- sesskey CHAR(32) DEFAULT '' NOT NULL,
- expiry INT DEFAULT 0 NOT NULL,
- expireref VARCHAR(64) DEFAULT '',
- data CLOB DEFAULT '',
- PRIMARY KEY (sesskey)
-);
-
-CREATE INDEX ix_expiry ON sessions (expiry);
-
-QUIT;
diff --git a/sources/vendor/adodb/adodb-php/session/adodb-sessions.oracle.sql b/sources/vendor/adodb/adodb-php/session/adodb-sessions.oracle.sql
deleted file mode 100644
index 8fd5a34..0000000
--- a/sources/vendor/adodb/adodb-php/session/adodb-sessions.oracle.sql
+++ /dev/null
@@ -1,16 +0,0 @@
--- $CVSHeader$
-
-DROP TABLE adodb_sessions;
-
-CREATE TABLE sessions (
- sesskey CHAR(32) DEFAULT '' NOT NULL,
- expiry INT DEFAULT 0 NOT NULL,
- expireref VARCHAR(64) DEFAULT '',
- data VARCHAR(4000) DEFAULT '',
- PRIMARY KEY (sesskey),
- INDEX expiry (expiry)
-);
-
-CREATE INDEX ix_expiry ON sessions (expiry);
-
-QUIT;
diff --git a/sources/vendor/adodb/adodb-php/session/crypt.inc.php b/sources/vendor/adodb/adodb-php/session/crypt.inc.php
deleted file mode 100644
index 1468cb1..0000000
--- a/sources/vendor/adodb/adodb-php/session/crypt.inc.php
+++ /dev/null
@@ -1,157 +0,0 @@
-
-class MD5Crypt{
- function keyED($txt,$encrypt_key)
- {
- $encrypt_key = md5($encrypt_key);
- $ctr=0;
- $tmp = "";
- for ($i=0;$ikeyED($tmp,$key));
- }
-
- function Decrypt($txt,$key)
- {
- $txt = $this->keyED(base64_decode($txt),$key);
- $tmp = "";
- for ($i=0;$i= 58 && $randnumber <= 64) || ($randnumber >= 91 && $randnumber <= 96))
- {
- $randnumber = rand(48,120);
- }
-
- $randomPassword .= chr($randnumber);
- }
- return $randomPassword;
- }
-
-}
-
-
-class SHA1Crypt{
- function keyED($txt,$encrypt_key)
- {
-
- $encrypt_key = sha1($encrypt_key);
- $ctr=0;
- $tmp = "";
-
- for ($i=0;$ikeyED($tmp,$key));
-
- }
-
-
-
- function Decrypt($txt,$key)
- {
-
- $txt = $this->keyED(base64_decode($txt),$key);
-
- $tmp = "";
-
- for ($i=0;$i= 58 && $randnumber <= 64) || ($randnumber >= 91 && $randnumber <= 96))
- {
- $randnumber = rand(48,120);
- }
-
- $randomPassword .= chr($randnumber);
- }
-
- return $randomPassword;
-
- }
-
-
-
-}
diff --git a/sources/vendor/adodb/adodb-php/session/old/adodb-cryptsession.php b/sources/vendor/adodb/adodb-php/session/old/adodb-cryptsession.php
deleted file mode 100644
index 1edb2e3..0000000
--- a/sources/vendor/adodb/adodb-php/session/old/adodb-cryptsession.php
+++ /dev/null
@@ -1,323 +0,0 @@
-
-
- Set tabs to 4 for best viewing.
-
- Latest version of ADODB is available at http://php.weblogs.com/adodb
- ======================================================================
-
- This file provides PHP4 session management using the ADODB database
-wrapper library.
-
- Example
- =======
-
- include('adodb.inc.php');
- #---------------------------------#
- include('adodb-cryptsession.php');
- #---------------------------------#
- session_start();
- session_register('AVAR');
- $_SESSION['AVAR'] += 1;
- print "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}
";
-
-
- Installation
- ============
- 1. Create a new database in MySQL or Access "sessions" like
-so:
-
- create table sessions (
- SESSKEY char(32) not null,
- EXPIRY int(11) unsigned not null,
- EXPIREREF varchar(64),
- DATA CLOB,
- primary key (sesskey)
- );
-
- 2. Then define the following parameters. You can either modify
- this file, or define them before this file is included:
-
- $ADODB_SESSION_DRIVER='database driver, eg. mysql or ibase';
- $ADODB_SESSION_CONNECT='server to connect to';
- $ADODB_SESSION_USER ='user';
- $ADODB_SESSION_PWD ='password';
- $ADODB_SESSION_DB ='database';
- $ADODB_SESSION_TBL = 'sessions'
-
- 3. Recommended is PHP 4.0.2 or later. There are documented
-session bugs in earlier versions of PHP.
-
-*/
-
-
-include_once('crypt.inc.php');
-
-if (!defined('_ADODB_LAYER')) {
- include (dirname(__FILE__).'/adodb.inc.php');
-}
-
- /* if database time and system time is difference is greater than this, then give warning */
- define('ADODB_SESSION_SYNCH_SECS',60);
-
-if (!defined('ADODB_SESSION')) {
-
- define('ADODB_SESSION',1);
-
-GLOBAL $ADODB_SESSION_CONNECT,
- $ADODB_SESSION_DRIVER,
- $ADODB_SESSION_USER,
- $ADODB_SESSION_PWD,
- $ADODB_SESSION_DB,
- $ADODB_SESS_CONN,
- $ADODB_SESS_LIFE,
- $ADODB_SESS_DEBUG,
- $ADODB_SESS_INSERT,
- $ADODB_SESSION_EXPIRE_NOTIFY,
- $ADODB_SESSION_TBL;
-
- //$ADODB_SESS_DEBUG = true;
-
- /* SET THE FOLLOWING PARAMETERS */
-if (empty($ADODB_SESSION_DRIVER)) {
- $ADODB_SESSION_DRIVER='mysql';
- $ADODB_SESSION_CONNECT='localhost';
- $ADODB_SESSION_USER ='root';
- $ADODB_SESSION_PWD ='';
- $ADODB_SESSION_DB ='xphplens_2';
-}
-
-if (empty($ADODB_SESSION_TBL)){
- $ADODB_SESSION_TBL = 'sessions';
-}
-
-if (empty($ADODB_SESSION_EXPIRE_NOTIFY)) {
- $ADODB_SESSION_EXPIRE_NOTIFY = false;
-}
-
-function ADODB_Session_Key()
-{
-$ADODB_CRYPT_KEY = 'CRYPTED ADODB SESSIONS ROCK!';
-
- /* USE THIS FUNCTION TO CREATE THE ENCRYPTION KEY FOR CRYPTED SESSIONS */
- /* Crypt the used key, $ADODB_CRYPT_KEY as key and session_ID as SALT */
- return crypt($ADODB_CRYPT_KEY, session_ID());
-}
-
-$ADODB_SESS_LIFE = ini_get('session.gc_maxlifetime');
-if ($ADODB_SESS_LIFE <= 1) {
- // bug in PHP 4.0.3 pl 1 -- how about other versions?
- //print "Session Error: PHP.INI setting session.gc_maxlifetime not set: $ADODB_SESS_LIFE ";
- $ADODB_SESS_LIFE=1440;
-}
-
-function adodb_sess_open($save_path, $session_name)
-{
-GLOBAL $ADODB_SESSION_CONNECT,
- $ADODB_SESSION_DRIVER,
- $ADODB_SESSION_USER,
- $ADODB_SESSION_PWD,
- $ADODB_SESSION_DB,
- $ADODB_SESS_CONN,
- $ADODB_SESS_DEBUG;
-
- $ADODB_SESS_INSERT = false;
-
- if (isset($ADODB_SESS_CONN)) return true;
-
- $ADODB_SESS_CONN = ADONewConnection($ADODB_SESSION_DRIVER);
- if (!empty($ADODB_SESS_DEBUG)) {
- $ADODB_SESS_CONN->debug = true;
- print" conn=$ADODB_SESSION_CONNECT user=$ADODB_SESSION_USER pwd=$ADODB_SESSION_PWD db=$ADODB_SESSION_DB ";
- }
- return $ADODB_SESS_CONN->PConnect($ADODB_SESSION_CONNECT,
- $ADODB_SESSION_USER,$ADODB_SESSION_PWD,$ADODB_SESSION_DB);
-
-}
-
-function adodb_sess_close()
-{
-global $ADODB_SESS_CONN;
-
- if ($ADODB_SESS_CONN) $ADODB_SESS_CONN->Close();
- return true;
-}
-
-function adodb_sess_read($key)
-{
-$Crypt = new MD5Crypt;
-global $ADODB_SESS_CONN,$ADODB_SESS_INSERT,$ADODB_SESSION_TBL;
- $rs = $ADODB_SESS_CONN->Execute("SELECT data FROM $ADODB_SESSION_TBL WHERE sesskey = '$key' AND expiry >= " . time());
- if ($rs) {
- if ($rs->EOF) {
- $ADODB_SESS_INSERT = true;
- $v = '';
- } else {
- // Decrypt session data
- $v = rawurldecode($Crypt->Decrypt(reset($rs->fields), ADODB_Session_Key()));
- }
- $rs->Close();
- return $v;
- }
- else $ADODB_SESS_INSERT = true;
-
- return '';
-}
-
-function adodb_sess_write($key, $val)
-{
-$Crypt = new MD5Crypt;
- global $ADODB_SESS_INSERT,$ADODB_SESS_CONN, $ADODB_SESS_LIFE, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY;
-
- $expiry = time() + $ADODB_SESS_LIFE;
-
- // encrypt session data..
- $val = $Crypt->Encrypt(rawurlencode($val), ADODB_Session_Key());
-
- $arr = array('sesskey' => $key, 'expiry' => $expiry, 'data' => $val);
- if ($ADODB_SESSION_EXPIRE_NOTIFY) {
- $var = reset($ADODB_SESSION_EXPIRE_NOTIFY);
- global $$var;
- $arr['expireref'] = $$var;
- }
- $rs = $ADODB_SESS_CONN->Replace($ADODB_SESSION_TBL,
- $arr,
- 'sesskey',$autoQuote = true);
-
- if (!$rs) {
- ADOConnection::outp( '
--- Session Replace: '.$ADODB_SESS_CONN->ErrorMsg().'',false);
- } else {
- // bug in access driver (could be odbc?) means that info is not commited
- // properly unless select statement executed in Win2000
-
- if ($ADODB_SESS_CONN->databaseType == 'access') $rs = $ADODB_SESS_CONN->Execute("select sesskey from $ADODB_SESSION_TBL WHERE sesskey='$key'");
- }
- return isset($rs);
-}
-
-function adodb_sess_destroy($key)
-{
- global $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY;
-
- if ($ADODB_SESSION_EXPIRE_NOTIFY) {
- reset($ADODB_SESSION_EXPIRE_NOTIFY);
- $fn = next($ADODB_SESSION_EXPIRE_NOTIFY);
- $savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM);
- $rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
- $ADODB_SESS_CONN->SetFetchMode($savem);
- if ($rs) {
- $ADODB_SESS_CONN->BeginTrans();
- while (!$rs->EOF) {
- $ref = $rs->fields[0];
- $key = $rs->fields[1];
- $fn($ref,$key);
- $del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
- $rs->MoveNext();
- }
- $ADODB_SESS_CONN->CommitTrans();
- }
- } else {
- $qry = "DELETE FROM $ADODB_SESSION_TBL WHERE sesskey = '$key'";
- $rs = $ADODB_SESS_CONN->Execute($qry);
- }
- return $rs ? true : false;
-}
-
-
-function adodb_sess_gc($maxlifetime) {
- global $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY,$ADODB_SESS_DEBUG;
-
- if ($ADODB_SESSION_EXPIRE_NOTIFY) {
- reset($ADODB_SESSION_EXPIRE_NOTIFY);
- $fn = next($ADODB_SESSION_EXPIRE_NOTIFY);
- $savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM);
- $t = time();
- $rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE expiry < $t");
- $ADODB_SESS_CONN->SetFetchMode($savem);
- if ($rs) {
- $ADODB_SESS_CONN->BeginTrans();
- while (!$rs->EOF) {
- $ref = $rs->fields[0];
- $key = $rs->fields[1];
- $fn($ref,$key);
- //$del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
- $rs->MoveNext();
- }
- $rs->Close();
-
- $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE expiry < $t");
- $ADODB_SESS_CONN->CommitTrans();
- }
- } else {
- $qry = "DELETE FROM $ADODB_SESSION_TBL WHERE expiry < " . time();
- $ADODB_SESS_CONN->Execute($qry);
- }
-
- // suggested by Cameron, "GaM3R"
- if (defined('ADODB_SESSION_OPTIMIZE'))
- {
- global $ADODB_SESSION_DRIVER;
-
- switch( $ADODB_SESSION_DRIVER ) {
- case 'mysql':
- case 'mysqlt':
- $opt_qry = 'OPTIMIZE TABLE '.$ADODB_SESSION_TBL;
- break;
- case 'postgresql':
- case 'postgresql7':
- $opt_qry = 'VACUUM '.$ADODB_SESSION_TBL;
- break;
- }
- }
-
- if ($ADODB_SESS_CONN->dataProvider === 'oci8') $sql = 'select TO_CHAR('.($ADODB_SESS_CONN->sysTimeStamp).', \'RRRR-MM-DD HH24:MI:SS\') from '. $ADODB_SESSION_TBL;
- else $sql = 'select '.$ADODB_SESS_CONN->sysTimeStamp.' from '. $ADODB_SESSION_TBL;
-
- $rs = $ADODB_SESS_CONN->SelectLimit($sql,1);
- if ($rs && !$rs->EOF) {
-
- $dbts = reset($rs->fields);
- $rs->Close();
- $dbt = $ADODB_SESS_CONN->UnixTimeStamp($dbts);
- $t = time();
- if (abs($dbt - $t) >= ADODB_SESSION_SYNCH_SECS) {
- $msg =
- __FILE__.": Server time for webserver {$_SERVER['HTTP_HOST']} not in synch with database: database=$dbt ($dbts), webserver=$t (diff=".(abs($dbt-$t)/3600)." hrs)";
- error_log($msg);
- if ($ADODB_SESS_DEBUG) ADOConnection::outp("
--- $msg");
- }
- }
-
- return true;
-}
-
-session_module_name('user');
-session_set_save_handler(
- "adodb_sess_open",
- "adodb_sess_close",
- "adodb_sess_read",
- "adodb_sess_write",
- "adodb_sess_destroy",
- "adodb_sess_gc");
-}
-
-/* TEST SCRIPT -- UNCOMMENT */
-/*
-if (0) {
-
- session_start();
- session_register('AVAR');
- $_SESSION['AVAR'] += 1;
- print "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}";
-}
-*/
diff --git a/sources/vendor/adodb/adodb-php/session/old/adodb-session-clob.php b/sources/vendor/adodb/adodb-php/session/old/adodb-session-clob.php
deleted file mode 100644
index bdb5b05..0000000
--- a/sources/vendor/adodb/adodb-php/session/old/adodb-session-clob.php
+++ /dev/null
@@ -1,446 +0,0 @@
-";
-
-To force non-persistent connections, call adodb_session_open first before session_start():
-
- include('adodb.inc.php');
- include('adodb-session.php');
- adodb_session_open(false,false,false);
- session_start();
- session_register('AVAR');
- $_SESSION['AVAR'] += 1;
- print "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}";
-
-
- Installation
- ============
- 1. Create this table in your database (syntax might vary depending on your db):
-
- create table sessions (
- SESSKEY char(32) not null,
- EXPIRY int(11) unsigned not null,
- EXPIREREF varchar(64),
- DATA CLOB,
- primary key (sesskey)
- );
-
-
- 2. Then define the following parameters in this file:
- $ADODB_SESSION_DRIVER='database driver, eg. mysql or ibase';
- $ADODB_SESSION_CONNECT='server to connect to';
- $ADODB_SESSION_USER ='user';
- $ADODB_SESSION_PWD ='password';
- $ADODB_SESSION_DB ='database';
- $ADODB_SESSION_TBL = 'sessions'
- $ADODB_SESSION_USE_LOBS = false; (or, if you wanna use CLOBS (= 'CLOB') or ( = 'BLOB')
-
- 3. Recommended is PHP 4.1.0 or later. There are documented
- session bugs in earlier versions of PHP.
-
- 4. If you want to receive notifications when a session expires, then
- you can tag a session with an EXPIREREF, and before the session
- record is deleted, we can call a function that will pass the EXPIREREF
- as the first parameter, and the session key as the second parameter.
-
- To do this, define a notification function, say NotifyFn:
-
- function NotifyFn($expireref, $sesskey)
- {
- }
-
- Then you need to define a global variable $ADODB_SESSION_EXPIRE_NOTIFY.
- This is an array with 2 elements, the first being the name of the variable
- you would like to store in the EXPIREREF field, and the 2nd is the
- notification function's name.
-
- In this example, we want to be notified when a user's session
- has expired, so we store the user id in the global variable $USERID,
- store this value in the EXPIREREF field:
-
- $ADODB_SESSION_EXPIRE_NOTIFY = array('USERID','NotifyFn');
-
- Then when the NotifyFn is called, we are passed the $USERID as the first
- parameter, eg. NotifyFn($userid, $sesskey).
-*/
-
-if (!defined('_ADODB_LAYER')) {
- include (dirname(__FILE__).'/adodb.inc.php');
-}
-
-if (!defined('ADODB_SESSION')) {
-
- define('ADODB_SESSION',1);
-
- /* if database time and system time is difference is greater than this, then give warning */
- define('ADODB_SESSION_SYNCH_SECS',60);
-
-/****************************************************************************************\
- Global definitions
-\****************************************************************************************/
-GLOBAL $ADODB_SESSION_CONNECT,
- $ADODB_SESSION_DRIVER,
- $ADODB_SESSION_USER,
- $ADODB_SESSION_PWD,
- $ADODB_SESSION_DB,
- $ADODB_SESS_CONN,
- $ADODB_SESS_LIFE,
- $ADODB_SESS_DEBUG,
- $ADODB_SESSION_EXPIRE_NOTIFY,
- $ADODB_SESSION_CRC,
- $ADODB_SESSION_USE_LOBS,
- $ADODB_SESSION_TBL;
-
- if (!isset($ADODB_SESSION_USE_LOBS)) $ADODB_SESSION_USE_LOBS = 'CLOB';
-
- $ADODB_SESS_LIFE = ini_get('session.gc_maxlifetime');
- if ($ADODB_SESS_LIFE <= 1) {
- // bug in PHP 4.0.3 pl 1 -- how about other versions?
- //print "Session Error: PHP.INI setting session.gc_maxlifetime not set: $ADODB_SESS_LIFE ";
- $ADODB_SESS_LIFE=1440;
- }
- $ADODB_SESSION_CRC = false;
- //$ADODB_SESS_DEBUG = true;
-
- //////////////////////////////////
- /* SET THE FOLLOWING PARAMETERS */
- //////////////////////////////////
-
- if (empty($ADODB_SESSION_DRIVER)) {
- $ADODB_SESSION_DRIVER='mysql';
- $ADODB_SESSION_CONNECT='localhost';
- $ADODB_SESSION_USER ='root';
- $ADODB_SESSION_PWD ='';
- $ADODB_SESSION_DB ='xphplens_2';
- }
-
- if (empty($ADODB_SESSION_EXPIRE_NOTIFY)) {
- $ADODB_SESSION_EXPIRE_NOTIFY = false;
- }
- // Made table name configurable - by David Johnson djohnson@inpro.net
- if (empty($ADODB_SESSION_TBL)){
- $ADODB_SESSION_TBL = 'sessions';
- }
-
-
- // defaulting $ADODB_SESSION_USE_LOBS
- if (!isset($ADODB_SESSION_USE_LOBS) || empty($ADODB_SESSION_USE_LOBS)) {
- $ADODB_SESSION_USE_LOBS = false;
- }
-
- /*
- $ADODB_SESS['driver'] = $ADODB_SESSION_DRIVER;
- $ADODB_SESS['connect'] = $ADODB_SESSION_CONNECT;
- $ADODB_SESS['user'] = $ADODB_SESSION_USER;
- $ADODB_SESS['pwd'] = $ADODB_SESSION_PWD;
- $ADODB_SESS['db'] = $ADODB_SESSION_DB;
- $ADODB_SESS['life'] = $ADODB_SESS_LIFE;
- $ADODB_SESS['debug'] = $ADODB_SESS_DEBUG;
-
- $ADODB_SESS['debug'] = $ADODB_SESS_DEBUG;
- $ADODB_SESS['table'] = $ADODB_SESS_TBL;
- */
-
-/****************************************************************************************\
- Create the connection to the database.
-
- If $ADODB_SESS_CONN already exists, reuse that connection
-\****************************************************************************************/
-function adodb_sess_open($save_path, $session_name,$persist=true)
-{
-GLOBAL $ADODB_SESS_CONN;
- if (isset($ADODB_SESS_CONN)) return true;
-
-GLOBAL $ADODB_SESSION_CONNECT,
- $ADODB_SESSION_DRIVER,
- $ADODB_SESSION_USER,
- $ADODB_SESSION_PWD,
- $ADODB_SESSION_DB,
- $ADODB_SESS_DEBUG;
-
- // cannot use & below - do not know why...
- $ADODB_SESS_CONN = ADONewConnection($ADODB_SESSION_DRIVER);
- if (!empty($ADODB_SESS_DEBUG)) {
- $ADODB_SESS_CONN->debug = true;
- ADOConnection::outp( " conn=$ADODB_SESSION_CONNECT user=$ADODB_SESSION_USER pwd=$ADODB_SESSION_PWD db=$ADODB_SESSION_DB ");
- }
- if ($persist) $ok = $ADODB_SESS_CONN->PConnect($ADODB_SESSION_CONNECT,
- $ADODB_SESSION_USER,$ADODB_SESSION_PWD,$ADODB_SESSION_DB);
- else $ok = $ADODB_SESS_CONN->Connect($ADODB_SESSION_CONNECT,
- $ADODB_SESSION_USER,$ADODB_SESSION_PWD,$ADODB_SESSION_DB);
-
- if (!$ok) ADOConnection::outp( "
--- Session: connection failed",false);
-}
-
-/****************************************************************************************\
- Close the connection
-\****************************************************************************************/
-function adodb_sess_close()
-{
-global $ADODB_SESS_CONN;
-
- if ($ADODB_SESS_CONN) $ADODB_SESS_CONN->Close();
- return true;
-}
-
-/****************************************************************************************\
- Slurp in the session variables and return the serialized string
-\****************************************************************************************/
-function adodb_sess_read($key)
-{
-global $ADODB_SESS_CONN,$ADODB_SESSION_TBL,$ADODB_SESSION_CRC;
-
- $rs = $ADODB_SESS_CONN->Execute("SELECT data FROM $ADODB_SESSION_TBL WHERE sesskey = '$key' AND expiry >= " . time());
- if ($rs) {
- if ($rs->EOF) {
- $v = '';
- } else
- $v = rawurldecode(reset($rs->fields));
-
- $rs->Close();
-
- // new optimization adodb 2.1
- $ADODB_SESSION_CRC = strlen($v).crc32($v);
-
- return $v;
- }
-
- return ''; // thx to Jorma Tuomainen, webmaster#wizactive.com
-}
-
-/****************************************************************************************\
- Write the serialized data to a database.
-
- If the data has not been modified since adodb_sess_read(), we do not write.
-\****************************************************************************************/
-function adodb_sess_write($key, $val)
-{
- global
- $ADODB_SESS_CONN,
- $ADODB_SESS_LIFE,
- $ADODB_SESSION_TBL,
- $ADODB_SESS_DEBUG,
- $ADODB_SESSION_CRC,
- $ADODB_SESSION_EXPIRE_NOTIFY,
- $ADODB_SESSION_DRIVER, // added
- $ADODB_SESSION_USE_LOBS; // added
-
- $expiry = time() + $ADODB_SESS_LIFE;
-
- // crc32 optimization since adodb 2.1
- // now we only update expiry date, thx to sebastian thom in adodb 2.32
- if ($ADODB_SESSION_CRC !== false && $ADODB_SESSION_CRC == strlen($val).crc32($val)) {
- if ($ADODB_SESS_DEBUG) echo "
--- Session: Only updating date - crc32 not changed";
- $qry = "UPDATE $ADODB_SESSION_TBL SET expiry=$expiry WHERE sesskey='$key' AND expiry >= " . time();
- $rs = $ADODB_SESS_CONN->Execute($qry);
- return true;
- }
- $val = rawurlencode($val);
-
- $arr = array('sesskey' => $key, 'expiry' => $expiry, 'data' => $val);
- if ($ADODB_SESSION_EXPIRE_NOTIFY) {
- $var = reset($ADODB_SESSION_EXPIRE_NOTIFY);
- global $$var;
- $arr['expireref'] = $$var;
- }
-
-
- if ($ADODB_SESSION_USE_LOBS === false) { // no lobs, simply use replace()
- $rs = $ADODB_SESS_CONN->Replace($ADODB_SESSION_TBL,$arr, 'sesskey',$autoQuote = true);
- if (!$rs) {
- $err = $ADODB_SESS_CONN->ErrorMsg();
- }
- } else {
- // what value shall we insert/update for lob row?
- switch ($ADODB_SESSION_DRIVER) {
- // empty_clob or empty_lob for oracle dbs
- case "oracle":
- case "oci8":
- case "oci8po":
- case "oci805":
- $lob_value = sprintf("empty_%s()", strtolower($ADODB_SESSION_USE_LOBS));
- break;
-
- // null for all other
- default:
- $lob_value = "null";
- break;
- }
-
- // do we insert or update? => as for sesskey
- $res = $ADODB_SESS_CONN->Execute("select count(*) as cnt from $ADODB_SESSION_TBL where sesskey = '$key'");
- if ($res && reset($res->fields) > 0) {
- $qry = sprintf("update %s set expiry = %d, data = %s where sesskey = '%s'", $ADODB_SESSION_TBL, $expiry, $lob_value, $key);
- } else {
- // insert
- $qry = sprintf("insert into %s (sesskey, expiry, data) values ('%s', %d, %s)", $ADODB_SESSION_TBL, $key, $expiry, $lob_value);
- }
-
- $err = "";
- $rs1 = $ADODB_SESS_CONN->Execute($qry);
- if (!$rs1) {
- $err .= $ADODB_SESS_CONN->ErrorMsg()."\n";
- }
- $rs2 = $ADODB_SESS_CONN->UpdateBlob($ADODB_SESSION_TBL, 'data', $val, "sesskey='$key'", strtoupper($ADODB_SESSION_USE_LOBS));
- if (!$rs2) {
- $err .= $ADODB_SESS_CONN->ErrorMsg()."\n";
- }
- $rs = ($rs1 && $rs2) ? true : false;
- }
-
- if (!$rs) {
- ADOConnection::outp( '
--- Session Replace: '.nl2br($err).'',false);
- } else {
- // bug in access driver (could be odbc?) means that info is not commited
- // properly unless select statement executed in Win2000
- if ($ADODB_SESS_CONN->databaseType == 'access')
- $rs = $ADODB_SESS_CONN->Execute("select sesskey from $ADODB_SESSION_TBL WHERE sesskey='$key'");
- }
- return !empty($rs);
-}
-
-function adodb_sess_destroy($key)
-{
- global $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY;
-
- if ($ADODB_SESSION_EXPIRE_NOTIFY) {
- reset($ADODB_SESSION_EXPIRE_NOTIFY);
- $fn = next($ADODB_SESSION_EXPIRE_NOTIFY);
- $savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM);
- $rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
- $ADODB_SESS_CONN->SetFetchMode($savem);
- if ($rs) {
- $ADODB_SESS_CONN->BeginTrans();
- while (!$rs->EOF) {
- $ref = $rs->fields[0];
- $key = $rs->fields[1];
- $fn($ref,$key);
- $del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
- $rs->MoveNext();
- }
- $ADODB_SESS_CONN->CommitTrans();
- }
- } else {
- $qry = "DELETE FROM $ADODB_SESSION_TBL WHERE sesskey = '$key'";
- $rs = $ADODB_SESS_CONN->Execute($qry);
- }
- return $rs ? true : false;
-}
-
-function adodb_sess_gc($maxlifetime)
-{
- global $ADODB_SESS_DEBUG, $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY;
-
- if ($ADODB_SESSION_EXPIRE_NOTIFY) {
- reset($ADODB_SESSION_EXPIRE_NOTIFY);
- $fn = next($ADODB_SESSION_EXPIRE_NOTIFY);
- $savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM);
- $t = time();
- $rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE expiry < $t");
- $ADODB_SESS_CONN->SetFetchMode($savem);
- if ($rs) {
- $ADODB_SESS_CONN->BeginTrans();
- while (!$rs->EOF) {
- $ref = $rs->fields[0];
- $key = $rs->fields[1];
- $fn($ref,$key);
- $del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
- $rs->MoveNext();
- }
- $rs->Close();
-
- //$ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE expiry < $t");
- $ADODB_SESS_CONN->CommitTrans();
-
- }
- } else {
- $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE expiry < " . time());
-
- if ($ADODB_SESS_DEBUG) ADOConnection::outp("
--- Garbage Collection : $qry");
- }
- // suggested by Cameron, "GaM3R"
- if (defined('ADODB_SESSION_OPTIMIZE')) {
- global $ADODB_SESSION_DRIVER;
-
- switch( $ADODB_SESSION_DRIVER ) {
- case 'mysql':
- case 'mysqlt':
- $opt_qry = 'OPTIMIZE TABLE '.$ADODB_SESSION_TBL;
- break;
- case 'postgresql':
- case 'postgresql7':
- $opt_qry = 'VACUUM '.$ADODB_SESSION_TBL;
- break;
- }
- if (!empty($opt_qry)) {
- $ADODB_SESS_CONN->Execute($opt_qry);
- }
- }
- if ($ADODB_SESS_CONN->dataProvider === 'oci8') $sql = 'select TO_CHAR('.($ADODB_SESS_CONN->sysTimeStamp).', \'RRRR-MM-DD HH24:MI:SS\') from '. $ADODB_SESSION_TBL;
- else $sql = 'select '.$ADODB_SESS_CONN->sysTimeStamp.' from '. $ADODB_SESSION_TBL;
-
- $rs = $ADODB_SESS_CONN->SelectLimit($sql,1);
- if ($rs && !$rs->EOF) {
-
- $dbts = reset($rs->fields);
- $rs->Close();
- $dbt = $ADODB_SESS_CONN->UnixTimeStamp($dbts);
- $t = time();
- if (abs($dbt - $t) >= ADODB_SESSION_SYNCH_SECS) {
- $msg =
- __FILE__.": Server time for webserver {$_SERVER['HTTP_HOST']} not in synch with database: database=$dbt ($dbts), webserver=$t (diff=".(abs($dbt-$t)/3600)." hrs)";
- error_log($msg);
- if ($ADODB_SESS_DEBUG) ADOConnection::outp("
--- $msg");
- }
- }
-
- return true;
-}
-
-session_module_name('user');
-session_set_save_handler(
- "adodb_sess_open",
- "adodb_sess_close",
- "adodb_sess_read",
- "adodb_sess_write",
- "adodb_sess_destroy",
- "adodb_sess_gc");
-}
-
-/* TEST SCRIPT -- UNCOMMENT */
-
-if (0) {
-
- session_start();
- session_register('AVAR');
- $_SESSION['AVAR'] += 1;
- ADOConnection::outp( "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}",false);
-}
diff --git a/sources/vendor/adodb/adodb-php/session/old/adodb-session.php b/sources/vendor/adodb/adodb-php/session/old/adodb-session.php
deleted file mode 100644
index e9b6418..0000000
--- a/sources/vendor/adodb/adodb-php/session/old/adodb-session.php
+++ /dev/null
@@ -1,437 +0,0 @@
-";
-
-To force non-persistent connections, call adodb_session_open first before session_start():
-
- include('adodb.inc.php');
- include('adodb-session.php');
- adodb_sess_open(false,false,false);
- session_start();
- session_register('AVAR');
- $_SESSION['AVAR'] += 1;
- print "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}";
-
-
- Installation
- ============
- 1. Create this table in your database (syntax might vary depending on your db):
-
- create table sessions (
- SESSKEY char(32) not null,
- EXPIRY int(11) unsigned not null,
- EXPIREREF varchar(64),
- DATA text not null,
- primary key (sesskey)
- );
-
- For oracle:
- create table sessions (
- SESSKEY char(32) not null,
- EXPIRY DECIMAL(16) not null,
- EXPIREREF varchar(64),
- DATA varchar(4000) not null,
- primary key (sesskey)
- );
-
-
- 2. Then define the following parameters. You can either modify
- this file, or define them before this file is included:
-
- $ADODB_SESSION_DRIVER='database driver, eg. mysql or ibase';
- $ADODB_SESSION_CONNECT='server to connect to';
- $ADODB_SESSION_USER ='user';
- $ADODB_SESSION_PWD ='password';
- $ADODB_SESSION_DB ='database';
- $ADODB_SESSION_TBL = 'sessions'
-
- 3. Recommended is PHP 4.1.0 or later. There are documented
- session bugs in earlier versions of PHP.
-
- 4. If you want to receive notifications when a session expires, then
- you can tag a session with an EXPIREREF, and before the session
- record is deleted, we can call a function that will pass the EXPIREREF
- as the first parameter, and the session key as the second parameter.
-
- To do this, define a notification function, say NotifyFn:
-
- function NotifyFn($expireref, $sesskey)
- {
- }
-
- Then you need to define a global variable $ADODB_SESSION_EXPIRE_NOTIFY.
- This is an array with 2 elements, the first being the name of the variable
- you would like to store in the EXPIREREF field, and the 2nd is the
- notification function's name.
-
- In this example, we want to be notified when a user's session
- has expired, so we store the user id in the global variable $USERID,
- store this value in the EXPIREREF field:
-
- $ADODB_SESSION_EXPIRE_NOTIFY = array('USERID','NotifyFn');
-
- Then when the NotifyFn is called, we are passed the $USERID as the first
- parameter, eg. NotifyFn($userid, $sesskey).
-*/
-
-if (!defined('_ADODB_LAYER')) {
- include (dirname(__FILE__).'/adodb.inc.php');
-}
-
-if (!defined('ADODB_SESSION')) {
-
- define('ADODB_SESSION',1);
-
- /* if database time and system time is difference is greater than this, then give warning */
- define('ADODB_SESSION_SYNCH_SECS',60);
-
- /*
- Thanks Joe Li. See http://phplens.com/lens/lensforum/msgs.php?id=11487&x=1
-*/
-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;
-}
-
-/****************************************************************************************\
- Global definitions
-\****************************************************************************************/
-GLOBAL $ADODB_SESSION_CONNECT,
- $ADODB_SESSION_DRIVER,
- $ADODB_SESSION_USER,
- $ADODB_SESSION_PWD,
- $ADODB_SESSION_DB,
- $ADODB_SESS_CONN,
- $ADODB_SESS_LIFE,
- $ADODB_SESS_DEBUG,
- $ADODB_SESSION_EXPIRE_NOTIFY,
- $ADODB_SESSION_CRC,
- $ADODB_SESSION_TBL;
-
-
- $ADODB_SESS_LIFE = ini_get('session.gc_maxlifetime');
- if ($ADODB_SESS_LIFE <= 1) {
- // bug in PHP 4.0.3 pl 1 -- how about other versions?
- //print "Session Error: PHP.INI setting session.gc_maxlifetime not set: $ADODB_SESS_LIFE ";
- $ADODB_SESS_LIFE=1440;
- }
- $ADODB_SESSION_CRC = false;
- //$ADODB_SESS_DEBUG = true;
-
- //////////////////////////////////
- /* SET THE FOLLOWING PARAMETERS */
- //////////////////////////////////
-
- if (empty($ADODB_SESSION_DRIVER)) {
- $ADODB_SESSION_DRIVER='mysql';
- $ADODB_SESSION_CONNECT='localhost';
- $ADODB_SESSION_USER ='root';
- $ADODB_SESSION_PWD ='';
- $ADODB_SESSION_DB ='xphplens_2';
- }
-
- if (empty($ADODB_SESSION_EXPIRE_NOTIFY)) {
- $ADODB_SESSION_EXPIRE_NOTIFY = false;
- }
- // Made table name configurable - by David Johnson djohnson@inpro.net
- if (empty($ADODB_SESSION_TBL)){
- $ADODB_SESSION_TBL = 'sessions';
- }
-
- /*
- $ADODB_SESS['driver'] = $ADODB_SESSION_DRIVER;
- $ADODB_SESS['connect'] = $ADODB_SESSION_CONNECT;
- $ADODB_SESS['user'] = $ADODB_SESSION_USER;
- $ADODB_SESS['pwd'] = $ADODB_SESSION_PWD;
- $ADODB_SESS['db'] = $ADODB_SESSION_DB;
- $ADODB_SESS['life'] = $ADODB_SESS_LIFE;
- $ADODB_SESS['debug'] = $ADODB_SESS_DEBUG;
-
- $ADODB_SESS['debug'] = $ADODB_SESS_DEBUG;
- $ADODB_SESS['table'] = $ADODB_SESS_TBL;
- */
-
-/****************************************************************************************\
- Create the connection to the database.
-
- If $ADODB_SESS_CONN already exists, reuse that connection
-\****************************************************************************************/
-function adodb_sess_open($save_path, $session_name,$persist=true)
-{
-GLOBAL $ADODB_SESS_CONN;
- if (isset($ADODB_SESS_CONN)) return true;
-
-GLOBAL $ADODB_SESSION_CONNECT,
- $ADODB_SESSION_DRIVER,
- $ADODB_SESSION_USER,
- $ADODB_SESSION_PWD,
- $ADODB_SESSION_DB,
- $ADODB_SESS_DEBUG;
-
- // cannot use & below - do not know why...
- $ADODB_SESS_CONN = ADONewConnection($ADODB_SESSION_DRIVER);
- if (!empty($ADODB_SESS_DEBUG)) {
- $ADODB_SESS_CONN->debug = true;
- ADOConnection::outp( " conn=$ADODB_SESSION_CONNECT user=$ADODB_SESSION_USER pwd=$ADODB_SESSION_PWD db=$ADODB_SESSION_DB ");
- }
- if ($persist) $ok = $ADODB_SESS_CONN->PConnect($ADODB_SESSION_CONNECT,
- $ADODB_SESSION_USER,$ADODB_SESSION_PWD,$ADODB_SESSION_DB);
- else $ok = $ADODB_SESS_CONN->Connect($ADODB_SESSION_CONNECT,
- $ADODB_SESSION_USER,$ADODB_SESSION_PWD,$ADODB_SESSION_DB);
-
- if (!$ok) ADOConnection::outp( "
--- Session: connection failed",false);
-}
-
-/****************************************************************************************\
- Close the connection
-\****************************************************************************************/
-function adodb_sess_close()
-{
-global $ADODB_SESS_CONN;
-
- if ($ADODB_SESS_CONN) $ADODB_SESS_CONN->Close();
- return true;
-}
-
-/****************************************************************************************\
- Slurp in the session variables and return the serialized string
-\****************************************************************************************/
-function adodb_sess_read($key)
-{
-global $ADODB_SESS_CONN,$ADODB_SESSION_TBL,$ADODB_SESSION_CRC;
-
- $rs = $ADODB_SESS_CONN->Execute("SELECT data FROM $ADODB_SESSION_TBL WHERE sesskey = '$key' AND expiry >= " . time());
- if ($rs) {
- if ($rs->EOF) {
- $v = '';
- } else
- $v = rawurldecode(reset($rs->fields));
-
- $rs->Close();
-
- // new optimization adodb 2.1
- $ADODB_SESSION_CRC = strlen($v).crc32($v);
-
- return $v;
- }
-
- return ''; // thx to Jorma Tuomainen, webmaster#wizactive.com
-}
-
-/****************************************************************************************\
- Write the serialized data to a database.
-
- If the data has not been modified since adodb_sess_read(), we do not write.
-\****************************************************************************************/
-function adodb_sess_write($key, $val)
-{
- global
- $ADODB_SESS_CONN,
- $ADODB_SESS_LIFE,
- $ADODB_SESSION_TBL,
- $ADODB_SESS_DEBUG,
- $ADODB_SESSION_CRC,
- $ADODB_SESSION_EXPIRE_NOTIFY;
-
- $expiry = time() + $ADODB_SESS_LIFE;
-
- // crc32 optimization since adodb 2.1
- // now we only update expiry date, thx to sebastian thom in adodb 2.32
- if ($ADODB_SESSION_CRC !== false && $ADODB_SESSION_CRC == strlen($val).crc32($val)) {
- if ($ADODB_SESS_DEBUG) echo "
--- Session: Only updating date - crc32 not changed";
- $qry = "UPDATE $ADODB_SESSION_TBL SET expiry=$expiry WHERE sesskey='$key' AND expiry >= " . time();
- $rs = $ADODB_SESS_CONN->Execute($qry);
- return true;
- }
- $val = rawurlencode($val);
-
- $arr = array('sesskey' => $key, 'expiry' => $expiry, 'data' => $val);
- if ($ADODB_SESSION_EXPIRE_NOTIFY) {
- $var = reset($ADODB_SESSION_EXPIRE_NOTIFY);
- global $$var;
- $arr['expireref'] = $$var;
- }
- $rs = $ADODB_SESS_CONN->Replace($ADODB_SESSION_TBL,$arr,
- 'sesskey',$autoQuote = true);
-
- if (!$rs) {
- ADOConnection::outp( '
--- Session Replace: '.$ADODB_SESS_CONN->ErrorMsg().'',false);
- } else {
- // bug in access driver (could be odbc?) means that info is not commited
- // properly unless select statement executed in Win2000
- if ($ADODB_SESS_CONN->databaseType == 'access')
- $rs = $ADODB_SESS_CONN->Execute("select sesskey from $ADODB_SESSION_TBL WHERE sesskey='$key'");
- }
- return !empty($rs);
-}
-
-function adodb_sess_destroy($key)
-{
- global $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY;
-
- if ($ADODB_SESSION_EXPIRE_NOTIFY) {
- reset($ADODB_SESSION_EXPIRE_NOTIFY);
- $fn = next($ADODB_SESSION_EXPIRE_NOTIFY);
- $savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM);
- $rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
- $ADODB_SESS_CONN->SetFetchMode($savem);
- if ($rs) {
- $ADODB_SESS_CONN->BeginTrans();
- while (!$rs->EOF) {
- $ref = $rs->fields[0];
- $key = $rs->fields[1];
- $fn($ref,$key);
- $del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
- $rs->MoveNext();
- }
- $ADODB_SESS_CONN->CommitTrans();
- }
- } else {
- $qry = "DELETE FROM $ADODB_SESSION_TBL WHERE sesskey = '$key'";
- $rs = $ADODB_SESS_CONN->Execute($qry);
- }
- return $rs ? true : false;
-}
-
-function adodb_sess_gc($maxlifetime)
-{
- global $ADODB_SESS_DEBUG, $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY;
-
- if ($ADODB_SESSION_EXPIRE_NOTIFY) {
- reset($ADODB_SESSION_EXPIRE_NOTIFY);
- $fn = next($ADODB_SESSION_EXPIRE_NOTIFY);
- $savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM);
- $t = time();
- $rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE expiry < $t");
- $ADODB_SESS_CONN->SetFetchMode($savem);
- if ($rs) {
- $ADODB_SESS_CONN->BeginTrans();
- while (!$rs->EOF) {
- $ref = $rs->fields[0];
- $key = $rs->fields[1];
- $fn($ref,$key);
- $del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
- $rs->MoveNext();
- }
- $rs->Close();
-
- $ADODB_SESS_CONN->CommitTrans();
-
- }
- } else {
- $qry = "DELETE FROM $ADODB_SESSION_TBL WHERE expiry < " . time();
- $ADODB_SESS_CONN->Execute($qry);
-
- if ($ADODB_SESS_DEBUG) ADOConnection::outp("
--- Garbage Collection : $qry");
- }
- // suggested by Cameron, "GaM3R"
- if (defined('ADODB_SESSION_OPTIMIZE')) {
- global $ADODB_SESSION_DRIVER;
-
- switch( $ADODB_SESSION_DRIVER ) {
- case 'mysql':
- case 'mysqlt':
- $opt_qry = 'OPTIMIZE TABLE '.$ADODB_SESSION_TBL;
- break;
- case 'postgresql':
- case 'postgresql7':
- $opt_qry = 'VACUUM '.$ADODB_SESSION_TBL;
- break;
- }
- if (!empty($opt_qry)) {
- $ADODB_SESS_CONN->Execute($opt_qry);
- }
- }
- if ($ADODB_SESS_CONN->dataProvider === 'oci8') $sql = 'select TO_CHAR('.($ADODB_SESS_CONN->sysTimeStamp).', \'RRRR-MM-DD HH24:MI:SS\') from '. $ADODB_SESSION_TBL;
- else $sql = 'select '.$ADODB_SESS_CONN->sysTimeStamp.' from '. $ADODB_SESSION_TBL;
-
- $rs = $ADODB_SESS_CONN->SelectLimit($sql,1);
- if ($rs && !$rs->EOF) {
-
- $dbts = reset($rs->fields);
- $rs->Close();
- $dbt = $ADODB_SESS_CONN->UnixTimeStamp($dbts);
- $t = time();
-
- if (abs($dbt - $t) >= ADODB_SESSION_SYNCH_SECS) {
-
- $msg =
- __FILE__.": Server time for webserver {$_SERVER['HTTP_HOST']} not in synch with database: database=$dbt ($dbts), webserver=$t (diff=".(abs($dbt-$t)/3600)." hrs)";
- error_log($msg);
- if ($ADODB_SESS_DEBUG) ADOConnection::outp("
--- $msg");
- }
- }
-
- return true;
-}
-
-session_module_name('user');
-session_set_save_handler(
- "adodb_sess_open",
- "adodb_sess_close",
- "adodb_sess_read",
- "adodb_sess_write",
- "adodb_sess_destroy",
- "adodb_sess_gc");
-}
-
-/* TEST SCRIPT -- UNCOMMENT */
-
-if (0) {
-
- session_start();
- session_register('AVAR');
- $_SESSION['AVAR'] += 1;
- ADOConnection::outp( "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}",false);
-}
diff --git a/sources/vendor/adodb/adodb-php/session/old/crypt.inc.php b/sources/vendor/adodb/adodb-php/session/old/crypt.inc.php
deleted file mode 100644
index 9c347db..0000000
--- a/sources/vendor/adodb/adodb-php/session/old/crypt.inc.php
+++ /dev/null
@@ -1,63 +0,0 @@
-
-class MD5Crypt{
- function keyED($txt,$encrypt_key)
- {
- $encrypt_key = md5($encrypt_key);
- $ctr=0;
- $tmp = "";
- for ($i=0;$ikeyED($tmp,$key));
- }
-
- function Decrypt($txt,$key)
- {
- $txt = $this->keyED(base64_decode($txt),$key);
- $tmp = "";
- for ($i=0;$i= 58 && $randnumber <= 64) || ($randnumber >= 91 && $randnumber <= 96))
- {
- $randnumber = rand(48,120);
- }
-
- $randomPassword .= chr($randnumber);
- }
- return $randomPassword;
- }
-
-}
diff --git a/sources/vendor/adodb/adodb-php/session/session_schema.xml b/sources/vendor/adodb/adodb-php/session/session_schema.xml
deleted file mode 100644
index 27e47bf..0000000
--- a/sources/vendor/adodb/adodb-php/session/session_schema.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
- table for ADOdb session-management
-
-
- session key
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sources/vendor/adodb/adodb-php/session/session_schema2.xml b/sources/vendor/adodb/adodb-php/session/session_schema2.xml
deleted file mode 100644
index f0d3ec9..0000000
--- a/sources/vendor/adodb/adodb-php/session/session_schema2.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
- table for ADOdb session-management
-
-
- session key
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sources/vendor/adodb/adodb-php/tests/benchmark.php b/sources/vendor/adodb/adodb-php/tests/benchmark.php
deleted file mode 100644
index 0d41310..0000000
--- a/sources/vendor/adodb/adodb-php/tests/benchmark.php
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
- ADODB Benchmarks
-
-
-
-ADODB Version: $ADODB_version Host: $db->host Database: $db->database ";
-
- // perform query once to cache results so we are only testing throughput
- $rs = $db->Execute($sql);
- if (!$rs){
- print "Error in recordset";
- return;
- }
- $arr = $rs->GetArray();
- //$db->debug = true;
- global $ADODB_COUNTRECS;
- $ADODB_COUNTRECS = false;
- $start = microtime();
- for ($i=0; $i < $max; $i++) {
- $rs = $db->Execute($sql);
- $arr = $rs->GetArray();
- // print $arr[0][1];
- }
- $end = microtime();
- $start = explode(' ',$start);
- $end = explode(' ',$end);
-
- //print_r($start);
- //print_r($end);
-
- // print_r($arr);
- $total = $end[0]+trim($end[1]) - $start[0]-trim($start[1]);
- printf ("
seconds = %8.2f for %d iterations each with %d records
",$total,$max, sizeof($arr));
- flush();
-
-
- //$db->Close();
-}
-include("testdatabases.inc.php");
-
-?>
-
-
-
-
diff --git a/sources/vendor/adodb/adodb-php/tests/client.php b/sources/vendor/adodb/adodb-php/tests/client.php
deleted file mode 100644
index 2b73bc4..0000000
--- a/sources/vendor/adodb/adodb-php/tests/client.php
+++ /dev/null
@@ -1,197 +0,0 @@
-
-
-';
- var_dump(parse_url('odbc_mssql://userserver/'));
- die();
-
-include('../adodb.inc.php');
-include('../tohtml.inc.php');
-
- function send2server($url,$sql)
- {
- $url .= '?sql='.urlencode($sql);
- print "$url
";
- $rs = csv2rs($url,$err);
- if ($err) print $err;
- return $rs;
- }
-
- function print_pre($s)
- {
- print "";print_r($s);print " ";
- }
-
-
-$serverURL = 'http://localhost/php/phplens/adodb/server.php';
-$testhttp = false;
-
-$sql1 = "insertz into products (productname) values ('testprod 1')";
-$sql2 = "insert into products (productname) values ('testprod 1')";
-$sql3 = "insert into products (productname) values ('testprod 2')";
-$sql4 = "delete from products where productid>80";
-$sql5 = 'select * from products';
-
-if ($testhttp) {
- print "Client Driver Tests ";
- print "
Test Error ";
- $rs = send2server($serverURL,$sql1);
- print_pre($rs);
- print " ";
-
- print "Test Insert ";
-
- $rs = send2server($serverURL,$sql2);
- print_pre($rs);
- print " ";
-
- print "Test Insert2 ";
-
- $rs = send2server($serverURL,$sql3);
- print_pre($rs);
- print " ";
-
- print "Test Delete ";
-
- $rs = send2server($serverURL,$sql4);
- print_pre($rs);
- print " ";
-
-
- print "Test Select ";
- $rs = send2server($serverURL,$sql5);
- if ($rs) rs2html($rs);
-
- print " ";
-}
-
-
-print "CLIENT Driver Tests ";
-$conn = ADONewConnection('csv');
-$conn->Connect($serverURL);
-$conn->debug = true;
-
-print "Bad SQL ";
-
-$rs = $conn->Execute($sql1);
-
-print "Insert SQL 1 ";
-$rs = $conn->Execute($sql2);
-
-print "Insert SQL 2 ";
-$rs = $conn->Execute($sql3);
-
-print "Select SQL ";
-$rs = $conn->Execute($sql5);
-if ($rs) rs2html($rs);
-
-print "Delete SQL ";
-$rs = $conn->Execute($sql4);
-
-print "Select SQL ";
-$rs = $conn->Execute($sql5);
-if ($rs) rs2html($rs);
-
-
-/* EXPECTED RESULTS FOR HTTP TEST:
-
-Test Insert
-http://localhost/php/adodb/server.php?sql=insert+into+products+%28productname%29+values+%28%27testprod%27%29
-
-adorecordset Object
-(
- [dataProvider] => native
- [fields] =>
- [blobSize] => 64
- [canSeek] =>
- [EOF] => 1
- [emptyTimeStamp] =>
- [emptyDate] =>
- [debug] =>
- [timeToLive] => 0
- [bind] =>
- [_numOfRows] => -1
- [_numOfFields] => 0
- [_queryID] => 1
- [_currentRow] => -1
- [_closed] =>
- [_inited] =>
- [sql] => insert into products (productname) values ('testprod')
- [affectedrows] => 1
- [insertid] => 81
-)
-
-
---------------------------------------------------------------------------------
-
-Test Insert2
-http://localhost/php/adodb/server.php?sql=insert+into+products+%28productname%29+values+%28%27testprod%27%29
-
-adorecordset Object
-(
- [dataProvider] => native
- [fields] =>
- [blobSize] => 64
- [canSeek] =>
- [EOF] => 1
- [emptyTimeStamp] =>
- [emptyDate] =>
- [debug] =>
- [timeToLive] => 0
- [bind] =>
- [_numOfRows] => -1
- [_numOfFields] => 0
- [_queryID] => 1
- [_currentRow] => -1
- [_closed] =>
- [_inited] =>
- [sql] => insert into products (productname) values ('testprod')
- [affectedrows] => 1
- [insertid] => 82
-)
-
-
---------------------------------------------------------------------------------
-
-Test Delete
-http://localhost/php/adodb/server.php?sql=delete+from+products+where+productid%3E80
-
-adorecordset Object
-(
- [dataProvider] => native
- [fields] =>
- [blobSize] => 64
- [canSeek] =>
- [EOF] => 1
- [emptyTimeStamp] =>
- [emptyDate] =>
- [debug] =>
- [timeToLive] => 0
- [bind] =>
- [_numOfRows] => -1
- [_numOfFields] => 0
- [_queryID] => 1
- [_currentRow] => -1
- [_closed] =>
- [_inited] =>
- [sql] => delete from products where productid>80
- [affectedrows] => 2
- [insertid] => 0
-)
-
-[more stuff deleted]
- .
- .
- .
-*/
diff --git a/sources/vendor/adodb/adodb-php/tests/pdo.php b/sources/vendor/adodb/adodb-php/tests/pdo.php
deleted file mode 100644
index 31ca596..0000000
--- a/sources/vendor/adodb/adodb-php/tests/pdo.php
+++ /dev/null
@@ -1,92 +0,0 @@
-";
-try {
- echo "New Connection\n";
-
-
- $dsn = 'pdo_mysql://root:@localhost/northwind?persist';
-
- if (!empty($dsn)) {
- $DB = NewADOConnection($dsn) || die("CONNECT FAILED");
- $connstr = $dsn;
- } else {
-
- $DB = NewADOConnection('pdo');
-
- echo "Connect\n";
-
- $u = ''; $p = '';
- /*
- $connstr = 'odbc:nwind';
-
- $connstr = 'oci:';
- $u = 'scott';
- $p = 'natsoft';
-
-
- $connstr ="sqlite:d:\inetpub\adodb\sqlite.db";
- */
-
- $connstr = "mysql:dbname=northwind";
- $u = 'root';
-
- $connstr = "pgsql:dbname=test";
- $u = 'tester';
- $p = 'test';
-
- $DB->Connect($connstr,$u,$p) || die("CONNECT FAILED");
-
- }
-
- echo "connection string=$connstr\n Execute\n";
-
- //$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- $rs = $DB->Execute("select * from ADOXYZ where id<3");
- if ($DB->ErrorNo()) echo "*** errno=".$DB->ErrorNo() . " ".($DB->ErrorMsg())."\n";
-
-
- //print_r(get_class_methods($DB->_stmt));
-
- if (!$rs) die("NO RS");
-
- echo "Meta\n";
- for ($i=0; $i < $rs->NumCols(); $i++) {
- var_dump($rs->FetchField($i));
- echo " ";
- }
-
- echo "FETCH\n";
- $cnt = 0;
- while (!$rs->EOF) {
- adodb_pr($rs->fields);
- $rs->MoveNext();
- if ($cnt++ > 1000) break;
- }
-
- echo " -------------------------------------------------------- \n\n\n";
-
- $stmt = $DB->PrepareStmt("select * from ADOXYZ");
-
- $rs = $stmt->Execute();
- $cols = $stmt->NumCols(); // execute required
-
- echo "COLS = $cols";
- for($i=1;$i<=$cols;$i++) {
- $v = $stmt->_stmt->getColumnMeta($i);
- var_dump($v);
- }
-
- echo "e=".$stmt->ErrorNo() . " ".($stmt->ErrorMsg())."\n";
- while ($arr = $rs->FetchRow()) {
- adodb_pr($arr);
- }
- die("DONE\n");
-
-} catch (exception $e) {
- echo "";
- echo $e;
- echo " ";
-}
diff --git a/sources/vendor/adodb/adodb-php/tests/test-active-record.php b/sources/vendor/adodb/adodb-php/tests/test-active-record.php
deleted file mode 100644
index 5947162..0000000
--- a/sources/vendor/adodb/adodb-php/tests/test-active-record.php
+++ /dev/null
@@ -1,140 +0,0 @@
-= 5) {
- include('../adodb-exceptions.inc.php');
- echo "Exceptions included ";
- }
- }
-
- $db = NewADOConnection('mysql://root@localhost/northwind?persist');
- $db->debug=1;
- ADOdb_Active_Record::SetDatabaseAdapter($db);
-
-
- $db->Execute("CREATE TEMPORARY TABLE `persons` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_color` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
- $db->Execute("CREATE TEMPORARY TABLE `children` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `person_id` int(10) unsigned NOT NULL,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_pet` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
- class Person extends ADOdb_Active_Record{ function ret($v) {return $v;} }
- $person = new Person();
- ADOdb_Active_Record::$_quoteNames = '111';
-
- echo "Output of getAttributeNames: ";
- var_dump($person->getAttributeNames());
-
- /**
- * Outputs the following:
- * array(4) {
- * [0]=>
- * string(2) "id"
- * [1]=>
- * string(9) "name_first"
- * [2]=>
- * string(8) "name_last"
- * [3]=>
- * string(13) "favorite_color"
- * }
- */
-
- $person = new Person();
- $person->name_first = 'Andi';
- $person->name_last = 'Gutmans';
- $person->save(); // this save() will fail on INSERT as favorite_color is a must fill...
-
-
- $person = new Person();
- $person->name_first = 'Andi';
- $person->name_last = 'Gutmans';
- $person->favorite_color = 'blue';
- $person->save(); // this save will perform an INSERT successfully
-
- echo "
The Insert ID generated:"; print_r($person->id);
-
- $person->favorite_color = 'red';
- $person->save(); // this save() will perform an UPDATE
-
- $person = new Person();
- $person->name_first = 'John';
- $person->name_last = 'Lim';
- $person->favorite_color = 'lavender';
- $person->save(); // this save will perform an INSERT successfully
-
- // load record where id=2 into a new ADOdb_Active_Record
- $person2 = new Person();
- $person2->Load('id=2');
-
- $activeArr = $db->GetActiveRecordsClass($class = "Person",$table = "Persons","id=".$db->Param(0),array(2));
- $person2 = $activeArr[0];
- echo "
Name (should be John): ",$person->name_first, " Class (should be Person): ",get_class($person2)," ";
-
- $db->Execute("insert into children (person_id,name_first,name_last) values (2,'Jill','Lim')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (2,'Joan','Lim')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (2,'JAMIE','Lim')");
-
- $newperson2 = new Person();
- $person2->HasMany('children','person_id');
- $person2->Load('id=2');
- $person2->name_last='green';
- $c = $person2->children;
- $person2->save();
-
- if (is_array($c) && sizeof($c) == 3 && $c[0]->name_first=='Jill' && $c[1]->name_first=='Joan'
- && $c[2]->name_first == 'JAMIE') echo "OK Loaded HasMany";
- else {
- var_dump($c);
- echo "error loading hasMany should have 3 array elements Jill Joan Jamie ";
- }
-
- class Child extends ADOdb_Active_Record{};
- $ch = new Child('children',array('id'));
- $ch->BelongsTo('person','person_id','id');
- $ch->Load('id=1');
- if ($ch->name_first !== 'Jill') echo "error in Loading Child ";
-
- $p = $ch->person;
- if ($p->name_first != 'John') echo "Error loading belongsTo ";
- else echo "OK loading BelongTo ";
-
- $p->hasMany('children','person_id');
- $p->LoadRelations('children', " Name_first like 'J%' order by id",1,2);
- if (sizeof($p->children) == 2 && $p->children[1]->name_first == 'JAMIE') echo "OK LoadRelations ";
- else echo "error LoadRelations ";
-
- $db->Execute("CREATE TEMPORARY TABLE `persons2` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_color` varchar(100) default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
- $p = new adodb_active_record('persons2');
- $p->name_first = 'James';
-
- $p->name_last = 'James';
-
- $p->HasMany('children','person_id');
- $p->children;
- var_dump($p);
- $p->Save();
diff --git a/sources/vendor/adodb/adodb-php/tests/test-active-recs2.php b/sources/vendor/adodb/adodb-php/tests/test-active-recs2.php
deleted file mode 100644
index f5898fc..0000000
--- a/sources/vendor/adodb/adodb-php/tests/test-active-recs2.php
+++ /dev/null
@@ -1,76 +0,0 @@
-Connect("localhost","tester","test","test");
-} else
- $db = NewADOConnection('oci8://scott:natsoft@/');
-
-
-$arr = $db->ServerInfo();
-echo "
$db->dataProvider: {$arr['description']} ";
-
-$arr = $db->GetActiveRecords('products',' productid<10');
-adodb_pr($arr);
-
-ADOdb_Active_Record::SetDatabaseAdapter($db);
-if (!$db) die('failed');
-
-
-
-
-$rec = new ADODB_Active_Record('photos');
-
-$rec = new ADODB_Active_Record('products');
-
-
-adodb_pr($rec->getAttributeNames());
-
-echo " ";
-
-
-$rec->load('productid=2');
-adodb_pr($rec);
-
-$db->debug=1;
-
-
-$rec->productname = 'Changie Chan'.rand();
-
-$rec->insert();
-$rec->update();
-
-$rec->productname = 'Changie Chan 99';
-$rec->replace();
-
-
-$rec2 = new ADODB_Active_Record('products');
-$rec->load('productid=3');
-$rec->save();
-
-$rec = new ADODB_Active_record('products');
-$rec->productname = 'John ActiveRec';
-$rec->notes = 22;
-#$rec->productid=0;
-$rec->discontinued=1;
-$rec->Save();
-$rec->supplierid=33;
-$rec->Save();
-$rec->discontinued=0;
-$rec->Save();
-$rec->Delete();
-
-echo "Affected Rows after delete=".$db->Affected_Rows()."
";
diff --git a/sources/vendor/adodb/adodb-php/tests/test-active-relations.php b/sources/vendor/adodb/adodb-php/tests/test-active-relations.php
deleted file mode 100644
index 7a98d47..0000000
--- a/sources/vendor/adodb/adodb-php/tests/test-active-relations.php
+++ /dev/null
@@ -1,85 +0,0 @@
-debug=1;
- ADOdb_Active_Record::SetDatabaseAdapter($db);
-
- $db->Execute("CREATE TEMPORARY TABLE `persons` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_color` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
- $db->Execute("CREATE TEMPORARY TABLE `children` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `person_id` int(10) unsigned NOT NULL,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_pet` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
-
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'Jill','Lim')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'Joan','Lim')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'JAMIE','Lim')");
-
- ADODB_Active_Record::TableHasMany('persons', 'children','person_id');
- class person extends ADOdb_Active_Record{}
-
- $person = new person();
-# $person->HasMany('children','person_id'); ## this is affects all other instances of Person
-
- $person->name_first = 'John';
- $person->name_last = 'Lim';
- $person->favorite_color = 'lavender';
- $person->save(); // this save will perform an INSERT successfully
-
- $person2 = new person();
- $person2->Load('id=1');
-
- $c = $person2->children;
- if (is_array($c) && sizeof($c) == 3 && $c[0]->name_first=='Jill' && $c[1]->name_first=='Joan'
- && $c[2]->name_first == 'JAMIE') echo "OK Loaded HasMany";
- else {
- var_dump($c);
- echo "error loading hasMany should have 3 array elements Jill Joan Jamie ";
- }
-
- class child extends ADOdb_Active_Record{};
- ADODB_Active_Record::TableBelongsTo('children','person','person_id','id');
- $ch = new Child('children',array('id'));
-
- $ch->Load('id=1');
- if ($ch->name_first !== 'Jill') echo "error in Loading Child ";
-
- $p = $ch->person;
- if (!$p || $p->name_first != 'John') echo "Error loading belongsTo ";
- else echo "OK loading BelongTo ";
-
- if ($p) {
- #$p->HasMany('children','person_id'); ## this is affects all other instances of Person
- $p->LoadRelations('children', 'order by id',1,2);
- if (sizeof($p->children) == 2 && $p->children[1]->name_first == 'JAMIE') echo "OK LoadRelations ";
- else {
- var_dump($p->children);
- echo "error LoadRelations ";
- }
-
- unset($p->children);
- $p->LoadRelations('children', " name_first like 'J%' order by id",1,2);
- }
- if ($p)
- foreach($p->children as $c) {
- echo " Saving $c->name_first ";
- $c->name_first .= ' K.';
- $c->Save();
- }
diff --git a/sources/vendor/adodb/adodb-php/tests/test-active-relationsx.php b/sources/vendor/adodb/adodb-php/tests/test-active-relationsx.php
deleted file mode 100644
index 0f28f72..0000000
--- a/sources/vendor/adodb/adodb-php/tests/test-active-relationsx.php
+++ /dev/null
@@ -1,418 +0,0 @@
-\n", $txt);
- echo $txt;
- }
-
- include_once('../adodb.inc.php');
- include_once('../adodb-active-recordx.inc.php');
-
-
- $db = NewADOConnection('mysql://root@localhost/test');
- $db->debug=0;
- ADOdb_Active_Record::SetDatabaseAdapter($db);
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("Preparing database using SQL queries (creating 'people', 'children')\n");
-
- $db->Execute("DROP TABLE `people`");
- $db->Execute("DROP TABLE `children`");
- $db->Execute("DROP TABLE `artists`");
- $db->Execute("DROP TABLE `songs`");
-
- $db->Execute("CREATE TABLE `people` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_color` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
- $db->Execute("CREATE TABLE `children` (
- `person_id` int(10) unsigned NOT NULL,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_pet` varchar(100) NOT NULL default '',
- `id` int(10) unsigned NOT NULL auto_increment,
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
- $db->Execute("CREATE TABLE `artists` (
- `name` varchar(100) NOT NULL default '',
- `artistuniqueid` int(10) unsigned NOT NULL auto_increment,
- PRIMARY KEY (`artistuniqueid`)
- ) ENGINE=MyISAM;
- ");
-
- $db->Execute("CREATE TABLE `songs` (
- `name` varchar(100) NOT NULL default '',
- `artistid` int(10) NOT NULL,
- `recordid` int(10) unsigned NOT NULL auto_increment,
- PRIMARY KEY (`recordid`)
- ) ENGINE=MyISAM;
- ");
-
- $db->Execute("insert into children (person_id,name_first,name_last,favorite_pet) values (1,'Jill','Lim','tortoise')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'Joan','Lim')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'JAMIE','Lim')");
-
- $db->Execute("insert into artists (artistuniqueid, name) values(1,'Elvis Costello')");
- $db->Execute("insert into songs (recordid, name, artistid) values(1,'No Hiding Place', 1)");
- $db->Execute("insert into songs (recordid, name, artistid) values(2,'American Gangster Time', 1)");
-
- // This class _implicitely_ relies on the 'people' table (pluralized form of 'person')
- class Person extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct();
- $this->hasMany('children');
- }
- }
- // This class _implicitely_ relies on the 'children' table
- class Child extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct();
- $this->belongsTo('person');
- }
- }
- // This class _explicitely_ relies on the 'children' table and shares its metadata with Child
- class Kid extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct('children');
- $this->belongsTo('person');
- }
- }
- // This class _explicitely_ relies on the 'children' table but does not share its metadata
- class Rugrat extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct('children', false, false, array('new' => true));
- }
- }
-
- class Artist extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct('artists', array('artistuniqueid'));
- $this->hasMany('songs', 'artistid');
- }
- }
- class Song extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct('songs', array('recordid'));
- $this->belongsTo('artist', 'artistid');
- }
- }
-
- ar_echo("Inserting person in 'people' table ('John Lim, he likes lavender')\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $person = new Person();
- $person->name_first = 'John';
- $person->name_last = 'Lim';
- $person->favorite_color = 'lavender';
- $person->save(); // this save will perform an INSERT successfully
-
- $person = new Person();
- $person->name_first = 'Lady';
- $person->name_last = 'Cat';
- $person->favorite_color = 'green';
- $person->save();
-
- $child = new Child();
- $child->name_first = 'Fluffy';
- $child->name_last = 'Cat';
- $child->favorite_pet = 'Cat Lady';
- $child->person_id = $person->id;
- $child->save();
-
- $child = new Child();
- $child->name_first = 'Sun';
- $child->name_last = 'Cat';
- $child->favorite_pet = 'Cat Lady';
- $child->person_id = $person->id;
- $child->save();
-
- $err_count = 0;
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("person->Find('id=1') [Lazy Method]\n");
- ar_echo("person is loaded but its children will be loaded on-demand later on\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $person = new Person();
- $people = $person->Find('id=1');
- ar_echo((ar_assert(found($people, "'name_first' => 'John'"))) ? "[OK] Found John\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($people, "'favorite_pet' => 'tortoise'"))) ? "[OK] No relation yet\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo("\n-- Lazily Loading Children:\n\n");
- foreach($people as $aperson)
- {
- foreach($aperson->children as $achild)
- {
- if($achild->name_first);
- }
- }
- ar_echo((ar_assert(found($people, "'favorite_pet' => 'tortoise'"))) ? "[OK] Found relation: child\n" : "[!!] Missing relation: child\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Joan'"))) ? "[OK] Found Joan\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'JAMIE'"))) ? "[OK] Found JAMIE\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("person->Find('id=1' ... ADODB_WORK_AR) [Worker Method]\n");
- ar_echo("person is loaded, and so are its children\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $person = new Person();
- $people = $person->Find('id=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($people, "'name_first' => 'John'"))) ? "[OK] Found John\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'favorite_pet' => 'tortoise'"))) ? "[OK] Found relation: child\n" : "[!!] Missing relation: child\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Joan'"))) ? "[OK] Found Joan\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'JAMIE'"))) ? "[OK] Found JAMIE\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("person->Find('id=1' ... ADODB_JOIN_AR) [Join Method]\n");
- ar_echo("person and its children are loaded using a single query\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $person = new Person();
- // When I specifically ask for a join, I have to specify which table id I am looking up
- // otherwise the SQL parser will wonder which table's id that would be.
- $people = $person->Find('people.id=1', false, false, array('loading' => ADODB_JOIN_AR));
- ar_echo((ar_assert(found($people, "'name_first' => 'John'"))) ? "[OK] Found John\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'favorite_pet' => 'tortoise'"))) ? "[OK] Found relation: child\n" : "[!!] Missing relation: child\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Joan'"))) ? "[OK] Found Joan\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'JAMIE'"))) ? "[OK] Found JAMIE\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("person->Load('people.id=1') [Join Method]\n");
- ar_echo("Load() always uses the join method since it returns only one row\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $person = new Person();
- // Under the hood, Load(), since it returns only one row, always perform a join
- // Therefore we need to clarify which id we are talking about.
- $person->Load('people.id=1');
- ar_echo((ar_assert(found($person, "'name_first' => 'John'"))) ? "[OK] Found John\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($person, "'favorite_pet' => 'tortoise'"))) ? "[OK] Found relation: child\n" : "[!!] Missing relation: child\n");
- ar_echo((ar_assert(found($person, "'name_first' => 'Joan'"))) ? "[OK] Found Joan\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($person, "'name_first' => 'JAMIE'"))) ? "[OK] Found JAMIE\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("child->Load('children.id=1') [Join Method]\n");
- ar_echo("We are now loading from the 'children' table, not from 'people'\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $child = new Child();
- $child->Load('children.id=1');
- ar_echo((ar_assert(found($child, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($child, "'favorite_color' => 'lavender'"))) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("child->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $child = new Child();
- $children = $child->Find('id=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($children, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($children, "'favorite_color' => 'lavender'"))) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n");
- ar_echo((ar_assert(notfound($children, "'name_first' => 'Joan'"))) ? "[OK] No Joan relation\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($children, "'name_first' => 'JAMIE'"))) ? "[OK] No JAMIE relation\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("kid->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n");
- ar_echo("Where we see that kid shares relationships with child because they are stored\n");
- ar_echo("in the common table's metadata structure.\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $kid = new Kid('children');
- $kids = $kid->Find('children.id=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($kids, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($kids, "'favorite_color' => 'lavender'"))) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n");
- ar_echo((ar_assert(notfound($kids, "'name_first' => 'Joan'"))) ? "[OK] No Joan relation\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($kids, "'name_first' => 'JAMIE'"))) ? "[OK] No JAMIE relation\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("kid->Find('children.id=1' ... ADODB_LAZY_AR) [Lazy Method]\n");
- ar_echo("Of course, lazy loading also retrieve medata information...\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $kid = new Kid('children');
- $kids = $kid->Find('children.id=1', false, false, array('loading' => ADODB_LAZY_AR));
- ar_echo((ar_assert(found($kids, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($kids, "'favorite_color' => 'lavender'"))) ? "[OK] No relation yet\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo("\n-- Lazily Loading People:\n\n");
- foreach($kids as $akid)
- {
- if($akid->person);
- }
- ar_echo((ar_assert(found($kids, "'favorite_color' => 'lavender'"))) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n");
- ar_echo((ar_assert(notfound($kids, "'name_first' => 'Joan'"))) ? "[OK] No Joan relation\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo((ar_assert(notfound($kids, "'name_first' => 'JAMIE'"))) ? "[OK] No JAMIE relation\n" : "[!!] Found relation when I shouldn't\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("rugrat->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n");
- ar_echo("In rugrat's constructor it is specified that\nit must forget any existing relation\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $rugrat = new Rugrat('children');
- $rugrats = $rugrat->Find('children.id=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($rugrats, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($rugrats, "'favorite_color' => 'lavender'"))) ? "[OK] No relation found\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo((ar_assert(notfound($rugrats, "'name_first' => 'Joan'"))) ? "[OK] No Joan relation\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo((ar_assert(notfound($rugrats, "'name_first' => 'JAMIE'"))) ? "[OK] No JAMIE relation\n" : "[!!] Found relation when I shouldn't\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("kid->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n");
- ar_echo("Note how only rugrat forgot its relations - kid is fine.\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $kid = new Kid('children');
- $kids = $kid->Find('children.id=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($kids, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($kids, "'favorite_color' => 'lavender'"))) ? "[OK] I did not forget relation: person\n" : "[!!] I should not have forgotten relation: person\n");
- ar_echo((ar_assert(notfound($kids, "'name_first' => 'Joan'"))) ? "[OK] No Joan relation\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo((ar_assert(notfound($kids, "'name_first' => 'JAMIE'"))) ? "[OK] No JAMIE relation\n" : "[!!] Found relation when I shouldn't\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("rugrat->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $rugrat = new Rugrat('children');
- $rugrats = $rugrat->Find('children.id=1', false, false, array('loading' => ADODB_WORK_AR));
- $arugrat = $rugrats[0];
- ar_echo((ar_assert(found($arugrat, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($arugrat, "'favorite_color' => 'lavender'"))) ? "[OK] No relation yet\n" : "[!!] Found relation when I shouldn't\n");
-
- ar_echo("\n-- Loading relations:\n\n");
- $arugrat->belongsTo('person');
- $arugrat->LoadRelations('person', 'order by id', 0, 2);
- ar_echo((ar_assert(found($arugrat, "'favorite_color' => 'lavender'"))) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n");
- ar_echo((ar_assert(found($arugrat, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($arugrat, "'name_first' => 'Joan'"))) ? "[OK] No Joan relation\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo((ar_assert(notfound($arugrat, "'name_first' => 'JAMIE'"))) ? "[OK] No Joan relation\n" : "[!!] Found relation when I shouldn't\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("person->Find('1=1') [Lazy Method]\n");
- ar_echo("And now for our finale...\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $person = new Person();
- $people = $person->Find('1=1', false, false, array('loading' => ADODB_LAZY_AR));
- ar_echo((ar_assert(found($people, "'name_first' => 'John'"))) ? "[OK] Found John\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($people, "'favorite_pet' => 'tortoise'"))) ? "[OK] No relation yet\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo((ar_assert(notfound($people, "'name_first' => 'Fluffy'"))) ? "[OK] No Fluffy yet\n" : "[!!] Found Fluffy relation when I shouldn't\n");
- ar_echo("\n-- Lazily Loading Everybody:\n\n");
- foreach($people as $aperson)
- {
- foreach($aperson->children as $achild)
- {
- if($achild->name_first);
- }
- }
- ar_echo((ar_assert(found($people, "'favorite_pet' => 'tortoise'"))) ? "[OK] Found relation: child\n" : "[!!] Missing relation: child\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Joan'"))) ? "[OK] Found Joan\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'JAMIE'"))) ? "[OK] Found JAMIE\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Lady'"))) ? "[OK] Found Cat Lady\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Fluffy'"))) ? "[OK] Found Fluffy\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Sun'"))) ? "[OK] Found Sun\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("artist->Load('artistuniqueid=1') [Join Method]\n");
- ar_echo("Yes, we are dabbling in the musical field now..\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $artist = new Artist();
- $artist->Load('artistuniqueid=1');
- ar_echo((ar_assert(found($artist, "'name' => 'Elvis Costello'"))) ? "[OK] Found Elvis Costello\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($artist, "'name' => 'No Hiding Place'"))) ? "[OK] Found relation: song\n" : "[!!] Missing relation: song\n");
-
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("song->Load('recordid=1') [Join Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $song = new Song();
- $song->Load('recordid=1');
- ar_echo((ar_assert(found($song, "'name' => 'No Hiding Place'"))) ? "[OK] Found song\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("artist->Find('artistuniqueid=1' ... ADODB_JOIN_AR) [Join Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $artist = new Artist();
- $artists = $artist->Find('artistuniqueid=1', false, false, array('loading' => ADODB_JOIN_AR));
- ar_echo((ar_assert(found($artists, "'name' => 'Elvis Costello'"))) ? "[OK] Found Elvis Costello\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($artists, "'name' => 'No Hiding Place'"))) ? "[OK] Found relation: song\n" : "[!!] Missing relation: song\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("song->Find('recordid=1' ... ADODB_JOIN_AR) [Join Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $song = new Song();
- $songs = $song->Find('recordid=1', false, false, array('loading' => ADODB_JOIN_AR));
- ar_echo((ar_assert(found($songs, "'name' => 'No Hiding Place'"))) ? "[OK] Found song\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("artist->Find('artistuniqueid=1' ... ADODB_WORK_AR) [Work Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $artist = new Artist();
- $artists = $artist->Find('artistuniqueid=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($artists, "'name' => 'Elvis Costello'"))) ? "[OK] Found Elvis Costello\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($artists, "'name' => 'No Hiding Place'"))) ? "[OK] Found relation: song\n" : "[!!] Missing relation: song\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("song->Find('recordid=1' ... ADODB_JOIN_AR) [Join Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $song = new Song();
- $songs = $song->Find('recordid=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($songs, "'name' => 'No Hiding Place'"))) ? "[OK] Found song\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("artist->Find('artistuniqueid=1' ... ADODB_LAZY_AR) [Lazy Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $artist = new Artist();
- $artists = $artist->Find('artistuniqueid=1', false, false, array('loading' => ADODB_LAZY_AR));
- ar_echo((ar_assert(found($artists, "'name' => 'Elvis Costello'"))) ? "[OK] Found Elvis Costello\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($artists, "'name' => 'No Hiding Place'"))) ? "[OK] No relation yet\n" : "[!!] Found relation when I shouldn't\n");
- foreach($artists as $anartist)
- {
- foreach($anartist->songs as $asong)
- {
- if($asong->name);
- }
- }
- ar_echo((ar_assert(found($artists, "'name' => 'No Hiding Place'"))) ? "[OK] Found relation: song\n" : "[!!] Missing relation: song\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("song->Find('recordid=1' ... ADODB_LAZY_AR) [Lazy Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $song = new Song();
- $songs = $song->Find('recordid=1', false, false, array('loading' => ADODB_LAZY_AR));
- ar_echo((ar_assert(found($songs, "'name' => 'No Hiding Place'"))) ? "[OK] Found song\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($songs, "'name' => 'Elvis Costello'"))) ? "[OK] No relation yet\n" : "[!!] Found relation when I shouldn't\n");
- foreach($songs as $asong)
- {
- if($asong->artist);
- }
- ar_echo((ar_assert(found($songs, "'name' => 'Elvis Costello'"))) ? "[OK] Found relation: artist\n" : "[!!] Missing relation: artist\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("Test suite complete. " . (($err_count > 0) ? "$err_count errors found.\n" : "Success.\n"));
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
diff --git a/sources/vendor/adodb/adodb-php/tests/test-datadict.php b/sources/vendor/adodb/adodb-php/tests/test-datadict.php
deleted file mode 100644
index 2ee135d..0000000
--- a/sources/vendor/adodb/adodb-php/tests/test-datadict.php
+++ /dev/null
@@ -1,249 +0,0 @@
-$dbType";
- $db = NewADOConnection($dbType);
- $dict = NewDataDictionary($db);
-
- if (!$dict) continue;
- $dict->debug = 1;
-
- $opts = array('REPLACE','mysql' => 'ENGINE=INNODB', 'oci8' => 'TABLESPACE USERS');
-
-/* $flds = array(
- array('id', 'I',
- 'AUTO','KEY'),
-
- array('name' => 'firstname', 'type' => 'varchar','size' => 30,
- 'DEFAULT'=>'Joan'),
-
- array('lastname','varchar',28,
- 'DEFAULT'=>'Chen','key'),
-
- array('averylonglongfieldname','X',1024,
- 'NOTNULL','default' => 'test'),
-
- array('price','N','7.2',
- 'NOTNULL','default' => '0.00'),
-
- array('MYDATE', 'D',
- 'DEFDATE'),
- array('TS','T',
- 'DEFTIMESTAMP')
- );*/
-
- $flds = "
-ID I AUTO KEY,
-FIRSTNAME VARCHAR(30) DEFAULT 'Joan' INDEX idx_name,
-LASTNAME VARCHAR(28) DEFAULT 'Chen' key INDEX idx_name INDEX idx_lastname,
-averylonglongfieldname X(1024) DEFAULT 'test',
-price N(7.2) DEFAULT '0.00',
-MYDATE D DEFDATE INDEX idx_date,
-BIGFELLOW X NOTNULL,
-TS_SECS T DEFTIMESTAMP,
-TS_SUBSEC TS DEFTIMESTAMP
-";
-
-
- $sqla = $dict->CreateDatabase('KUTU',array('postgres'=>"LOCATION='/u01/postdata'"));
- $dict->SetSchema('KUTU');
-
- $sqli = ($dict->CreateTableSQL('testtable',$flds, $opts));
- $sqla = array_merge($sqla,$sqli);
-
- $sqli = $dict->CreateIndexSQL('idx','testtable','price,firstname,lastname',array('BITMAP','FULLTEXT','CLUSTERED','HASH'));
- $sqla = array_merge($sqla,$sqli);
- $sqli = $dict->CreateIndexSQL('idx2','testtable','price,lastname');//,array('BITMAP','FULLTEXT','CLUSTERED'));
- $sqla = array_merge($sqla,$sqli);
-
- $addflds = array(array('height', 'F'),array('weight','F'));
- $sqli = $dict->AddColumnSQL('testtable',$addflds);
- $sqla = array_merge($sqla,$sqli);
- $addflds = array(array('height', 'F','NOTNULL'),array('weight','F','NOTNULL'));
- $sqli = $dict->AlterColumnSQL('testtable',$addflds);
- $sqla = array_merge($sqla,$sqli);
-
-
- printsqla($dbType,$sqla);
-
- if (file_exists('d:\inetpub\wwwroot\php\phplens\adodb\adodb.inc.php'))
- if ($dbType == 'mysqlt') {
- $db->Connect('localhost', "root", "", "test");
- $dict->SetSchema('');
- $sqla2 = $dict->ChangeTableSQL('adoxyz',$flds);
- if ($sqla2) printsqla($dbType,$sqla2);
- }
- if ($dbType == 'postgres') {
- if (@$db->Connect('localhost', "tester", "test", "test"));
- $dict->SetSchema('');
- $sqla2 = $dict->ChangeTableSQL('adoxyz',$flds);
- if ($sqla2) printsqla($dbType,$sqla2);
- }
-
- if ($dbType == 'odbc_mssql') {
- $dsn = $dsn = "PROVIDER=MSDASQL;Driver={SQL Server};Server=localhost;Database=northwind;";
- if (@$db->Connect($dsn, "sa", "natsoft", "test"));
- $dict->SetSchema('');
- $sqla2 = $dict->ChangeTableSQL('adoxyz',$flds);
- if ($sqla2) printsqla($dbType,$sqla2);
- }
-
-
-
- adodb_pr($dict->databaseType);
- printsqla($dbType, $dict->DropColumnSQL('table',array('my col','`col2_with_Quotes`','A_col3','col3(10)')));
- printsqla($dbType, $dict->ChangeTableSQL('adoxyz','LASTNAME varchar(32)'));
-
-}
-
-function printsqla($dbType,$sqla)
-{
- print "
";
- //print_r($dict->MetaTables());
- foreach($sqla as $s) {
- $s = htmlspecialchars($s);
- print "$s;\n";
- if ($dbType == 'oci8') print "/\n";
- }
- print " ";
-}
-
-/***
-
-Generated SQL:
-
-mysql
-
-CREATE DATABASE KUTU;
-DROP TABLE KUTU.testtable;
-CREATE TABLE KUTU.testtable (
-id INTEGER NOT NULL AUTO_INCREMENT,
-firstname VARCHAR(30) DEFAULT 'Joan',
-lastname VARCHAR(28) NOT NULL DEFAULT 'Chen',
-averylonglongfieldname LONGTEXT NOT NULL,
-price NUMERIC(7,2) NOT NULL DEFAULT 0.00,
-MYDATE DATE DEFAULT CURDATE(),
- PRIMARY KEY (id, lastname)
-)TYPE=ISAM;
-CREATE FULLTEXT INDEX idx ON KUTU.testtable (firstname,lastname);
-CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
-ALTER TABLE KUTU.testtable ADD height DOUBLE;
-ALTER TABLE KUTU.testtable ADD weight DOUBLE;
-ALTER TABLE KUTU.testtable MODIFY COLUMN height DOUBLE NOT NULL;
-ALTER TABLE KUTU.testtable MODIFY COLUMN weight DOUBLE NOT NULL;
-
-
---------------------------------------------------------------------------------
-
-oci8
-
-CREATE USER KUTU IDENTIFIED BY tiger;
-/
-GRANT CREATE SESSION, CREATE TABLE,UNLIMITED TABLESPACE,CREATE SEQUENCE TO KUTU;
-/
-DROP TABLE KUTU.testtable CASCADE CONSTRAINTS;
-/
-CREATE TABLE KUTU.testtable (
-id NUMBER(16) NOT NULL,
-firstname VARCHAR(30) DEFAULT 'Joan',
-lastname VARCHAR(28) DEFAULT 'Chen' NOT NULL,
-averylonglongfieldname CLOB NOT NULL,
-price NUMBER(7,2) DEFAULT 0.00 NOT NULL,
-MYDATE DATE DEFAULT TRUNC(SYSDATE),
- PRIMARY KEY (id, lastname)
-)TABLESPACE USERS;
-/
-DROP SEQUENCE KUTU.SEQ_testtable;
-/
-CREATE SEQUENCE KUTU.SEQ_testtable;
-/
-CREATE OR REPLACE TRIGGER KUTU.TRIG_SEQ_testtable BEFORE insert ON KUTU.testtable
- FOR EACH ROW
- BEGIN
- select KUTU.SEQ_testtable.nextval into :new.id from dual;
- END;
-/
-CREATE BITMAP INDEX idx ON KUTU.testtable (firstname,lastname);
-/
-CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
-/
-ALTER TABLE testtable ADD (
- height NUMBER,
- weight NUMBER);
-/
-ALTER TABLE testtable MODIFY(
- height NUMBER NOT NULL,
- weight NUMBER NOT NULL);
-/
-
-
---------------------------------------------------------------------------------
-
-postgres
-AlterColumnSQL not supported for PostgreSQL
-
-
-CREATE DATABASE KUTU LOCATION='/u01/postdata';
-DROP TABLE KUTU.testtable;
-CREATE TABLE KUTU.testtable (
-id SERIAL,
-firstname VARCHAR(30) DEFAULT 'Joan',
-lastname VARCHAR(28) DEFAULT 'Chen' NOT NULL,
-averylonglongfieldname TEXT NOT NULL,
-price NUMERIC(7,2) DEFAULT 0.00 NOT NULL,
-MYDATE DATE DEFAULT CURRENT_DATE,
- PRIMARY KEY (id, lastname)
-);
-CREATE INDEX idx ON KUTU.testtable USING HASH (firstname,lastname);
-CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
-ALTER TABLE KUTU.testtable ADD height FLOAT8;
-ALTER TABLE KUTU.testtable ADD weight FLOAT8;
-
-
---------------------------------------------------------------------------------
-
-odbc_mssql
-
-CREATE DATABASE KUTU;
-DROP TABLE KUTU.testtable;
-CREATE TABLE KUTU.testtable (
-id INT IDENTITY(1,1) NOT NULL,
-firstname VARCHAR(30) DEFAULT 'Joan',
-lastname VARCHAR(28) DEFAULT 'Chen' NOT NULL,
-averylonglongfieldname TEXT NOT NULL,
-price NUMERIC(7,2) DEFAULT 0.00 NOT NULL,
-MYDATE DATETIME DEFAULT GetDate(),
- PRIMARY KEY (id, lastname)
-);
-CREATE CLUSTERED INDEX idx ON KUTU.testtable (firstname,lastname);
-CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
-ALTER TABLE KUTU.testtable ADD
- height REAL,
- weight REAL;
-ALTER TABLE KUTU.testtable ALTER COLUMN height REAL NOT NULL;
-ALTER TABLE KUTU.testtable ALTER COLUMN weight REAL NOT NULL;
-
-
---------------------------------------------------------------------------------
-*/
-
-
-echo "Test XML Schema ";
-$ff = file('xmlschema.xml');
-echo "";
-foreach($ff as $xml) echo htmlspecialchars($xml);
-echo " ";
-include_once('test-xmlschema.php');
diff --git a/sources/vendor/adodb/adodb-php/tests/test-perf.php b/sources/vendor/adodb/adodb-php/tests/test-perf.php
deleted file mode 100644
index 62465be..0000000
--- a/sources/vendor/adodb/adodb-php/tests/test-perf.php
+++ /dev/null
@@ -1,48 +0,0 @@
- $v) {
- if (strncmp($k,'test',4) == 0) $_SESSION['_db'] = $k;
- }
-}
-
-if (isset($_SESSION['_db'])) {
- $_db = $_SESSION['_db'];
- $_GET[$_db] = 1;
- $$_db = 1;
-}
-
-echo "Performance Monitoring ";
-include_once('testdatabases.inc.php');
-
-
-function testdb($db)
-{
- if (!$db) return;
- echo "";print_r($db->ServerInfo()); echo " user=".$db->user." ";
-
- $perf = NewPerfMonitor($db);
-
- # unit tests
- if (0) {
- //$DB->debug=1;
- echo "Data Cache Size=".$perf->DBParameter('data cache size').'';
- echo $perf->HealthCheck();
- echo($perf->SuspiciousSQL());
- echo($perf->ExpensiveSQL());
- echo($perf->InvalidSQL());
- echo $perf->Tables();
-
- echo "
";
- echo $perf->HealthCheckCLI();
- $perf->Poll(3);
- die();
- }
-
- if ($perf) $perf->UI(3);
-}
diff --git a/sources/vendor/adodb/adodb-php/tests/test-pgblob.php b/sources/vendor/adodb/adodb-php/tests/test-pgblob.php
deleted file mode 100644
index 3add99e..0000000
--- a/sources/vendor/adodb/adodb-php/tests/test-pgblob.php
+++ /dev/null
@@ -1,86 +0,0 @@
-Param(false);
- $x = (rand() % 10) + 1;
- $db->debug= ($i==1);
- $id = $db->GetOne($sql,
- array('Z%','Z%',$x));
- if($id != $offset+$x) {
- print "Error at $x";
- break;
- }
- }
-}
-
-include_once('../adodb.inc.php');
-$db = NewADOConnection('postgres7');
-$db->PConnect('localhost','tester','test','test') || die("failed connection");
-
-$enc = "GIF89a%01%00%01%00%80%FF%00%C0%C0%C0%00%00%00%21%F9%04%01%00%00%00%00%2C%00%00%00%00%01%00%01%00%00%01%012%00%3Bt_clear.gif%0D";
-$val = rawurldecode($enc);
-
-$MAX = 1000;
-
-adodb_pr($db->ServerInfo());
-
-echo "
Testing PREPARE/EXECUTE PLAN ";
-
-
-$db->_bindInputArray = true; // requires postgresql 7.3+ and ability to modify database
-$t = getmicrotime();
-doloop();
-echo '',$MAX,' times, with plan=',getmicrotime() - $t,'
';
-
-
-$db->_bindInputArray = false;
-$t = getmicrotime();
-doloop();
-echo '',$MAX,' times, no plan=',getmicrotime() - $t,'
';
-
-
-
-echo "Testing UPDATEBLOB ";
-$db->debug=1;
-
-### TEST BEGINS
-
-$db->Execute("insert into photos (id,name) values(9999,'dot.gif')");
-$db->UpdateBlob('photos','photo',$val,'id=9999');
-$v = $db->GetOne('select photo from photos where id=9999');
-
-
-### CLEANUP
-
-$db->Execute("delete from photos where id=9999");
-
-### VALIDATION
-
-if ($v !== $val) echo "*** ERROR: Inserted value does not match downloaded val";
-else echo "*** OK: Passed ";
-
-echo "";
-echo "INSERTED: ", $enc;
-echo " ";
-echo"RETURNED: ", rawurlencode($v);
-echo "";
-echo "INSERTED: ", $val;
-echo "
";
-echo "RETURNED: ", $v;
diff --git a/sources/vendor/adodb/adodb-php/tests/test-php5.php b/sources/vendor/adodb/adodb-php/tests/test-php5.php
deleted file mode 100644
index bfc6e33..0000000
--- a/sources/vendor/adodb/adodb-php/tests/test-php5.php
+++ /dev/null
@@ -1,114 +0,0 @@
-PHP ".PHP_VERSION."\n";
-try {
-
-$dbt = 'oci8po';
-
-try {
-switch($dbt) {
-case 'oci8po':
- $db = NewADOConnection("oci8po");
-
- $db->Connect('localhost','scott','natsoft','sherkhan');
- break;
-default:
-case 'mysql':
- $db = NewADOConnection("mysql");
- $db->Connect('localhost','root','','northwind');
- break;
-
-case 'mysqli':
- $db = NewADOConnection("mysqli://root:@localhost/northwind");
- //$db->Connect('localhost','root','','test');
- break;
-}
-} catch (exception $e){
- echo "Connect Failed";
- adodb_pr($e);
- die();
-}
-
-$db->debug=1;
-
-$cnt = $db->GetOne("select count(*) from adoxyz where ?Prepare("select * from adoxyz where ?ErrorMsg(),"\n";
-$rs = $db->Execute($stmt,array(10,20));
-
-echo " Foreach Iterator Test (rand=".rand().") ";
-$i = 0;
-foreach($rs as $v) {
- $i += 1;
- echo "rec $i: "; $s1 = adodb_pr($v,true); $s2 = adodb_pr($rs->fields,true);
- if ($s1 != $s2 && !empty($v)) {adodb_pr($s1); adodb_pr($s2);}
- else echo "passed ";
- flush();
-}
-
-$rs = new ADORecordSet_empty();
-foreach($rs as $v) {
- echo "empty ";var_dump($v);
-}
-
-
-if ($i != $cnt) die("actual cnt is $i, cnt should be $cnt\n");
-else echo "Count $i is correct ";
-
-$rs = $db->Execute("select bad from badder");
-
-} catch (exception $e) {
- adodb_pr($e);
- echo "
adodb_backtrace: \n";
- $e = adodb_backtrace($e->gettrace());
-}
-
-$rs = $db->Execute("select distinct id, firstname,lastname from adoxyz order by id");
-echo "Result=\n",$rs,"";
-
-echo "Active Record ";
-
- include_once("../adodb-active-record.inc.php");
- ADOdb_Active_Record::SetDatabaseAdapter($db);
-
-try {
- class City extends ADOdb_Active_Record{};
- $a = new City();
-
-} catch(exception $e){
- echo $e->getMessage();
-}
-
-try {
-
- $a = new City();
-
- echo "Successfully created City() ";
- #var_dump($a->GetPrimaryKeys());
- $a->city = 'Kuala Lumpur';
- $a->Save();
- $a->Update();
- #$a->SetPrimaryKeys(array('city'));
- $a->country = "M'sia";
- $a->save();
- $a->Delete();
-} catch(exception $e){
- echo $e->getMessage();
-}
-
-//include_once("test-active-record.php");
diff --git a/sources/vendor/adodb/adodb-php/tests/test-xmlschema.php b/sources/vendor/adodb/adodb-php/tests/test-xmlschema.php
deleted file mode 100644
index c56cfec..0000000
--- a/sources/vendor/adodb/adodb-php/tests/test-xmlschema.php
+++ /dev/null
@@ -1,53 +0,0 @@
-Connect( 'localhost', 'root', '', 'test' ) || die('fail connect1');
-
-// To create a schema object and build the query array.
-$schema = new adoSchema( $db );
-
-// To upgrade an existing schema object, use the following
-// To upgrade an existing database to the provided schema,
-// uncomment the following line:
-#$schema->upgradeSchema();
-
-print "SQL to build xmlschema.xml :\n
";
-// Build the SQL array
-$sql = $schema->ParseSchema( "xmlschema.xml" );
-
-var_dump( $sql );
-print " \n";
-
-// Execute the SQL on the database
-//$result = $schema->ExecuteSchema( $sql );
-
-// Finally, clean up after the XML parser
-// (PHP won't do this for you!)
-//$schema->Destroy();
-
-
-
-print "SQL to build xmlschema-mssql.xml :\n";
-
-$db2 = ADONewConnection('mssql');
-$db2->Connect('','adodb','natsoft','northwind') || die("Fail 2");
-
-$db2->Execute("drop table simple_table");
-
-$schema = new adoSchema( $db2 );
-$sql = $schema->ParseSchema( "xmlschema-mssql.xml" );
-
-print_r( $sql );
-print " \n";
-
-$db2->debug=1;
-
-foreach ($sql as $s)
-$db2->Execute($s);
diff --git a/sources/vendor/adodb/adodb-php/tests/test.php b/sources/vendor/adodb/adodb-php/tests/test.php
deleted file mode 100644
index 1ce1e6a..0000000
--- a/sources/vendor/adodb/adodb-php/tests/test.php
+++ /dev/null
@@ -1,1776 +0,0 @@
-$msg ";
- flush();
-}
-
-function CheckWS($conn)
-{
-global $ADODB_EXTENSION;
-
- include_once('../session/adodb-session.php');
- if (defined('CHECKWSFAIL')){ echo " TESTING $conn ";flush();}
- $saved = $ADODB_EXTENSION;
- $db = ADONewConnection($conn);
- $ADODB_EXTENSION = $saved;
- if (headers_sent()) {
- print " White space detected in adodb-$conn.inc.php or include file...
";
- //die();
- }
-}
-
-function do_strtolower(&$arr)
-{
- foreach($arr as $k => $v) {
- if (is_object($v)) $arr[$k] = adodb_pr($v,true);
- else $arr[$k] = strtolower($v);
- }
-}
-
-
-function CountExecs($db, $sql, $inputarray)
-{
-global $EXECS; $EXECS++;
-}
-
-function CountCachedExecs($db, $secs2cache, $sql, $inputarray)
-{
-global $CACHED; $CACHED++;
-}
-
-// the table creation code is specific to the database, so we allow the user
-// to define their own table creation stuff
-
-function testdb(&$db,$createtab="create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)")
-{
-GLOBAL $ADODB_vers,$ADODB_CACHE_DIR,$ADODB_FETCH_MODE,$ADODB_COUNTRECS;
-
- //adodb_pr($db);
-
-?>
-Close();
- if ($rs2) $rs2->Close();
- if ($rs) $rs->Close();
- $db->Close();
-
- if ($db->transCnt != 0) Err("Error in transCnt=$db->transCnt (should be 0)");
-
-
- printf("Total queries=%d; total cached=%d
",$EXECS+$CACHED, $CACHED);
- flush();
-}
-
-function adodb_test_err($dbms, $fn, $errno, $errmsg, $p1=false, $p2=false)
-{
-global $TESTERRS,$ERRNO;
-
- $ERRNO = $errno;
- $TESTERRS += 1;
- print "** $dbms ($fn): errno=$errno errmsg=$errmsg ($p1,$p2) ";
-}
-
-//--------------------------------------------------------------------------------------
-
-
-@set_time_limit(240); // increase timeout
-
-include("../tohtml.inc.php");
-include("../adodb.inc.php");
-include("../rsfilter.inc.php");
-
-/* White Space Check */
-
-if (isset($_SERVER['argv'][1])) {
- //print_r($_SERVER['argv']);
- $_GET[$_SERVER['argv'][1]] = 1;
-}
-
-if (@$_SERVER['COMPUTERNAME'] == 'TIGRESS') {
- CheckWS('mysqlt');
- CheckWS('postgres');
- CheckWS('oci8po');
-
- CheckWS('firebird');
- CheckWS('sybase');
- if (!ini_get('safe_mode')) CheckWS('informix');
-
- CheckWS('ado_mssql');
- CheckWS('ado_access');
- CheckWS('mssql');
-
- CheckWS('vfp');
- CheckWS('sqlanywhere');
- CheckWS('db2');
- CheckWS('access');
- CheckWS('odbc_mssql');
- CheckWS('firebird15');
- //
- CheckWS('oracle');
- CheckWS('proxy');
- CheckWS('fbsql');
- print "White Space Check complete";
-}
-if (sizeof($_GET) == 0) $testmysql = true;
-
-
-foreach($_GET as $k=>$v) {
- //global $$k;
- $$k = $v;
-}
-
-?>
-
-
ADODB Testing
-
-ADODB Test
-
-This script tests the following databases: Interbase, Oracle, Visual FoxPro, Microsoft Access (ODBC and ADO), MySQL, MSSQL (ODBC, native, ADO).
-There is also support for Sybase, PostgreSQL.
-For the latest version of ADODB, visit adodb.sourceforge.net .
-
-Test GetInsertSQL/GetUpdateSQL
- Sessions
- Paging
- Perf Monitor
-vers=",ADOConnection::Version();
-
-
-
-?>
-
ADODB Database Library (c) 2000-2014 John Lim. All rights reserved. Released under BSD and LGPL, PHP .
-
-
diff --git a/sources/vendor/adodb/adodb-php/tests/test2.php b/sources/vendor/adodb/adodb-php/tests/test2.php
deleted file mode 100644
index eb3b025..0000000
--- a/sources/vendor/adodb/adodb-php/tests/test2.php
+++ /dev/null
@@ -1,25 +0,0 @@
-debug=1;
- $access = 'd:\inetpub\wwwroot\php\NWIND.MDB';
- $myDSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;'
- . 'DATA SOURCE=' . $access . ';';
-
- echo "PHP ",PHP_VERSION,"
";
-
- $db->Connect($myDSN) || die('fail');
-
- print_r($db->ServerInfo());
-
- try {
- $rs = $db->Execute("select $db->sysTimeStamp,* from adoxyz where id>02xx");
- print_r($rs->fields);
- } catch(exception $e) {
- print_r($e);
- echo " Date m/d/Y =",$db->UserDate($rs->fields[4],'m/d/Y');
- }
diff --git a/sources/vendor/adodb/adodb-php/tests/test3.php b/sources/vendor/adodb/adodb-php/tests/test3.php
deleted file mode 100644
index fc881a4..0000000
--- a/sources/vendor/adodb/adodb-php/tests/test3.php
+++ /dev/null
@@ -1,42 +0,0 @@
-Connect('','scott','natsoft');
-$db->debug=1;
-
-$cnt = $db->GetOne("select count(*) from adoxyz");
-$rs = $db->Execute("select * from adoxyz order by id");
-
-$i = 0;
-foreach($rs as $k => $v) {
- $i += 1;
- echo $k; adodb_pr($v);
- flush();
-}
-
-if ($i != $cnt) die("actual cnt is $i, cnt should be $cnt\n");
-
-
-
-$rs = $db->Execute("select bad from badder");
-
-} catch (exception $e) {
- adodb_pr($e);
- $e = adodb_backtrace($e->trace);
-}
diff --git a/sources/vendor/adodb/adodb-php/tests/test4.php b/sources/vendor/adodb/adodb-php/tests/test4.php
deleted file mode 100644
index ff0c53e..0000000
--- a/sources/vendor/adodb/adodb-php/tests/test4.php
+++ /dev/null
@@ -1,142 +0,0 @@
-PConnect("", "sa", "natsoft", "northwind"); // connect to MySQL, testdb
-
-$conn = ADONewConnection("mysql"); // create a connection
-$conn->PConnect("localhost", "root", "", "test"); // connect to MySQL, testdb
-
-
-#$conn = ADONewConnection('oci8po');
-#$conn->Connect('','scott','natsoft');
-
-if (PHP_VERSION >= 5) {
- $connstr = "mysql:dbname=northwind";
- $u = 'root';$p='';
- $conn = ADONewConnection('pdo');
- $conn->Connect($connstr, $u, $p);
-}
-//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-
-
-$conn->debug=1;
-$conn->Execute("delete from adoxyz where lastname like 'Smi%'");
-
-$rs = $conn->Execute($sql); // Execute the query and get the empty recordset
-$record = array(); // Initialize an array to hold the record data to insert
-
-if (strpos($conn->databaseType,'mysql')===false) $record['id'] = 751;
-$record["firstname"] = 'Jann';
-$record["lastname"] = "Smitts";
-$record["created"] = time();
-
-$insertSQL = $conn->GetInsertSQL($rs, $record);
-$conn->Execute($insertSQL); // Insert the record into the database
-
-if (strpos($conn->databaseType,'mysql')===false) $record['id'] = 752;
-// Set the values for the fields in the record
-$record["firstname"] = 'anull';
-$record["lastname"] = "Smith\$@//";
-$record["created"] = time();
-
-if (isset($_GET['f'])) $ADODB_FORCE_TYPE = $_GET['f'];
-
-//$record["id"] = -1;
-
-// Pass the empty recordset and the array containing the data to insert
-// into the GetInsertSQL function. The function will process the data and return
-// a fully formatted insert sql statement.
-$insertSQL = $conn->GetInsertSQL($rs, $record);
-$conn->Execute($insertSQL); // Insert the record into the database
-
-
-
-$insertSQL2 = $conn->GetInsertSQL($table='ADOXYZ', $record);
-if ($insertSQL != $insertSQL2) echo "
Walt's new stuff failed : $insertSQL2
";
-//==========================
-// This code tests an update
-
-$sql = "
-SELECT *
-FROM ADOXYZ WHERE lastname=".$conn->Param('var'). " ORDER BY 1";
-// Select a record to update
-
-$varr = array('var'=>$record['lastname'].'');
-$rs = $conn->Execute($sql,$varr); // Execute the query and get the existing record to update
-if (!$rs || $rs->EOF) print "No record found!
";
-
-$record = array(); // Initialize an array to hold the record data to update
-
-
-// Set the values for the fields in the record
-$record["firstName"] = "Caroline".rand();
-//$record["lasTname"] = ""; // Update Caroline's lastname from Miranda to Smith
-$record["creAted"] = '2002-12-'.(rand()%30+1);
-$record['num'] = '';
-// Pass the single record recordset and the array containing the data to update
-// into the GetUpdateSQL function. The function will process the data and return
-// a fully formatted update sql statement.
-// If the data has not changed, no recordset is returned
-
-$updateSQL = $conn->GetUpdateSQL($rs, $record);
-$conn->Execute($updateSQL,$varr); // Update the record in the database
-if ($conn->Affected_Rows() != 1)print "Error1 : Rows Affected=".$conn->Affected_Rows().", should be 1
";
-
-$record["firstName"] = "Caroline".rand();
-$record["lasTname"] = "Smithy Jones"; // Update Caroline's lastname from Miranda to Smith
-$record["creAted"] = '2002-12-'.(rand()%30+1);
-$record['num'] = 331;
-$updateSQL = $conn->GetUpdateSQL($rs, $record);
-$conn->Execute($updateSQL,$varr); // Update the record in the database
-if ($conn->Affected_Rows() != 1)print "Error 2 : Rows Affected=".$conn->Affected_Rows().", should be 1
";
-
-$rs = $conn->Execute("select * from ADOXYZ where lastname like 'Sm%'");
-//adodb_pr($rs);
-rs2html($rs);
-
-$record["firstName"] = "Carol-new-".rand();
-$record["lasTname"] = "Smithy"; // Update Caroline's lastname from Miranda to Smith
-$record["creAted"] = '2002-12-'.(rand()%30+1);
-$record['num'] = 331;
-
-$conn->AutoExecute('ADOXYZ',$record,'UPDATE', "lastname like 'Sm%'");
-$rs = $conn->Execute("select * from ADOXYZ where lastname like 'Sm%'");
-//adodb_pr($rs);
-rs2html($rs);
-}
-
-
-testsql();
diff --git a/sources/vendor/adodb/adodb-php/tests/test5.php b/sources/vendor/adodb/adodb-php/tests/test5.php
deleted file mode 100644
index 4af762c..0000000
--- a/sources/vendor/adodb/adodb-php/tests/test5.php
+++ /dev/null
@@ -1,46 +0,0 @@
-debug=1;
- $conn->PConnect("localhost","root","","xphplens");
- print $conn->databaseType.':'.$conn->GenID().' ';
-}
-
-if (0) {
- $conn = ADONewConnection("oci8"); // create a connection
- $conn->debug=1;
- $conn->PConnect("falcon", "scott", "tiger", "juris8.ecosystem.natsoft.com.my"); // connect to MySQL, testdb
- print $conn->databaseType.':'.$conn->GenID();
-}
-
-if (0) {
- $conn = ADONewConnection("ibase"); // create a connection
- $conn->debug=1;
- $conn->Connect("localhost:c:\\Interbase\\Examples\\Database\\employee.gdb", "sysdba", "masterkey", ""); // connect to MySQL, testdb
- print $conn->databaseType.':'.$conn->GenID().' ';
-}
-
-if (0) {
- $conn = ADONewConnection('postgres');
- $conn->debug=1;
- @$conn->PConnect("susetikus","tester","test","test");
- print $conn->databaseType.':'.$conn->GenID().' ';
-}
diff --git a/sources/vendor/adodb/adodb-php/tests/test_rs_array.php b/sources/vendor/adodb/adodb-php/tests/test_rs_array.php
deleted file mode 100644
index 547b20a..0000000
--- a/sources/vendor/adodb/adodb-php/tests/test_rs_array.php
+++ /dev/null
@@ -1,46 +0,0 @@
-InitArray($array,$typearr);
-
-while (!$rs->EOF) {
- print_r($rs->fields);echo " ";
- $rs->MoveNext();
-}
-
-echo " 1 Seek ";
-$rs->Move(1);
-while (!$rs->EOF) {
- print_r($rs->fields);echo " ";
- $rs->MoveNext();
-}
-
-echo " 2 Seek ";
-$rs->Move(2);
-while (!$rs->EOF) {
- print_r($rs->fields);echo " ";
- $rs->MoveNext();
-}
-
-echo " 3 Seek ";
-$rs->Move(3);
-while (!$rs->EOF) {
- print_r($rs->fields);echo " ";
- $rs->MoveNext();
-}
-
-
-
-die();
diff --git a/sources/vendor/adodb/adodb-php/tests/testcache.php b/sources/vendor/adodb/adodb-php/tests/testcache.php
deleted file mode 100644
index 3e08e1f..0000000
--- a/sources/vendor/adodb/adodb-php/tests/testcache.php
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-PConnect('nwind');
-} else {
- $db = ADONewConnection('mysql');
- $db->PConnect('mangrove','root','','xphplens');
-}
-if (isset($cache)) $rs = $db->CacheExecute(120,'select * from products');
-else $rs = $db->Execute('select * from products');
-
-$arr = $rs->GetArray();
-print sizeof($arr);
diff --git a/sources/vendor/adodb/adodb-php/tests/testdatabases.inc.php b/sources/vendor/adodb/adodb-php/tests/testdatabases.inc.php
deleted file mode 100644
index 5c30edd..0000000
--- a/sources/vendor/adodb/adodb-php/tests/testdatabases.inc.php
+++ /dev/null
@@ -1,476 +0,0 @@
-
-
-
-
-
-
-FETCH MODE IS NOT ADODB_FETCH_DEFAULT";
-
-if (isset($nocountrecs)) $ADODB_COUNTRECS = false;
-
-// cannot test databases below, but we include them anyway to check
-// if they parse ok...
-
-if (sizeof($_GET) || !isset($_SERVER['HTTP_HOST'])) {
- echo " ";
- ADOLoadCode2("sybase");
- ADOLoadCode2("postgres");
- ADOLoadCode2("postgres7");
- ADOLoadCode2("firebird");
- ADOLoadCode2("borland_ibase");
- ADOLoadCode2("informix");
- ADOLoadCode2('mysqli');
- if (defined('ODBC_BINMODE_RETURN')) {
- ADOLoadCode2("sqlanywhere");
- ADOLoadCode2("access");
- }
- ADOLoadCode2("mysql");
- ADOLoadCode2("oci8");
-}
-
-function ADOLoadCode2($d)
-{
- ADOLoadCode($d);
- $c = ADONewConnection($d);
- echo "Loaded $d ",($c ? 'ok' : 'extension not installed')," ";
-}
-
-flush();
-
-// dregad 2014-04-15 added serial field to avoid error with lastval()
-$pg_test_table = "create table ADOXYZ (id integer, firstname char(24), lastname varchar,created date, ser serial)";
-$pg_hostname = 'localhost';
-$pg_user = 'tester';
-$pg_password = 'test';
-$pg_database = 'northwind';
-$pg_errmsg = "ERROR: PostgreSQL requires a database called '$pg_database' "
- . "on server '$pg_hostname', user '$pg_user', password '$pg_password'. ";
-
-if (!empty($testpostgres)) {
- //ADOLoadCode("postgres");
-
- $db = ADONewConnection('postgres');
- print "Connecting $db->databaseType... ";
- if ($db->Connect($pg_hostname, $pg_user, $pg_password, $pg_database)) {
- testdb($db, $pg_test_table);
- } else {
- print $pg_errmsg . $db->ErrorMsg();
- }
-}
-
-if (!empty($testpostgres9)) {
- //ADOLoadCode("postgres");
-
- $db = ADONewConnection('postgres9');
- print "Connecting $db->databaseType... ";
- if ($db->Connect($pg_hostname, $pg_user, $pg_password, $pg_database)) {
- testdb($db, $pg_test_table);
- } else {
- print $pg_errmsg . $db->ErrorMsg();
- }
-}
-
-if (!empty($testpgodbc)) {
-
- $db = ADONewConnection('odbc');
- $db->hasTransactions = false;
- print "Connecting $db->databaseType... ";
-
- if ($db->PConnect('Postgresql')) {
- $db->hasTransactions = true;
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) type=innodb");
- } else print "ERROR: PostgreSQL requires a database called test on server, user tester, password test. ".$db->ErrorMsg();
-}
-
-if (!empty($testibase)) {
- //$_GET['nolog'] = true;
- $db = ADONewConnection('firebird');
- print "Connecting $db->databaseType... ";
- if ($db->PConnect("localhost:d:\\firebird\\151\\examples\\EMPLOYEE.fdb", "sysdba", "masterkey", ""))
- testdb($db,"create table ADOXYZ (id integer, firstname char(24), lastname char(24),price numeric(12,2),created date)");
- else print "ERROR: Interbase test requires a database called employee.gdb".' '.$db->ErrorMsg();
-
-}
-
-
-if (!empty($testsqlite)) {
- $path =urlencode('d:\inetpub\adodb\sqlite.db');
- $dsn = "sqlite://$path/";
- $db = ADONewConnection($dsn);
- //echo $dsn;
-
- //$db = ADONewConnection('sqlite');
-
-
- if ($db && $db->PConnect("d:\\inetpub\\adodb\\sqlite.db", "", "", "")) {
- print "Connecting $db->databaseType... ";
- testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
- } else
- print "ERROR: SQLite";
-
-}
-
-if (!empty($testpdopgsql)) {
- $connstr = "pgsql:dbname=test";
- $u = 'tester';$p='test';
- $db = ADONewConnection('pdo');
- print "Connecting $db->databaseType... ";
- $db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-if (!empty($testpdomysql)) {
- $connstr = "mysql:dbname=northwind";
- $u = 'root';$p='';
- $db = ADONewConnection('pdo');
- print "Connecting $db->databaseType... ";
- $db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
-
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-if (!empty($testpdomssql)) {
- $connstr = "mssql:dbname=northwind";
- $u = 'sa';$p='natsoft';
- $db = ADONewConnection('pdo');
- print "Connecting $db->databaseType... ";
- $db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
-
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-if (!empty($testpdosqlite)) {
- $connstr = "sqlite:d:/inetpub/adodb/sqlite-pdo.db3";
- $u = '';$p='';
- $db = ADONewConnection('pdo');
- $db->hasTransactions = false;
- print "Connecting $db->databaseType... ";
- $db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-if (!empty($testpdoaccess)) {
- $connstr = 'odbc:nwind';
- $u = '';$p='';
- $db = ADONewConnection('pdo');
- $db->hasTransactions = false;
- print "Connecting $db->databaseType... ";
- $db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-if (!empty($testpdoora)) {
- $connstr = 'oci:';
- $u = 'scott';$p='natsoft';
- $db = ADONewConnection('pdo');
- #$db->hasTransactions = false;
- print "Connecting $db->databaseType... ";
- $db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-// REQUIRES ODBC DSN CALLED nwind
-if (!empty($testaccess)) {
- $db = ADONewConnection('access');
- print "Connecting $db->databaseType... ";
- $access = 'd:\inetpub\wwwroot\php\NWIND.MDB';
- $dsn = "nwind";
- $dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=$access;Uid=Admin;Pwd=;";
-
- //$dsn = 'Provider=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=' . $access . ';';
- if ($db->PConnect($dsn, "", "", ""))
- testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
- else print "ERROR: Access test requires a Windows ODBC DSN=nwind, Access driver";
-
-}
-
-if (!empty($testaccess) && !empty($testado)) { // ADO ACCESS
-
- $db = ADONewConnection("ado_access");
- print "Connecting $db->databaseType... ";
-
- $access = 'd:\inetpub\wwwroot\php\NWIND.MDB';
- $myDSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;'
- . 'DATA SOURCE=' . $access . ';';
- //. 'USER ID=;PASSWORD=;';
- $_GET['nolog'] = 1;
- if ($db->PConnect($myDSN, "", "", "")) {
- print "ADO version=".$db->_connectionID->version." ";
- testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
- } else print "ERROR: Access test requires a Access database $access".' '.$db->ErrorMsg();
-
-}
-
-if (!empty($testvfp)) { // ODBC
- $db = ADONewConnection('vfp');
- print "Connecting $db->databaseType... ";flush();
-
- if ( $db->PConnect("vfp-adoxyz")) {
- testdb($db,"create table d:\\inetpub\\adodb\\ADOXYZ (id int, firstname char(24), lastname char(24),created date)");
- } else print "ERROR: Visual FoxPro test requires a Windows ODBC DSN=vfp-adoxyz, VFP driver";
-
- echo " ";
- $db = ADONewConnection('odbtp');
-
- if ( $db->PConnect('localhost','DRIVER={Microsoft Visual FoxPro Driver};SOURCETYPE=DBF;SOURCEDB=d:\inetpub\adodb;EXCLUSIVE=NO;')) {
- print "Connecting $db->databaseType... ";flush();
- testdb($db,"create table d:\\inetpub\\adodb\\ADOXYZ (id int, firstname char(24), lastname char(24),created date)");
- } else print "ERROR: Visual FoxPro odbtp requires a Windows ODBC DSN=vfp-adoxyz, VFP driver";
-
-}
-
-
-// REQUIRES MySQL server at localhost with database 'test'
-if (!empty($testmysql)) { // MYSQL
-
-
- if (PHP_VERSION >= 5 || $_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
- else $server = "mangrove";
- $user = 'root'; $password = ''; $database = 'northwind';
- $db = ADONewConnection("mysqlt://$user:$password@$server/$database?persist");
- print "Connecting $db->databaseType... ";
-
- if (true || $db->PConnect($server, "root", "", "northwind")) {
- //$db->Execute("DROP TABLE ADOXYZ") || die('fail drop');
- //$db->debug=1;$db->Execute('drop table ADOXYZ');
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) Type=InnoDB");
- } else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".' '.$db->ErrorMsg();
-}
-
-// REQUIRES MySQL server at localhost with database 'test'
-if (!empty($testmysqli)) { // MYSQL
-
- $db = ADONewConnection('mysqli');
- print "Connecting $db->databaseType... ";
- if (PHP_VERSION >= 5 || $_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
- else $server = "mangrove";
- if ($db->PConnect($server, "root", "", "northwind")) {
- //$db->debug=1;$db->Execute('drop table ADOXYZ');
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
- } else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".' '.$db->ErrorMsg();
-}
-
-
-// REQUIRES MySQL server at localhost with database 'test'
-if (!empty($testmysqlodbc)) { // MYSQL
-
- $db = ADONewConnection('odbc');
- $db->hasTransactions = false;
- print "Connecting $db->databaseType... ";
- if ($_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
- else $server = "mangrove";
- if ($db->PConnect('mysql', "root", ""))
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) type=innodb");
- else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".' '.$db->ErrorMsg();
-}
-
-if (!empty($testproxy)){
- $db = ADONewConnection('proxy');
- print "Connecting $db->databaseType... ";
- if ($_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
-
- if ($db->PConnect('http://localhost/php/phplens/adodb/server.php'))
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) type=innodb");
- else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".' '.$db->ErrorMsg();
-
-}
-
-ADOLoadCode('oci805');
-ADOLoadCode("oci8po");
-
-if (!empty($testoracle)) {
- $dsn = "oci8";//://scott:natsoft@kk2?persist";
- $db = ADONewConnection($dsn );//'oci8');
-
- //$db->debug=1;
- print "Connecting $db->databaseType... ";
- if ($db->Connect('mobydick', "scott", "natsoft",'SID=mobydick'))
- testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
- else
- print "ERROR: Oracle test requires an Oracle server setup with scott/natsoft".' '.$db->ErrorMsg();
-
-}
-ADOLoadCode("oracle"); // no longer supported
-if (false && !empty($testoracle)) {
-
- $db = ADONewConnection();
- print "Connecting $db->databaseType... ";
- if ($db->PConnect("", "scott", "tiger", "natsoft.domain"))
- testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
- else print "ERROR: Oracle test requires an Oracle server setup with scott/tiger".' '.$db->ErrorMsg();
-
-}
-
-ADOLoadCode("odbc_db2"); // no longer supported
-if (!empty($testdb2)) {
- if (PHP_VERSION>=5.1) {
- $db = ADONewConnection("db2");
- print "Connecting $db->databaseType... ";
-
- #$db->curMode = SQL_CUR_USE_ODBC;
- #$dsn = "driver={IBM db2 odbc DRIVER};Database=test;hostname=localhost;port=50000;protocol=TCPIP; uid=natsoft; pwd=guest";
- if ($db->Connect('localhost','natsoft','guest','test')) {
- testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
- } else print "ERROR: DB2 test requires an server setup with odbc data source db2_sample".' '.$db->ErrorMsg();
- } else {
- $db = ADONewConnection("odbc_db2");
- print "Connecting $db->databaseType... ";
-
- $dsn = "db2test";
- #$db->curMode = SQL_CUR_USE_ODBC;
- #$dsn = "driver={IBM db2 odbc DRIVER};Database=test;hostname=localhost;port=50000;protocol=TCPIP; uid=natsoft; pwd=guest";
- if ($db->Connect($dsn)) {
- testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
- } else print "ERROR: DB2 test requires an server setup with odbc data source db2_sample".' '.$db->ErrorMsg();
- }
-echo " ";
-flush();
- $dsn = "driver={IBM db2 odbc DRIVER};Database=sample;hostname=localhost;port=50000;protocol=TCPIP; uid=root; pwd=natsoft";
-
- $db = ADONewConnection('odbtp');
- if ($db->Connect('127.0.0.1',$dsn)) {
-
- $db->debug=1;
- $arr = $db->GetArray( "||SQLProcedures" ); adodb_pr($arr);
- $arr = $db->GetArray( "||SQLProcedureColumns|||GET_ROUTINE_SAR" );adodb_pr($arr);
-
- testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
- } else echo ("ERROR Connection");
- echo $db->ErrorMsg();
-}
-
-
-$server = 'localhost';
-
-
-
-ADOLoadCode("mssqlpo");
-if (false && !empty($testmssql)) { // MS SQL Server -- the extension is buggy -- probably better to use ODBC
- $db = ADONewConnection("mssqlpo");
- //$db->debug=1;
- print "Connecting $db->databaseType... ";
-
- $ok = $db->Connect('','sa','natsoft','northwind');
- echo $db->ErrorMsg();
- if ($ok /*or $db->PConnect("mangrove", "sa", "natsoft", "ai")*/) {
- AutoDetect_MSSQL_Date_Order($db);
- // $db->Execute('drop table adoxyz');
- testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
- } else print "ERROR: MSSQL test 2 requires a MS SQL 7 on a server='$server', userid='adodb', password='natsoft', database='ai'".' '.$db->ErrorMsg();
-
-}
-
-
-ADOLoadCode('odbc_mssql');
-if (!empty($testmssql)) { // MS SQL Server via ODBC
- $db = ADONewConnection();
-
- print "Connecting $db->databaseType... ";
-
- $dsn = "PROVIDER=MSDASQL;Driver={SQL Server};Server=$server;Database=northwind;";
- $dsn = 'condor';
- if ($db->PConnect($dsn, "sa", "natsoft", "")) {
- testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
- }
- else print "ERROR: MSSQL test 1 requires a MS SQL 7 server setup with DSN setup";
-
-}
-
-ADOLoadCode("ado_mssql");
-if (!empty($testmssql) && !empty($testado) ) { // ADO ACCESS MSSQL -- thru ODBC -- DSN-less
-
- $db = ADONewConnection("ado_mssql");
- //$db->debug=1;
- print "Connecting DSN-less $db->databaseType... ";
-
- $myDSN="PROVIDER=MSDASQL;DRIVER={SQL Server};"
- . "SERVER=$server;DATABASE=NorthWind;UID=adodb;PWD=natsoft;Trusted_Connection=No";
-
-
- if ($db->PConnect($myDSN, "", "", ""))
- testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
- else print "ERROR: MSSQL test 2 requires MS SQL 7";
-
-}
-
-if (!empty($testmssql) && !empty($testado)) { // ADO ACCESS MSSQL with OLEDB provider
-
- $db = ADONewConnection("ado_mssql");
- print "Connecting DSN-less OLEDB Provider $db->databaseType... ";
- //$db->debug=1;
- $myDSN="SERVER=localhost;DATABASE=northwind;Trusted_Connection=yes";
- if ($db->PConnect($myDSN, "adodb", "natsoft", 'SQLOLEDB')) {
- testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
- } else print "ERROR: MSSQL test 2 requires a MS SQL 7 on a server='mangrove', userid='sa', password='', database='ai'";
-
-}
-
-
-if (extension_loaded('odbtp') && !empty($testmssql)) { // MS SQL Server via ODBC
- $db = ADONewConnection('odbtp');
-
- $dsn = "PROVIDER=MSDASQL;Driver={SQL Server};Server=$server;Database=northwind;uid=adodb;pwd=natsoft";
-
- if ($db->PConnect('localhost',$dsn, "", "")) {
- print "Connecting $db->databaseType... ";
- testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
- }
- else print "ERROR: MSSQL test 1 requires a MS SQL 7 server setup with DSN setup";
-
-}
-
-
-print "Tests Completed ";
diff --git a/sources/vendor/adodb/adodb-php/tests/testgenid.php b/sources/vendor/adodb/adodb-php/tests/testgenid.php
deleted file mode 100644
index 3310734..0000000
--- a/sources/vendor/adodb/adodb-php/tests/testgenid.php
+++ /dev/null
@@ -1,35 +0,0 @@
-Execute("drop table $table");
- //$db->debug=true;
-
- $ctr = 5000;
- $lastnum = 0;
-
- while (--$ctr >= 0) {
- $num = $db->GenID($table);
- if ($num === false) {
- print "GenID returned false";
- break;
- }
- if ($lastnum + 1 == $num) print " $num ";
- else {
- print " $num ";
- flush();
- }
- $lastnum = $num;
- }
-}
diff --git a/sources/vendor/adodb/adodb-php/tests/testmssql.php b/sources/vendor/adodb/adodb-php/tests/testmssql.php
deleted file mode 100644
index 25a8cb2..0000000
--- a/sources/vendor/adodb/adodb-php/tests/testmssql.php
+++ /dev/null
@@ -1,75 +0,0 @@
-Connect('127.0.0.1','adodb','natsoft','northwind') or die('Fail');
-
-$conn->debug =1;
-$query = 'select * from products';
-$conn->SetFetchMode(ADODB_FETCH_ASSOC);
-$rs = $conn->Execute($query);
-echo "";
-while( !$rs->EOF ) {
- $output[] = $rs->fields;
- var_dump($rs->fields);
- $rs->MoveNext();
- print "";
-}
-die();
-
-
-$p = $conn->Prepare('insert into products (productname,unitprice,dcreated) values (?,?,?)');
-echo "
";
-print_r($p);
-
-$conn->debug=1;
-$conn->Execute($p,array('John'.rand(),33.3,$conn->DBDate(time())));
-
-$p = $conn->Prepare('select * from products where productname like ?');
-$arr = $conn->getarray($p,array('V%'));
-print_r($arr);
-die();
-
-//$conn = ADONewConnection("mssql");
-//$conn->Connect('mangrove','sa','natsoft','ai');
-
-//$conn->Connect('mangrove','sa','natsoft','ai');
-$conn->debug=1;
-$conn->Execute('delete from blobtest');
-
-$conn->Execute('insert into blobtest (id) values(1)');
-$conn->UpdateBlobFile('blobtest','b1','../cute_icons_for_site/adodb.gif','id=1');
-$rs = $conn->Execute('select b1 from blobtest where id=1');
-
-$output = "c:\\temp\\test_out-".date('H-i-s').".gif";
-print "Saving file $output , size=".strlen($rs->fields[0])."";
-$fd = fopen($output, "wb");
-fwrite($fd, $rs->fields[0]);
-fclose($fd);
-
-print " View Image ";
-//$rs = $conn->Execute('SELECT id,SUBSTRING(b1, 1, 10) FROM blobtest');
-//rs2html($rs);
diff --git a/sources/vendor/adodb/adodb-php/tests/testoci8.php b/sources/vendor/adodb/adodb-php/tests/testoci8.php
deleted file mode 100644
index febb2ed..0000000
--- a/sources/vendor/adodb/adodb-php/tests/testoci8.php
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-PConnect('','scott','natsoft');
- if (!empty($testblob)) {
- $varHoldingBlob = 'ABC DEF GEF John TEST';
- $num = time()%10240;
- // create table atable (id integer, ablob blob);
- $db->Execute('insert into ATABLE (id,ablob) values('.$num.',empty_blob())');
- $db->UpdateBlob('ATABLE', 'ablob', $varHoldingBlob, 'id='.$num, 'BLOB');
-
- $rs = $db->Execute('select * from atable');
-
- if (!$rs) die("Empty RS");
- if ($rs->EOF) die("EOF RS");
- rs2html($rs);
- }
- $stmt = $db->Prepare('select * from adoxyz where id=?');
- for ($i = 1; $i <= 10; $i++) {
- $rs = $db->Execute(
- $stmt,
- array($i));
-
- if (!$rs) die("Empty RS");
- if ($rs->EOF) die("EOF RS");
- rs2html($rs);
- }
-}
-if (1) {
- $db = ADONewConnection('oci8');
- $db->PConnect('','scott','natsoft');
- $db->debug = true;
- $db->Execute("delete from emp where ename='John'");
- print $db->Affected_Rows().' ';
- $stmt = $db->Prepare('insert into emp (empno, ename) values (:empno, :ename)');
- $rs = $db->Execute($stmt,array('empno'=>4321,'ename'=>'John'));
- // prepare not quite ready for prime time
- //$rs = $db->Execute($stmt,array('empno'=>3775,'ename'=>'John'));
- if (!$rs) die("Empty RS");
-
- $db->setfetchmode(ADODB_FETCH_NUM);
-
- $vv = 'A%';
- $stmt = $db->PrepareSP("BEGIN adodb.open_tab2(:rs,:tt); END;",true);
- $db->OutParameter($stmt, $cur, 'rs', -1, OCI_B_CURSOR);
- $db->OutParameter($stmt, $vv, 'tt');
- $rs = $db->Execute($stmt);
- while (!$rs->EOF) {
- adodb_pr($rs->fields);
- $rs->MoveNext();
- }
- echo " val = $vv";
-
-}
-
-if (0) {
- $db = ADONewConnection('odbc_oracle');
- if (!$db->PConnect('local_oracle','scott','tiger')) die('fail connect');
- $db->debug = true;
- $rs = $db->Execute(
- 'select * from adoxyz where firstname=? and trim(lastname)=?',
- array('first'=>'Caroline','last'=>'Miranda'));
- if (!$rs) die("Empty RS");
- if ($rs->EOF) die("EOF RS");
- rs2html($rs);
-}
diff --git a/sources/vendor/adodb/adodb-php/tests/testoci8cursor.php b/sources/vendor/adodb/adodb-php/tests/testoci8cursor.php
deleted file mode 100644
index 8946e67..0000000
--- a/sources/vendor/adodb/adodb-php/tests/testoci8cursor.php
+++ /dev/null
@@ -1,108 +0,0 @@
-PConnect('','scott','natsoft');
- $db->debug = 99;
-
-
-/*
-*/
-
- define('MYNUM',5);
-
-
- $rs = $db->ExecuteCursor("BEGIN adodb.open_tab(:RS,'A%'); END;");
-
- if ($rs && !$rs->EOF) {
- print "Test 1 RowCount: ".$rs->RecordCount()."";
- } else {
- print "Error in using Cursor Variables 1
";
- }
-
- print "
Testing Stored Procedures for oci8 ";
-
- $stid = $db->PrepareSP('BEGIN adodb.myproc('.MYNUM.', :myov); END;');
- $db->OutParameter($stid, $myov, 'myov');
- $db->Execute($stid);
- if ($myov != MYNUM) print "Error with myproc
";
-
-
- $stmt = $db->PrepareSP("BEGIN adodb.data_out(:a1, :a2); END;",true);
- $a1 = 'Malaysia';
- //$a2 = ''; # a2 doesn't even need to be defined!
- $db->InParameter($stmt,$a1,'a1');
- $db->OutParameter($stmt,$a2,'a2');
- $rs = $db->Execute($stmt);
- if ($rs) {
- if ($a2 !== 'Cinta Hati Malaysia') print "Stored Procedure Error: a2 = $a2 ";
- else echo "OK: a2=$a2
";
- } else {
- print "Error in using Stored Procedure IN/Out Variables
";
- }
-
-
- $tname = 'A%';
-
- $stmt = $db->PrepareSP('select * from tab where tname like :tablename');
- $db->Parameter($stmt,$tname,'tablename');
- $rs = $db->Execute($stmt);
- rs2html($rs);
diff --git a/sources/vendor/adodb/adodb-php/tests/testpaging.php b/sources/vendor/adodb/adodb-php/tests/testpaging.php
deleted file mode 100644
index f81a481..0000000
--- a/sources/vendor/adodb/adodb-php/tests/testpaging.php
+++ /dev/null
@@ -1,85 +0,0 @@
-PConnect('localhost','tester','test','test');
-}
-
-if ($driver == 'access') {
- $db = NewADOConnection('access');
- $db->PConnect("nwind", "", "", "");
-}
-
-if ($driver == 'ibase') {
- $db = NewADOConnection('ibase');
- $db->PConnect("localhost:e:\\firebird\\examples\\employee.gdb", "sysdba", "masterkey", "");
- $sql = 'select distinct firstname, lastname from adoxyz order by firstname';
-
-}
-if ($driver == 'mssql') {
- $db = NewADOConnection('mssql');
- $db->Connect('JAGUAR\vsdotnet','adodb','natsoft','northwind');
-}
-if ($driver == 'oci8') {
- $db = NewADOConnection('oci8');
- $db->Connect('','scott','natsoft');
-
-$sql = "select * from (select ID, firstname as \"First Name\", lastname as \"Last Name\" from adoxyz
- order by 1)";
-}
-
-if ($driver == 'access') {
- $db = NewADOConnection('access');
- $db->Connect('nwind');
-}
-
-if (empty($driver) or $driver == 'mysql') {
- $db = NewADOConnection('mysql');
- $db->Connect('localhost','root','','test');
-}
-
-//$db->pageExecuteCountRows = false;
-
-$db->debug = true;
-
-if (0) {
-$rs = $db->Execute($sql);
-include_once('../toexport.inc.php');
-print "
";
-print rs2csv($rs); # return a string
-
-print ' ';
-$rs->MoveFirst(); # note, some databases do not support MoveFirst
-print rs2tab($rs); # return a string
-
-print ' ';
-$rs->MoveFirst();
-rs2tabout($rs); # send to stdout directly
-print " ";
-}
-
-$pager = new ADODB_Pager($db,$sql);
-$pager->showPageLinks = true;
-$pager->linksPerPage = 10;
-$pager->cache = 60;
-$pager->Render($rows=7);
diff --git a/sources/vendor/adodb/adodb-php/tests/testpear.php b/sources/vendor/adodb/adodb-php/tests/testpear.php
deleted file mode 100644
index 68dd7b9..0000000
--- a/sources/vendor/adodb/adodb-php/tests/testpear.php
+++ /dev/null
@@ -1,33 +0,0 @@
-setFetchMode(ADODB_FETCH_ASSOC);
-$rs = $db->Query('select firstname,lastname from adoxyz');
-$cnt = 0;
-while ($arr = $rs->FetchRow()) {
- print_r($arr);
- print " ";
- $cnt += 1;
-}
-
-if ($cnt != 50) print "Error in \$cnt = $cnt ";
diff --git a/sources/vendor/adodb/adodb-php/tests/testsessions.php b/sources/vendor/adodb/adodb-php/tests/testsessions.php
deleted file mode 100644
index cf1d9af..0000000
--- a/sources/vendor/adodb/adodb-php/tests/testsessions.php
+++ /dev/null
@@ -1,98 +0,0 @@
-Notify Expiring=$ref, sessionkey=$key ";
-}
-
-//-------------------------------------------------------------------
-
-error_reporting(E_ALL);
-
-
-ob_start();
-include('../session/adodb-cryptsession2.php');
-
-
-$options['debug'] = 1;
-$db = 'postgres';
-
-#### CONNECTION
-switch($db) {
-case 'oci8':
- $options['table'] = 'adodb_sessions2';
- ADOdb_Session::config('oci8', 'mobydick', 'jdev', 'natsoft', 'mobydick',$options);
- break;
-
-case 'postgres':
- $options['table'] = 'sessions2';
- ADOdb_Session::config('postgres', 'localhost', 'postgres', 'natsoft', 'northwind',$options);
- break;
-
-case 'mysql':
-default:
- $options['table'] = 'sessions2';
- ADOdb_Session::config('mysql', 'localhost', 'root', '', 'xphplens_2',$options);
- break;
-
-
-}
-
-
-
-#### SETUP NOTIFICATION
- $USER = 'JLIM'.rand();
- $ADODB_SESSION_EXPIRE_NOTIFY = array('USER','NotifyExpire');
-
- adodb_session_create_table();
- session_start();
-
- adodb_session_regenerate_id();
-
-### SETUP SESSION VARIABLES
- if (empty($_SESSION['MONKEY'])) $_SESSION['MONKEY'] = array(1,'abc',44.41);
- else $_SESSION['MONKEY'][0] += 1;
- if (!isset($_GET['nochange'])) @$_SESSION['AVAR'] += 1;
-
-
-### START DISPLAY
- print "PHP ".PHP_VERSION." ";
- print "\$_SESSION['AVAR']={$_SESSION['AVAR']}
";
-
- print " Cookies : ";
- 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()
-### automatically for you. See php.ini's
-### session.cookie_lifetime and session.gc_probability
-
- if (rand() % 5 == 0) {
-
- print "Garbage Collection
";
- adodb_sess_gc(10);
-
- if (rand() % 2 == 0) {
- print "Random own session destroy
";
- session_destroy();
- }
- } else {
- $DB = ADODB_Session::_conn();
- $sessk = $DB->qstr('%AZ'.rand().time());
- $olddate = $DB->DBTimeStamp(time()-30*24*3600);
- $rr = $DB->qstr(rand());
- $DB->Execute("insert into {$options['table']} (sesskey,expiry,expireref,sessdata,created,modified) values ($sessk,$olddate, $rr,'',$olddate,$olddate)");
- }
diff --git a/sources/vendor/adodb/adodb-php/tests/time.php b/sources/vendor/adodb/adodb-php/tests/time.php
deleted file mode 100644
index 8261e1e..0000000
--- a/sources/vendor/adodb/adodb-php/tests/time.php
+++ /dev/null
@@ -1,16 +0,0 @@
-
-" );
-echo( "Converted: $convertedDate" ); //why is string returned as one day (3 not 4) less for this example??
diff --git a/sources/vendor/adodb/adodb-php/tests/tmssql.php b/sources/vendor/adodb/adodb-php/tests/tmssql.php
deleted file mode 100644
index 0f81311..0000000
--- a/sources/vendor/adodb/adodb-php/tests/tmssql.php
+++ /dev/null
@@ -1,79 +0,0 @@
-mssql";
- $db = mssql_connect('JAGUAR\vsdotnet','adodb','natsoft') or die('No Connection');
- mssql_select_db('northwind',$db);
-
- $rs = mssql_query('select getdate() as date',$db);
- $o = mssql_fetch_row($rs);
- print_r($o);
- mssql_free_result($rs);
-
- print "Delete
"; flush();
- $rs2 = mssql_query('delete from adoxyz',$db);
- $p = mssql_num_rows($rs2);
- mssql_free_result($rs2);
-
-}
-
-function tpear()
-{
-include_once('DB.php');
-
- print "PEAR ";
- $username = 'adodb';
- $password = 'natsoft';
- $hostname = 'JAGUAR\vsdotnet';
- $databasename = 'northwind';
-
- $dsn = "mssql://$username:$password@$hostname/$databasename";
- $conn = DB::connect($dsn);
- print "date=".$conn->GetOne('select getdate()')." ";
- @$conn->query('create table tester (id integer)');
- print "Delete
"; flush();
- $rs = $conn->query('delete from tester');
- print "date=".$conn->GetOne('select getdate()')." ";
-}
-
-function tadodb()
-{
-include_once('../adodb.inc.php');
-
- print "ADOdb ";
- $conn = NewADOConnection('mssql');
- $conn->Connect('JAGUAR\vsdotnet','adodb','natsoft','northwind');
-// $conn->debug=1;
- print "date=".$conn->GetOne('select getdate()')." ";
- $conn->Execute('create table tester (id integer)');
- print "Delete
"; flush();
- $rs = $conn->Execute('delete from tester');
- print "date=".$conn->GetOne('select getdate()')." ";
-}
-
-
-$ACCEPTIP = '127.0.0.1';
-
-$remote = $_SERVER["REMOTE_ADDR"];
-
-if (!empty($ACCEPTIP))
- if ($remote != '127.0.0.1' && $remote != $ACCEPTIP)
- die("Unauthorised client: '$remote'");
-
-?>
-mssql
-pear
-adodb
-
-
-
-
-
-
-
-
-
-
-
-
-
- id
-
-
- id
-
-
-
-
-
- SQL to be executed only on specific platforms
-
- insert into mytable ( row1, row2 ) values ( 12, 'postgres stuff' )
-
-
- insert into mytable ( row1, row2 ) values ( 12, 'mysql stuff' )
-
-
- INSERT into simple_table ( name, description ) values ( '12', 'Microsoft stuff' )
-
-
-
\ No newline at end of file
diff --git a/sources/vendor/adodb/adodb-php/tests/xmlschema.xml b/sources/vendor/adodb/adodb-php/tests/xmlschema.xml
deleted file mode 100644
index ea48ae2..0000000
--- a/sources/vendor/adodb/adodb-php/tests/xmlschema.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
- An integer row that's a primary key and autoincrements
-
-
-
-
- A 16 character varchar row that can't be null
-
-
-
- row1
- row2
-
-
-
- SQL to be executed only on specific platforms
-
- insert into mytable ( row1, row2 ) values ( 12, 'postgres stuff' )
-
-
- insert into mytable ( row1, row2 ) values ( 12, 'mysql stuff' )
-
-
- insert into mytable ( row1, row2 ) values ( 12, 'Microsoft stuff' )
-
-
-
-
\ No newline at end of file
diff --git a/sources/vendor/adodb/adodb-php/toexport.inc.php b/sources/vendor/adodb/adodb-php/toexport.inc.php
deleted file mode 100644
index c078d8d..0000000
--- a/sources/vendor/adodb/adodb-php/toexport.inc.php
+++ /dev/null
@@ -1,133 +0,0 @@
-FieldTypesArray();
- reset($fieldTypes);
- $i = 0;
- while(list(,$o) = each($fieldTypes)) {
-
- $v = ($o) ? $o->name : 'Field'.($i++);
- if ($escquote) $v = str_replace($quote,$escquotequote,$v);
- $v = strip_tags(str_replace("\n", $replaceNewLine, str_replace("\r\n",$replaceNewLine,str_replace($sep,$sepreplace,$v))));
- $elements[] = $v;
-
- }
- $s .= implode($sep, $elements).$NEWLINE;
- }
- $hasNumIndex = isset($rs->fields[0]);
-
- $line = 0;
- $max = $rs->FieldCount();
-
- while (!$rs->EOF) {
- $elements = array();
- $i = 0;
-
- if ($hasNumIndex) {
- for ($j=0; $j < $max; $j++) {
- $v = $rs->fields[$j];
- if (!is_object($v)) $v = trim($v);
- else $v = 'Object';
- if ($escquote) $v = str_replace($quote,$escquotequote,$v);
- $v = strip_tags(str_replace("\n", $replaceNewLine, str_replace("\r\n",$replaceNewLine,str_replace($sep,$sepreplace,$v))));
-
- if (strpos($v,$sep) !== false || strpos($v,$quote) !== false) $elements[] = "$quote$v$quote";
- else $elements[] = $v;
- }
- } else { // ASSOCIATIVE ARRAY
- foreach($rs->fields as $v) {
- if ($escquote) $v = str_replace($quote,$escquotequote,trim($v));
- $v = strip_tags(str_replace("\n", $replaceNewLine, str_replace("\r\n",$replaceNewLine,str_replace($sep,$sepreplace,$v))));
-
- if (strpos($v,$sep) !== false || strpos($v,$quote) !== false) $elements[] = "$quote$v$quote";
- else $elements[] = $v;
- }
- }
- $s .= implode($sep, $elements).$NEWLINE;
- $rs->MoveNext();
- $line += 1;
- if ($fp && ($line % $BUFLINES) == 0) {
- if ($fp === true) echo $s;
- else fwrite($fp,$s);
- $s = '';
- }
- }
-
- if ($fp) {
- if ($fp === true) echo $s;
- else fwrite($fp,$s);
- $s = '';
- }
-
- return $s;
-}
diff --git a/sources/vendor/adodb/adodb-php/tohtml.inc.php b/sources/vendor/adodb/adodb-php/tohtml.inc.php
deleted file mode 100644
index 808edf4..0000000
--- a/sources/vendor/adodb/adodb-php/tohtml.inc.php
+++ /dev/null
@@ -1,199 +0,0 @@
-
-*/
-
-// specific code for tohtml
-GLOBAL $gSQLMaxRows,$gSQLBlockRows,$ADODB_ROUND;
-
-$ADODB_ROUND=4; // rounding
-$gSQLMaxRows = 1000; // max no of rows to download
-$gSQLBlockRows=20; // max no of rows per table block
-
-// RecordSet to HTML Table
-//------------------------------------------------------------
-// Convert a recordset to a html table. Multiple tables are generated
-// if the number of rows is > $gSQLBlockRows. This is because
-// web browsers normally require the whole table to be downloaded
-// before it can be rendered, so we break the output into several
-// smaller faster rendering tables.
-//
-// $rs: the recordset
-// $ztabhtml: the table tag attributes (optional)
-// $zheaderarray: contains the replacement strings for the headers (optional)
-//
-// USAGE:
-// include('adodb.inc.php');
-// $db = ADONewConnection('mysql');
-// $db->Connect('mysql','userid','password','database');
-// $rs = $db->Execute('select col1,col2,col3 from table');
-// rs2html($rs, 'BORDER=2', array('Title1', 'Title2', 'Title3'));
-// $rs->Close();
-//
-// RETURNS: number of rows displayed
-
-
-function rs2html(&$rs,$ztabhtml=false,$zheaderarray=false,$htmlspecialchars=true,$echo = true)
-{
-$s ='';$rows=0;$docnt = false;
-GLOBAL $gSQLMaxRows,$gSQLBlockRows,$ADODB_ROUND;
-
- if (!$rs) {
- printf(ADODB_BAD_RS,'rs2html');
- return false;
- }
-
- if (! $ztabhtml) $ztabhtml = "BORDER='1' WIDTH='98%'";
- //else $docnt = true;
- $typearr = array();
- $ncols = $rs->FieldCount();
- $hdr = " \n\n";
- for ($i=0; $i < $ncols; $i++) {
- $field = $rs->FetchField($i);
- if ($field) {
- if ($zheaderarray) $fname = $zheaderarray[$i];
- else $fname = htmlspecialchars($field->name);
- $typearr[$i] = $rs->MetaType($field->type,$field->max_length);
- //print " $field->name $field->type $typearr[$i] ";
- } else {
- $fname = 'Field '.($i+1);
- $typearr[$i] = 'C';
- }
- if (strlen($fname)==0) $fname = ' ';
- $hdr .= "$fname ";
- }
- $hdr .= "\n ";
- if ($echo) print $hdr."\n\n";
- else $html = $hdr;
-
- // smart algorithm - handles ADODB_FETCH_MODE's correctly by probing...
- $numoffset = isset($rs->fields[0]) ||isset($rs->fields[1]) || isset($rs->fields[2]);
- while (!$rs->EOF) {
-
- $s .= "\n";
-
- for ($i=0; $i < $ncols; $i++) {
- if ($i===0) $v=($numoffset) ? $rs->fields[0] : reset($rs->fields);
- else $v = ($numoffset) ? $rs->fields[$i] : next($rs->fields);
-
- $type = $typearr[$i];
- switch($type) {
- case 'D':
- if (strpos($v,':') !== false);
- else {
- if (empty($v)) {
- $s .= " \n";
- } else {
- $s .= " ".$rs->UserDate($v,"D d, M Y") ." \n";
- }
- break;
- }
- case 'T':
- if (empty($v)) $s .= " \n";
- else $s .= " ".$rs->UserTimeStamp($v,"D d, M Y, H:i:s") ." \n";
- break;
-
- case 'N':
- if (abs(abs($v) - round($v,0)) < 0.00000001)
- $v = round($v);
- else
- $v = round($v,$ADODB_ROUND);
- case 'I':
- $vv = stripslashes((trim($v)));
- if (strlen($vv) == 0) $vv .= ' ';
- $s .= " ".$vv ." \n";
-
- break;
- /*
- case 'B':
- if (substr($v,8,2)=="BM" ) $v = substr($v,8);
- $mtime = substr(str_replace(' ','_',microtime()),2);
- $tmpname = "tmp/".uniqid($mtime).getmypid();
- $fd = @fopen($tmpname,'a');
- @ftruncate($fd,0);
- @fwrite($fd,$v);
- @fclose($fd);
- if (!function_exists ("mime_content_type")) {
- function mime_content_type ($file) {
- return exec("file -bi ".escapeshellarg($file));
- }
- }
- $t = mime_content_type($tmpname);
- $s .= (substr($t,0,5)=="image") ? " \\n" : " $t \\n";
- break;
- */
-
- default:
- if ($htmlspecialchars) $v = htmlspecialchars(trim($v));
- $v = trim($v);
- if (strlen($v) == 0) $v = ' ';
- $s .= " ". str_replace("\n",' ',stripslashes($v)) ." \n";
-
- }
- } // for
- $s .= " \n\n";
-
- $rows += 1;
- if ($rows >= $gSQLMaxRows) {
- $rows = "Truncated at $gSQLMaxRows
";
- break;
- } // switch
-
- $rs->MoveNext();
-
- // additional EOF check to prevent a widow header
- if (!$rs->EOF && $rows % $gSQLBlockRows == 0) {
-
- //if (connection_aborted()) break;// not needed as PHP aborts script, unlike ASP
- if ($echo) print $s . "
\n\n";
- else $html .= $s ."