diff --git a/composer.json b/composer.json
index f7af4de2..75d0ffe8 100644
--- a/composer.json
+++ b/composer.json
@@ -5,7 +5,6 @@
"league/plates": "^3.3",
"phpmailer/phpmailer": "^6.0",
"guzzlehttp/guzzle": "^6.3",
- "leafo/scssphp": "^0.7.5",
- "adodb/adodb-php": "^5.20"
+ "leafo/scssphp": "^0.7.5"
}
}
diff --git a/composer.lock b/composer.lock
index 78605f91..f9dacdfd 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,62 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "content-hash": "a8d79581e2352baf2677220b715f1348",
+ "content-hash": "7b9fdde15b3d81d1431847e29f201587",
"packages": [
- {
- "name": "adodb/adodb-php",
- "version": "v5.20.9",
- "source": {
- "type": "git",
- "url": "https://github.com/ADOdb/ADOdb.git",
- "reference": "f601748cca1ccb86dfd427620a1692a70e681075"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/ADOdb/ADOdb/zipball/f601748cca1ccb86dfd427620a1692a70e681075",
- "reference": "f601748cca1ccb86dfd427620a1692a70e681075",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.2"
- },
- "type": "library",
- "autoload": {
- "files": [
- "adodb.inc.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause",
- "LGPL-2.1"
- ],
- "authors": [
- {
- "name": "John Lim",
- "email": "jlim@natsoft.com",
- "role": "Author"
- },
- {
- "name": "Damien Regad",
- "role": "Current maintainer"
- },
- {
- "name": "Mark Newnham",
- "role": "Developer"
- }
- ],
- "description": "ADOdb is a PHP database abstraction layer library",
- "homepage": "http://adodb.org/",
- "keywords": [
- "abstraction",
- "database",
- "layer",
- "library",
- "php"
- ],
- "time": "2016-12-21T17:19:42+00:00"
- },
{
"name": "brandonwamboldt/utilphp",
"version": "1.1.0",
diff --git a/vendor/adodb/adodb-php/.gitattributes b/vendor/adodb/adodb-php/.gitattributes
deleted file mode 100644
index 2cb098d8..00000000
--- a/vendor/adodb/adodb-php/.gitattributes
+++ /dev/null
@@ -1,17 +0,0 @@
-# Default behavior
-* text=auto
-
-# Text files to be normalized to lf line endings
-*.php text
-*.htm* text
-*.sql text
-*.txt text
-*.xml text
-*.xsl text
-
-# Windows-only files
-*.bat eol=crlf
-
-# Binary files
-*.gif binary
-
diff --git a/vendor/adodb/adodb-php/.gitignore b/vendor/adodb/adodb-php/.gitignore
deleted file mode 100644
index 0d777b27..00000000
--- a/vendor/adodb/adodb-php/.gitignore
+++ /dev/null
@@ -1,10 +0,0 @@
-# IDE/Editor temporary files
-*~
-*.swp
-*.bak
-*.tmp
-.project
-.settings/
-/nbproject/
-.idea/
-
diff --git a/vendor/adodb/adodb-php/.mailmap b/vendor/adodb/adodb-php/.mailmap
deleted file mode 100644
index 1f2f7e7f..00000000
--- a/vendor/adodb/adodb-php/.mailmap
+++ /dev/null
@@ -1,4 +0,0 @@
-Andreas Fernandez ';
- }
- return $rs;
- }
-
- $meta = false;
- $meta = fgetcsv($fp, 32000, ",");
- if (!$meta) {
- fclose($fp);
- $err = "Unexpected EOF 1";
- return $false;
- }
- }
-
- // Get Column definitions
- $flds = array();
- foreach($meta as $o) {
- $o2 = explode(':',$o);
- if (sizeof($o2)!=3) {
- $arr[] = $meta;
- $flds = false;
- break;
- }
- $fld = new ADOFieldObject();
- $fld->name = urldecode($o2[0]);
- $fld->type = $o2[1];
- $fld->max_length = $o2[2];
- $flds[] = $fld;
- }
- } else {
- fclose($fp);
- $err = "Recordset had unexpected EOF 2";
- return $false;
- }
-
- // slurp in the data
- $MAXSIZE = 128000;
-
- $text = '';
- while ($txt = fread($fp,$MAXSIZE)) {
- $text .= $txt;
- }
-
- fclose($fp);
- @$arr = unserialize($text);
- //var_dump($arr);
- if (!is_array($arr)) {
- $err = "Recordset had unexpected EOF (in serialized recordset)";
- if (get_magic_quotes_runtime()) $err .= ". Magic Quotes Runtime should be disabled!";
- return $false;
- }
- $rs = new $rsclass();
- $rs->timeCreated = $ttl;
- $rs->InitArrayFields($arr,$flds);
- return $rs;
- }
-
-
- /**
- * Save a file $filename and its $contents (normally for caching) with file locking
- * Returns true if ok, false if fopen/fwrite error, 0 if rename error (eg. file is locked)
- */
- function adodb_write_file($filename, $contents,$debug=false)
- {
- # http://www.php.net/bugs.php?id=9203 Bug that flock fails on Windows
- # So to simulate locking, we assume that rename is an atomic operation.
- # First we delete $filename, then we create a $tempfile write to it and
- # rename to the desired $filename. If the rename works, then we successfully
- # modified the file exclusively.
- # What a stupid need - having to simulate locking.
- # Risks:
- # 1. $tempfile name is not unique -- very very low
- # 2. unlink($filename) fails -- ok, rename will fail
- # 3. adodb reads stale file because unlink fails -- ok, $rs timeout occurs
- # 4. another process creates $filename between unlink() and rename() -- ok, rename() fails and cache updated
- if (strncmp(PHP_OS,'WIN',3) === 0) {
- // skip the decimal place
- $mtime = substr(str_replace(' ','_',microtime()),2);
- // getmypid() actually returns 0 on Win98 - never mind!
- $tmpname = $filename.uniqid($mtime).getmypid();
- if (!($fd = @fopen($tmpname,'w'))) return false;
- if (fwrite($fd,$contents)) $ok = true;
- else $ok = false;
- fclose($fd);
-
- if ($ok) {
- @chmod($tmpname,0644);
- // the tricky moment
- @unlink($filename);
- if (!@rename($tmpname,$filename)) {
- @unlink($tmpname);
- $ok = 0;
- }
- if (!$ok) {
- if ($debug) ADOConnection::outp( " Rename $tmpname ".($ok? 'ok' : 'failed'));
- }
- }
- return $ok;
- }
- if (!($fd = @fopen($filename, 'a'))) return false;
- if (flock($fd, LOCK_EX) && ftruncate($fd, 0)) {
- if (fwrite( $fd, $contents )) $ok = true;
- else $ok = false;
- fclose($fd);
- @chmod($filename,0644);
- }else {
- fclose($fd);
- if ($debug)ADOConnection::outp( " Failed acquiring lock for $filename";
-print_r($rs->GetRows());
-print "
";
-```
-
-
-Documentation and Examples
-==========================
-
-Refer to the [ADOdb website](http://adodb.org/) for library documentation and examples. The documentation can also be [downloaded for offline viewing](https://sourceforge.net/projects/adodb/files/Documentation/).
-
-- [Main documentation](http://adodb.org/dokuwiki/doku.php?id=v5:userguide:userguide_index): Query, update and insert records using a portable API.
-- [Data dictionary](http://adodb.org/dokuwiki/doku.php?id=v5:dictionary:dictionary_index) describes how to create database tables and indexes in a portable manner.
-- [Database performance monitoring](http://adodb.org/dokuwiki/doku.php?id=v5:performance:performance_index) allows you to perform health checks, tune and monitor your database.
-- [Database-backed sessions](http://adodb.org/dokuwiki/doku.php?id=v5:session:session_index).
-
-There is also a [tutorial](http://adodb.org/dokuwiki/doku.php?id=v5:userguide:mysql_tutorial) that contrasts ADOdb code with PHP native MySQL code.
-
-
-Files
-=====
-
-- `adodb.inc.php` is the library's main file. You only need to include this file.
-- `adodb-*.inc.php` are the database specific driver code.
-- `adodb-session.php` is the PHP4 session handling code.
-- `test.php` contains a list of test commands to exercise the class library.
-- `testdatabases.inc.php` contains the list of databases to apply the tests on.
-- `Benchmark.php` is a simple benchmark to test the throughput of a SELECT
-statement for databases described in testdatabases.inc.php. The benchmark
-tables are created in test.php.
-
-
-Support
-=======
-
-To discuss with the ADOdb development team and users, connect to our
-[Gitter chatroom](https://gitter.im/adodb/adodb) using your Github credentials.
-
-Please report bugs, issues and feature requests on Github:
-
-https://github.com/ADOdb/ADOdb/issues
-
-You may also find legacy issues in
-
-- the old [ADOdb forums](http://phplens.com/lens/lensforum/topics.php?id=4) on phplens.com
-- the [SourceForge tickets section](http://sourceforge.net/p/adodb/_list/tickets)
-
-However, please note that they are not actively monitored and should
-only be used as reference.
diff --git a/vendor/adodb/adodb-php/adodb-active-record.inc.php b/vendor/adodb/adodb-php/adodb-active-record.inc.php
deleted file mode 100644
index a7f0adf7..00000000
--- a/vendor/adodb/adodb-php/adodb-active-record.inc.php
+++ /dev/null
@@ -1,1142 +0,0 @@
-_dbat
-$_ADODB_ACTIVE_DBS = array();
-$ACTIVE_RECORD_SAFETY = true;
-$ADODB_ACTIVE_DEFVALS = false;
-$ADODB_ACTIVE_CACHESECS = 0;
-
-class ADODB_Active_DB {
- var $db; // ADOConnection
- var $tables; // assoc array of ADODB_Active_Table objects, indexed by tablename
-}
-
-class ADODB_Active_Table {
- var $name; // table name
- var $flds; // assoc array of adofieldobjs, indexed by fieldname
- var $keys; // assoc array of primary keys, indexed by fieldname
- var $_created; // only used when stored as a cached file
- var $_belongsTo = array();
- var $_hasMany = array();
-}
-
-// $db = database connection
-// $index = name of index - can be associative, for an example see
-// http://phplens.com/lens/lensforum/msgs.php?id=17790
-// returns index into $_ADODB_ACTIVE_DBS
-function ADODB_SetDatabaseAdapter(&$db, $index=false)
-{
- global $_ADODB_ACTIVE_DBS;
-
- foreach($_ADODB_ACTIVE_DBS as $k => $d) {
- if (PHP_VERSION >= 5) {
- if ($d->db === $db) {
- return $k;
- }
- } else {
- if ($d->db->_connectionID === $db->_connectionID && $db->database == $d->db->database) {
- return $k;
- }
- }
- }
-
- $obj = new ADODB_Active_DB();
- $obj->db = $db;
- $obj->tables = array();
-
- if ($index == false) {
- $index = sizeof($_ADODB_ACTIVE_DBS);
- }
-
- $_ADODB_ACTIVE_DBS[$index] = $obj;
-
- return sizeof($_ADODB_ACTIVE_DBS)-1;
-}
-
-
-class ADODB_Active_Record {
- static $_changeNames = true; // dynamically pluralize table names
- static $_quoteNames = false;
-
- static $_foreignSuffix = '_id'; //
- var $_dbat; // associative index pointing to ADODB_Active_DB eg. $ADODB_Active_DBS[_dbat]
- var $_table; // tablename, if set in class definition then use it as table name
- var $_tableat; // associative index pointing to ADODB_Active_Table, eg $ADODB_Active_DBS[_dbat]->tables[$this->_tableat]
- var $_where; // where clause set in Load()
- var $_saved = false; // indicates whether data is already inserted.
- var $_lasterr = false; // last error message
- var $_original = false; // the original values loaded or inserted, refreshed on update
-
- var $foreignName; // CFR: class name when in a relationship
-
- var $lockMode = ' for update '; // you might want to change to
-
- static function UseDefaultValues($bool=null)
- {
- global $ADODB_ACTIVE_DEFVALS;
- if (isset($bool)) {
- $ADODB_ACTIVE_DEFVALS = $bool;
- }
- return $ADODB_ACTIVE_DEFVALS;
- }
-
- // should be static
- static function SetDatabaseAdapter(&$db, $index=false)
- {
- return ADODB_SetDatabaseAdapter($db, $index);
- }
-
-
- public function __set($name, $value)
- {
- $name = str_replace(' ', '_', $name);
- $this->$name = $value;
- }
-
- // php5 constructor
- function __construct($table = false, $pkeyarr=false, $db=false)
- {
- global $ADODB_ASSOC_CASE,$_ADODB_ACTIVE_DBS;
-
- if ($db == false && is_object($pkeyarr)) {
- $db = $pkeyarr;
- $pkeyarr = false;
- }
-
- if (!$table) {
- if (!empty($this->_table)) {
- $table = $this->_table;
- }
- else $table = $this->_pluralize(get_class($this));
- }
- $this->foreignName = strtolower(get_class($this)); // CFR: default foreign name
- if ($db) {
- $this->_dbat = ADODB_Active_Record::SetDatabaseAdapter($db);
- } else if (!isset($this->_dbat)) {
- if (sizeof($_ADODB_ACTIVE_DBS) == 0) {
- $this->Error(
- "No database connection set; use ADOdb_Active_Record::SetDatabaseAdapter(\$db)",
- 'ADODB_Active_Record::__constructor'
- );
- }
- end($_ADODB_ACTIVE_DBS);
- $this->_dbat = key($_ADODB_ACTIVE_DBS);
- }
-
- $this->_table = $table;
- $this->_tableat = $table; # reserved for setting the assoc value to a non-table name, eg. the sql string in future
-
- $this->UpdateActiveTable($pkeyarr);
- }
-
- function __wakeup()
- {
- $class = get_class($this);
- new $class;
- }
-
- function _pluralize($table)
- {
- if (!ADODB_Active_Record::$_changeNames) {
- return $table;
- }
-
- $ut = strtoupper($table);
- $len = strlen($table);
- $lastc = $ut[$len-1];
- $lastc2 = substr($ut,$len-2);
- switch ($lastc) {
- case 'S':
- return $table.'es';
- case 'Y':
- return substr($table,0,$len-1).'ies';
- case 'X':
- return $table.'es';
- case 'H':
- if ($lastc2 == 'CH' || $lastc2 == 'SH') {
- return $table.'es';
- }
- default:
- return $table.'s';
- }
- }
-
- // CFR Lamest singular inflector ever - @todo Make it real!
- // Note: There is an assumption here...and it is that the argument's length >= 4
- function _singularize($tables)
- {
-
- if (!ADODB_Active_Record::$_changeNames) {
- return $table;
- }
-
- $ut = strtoupper($tables);
- $len = strlen($tables);
- if($ut[$len-1] != 'S') {
- return $tables; // I know...forget oxen
- }
- if($ut[$len-2] != 'E') {
- return substr($tables, 0, $len-1);
- }
- switch($ut[$len-3]) {
- case 'S':
- case 'X':
- return substr($tables, 0, $len-2);
- case 'I':
- return substr($tables, 0, $len-3) . 'y';
- case 'H';
- if($ut[$len-4] == 'C' || $ut[$len-4] == 'S') {
- return substr($tables, 0, $len-2);
- }
- default:
- return substr($tables, 0, $len-1); // ?
- }
- }
-
- function hasMany($foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record')
- {
- $ar = new $foreignClass($foreignRef);
- $ar->foreignName = $foreignRef;
- $ar->UpdateActiveTable();
- $ar->foreignKey = ($foreignKey) ? $foreignKey : $foreignRef.ADODB_Active_Record::$_foreignSuffix;
- $table =& $this->TableInfo();
- $table->_hasMany[$foreignRef] = $ar;
- # $this->$foreignRef = $this->_hasMany[$foreignRef]; // WATCHME Removed assignment by ref. to please __get()
- }
-
- // use when you don't want ADOdb to auto-pluralize tablename
- static function TableHasMany($table, $foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record')
- {
- $ar = new ADODB_Active_Record($table);
- $ar->hasMany($foreignRef, $foreignKey, $foreignClass);
- }
-
- // use when you don't want ADOdb to auto-pluralize tablename
- static function TableKeyHasMany($table, $tablePKey, $foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record')
- {
- if (!is_array($tablePKey)) {
- $tablePKey = array($tablePKey);
- }
- $ar = new ADODB_Active_Record($table,$tablePKey);
- $ar->hasMany($foreignRef, $foreignKey, $foreignClass);
- }
-
-
- // use when you want ADOdb to auto-pluralize tablename for you. Note that the class must already be defined.
- // e.g. class Person will generate relationship for table Persons
- static function ClassHasMany($parentclass, $foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record')
- {
- $ar = new $parentclass();
- $ar->hasMany($foreignRef, $foreignKey, $foreignClass);
- }
-
-
- function belongsTo($foreignRef,$foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record')
- {
- global $inflector;
-
- $ar = new $parentClass($this->_pluralize($foreignRef));
- $ar->foreignName = $foreignRef;
- $ar->parentKey = $parentKey;
- $ar->UpdateActiveTable();
- $ar->foreignKey = ($foreignKey) ? $foreignKey : $foreignRef.ADODB_Active_Record::$_foreignSuffix;
-
- $table =& $this->TableInfo();
- $table->_belongsTo[$foreignRef] = $ar;
- # $this->$foreignRef = $this->_belongsTo[$foreignRef];
- }
-
- static function ClassBelongsTo($class, $foreignRef, $foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record')
- {
- $ar = new $class();
- $ar->belongsTo($foreignRef, $foreignKey, $parentKey, $parentClass);
- }
-
- static function TableBelongsTo($table, $foreignRef, $foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record')
- {
- $ar = new ADOdb_Active_Record($table);
- $ar->belongsTo($foreignRef, $foreignKey, $parentKey, $parentClass);
- }
-
- static function TableKeyBelongsTo($table, $tablePKey, $foreignRef, $foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record')
- {
- if (!is_array($tablePKey)) {
- $tablePKey = array($tablePKey);
- }
- $ar = new ADOdb_Active_Record($table, $tablePKey);
- $ar->belongsTo($foreignRef, $foreignKey, $parentKey, $parentClass);
- }
-
-
- /**
- * __get Access properties - used for lazy loading
- *
- * @param mixed $name
- * @access protected
- * @return mixed
- */
- function __get($name)
- {
- return $this->LoadRelations($name, '', -1, -1);
- }
-
- /**
- * @param string $name
- * @param string $whereOrderBy : eg. ' AND field1 = value ORDER BY field2'
- * @param offset
- * @param limit
- * @return mixed
- */
- function LoadRelations($name, $whereOrderBy='', $offset=-1,$limit=-1)
- {
- $extras = array();
- $table = $this->TableInfo();
- if ($limit >= 0) {
- $extras['limit'] = $limit;
- }
- if ($offset >= 0) {
- $extras['offset'] = $offset;
- }
-
- if (strlen($whereOrderBy)) {
- if (!preg_match('/^[ \n\r]*AND/i', $whereOrderBy)) {
- if (!preg_match('/^[ \n\r]*ORDER[ \n\r]/i', $whereOrderBy)) {
- $whereOrderBy = 'AND ' . $whereOrderBy;
- }
- }
- }
-
- if(!empty($table->_belongsTo[$name])) {
- $obj = $table->_belongsTo[$name];
- $columnName = $obj->foreignKey;
- if(empty($this->$columnName)) {
- $this->$name = null;
- }
- else {
- if ($obj->parentKey) {
- $key = $obj->parentKey;
- }
- else {
- $key = reset($table->keys);
- }
-
- $arrayOfOne = $obj->Find($key.'='.$this->$columnName.' '.$whereOrderBy,false,false,$extras);
- if ($arrayOfOne) {
- $this->$name = $arrayOfOne[0];
- return $arrayOfOne[0];
- }
- }
- }
- if(!empty($table->_hasMany[$name])) {
- $obj = $table->_hasMany[$name];
- $key = reset($table->keys);
- $id = @$this->$key;
- if (!is_numeric($id)) {
- $db = $this->DB();
- $id = $db->qstr($id);
- }
- $objs = $obj->Find($obj->foreignKey.'='.$id. ' '.$whereOrderBy,false,false,$extras);
- if (!$objs) {
- $objs = array();
- }
- $this->$name = $objs;
- return $objs;
- }
-
- return array();
- }
- //////////////////////////////////
-
- // update metadata
- function UpdateActiveTable($pkeys=false,$forceUpdate=false)
- {
- global $ADODB_ASSOC_CASE,$_ADODB_ACTIVE_DBS , $ADODB_CACHE_DIR, $ADODB_ACTIVE_CACHESECS;
- global $ADODB_ACTIVE_DEFVALS,$ADODB_FETCH_MODE;
-
- $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat];
-
- $table = $this->_table;
- $tables = $activedb->tables;
- $tableat = $this->_tableat;
- if (!$forceUpdate && !empty($tables[$tableat])) {
-
- $acttab = $tables[$tableat];
- foreach($acttab->flds as $name => $fld) {
- if ($ADODB_ACTIVE_DEFVALS && isset($fld->default_value)) {
- $this->$name = $fld->default_value;
- }
- else {
- $this->$name = null;
- }
- }
- return;
- }
- $db = $activedb->db;
- $fname = $ADODB_CACHE_DIR . '/adodb_' . $db->databaseType . '_active_'. $table . '.cache';
- if (!$forceUpdate && $ADODB_ACTIVE_CACHESECS && $ADODB_CACHE_DIR && file_exists($fname)) {
- $fp = fopen($fname,'r');
- @flock($fp, LOCK_SH);
- $acttab = unserialize(fread($fp,100000));
- fclose($fp);
- if ($acttab->_created + $ADODB_ACTIVE_CACHESECS - (abs(rand()) % 16) > time()) {
- // abs(rand()) randomizes deletion, reducing contention to delete/refresh file
- // ideally, you should cache at least 32 secs
-
- foreach($acttab->flds as $name => $fld) {
- if ($ADODB_ACTIVE_DEFVALS && isset($fld->default_value)) {
- $this->$name = $fld->default_value;
- }
- else {
- $this->$name = null;
- }
- }
-
- $activedb->tables[$table] = $acttab;
-
- //if ($db->debug) ADOConnection::outp("Reading cached active record file: $fname");
- return;
- } else if ($db->debug) {
- ADOConnection::outp("Refreshing cached active record file: $fname");
- }
- }
- $activetab = new ADODB_Active_Table();
- $activetab->name = $table;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- if ($db->fetchMode !== false) {
- $savem = $db->SetFetchMode(false);
- }
-
- $cols = $db->MetaColumns($table);
-
- if (isset($savem)) {
- $db->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- if (!$cols) {
- $this->Error("Invalid table name: $table",'UpdateActiveTable');
- return false;
- }
- $fld = reset($cols);
- if (!$pkeys) {
- if (isset($fld->primary_key)) {
- $pkeys = array();
- foreach($cols as $name => $fld) {
- if (!empty($fld->primary_key)) {
- $pkeys[] = $name;
- }
- }
- } else
- $pkeys = $this->GetPrimaryKeys($db, $table);
- }
- if (empty($pkeys)) {
- $this->Error("No primary key found for table $table",'UpdateActiveTable');
- return false;
- }
-
- $attr = array();
- $keys = array();
-
- switch($ADODB_ASSOC_CASE) {
- case 0:
- foreach($cols as $name => $fldobj) {
- $name = strtolower($name);
- if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value)) {
- $this->$name = $fldobj->default_value;
- }
- else {
- $this->$name = null;
- }
- $attr[$name] = $fldobj;
- }
- foreach($pkeys as $k => $name) {
- $keys[strtolower($name)] = strtolower($name);
- }
- break;
-
- case 1:
- foreach($cols as $name => $fldobj) {
- $name = strtoupper($name);
-
- if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value)) {
- $this->$name = $fldobj->default_value;
- }
- else {
- $this->$name = null;
- }
- $attr[$name] = $fldobj;
- }
-
- foreach($pkeys as $k => $name) {
- $keys[strtoupper($name)] = strtoupper($name);
- }
- break;
- default:
- foreach($cols as $name => $fldobj) {
- $name = ($fldobj->name);
-
- if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value)) {
- $this->$name = $fldobj->default_value;
- }
- else {
- $this->$name = null;
- }
- $attr[$name] = $fldobj;
- }
- foreach($pkeys as $k => $name) {
- $keys[$name] = $cols[$name]->name;
- }
- break;
- }
-
- $activetab->keys = $keys;
- $activetab->flds = $attr;
-
- if ($ADODB_ACTIVE_CACHESECS && $ADODB_CACHE_DIR) {
- $activetab->_created = time();
- $s = serialize($activetab);
- if (!function_exists('adodb_write_file')) {
- include(ADODB_DIR.'/adodb-csvlib.inc.php');
- }
- adodb_write_file($fname,$s);
- }
- if (isset($activedb->tables[$table])) {
- $oldtab = $activedb->tables[$table];
-
- if ($oldtab) {
- $activetab->_belongsTo = $oldtab->_belongsTo;
- $activetab->_hasMany = $oldtab->_hasMany;
- }
- }
- $activedb->tables[$table] = $activetab;
- }
-
- function GetPrimaryKeys(&$db, $table)
- {
- return $db->MetaPrimaryKeys($table);
- }
-
- // error handler for both PHP4+5.
- function Error($err,$fn)
- {
- global $_ADODB_ACTIVE_DBS;
-
- $fn = get_class($this).'::'.$fn;
- $this->_lasterr = $fn.': '.$err;
-
- if ($this->_dbat < 0) {
- $db = false;
- }
- else {
- $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat];
- $db = $activedb->db;
- }
-
- if (function_exists('adodb_throw')) {
- if (!$db) {
- adodb_throw('ADOdb_Active_Record', $fn, -1, $err, 0, 0, false);
- }
- else {
- adodb_throw($db->databaseType, $fn, -1, $err, 0, 0, $db);
- }
- } else {
- if (!$db || $db->debug) {
- ADOConnection::outp($this->_lasterr);
- }
- }
-
- }
-
- // return last error message
- function ErrorMsg()
- {
- if (!function_exists('adodb_throw')) {
- if ($this->_dbat < 0) {
- $db = false;
- }
- else {
- $db = $this->DB();
- }
-
- // last error could be database error too
- if ($db && $db->ErrorMsg()) {
- return $db->ErrorMsg();
- }
- }
- return $this->_lasterr;
- }
-
- function ErrorNo()
- {
- if ($this->_dbat < 0) {
- return -9999; // no database connection...
- }
- $db = $this->DB();
-
- return (int) $db->ErrorNo();
- }
-
-
- // retrieve ADOConnection from _ADODB_Active_DBs
- function DB()
- {
- global $_ADODB_ACTIVE_DBS;
-
- if ($this->_dbat < 0) {
- $false = false;
- $this->Error("No database connection set: use ADOdb_Active_Record::SetDatabaseAdaptor(\$db)", "DB");
- return $false;
- }
- $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat];
- $db = $activedb->db;
- return $db;
- }
-
- // retrieve ADODB_Active_Table
- function &TableInfo()
- {
- global $_ADODB_ACTIVE_DBS;
- $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat];
- $table = $activedb->tables[$this->_tableat];
- return $table;
- }
-
-
- // I have an ON INSERT trigger on a table that sets other columns in the table.
- // So, I find that for myTable, I want to reload an active record after saving it. -- Malcolm Cook
- function Reload()
- {
- $db = $this->DB();
- if (!$db) {
- return false;
- }
- $table = $this->TableInfo();
- $where = $this->GenWhere($db, $table);
- return($this->Load($where));
- }
-
-
- // set a numeric array (using natural table field ordering) as object properties
- function Set(&$row)
- {
- global $ACTIVE_RECORD_SAFETY;
-
- $db = $this->DB();
-
- if (!$row) {
- $this->_saved = false;
- return false;
- }
-
- $this->_saved = true;
-
- $table = $this->TableInfo();
- if ($ACTIVE_RECORD_SAFETY && sizeof($table->flds) != sizeof($row)) {
- #
\n");
- $ok = false;
- }
-
- return $ok;
- }
diff --git a/vendor/adodb/adodb-php/adodb-datadict.inc.php b/vendor/adodb/adodb-php/adodb-datadict.inc.php
deleted file mode 100644
index b15a80e6..00000000
--- a/vendor/adodb/adodb-php/adodb-datadict.inc.php
+++ /dev/null
@@ -1,1033 +0,0 @@
-$str";
-print_r($a);
-print "
";
-}
-
-
-if (!function_exists('ctype_alnum')) {
- function ctype_alnum($text) {
- return preg_match('/^[a-z0-9]*$/i', $text);
- }
-}
-
-//Lens_ParseTest();
-
-/**
- Parse arguments, treat "text" (text) and 'text' as quotation marks.
- To escape, use "" or '' or ))
-
- Will read in "abc def" sans quotes, as: abc def
- Same with 'abc def'.
- However if `abc def`, then will read in as `abc def`
-
- @param endstmtchar Character that indicates end of statement
- @param tokenchars Include the following characters in tokens apart from A-Z and 0-9
- @returns 2 dimensional array containing parsed tokens.
-*/
-function Lens_ParseArgs($args,$endstmtchar=',',$tokenchars='_.-')
-{
- $pos = 0;
- $intoken = false;
- $stmtno = 0;
- $endquote = false;
- $tokens = array();
- $tokens[$stmtno] = array();
- $max = strlen($args);
- $quoted = false;
- $tokarr = array();
-
- while ($pos < $max) {
- $ch = substr($args,$pos,1);
- switch($ch) {
- case ' ':
- case "\t":
- case "\n":
- case "\r":
- if (!$quoted) {
- if ($intoken) {
- $intoken = false;
- $tokens[$stmtno][] = implode('',$tokarr);
- }
- break;
- }
-
- $tokarr[] = $ch;
- break;
-
- case '`':
- if ($intoken) $tokarr[] = $ch;
- case '(':
- case ')':
- case '"':
- case "'":
-
- if ($intoken) {
- if (empty($endquote)) {
- $tokens[$stmtno][] = implode('',$tokarr);
- if ($ch == '(') $endquote = ')';
- else $endquote = $ch;
- $quoted = true;
- $intoken = true;
- $tokarr = array();
- } else if ($endquote == $ch) {
- $ch2 = substr($args,$pos+1,1);
- if ($ch2 == $endquote) {
- $pos += 1;
- $tokarr[] = $ch2;
- } else {
- $quoted = false;
- $intoken = false;
- $tokens[$stmtno][] = implode('',$tokarr);
- $endquote = '';
- }
- } else
- $tokarr[] = $ch;
-
- }else {
-
- if ($ch == '(') $endquote = ')';
- else $endquote = $ch;
- $quoted = true;
- $intoken = true;
- $tokarr = array();
- if ($ch == '`') $tokarr[] = '`';
- }
- break;
-
- default:
-
- if (!$intoken) {
- if ($ch == $endstmtchar) {
- $stmtno += 1;
- $tokens[$stmtno] = array();
- break;
- }
-
- $intoken = true;
- $quoted = false;
- $endquote = false;
- $tokarr = array();
-
- }
-
- if ($quoted) $tokarr[] = $ch;
- else if (ctype_alnum($ch) || strpos($tokenchars,$ch) !== false) $tokarr[] = $ch;
- else {
- if ($ch == $endstmtchar) {
- $tokens[$stmtno][] = implode('',$tokarr);
- $stmtno += 1;
- $tokens[$stmtno] = array();
- $intoken = false;
- $tokarr = array();
- break;
- }
- $tokens[$stmtno][] = implode('',$tokarr);
- $tokens[$stmtno][] = $ch;
- $intoken = false;
- }
- }
- $pos += 1;
- }
- if ($intoken) $tokens[$stmtno][] = implode('',$tokarr);
-
- return $tokens;
-}
-
-
-class ADODB_DataDict {
- var $connection;
- var $debug = false;
- var $dropTable = 'DROP TABLE %s';
- var $renameTable = 'RENAME TABLE %s TO %s';
- var $dropIndex = 'DROP INDEX %s';
- var $addCol = ' ADD';
- var $alterCol = ' ALTER COLUMN';
- var $dropCol = ' DROP COLUMN';
- var $renameColumn = 'ALTER TABLE %s RENAME COLUMN %s TO %s'; // table, old-column, new-column, column-definitions (not used by default)
- var $nameRegex = '\w';
- var $nameRegexBrackets = 'a-zA-Z0-9_\(\)';
- var $schema = false;
- var $serverInfo = array();
- var $autoIncrement = false;
- var $dataProvider;
- var $invalidResizeTypes4 = array('CLOB','BLOB','TEXT','DATE','TIME'); // for changetablesql
- var $blobSize = 100; /// any varchar/char field this size or greater is treated as a blob
- /// in other words, we use a text area for editting.
-
- function GetCommentSQL($table,$col)
- {
- return false;
- }
-
- function SetCommentSQL($table,$col,$cmt)
- {
- return false;
- }
-
- function MetaTables()
- {
- if (!$this->connection->IsConnected()) return array();
- return $this->connection->MetaTables();
- }
-
- function MetaColumns($tab, $upper=true, $schema=false)
- {
- if (!$this->connection->IsConnected()) return array();
- return $this->connection->MetaColumns($this->TableName($tab), $upper, $schema);
- }
-
- function MetaPrimaryKeys($tab,$owner=false,$intkey=false)
- {
- if (!$this->connection->IsConnected()) return array();
- return $this->connection->MetaPrimaryKeys($this->TableName($tab), $owner, $intkey);
- }
-
- function MetaIndexes($table, $primary = false, $owner = false)
- {
- if (!$this->connection->IsConnected()) return array();
- return $this->connection->MetaIndexes($this->TableName($table), $primary, $owner);
- }
-
- function MetaType($t,$len=-1,$fieldobj=false)
- {
- static $typeMap = array(
- 'VARCHAR' => 'C',
- 'VARCHAR2' => 'C',
- 'CHAR' => 'C',
- 'C' => 'C',
- 'STRING' => 'C',
- 'NCHAR' => 'C',
- 'NVARCHAR' => 'C',
- 'VARYING' => 'C',
- 'BPCHAR' => 'C',
- 'CHARACTER' => 'C',
- 'INTERVAL' => 'C', # Postgres
- 'MACADDR' => 'C', # postgres
- 'VAR_STRING' => 'C', # mysql
- ##
- 'LONGCHAR' => 'X',
- 'TEXT' => 'X',
- 'NTEXT' => 'X',
- 'M' => 'X',
- 'X' => 'X',
- 'CLOB' => 'X',
- 'NCLOB' => 'X',
- 'LVARCHAR' => 'X',
- ##
- 'BLOB' => 'B',
- 'IMAGE' => 'B',
- 'BINARY' => 'B',
- 'VARBINARY' => 'B',
- 'LONGBINARY' => 'B',
- 'B' => 'B',
- ##
- 'YEAR' => 'D', // mysql
- 'DATE' => 'D',
- 'D' => 'D',
- ##
- 'UNIQUEIDENTIFIER' => 'C', # MS SQL Server
- ##
- 'TIME' => 'T',
- 'TIMESTAMP' => 'T',
- 'DATETIME' => 'T',
- 'TIMESTAMPTZ' => 'T',
- 'SMALLDATETIME' => 'T',
- 'T' => 'T',
- 'TIMESTAMP WITHOUT TIME ZONE' => 'T', // postgresql
- ##
- 'BOOL' => 'L',
- 'BOOLEAN' => 'L',
- 'BIT' => 'L',
- 'L' => 'L',
- ##
- 'COUNTER' => 'R',
- 'R' => 'R',
- 'SERIAL' => 'R', // ifx
- 'INT IDENTITY' => 'R',
- ##
- 'INT' => 'I',
- 'INT2' => 'I',
- 'INT4' => 'I',
- 'INT8' => 'I',
- 'INTEGER' => 'I',
- 'INTEGER UNSIGNED' => 'I',
- 'SHORT' => 'I',
- 'TINYINT' => 'I',
- 'SMALLINT' => 'I',
- 'I' => 'I',
- ##
- 'LONG' => 'N', // interbase is numeric, oci8 is blob
- 'BIGINT' => 'N', // this is bigger than PHP 32-bit integers
- 'DECIMAL' => 'N',
- 'DEC' => 'N',
- 'REAL' => 'N',
- 'DOUBLE' => 'N',
- 'DOUBLE PRECISION' => 'N',
- 'SMALLFLOAT' => 'N',
- 'FLOAT' => 'N',
- 'NUMBER' => 'N',
- 'NUM' => 'N',
- 'NUMERIC' => 'N',
- 'MONEY' => 'N',
-
- ## informix 9.2
- 'SQLINT' => 'I',
- 'SQLSERIAL' => 'I',
- 'SQLSMINT' => 'I',
- 'SQLSMFLOAT' => 'N',
- 'SQLFLOAT' => 'N',
- 'SQLMONEY' => 'N',
- 'SQLDECIMAL' => 'N',
- 'SQLDATE' => 'D',
- 'SQLVCHAR' => 'C',
- 'SQLCHAR' => 'C',
- 'SQLDTIME' => 'T',
- 'SQLINTERVAL' => 'N',
- 'SQLBYTES' => 'B',
- 'SQLTEXT' => 'X',
- ## informix 10
- "SQLINT8" => 'I8',
- "SQLSERIAL8" => 'I8',
- "SQLNCHAR" => 'C',
- "SQLNVCHAR" => 'C',
- "SQLLVARCHAR" => 'X',
- "SQLBOOL" => 'L'
- );
-
- if (!$this->connection->IsConnected()) {
- $t = strtoupper($t);
- if (isset($typeMap[$t])) return $typeMap[$t];
- return 'N';
- }
- return $this->connection->MetaType($t,$len,$fieldobj);
- }
-
- function NameQuote($name = NULL,$allowBrackets=false)
- {
- if (!is_string($name)) {
- return FALSE;
- }
-
- $name = trim($name);
-
- if ( !is_object($this->connection) ) {
- return $name;
- }
-
- $quote = $this->connection->nameQuote;
-
- // if name is of the form `name`, quote it
- if ( preg_match('/^`(.+)`$/', $name, $matches) ) {
- return $quote . $matches[1] . $quote;
- }
-
- // if name contains special characters, quote it
- $regex = ($allowBrackets) ? $this->nameRegexBrackets : $this->nameRegex;
-
- if ( !preg_match('/^[' . $regex . ']+$/', $name) ) {
- return $quote . $name . $quote;
- }
-
- return $name;
- }
-
- function TableName($name)
- {
- if ( $this->schema ) {
- return $this->NameQuote($this->schema) .'.'. $this->NameQuote($name);
- }
- return $this->NameQuote($name);
- }
-
- // Executes the sql array returned by GetTableSQL and GetIndexSQL
- function ExecuteSQLArray($sql, $continueOnError = true)
- {
- $rez = 2;
- $conn = $this->connection;
- $saved = $conn->debug;
- foreach($sql as $line) {
-
- if ($this->debug) $conn->debug = true;
- $ok = $conn->Execute($line);
- $conn->debug = $saved;
- if (!$ok) {
- if ($this->debug) ADOConnection::outp($conn->ErrorMsg());
- if (!$continueOnError) return 0;
- $rez = 1;
- }
- }
- return $rez;
- }
-
- /**
- Returns the actual type given a character code.
-
- C: varchar
- X: CLOB (character large object) or largest varchar size if CLOB is not supported
- C2: Multibyte varchar
- X2: Multibyte CLOB
-
- B: BLOB (binary large object)
-
- D: Date
- T: Date-time
- L: Integer field suitable for storing booleans (0 or 1)
- I: Integer
- F: Floating point number
- N: Numeric or decimal number
- */
-
- function ActualType($meta)
- {
- return $meta;
- }
-
- function CreateDatabase($dbname,$options=false)
- {
- $options = $this->_Options($options);
- $sql = array();
-
- $s = 'CREATE DATABASE ' . $this->NameQuote($dbname);
- if (isset($options[$this->upperName]))
- $s .= ' '.$options[$this->upperName];
-
- $sql[] = $s;
- return $sql;
- }
-
- /*
- Generates the SQL to create index. Returns an array of sql strings.
- */
- function CreateIndexSQL($idxname, $tabname, $flds, $idxoptions = false)
- {
- if (!is_array($flds)) {
- $flds = explode(',',$flds);
- }
-
- foreach($flds as $key => $fld) {
- # some indexes can use partial fields, eg. index first 32 chars of "name" with NAME(32)
- $flds[$key] = $this->NameQuote($fld,$allowBrackets=true);
- }
-
- return $this->_IndexSQL($this->NameQuote($idxname), $this->TableName($tabname), $flds, $this->_Options($idxoptions));
- }
-
- function DropIndexSQL ($idxname, $tabname = NULL)
- {
- return array(sprintf($this->dropIndex, $this->NameQuote($idxname), $this->TableName($tabname)));
- }
-
- function SetSchema($schema)
- {
- $this->schema = $schema;
- }
-
- function AddColumnSQL($tabname, $flds)
- {
- $tabname = $this->TableName ($tabname);
- $sql = array();
- list($lines,$pkey,$idxs) = $this->_GenFields($flds);
- // genfields can return FALSE at times
- if ($lines == null) $lines = array();
- $alter = 'ALTER TABLE ' . $tabname . $this->addCol . ' ';
- foreach($lines as $v) {
- $sql[] = $alter . $v;
- }
- if (is_array($idxs)) {
- foreach($idxs as $idx => $idxdef) {
- $sql_idxs = $this->CreateIndexSql($idx, $tabname, $idxdef['cols'], $idxdef['opts']);
- $sql = array_merge($sql, $sql_idxs);
- }
- }
- return $sql;
- }
-
- /**
- * Change the definition of one column
- *
- * As some DBM's can't do that on there own, you need to supply the complete defintion of the new table,
- * to allow, recreating the table and copying the content over to the new table
- * @param string $tabname table-name
- * @param string $flds column-name and type for the changed column
- * @param string $tableflds='' complete defintion of the new table, eg. for postgres, default ''
- * @param array/string $tableoptions='' options for the new table see CreateTableSQL, default ''
- * @return array with SQL strings
- */
- function AlterColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
- {
- $tabname = $this->TableName ($tabname);
- $sql = array();
- list($lines,$pkey,$idxs) = $this->_GenFields($flds);
- // genfields can return FALSE at times
- if ($lines == null) $lines = array();
- $alter = 'ALTER TABLE ' . $tabname . $this->alterCol . ' ';
- foreach($lines as $v) {
- $sql[] = $alter . $v;
- }
- if (is_array($idxs)) {
- foreach($idxs as $idx => $idxdef) {
- $sql_idxs = $this->CreateIndexSql($idx, $tabname, $idxdef['cols'], $idxdef['opts']);
- $sql = array_merge($sql, $sql_idxs);
- }
-
- }
- return $sql;
- }
-
- /**
- * Rename one column
- *
- * Some DBM's can only do this together with changeing the type of the column (even if that stays the same, eg. mysql)
- * @param string $tabname table-name
- * @param string $oldcolumn column-name to be renamed
- * @param string $newcolumn new column-name
- * @param string $flds='' complete column-defintion-string like for AddColumnSQL, only used by mysql atm., default=''
- * @return array with SQL strings
- */
- function RenameColumnSQL($tabname,$oldcolumn,$newcolumn,$flds='')
- {
- $tabname = $this->TableName ($tabname);
- if ($flds) {
- list($lines,$pkey,$idxs) = $this->_GenFields($flds);
- // genfields can return FALSE at times
- if ($lines == null) $lines = array();
- list(,$first) = each($lines);
- list(,$column_def) = preg_split("/[\t ]+/",$first,2);
- }
- return array(sprintf($this->renameColumn,$tabname,$this->NameQuote($oldcolumn),$this->NameQuote($newcolumn),$column_def));
- }
-
- /**
- * Drop one column
- *
- * Some DBM's can't do that on there own, you need to supply the complete defintion of the new table,
- * to allow, recreating the table and copying the content over to the new table
- * @param string $tabname table-name
- * @param string $flds column-name and type for the changed column
- * @param string $tableflds='' complete defintion of the new table, eg. for postgres, default ''
- * @param array/string $tableoptions='' options for the new table see CreateTableSQL, default ''
- * @return array with SQL strings
- */
- function DropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
- {
- $tabname = $this->TableName ($tabname);
- if (!is_array($flds)) $flds = explode(',',$flds);
- $sql = array();
- $alter = 'ALTER TABLE ' . $tabname . $this->dropCol . ' ';
- foreach($flds as $v) {
- $sql[] = $alter . $this->NameQuote($v);
- }
- return $sql;
- }
-
- function DropTableSQL($tabname)
- {
- return array (sprintf($this->dropTable, $this->TableName($tabname)));
- }
-
- function RenameTableSQL($tabname,$newname)
- {
- return array (sprintf($this->renameTable, $this->TableName($tabname),$this->TableName($newname)));
- }
-
- /**
- Generate the SQL to create table. Returns an array of sql strings.
- */
- function CreateTableSQL($tabname, $flds, $tableoptions=array())
- {
- list($lines,$pkey,$idxs) = $this->_GenFields($flds, true);
- // genfields can return FALSE at times
- if ($lines == null) $lines = array();
-
- $taboptions = $this->_Options($tableoptions);
- $tabname = $this->TableName ($tabname);
- $sql = $this->_TableSQL($tabname,$lines,$pkey,$taboptions);
-
- // ggiunta - 2006/10/12 - KLUDGE:
- // if we are on autoincrement, and table options includes REPLACE, the
- // autoincrement sequence has already been dropped on table creation sql, so
- // we avoid passing REPLACE to trigger creation code. This prevents
- // creating sql that double-drops the sequence
- if ($this->autoIncrement && isset($taboptions['REPLACE']))
- unset($taboptions['REPLACE']);
- $tsql = $this->_Triggers($tabname,$taboptions);
- foreach($tsql as $s) $sql[] = $s;
-
- if (is_array($idxs)) {
- foreach($idxs as $idx => $idxdef) {
- $sql_idxs = $this->CreateIndexSql($idx, $tabname, $idxdef['cols'], $idxdef['opts']);
- $sql = array_merge($sql, $sql_idxs);
- }
- }
-
- return $sql;
- }
-
-
-
- function _GenFields($flds,$widespacing=false)
- {
- if (is_string($flds)) {
- $padding = ' ';
- $txt = $flds.$padding;
- $flds = array();
- $flds0 = Lens_ParseArgs($txt,',');
- $hasparam = false;
- foreach($flds0 as $f0) {
- $f1 = array();
- foreach($f0 as $token) {
- switch (strtoupper($token)) {
- case 'INDEX':
- $f1['INDEX'] = '';
- // fall through intentionally
- case 'CONSTRAINT':
- case 'DEFAULT':
- $hasparam = $token;
- break;
- default:
- if ($hasparam) $f1[$hasparam] = $token;
- else $f1[] = $token;
- $hasparam = false;
- break;
- }
- }
- // 'index' token without a name means single column index: name it after column
- if (array_key_exists('INDEX', $f1) && $f1['INDEX'] == '') {
- $f1['INDEX'] = isset($f0['NAME']) ? $f0['NAME'] : $f0[0];
- // check if column name used to create an index name was quoted
- if (($f1['INDEX'][0] == '"' || $f1['INDEX'][0] == "'" || $f1['INDEX'][0] == "`") &&
- ($f1['INDEX'][0] == substr($f1['INDEX'], -1))) {
- $f1['INDEX'] = $f1['INDEX'][0].'idx_'.substr($f1['INDEX'], 1, -1).$f1['INDEX'][0];
- }
- else
- $f1['INDEX'] = 'idx_'.$f1['INDEX'];
- }
- // reset it, so we don't get next field 1st token as INDEX...
- $hasparam = false;
-
- $flds[] = $f1;
-
- }
- }
- $this->autoIncrement = false;
- $lines = array();
- $pkey = array();
- $idxs = array();
- foreach($flds as $fld) {
- $fld = _array_change_key_case($fld);
-
- $fname = false;
- $fdefault = false;
- $fautoinc = false;
- $ftype = false;
- $fsize = false;
- $fprec = false;
- $fprimary = false;
- $fnoquote = false;
- $fdefts = false;
- $fdefdate = false;
- $fconstraint = false;
- $fnotnull = false;
- $funsigned = false;
- $findex = '';
- $funiqueindex = false;
-
- //-----------------
- // Parse attributes
- foreach($fld as $attr => $v) {
- if ($attr == 2 && is_numeric($v)) $attr = 'SIZE';
- else if (is_numeric($attr) && $attr > 1 && !is_numeric($v)) $attr = strtoupper($v);
-
- switch($attr) {
- case '0':
- case 'NAME': $fname = $v; break;
- case '1':
- case 'TYPE': $ty = $v; $ftype = $this->ActualType(strtoupper($v)); break;
-
- case 'SIZE':
- $dotat = strpos($v,'.'); if ($dotat === false) $dotat = strpos($v,',');
- if ($dotat === false) $fsize = $v;
- else {
- $fsize = substr($v,0,$dotat);
- $fprec = substr($v,$dotat+1);
- }
- break;
- case 'UNSIGNED': $funsigned = true; break;
- case 'AUTOINCREMENT':
- case 'AUTO': $fautoinc = true; $fnotnull = true; break;
- case 'KEY':
- // a primary key col can be non unique in itself (if key spans many cols...)
- case 'PRIMARY': $fprimary = $v; $fnotnull = true; /*$funiqueindex = true;*/ break;
- case 'DEF':
- case 'DEFAULT': $fdefault = $v; break;
- case 'NOTNULL': $fnotnull = $v; break;
- case 'NOQUOTE': $fnoquote = $v; break;
- case 'DEFDATE': $fdefdate = $v; break;
- case 'DEFTIMESTAMP': $fdefts = $v; break;
- case 'CONSTRAINT': $fconstraint = $v; break;
- // let INDEX keyword create a 'very standard' index on column
- case 'INDEX': $findex = $v; break;
- case 'UNIQUE': $funiqueindex = true; break;
- } //switch
- } // foreach $fld
-
- //--------------------
- // VALIDATE FIELD INFO
- if (!strlen($fname)) {
- if ($this->debug) ADOConnection::outp("Undefined NAME");
- return false;
- }
-
- $fid = strtoupper(preg_replace('/^`(.+)`$/', '$1', $fname));
- $fname = $this->NameQuote($fname);
-
- if (!strlen($ftype)) {
- if ($this->debug) ADOConnection::outp("Undefined TYPE for field '$fname'");
- return false;
- } else {
- $ftype = strtoupper($ftype);
- }
-
- $ftype = $this->_GetSize($ftype, $ty, $fsize, $fprec);
-
- if ($ty == 'X' || $ty == 'X2' || $ty == 'B') $fnotnull = false; // some blob types do not accept nulls
-
- if ($fprimary) $pkey[] = $fname;
-
- // some databases do not allow blobs to have defaults
- if ($ty == 'X') $fdefault = false;
-
- // build list of indexes
- if ($findex != '') {
- if (array_key_exists($findex, $idxs)) {
- $idxs[$findex]['cols'][] = ($fname);
- if (in_array('UNIQUE', $idxs[$findex]['opts']) != $funiqueindex) {
- if ($this->debug) ADOConnection::outp("Index $findex defined once UNIQUE and once not");
- }
- if ($funiqueindex && !in_array('UNIQUE', $idxs[$findex]['opts']))
- $idxs[$findex]['opts'][] = 'UNIQUE';
- }
- else
- {
- $idxs[$findex] = array();
- $idxs[$findex]['cols'] = array($fname);
- if ($funiqueindex)
- $idxs[$findex]['opts'] = array('UNIQUE');
- else
- $idxs[$findex]['opts'] = array();
- }
- }
-
- //--------------------
- // CONSTRUCT FIELD SQL
- if ($fdefts) {
- if (substr($this->connection->databaseType,0,5) == 'mysql') {
- $ftype = 'TIMESTAMP';
- } else {
- $fdefault = $this->connection->sysTimeStamp;
- }
- } else if ($fdefdate) {
- if (substr($this->connection->databaseType,0,5) == 'mysql') {
- $ftype = 'TIMESTAMP';
- } else {
- $fdefault = $this->connection->sysDate;
- }
- } else if ($fdefault !== false && !$fnoquote) {
- if ($ty == 'C' or $ty == 'X' or
- ( substr($fdefault,0,1) != "'" && !is_numeric($fdefault))) {
-
- if (($ty == 'D' || $ty == 'T') && strtolower($fdefault) != 'null') {
- // convert default date into database-aware code
- if ($ty == 'T')
- {
- $fdefault = $this->connection->DBTimeStamp($fdefault);
- }
- else
- {
- $fdefault = $this->connection->DBDate($fdefault);
- }
- }
- else
- if (strlen($fdefault) != 1 && substr($fdefault,0,1) == ' ' && substr($fdefault,strlen($fdefault)-1) == ' ')
- $fdefault = trim($fdefault);
- else if (strtolower($fdefault) != 'null')
- $fdefault = $this->connection->qstr($fdefault);
- }
- }
- $suffix = $this->_CreateSuffix($fname,$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned);
-
- // add index creation
- if ($widespacing) $fname = str_pad($fname,24);
-
- // check for field names appearing twice
- if (array_key_exists($fid, $lines)) {
- ADOConnection::outp("Field '$fname' defined twice");
- }
-
- $lines[$fid] = $fname.' '.$ftype.$suffix;
-
- if ($fautoinc) $this->autoIncrement = true;
- } // foreach $flds
-
- return array($lines,$pkey,$idxs);
- }
-
- /**
- GENERATE THE SIZE PART OF THE DATATYPE
- $ftype is the actual type
- $ty is the type defined originally in the DDL
- */
- function _GetSize($ftype, $ty, $fsize, $fprec)
- {
- if (strlen($fsize) && $ty != 'X' && $ty != 'B' && strpos($ftype,'(') === false) {
- $ftype .= "(".$fsize;
- if (strlen($fprec)) $ftype .= ",".$fprec;
- $ftype .= ')';
- }
- return $ftype;
- }
-
-
- // return string must begin with space
- function _CreateSuffix($fname,&$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned)
- {
- $suffix = '';
- if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault";
- if ($fnotnull) $suffix .= ' NOT NULL';
- if ($fconstraint) $suffix .= ' '.$fconstraint;
- return $suffix;
- }
-
- function _IndexSQL($idxname, $tabname, $flds, $idxoptions)
- {
- $sql = array();
-
- if ( isset($idxoptions['REPLACE']) || isset($idxoptions['DROP']) ) {
- $sql[] = sprintf ($this->dropIndex, $idxname);
- if ( isset($idxoptions['DROP']) )
- return $sql;
- }
-
- if ( empty ($flds) ) {
- return $sql;
- }
-
- $unique = isset($idxoptions['UNIQUE']) ? ' UNIQUE' : '';
-
- $s = 'CREATE' . $unique . ' INDEX ' . $idxname . ' ON ' . $tabname . ' ';
-
- if ( isset($idxoptions[$this->upperName]) )
- $s .= $idxoptions[$this->upperName];
-
- if ( is_array($flds) )
- $flds = implode(', ',$flds);
- $s .= '(' . $flds . ')';
- $sql[] = $s;
-
- return $sql;
- }
-
- function _DropAutoIncrement($tabname)
- {
- return false;
- }
-
- function _TableSQL($tabname,$lines,$pkey,$tableoptions)
- {
- $sql = array();
-
- if (isset($tableoptions['REPLACE']) || isset ($tableoptions['DROP'])) {
- $sql[] = sprintf($this->dropTable,$tabname);
- if ($this->autoIncrement) {
- $sInc = $this->_DropAutoIncrement($tabname);
- if ($sInc) $sql[] = $sInc;
- }
- if ( isset ($tableoptions['DROP']) ) {
- return $sql;
- }
- }
- $s = "CREATE TABLE $tabname (\n";
- $s .= implode(",\n", $lines);
- if (sizeof($pkey)>0) {
- $s .= ",\n PRIMARY KEY (";
- $s .= implode(", ",$pkey).")";
- }
- if (isset($tableoptions['CONSTRAINTS']))
- $s .= "\n".$tableoptions['CONSTRAINTS'];
-
- if (isset($tableoptions[$this->upperName.'_CONSTRAINTS']))
- $s .= "\n".$tableoptions[$this->upperName.'_CONSTRAINTS'];
-
- $s .= "\n)";
- if (isset($tableoptions[$this->upperName])) $s .= $tableoptions[$this->upperName];
- $sql[] = $s;
-
- return $sql;
- }
-
- /**
- GENERATE TRIGGERS IF NEEDED
- used when table has auto-incrementing field that is emulated using triggers
- */
- function _Triggers($tabname,$taboptions)
- {
- return array();
- }
-
- /**
- Sanitize options, so that array elements with no keys are promoted to keys
- */
- function _Options($opts)
- {
- if (!is_array($opts)) return array();
- $newopts = array();
- foreach($opts as $k => $v) {
- if (is_numeric($k)) $newopts[strtoupper($v)] = $v;
- else $newopts[strtoupper($k)] = $v;
- }
- return $newopts;
- }
-
-
- function _getSizePrec($size)
- {
- $fsize = false;
- $fprec = false;
- $dotat = strpos($size,'.');
- if ($dotat === false) $dotat = strpos($size,',');
- if ($dotat === false) $fsize = $size;
- else {
- $fsize = substr($size,0,$dotat);
- $fprec = substr($size,$dotat+1);
- }
- return array($fsize, $fprec);
- }
-
- /**
- "Florian Buzin [ easywe ]" %s cannot be changed to %s currently
", $flds[0][0], $flds[0][1]));
- #echo "$this->alterCol cannot be changed to $flds currently
";
- continue;
- }
- $sql[] = $alter . $this->alterCol . ' ' . $v;
- } else {
- $sql[] = $alter . $this->addCol . ' ' . $v;
- }
- }
-
- if ($dropOldFlds) {
- foreach ( $cols as $id => $v )
- if ( !isset($lines[$id]) )
- $sql[] = $alter . $this->dropCol . ' ' . $v->name;
- }
- return $sql;
- }
-} // class
diff --git a/vendor/adodb/adodb-php/adodb-error.inc.php b/vendor/adodb/adodb-php/adodb-error.inc.php
deleted file mode 100644
index d42a06a8..00000000
--- a/vendor/adodb/adodb-php/adodb-error.inc.php
+++ /dev/null
@@ -1,265 +0,0 @@
- DB_ERROR_NOSUCHTABLE,
- 'Relation [\"\'].*[\"\'] already exists|Cannot insert a duplicate key into (a )?unique index.*|duplicate key.*violates unique constraint' => DB_ERROR_ALREADY_EXISTS,
- 'database ".+" does not exist$' => DB_ERROR_NOSUCHDB,
- '(divide|division) by zero$' => DB_ERROR_DIVZERO,
- 'pg_atoi: error in .*: can\'t parse ' => DB_ERROR_INVALID_NUMBER,
- 'ttribute [\"\'].*[\"\'] not found|Relation [\"\'].*[\"\'] does not have attribute [\"\'].*[\"\']' => DB_ERROR_NOSUCHFIELD,
- '(parser: parse|syntax) error at or near \"' => DB_ERROR_SYNTAX,
- 'referential integrity violation' => DB_ERROR_CONSTRAINT,
- 'deadlock detected$' => DB_ERROR_DEADLOCK,
- 'canceling statement due to statement timeout$' => DB_ERROR_STATEMENT_TIMEOUT,
- 'could not serialize access due to' => DB_ERROR_SERIALIZATION_FAILURE
- );
- reset($error_regexps);
- while (list($regexp,$code) = each($error_regexps)) {
- if (preg_match("/$regexp/mi", $errormsg)) {
- return $code;
- }
- }
- // Fall back to DB_ERROR if there was no mapping.
- return DB_ERROR;
-}
-
-function adodb_error_odbc()
-{
-static $MAP = array(
- '01004' => DB_ERROR_TRUNCATED,
- '07001' => DB_ERROR_MISMATCH,
- '21S01' => DB_ERROR_MISMATCH,
- '21S02' => DB_ERROR_MISMATCH,
- '22003' => DB_ERROR_INVALID_NUMBER,
- '22008' => DB_ERROR_INVALID_DATE,
- '22012' => DB_ERROR_DIVZERO,
- '23000' => DB_ERROR_CONSTRAINT,
- '24000' => DB_ERROR_INVALID,
- '34000' => DB_ERROR_INVALID,
- '37000' => DB_ERROR_SYNTAX,
- '42000' => DB_ERROR_SYNTAX,
- 'IM001' => DB_ERROR_UNSUPPORTED,
- 'S0000' => DB_ERROR_NOSUCHTABLE,
- 'S0001' => DB_ERROR_NOT_FOUND,
- 'S0002' => DB_ERROR_NOSUCHTABLE,
- 'S0011' => DB_ERROR_ALREADY_EXISTS,
- 'S0012' => DB_ERROR_NOT_FOUND,
- 'S0021' => DB_ERROR_ALREADY_EXISTS,
- 'S0022' => DB_ERROR_NOT_FOUND,
- 'S1000' => DB_ERROR_NOSUCHTABLE,
- 'S1009' => DB_ERROR_INVALID,
- 'S1090' => DB_ERROR_INVALID,
- 'S1C00' => DB_ERROR_NOT_CAPABLE
- );
- return $MAP;
-}
-
-function adodb_error_ibase()
-{
-static $MAP = array(
- -104 => DB_ERROR_SYNTAX,
- -150 => DB_ERROR_ACCESS_VIOLATION,
- -151 => DB_ERROR_ACCESS_VIOLATION,
- -155 => DB_ERROR_NOSUCHTABLE,
- -157 => DB_ERROR_NOSUCHFIELD,
- -158 => DB_ERROR_VALUE_COUNT_ON_ROW,
- -170 => DB_ERROR_MISMATCH,
- -171 => DB_ERROR_MISMATCH,
- -172 => DB_ERROR_INVALID,
- -204 => DB_ERROR_INVALID,
- -205 => DB_ERROR_NOSUCHFIELD,
- -206 => DB_ERROR_NOSUCHFIELD,
- -208 => DB_ERROR_INVALID,
- -219 => DB_ERROR_NOSUCHTABLE,
- -297 => DB_ERROR_CONSTRAINT,
- -530 => DB_ERROR_CONSTRAINT,
- -803 => DB_ERROR_CONSTRAINT,
- -551 => DB_ERROR_ACCESS_VIOLATION,
- -552 => DB_ERROR_ACCESS_VIOLATION,
- -922 => DB_ERROR_NOSUCHDB,
- -923 => DB_ERROR_CONNECT_FAILED,
- -924 => DB_ERROR_CONNECT_FAILED
- );
-
- return $MAP;
-}
-
-function adodb_error_ifx()
-{
-static $MAP = array(
- '-201' => DB_ERROR_SYNTAX,
- '-206' => DB_ERROR_NOSUCHTABLE,
- '-217' => DB_ERROR_NOSUCHFIELD,
- '-329' => DB_ERROR_NODBSELECTED,
- '-1204' => DB_ERROR_INVALID_DATE,
- '-1205' => DB_ERROR_INVALID_DATE,
- '-1206' => DB_ERROR_INVALID_DATE,
- '-1209' => DB_ERROR_INVALID_DATE,
- '-1210' => DB_ERROR_INVALID_DATE,
- '-1212' => DB_ERROR_INVALID_DATE
- );
-
- return $MAP;
-}
-
-function adodb_error_oci8()
-{
-static $MAP = array(
- 1 => DB_ERROR_ALREADY_EXISTS,
- 900 => DB_ERROR_SYNTAX,
- 904 => DB_ERROR_NOSUCHFIELD,
- 923 => DB_ERROR_SYNTAX,
- 942 => DB_ERROR_NOSUCHTABLE,
- 955 => DB_ERROR_ALREADY_EXISTS,
- 1476 => DB_ERROR_DIVZERO,
- 1722 => DB_ERROR_INVALID_NUMBER,
- 2289 => DB_ERROR_NOSUCHTABLE,
- 2291 => DB_ERROR_CONSTRAINT,
- 2449 => DB_ERROR_CONSTRAINT
- );
-
- return $MAP;
-}
-
-function adodb_error_mssql()
-{
-static $MAP = array(
- 208 => DB_ERROR_NOSUCHTABLE,
- 2601 => DB_ERROR_ALREADY_EXISTS
- );
-
- return $MAP;
-}
-
-function adodb_error_sqlite()
-{
-static $MAP = array(
- 1 => DB_ERROR_SYNTAX
- );
-
- return $MAP;
-}
-
-function adodb_error_mysql()
-{
-static $MAP = array(
- 1004 => DB_ERROR_CANNOT_CREATE,
- 1005 => DB_ERROR_CANNOT_CREATE,
- 1006 => DB_ERROR_CANNOT_CREATE,
- 1007 => DB_ERROR_ALREADY_EXISTS,
- 1008 => DB_ERROR_CANNOT_DROP,
- 1045 => DB_ERROR_ACCESS_VIOLATION,
- 1046 => DB_ERROR_NODBSELECTED,
- 1049 => DB_ERROR_NOSUCHDB,
- 1050 => DB_ERROR_ALREADY_EXISTS,
- 1051 => DB_ERROR_NOSUCHTABLE,
- 1054 => DB_ERROR_NOSUCHFIELD,
- 1062 => DB_ERROR_ALREADY_EXISTS,
- 1064 => DB_ERROR_SYNTAX,
- 1100 => DB_ERROR_NOT_LOCKED,
- 1136 => DB_ERROR_VALUE_COUNT_ON_ROW,
- 1146 => DB_ERROR_NOSUCHTABLE,
- 1048 => DB_ERROR_CONSTRAINT,
- 2002 => DB_ERROR_CONNECT_FAILED,
- 2005 => DB_ERROR_CONNECT_FAILED
- );
-
- return $MAP;
-}
diff --git a/vendor/adodb/adodb-php/adodb-errorhandler.inc.php b/vendor/adodb/adodb-php/adodb-errorhandler.inc.php
deleted file mode 100644
index 7f36ba1e..00000000
--- a/vendor/adodb/adodb-php/adodb-errorhandler.inc.php
+++ /dev/null
@@ -1,80 +0,0 @@
-$s
Error=".$this->ErrorNo().'
';
- $first = true;
- foreach($fieldArray as $k => $v) {
- if ($has_autoinc && in_array($k,$keyCol)) continue; // skip autoinc col
-
- if ($first) {
- $first = false;
- $iCols = "$k";
- $iVals = "$v";
- } else {
- $iCols .= ",$k";
- $iVals .= ",$v";
- }
- }
- $insert = "INSERT INTO $table ($iCols) VALUES ($iVals)";
- $rs = $zthis->Execute($insert);
- return ($rs) ? 2 : 0;
-}
-
-// Requires $ADODB_FETCH_MODE = ADODB_FETCH_NUM
-function _adodb_getmenu(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=false,
- $size=0, $selectAttr='',$compareFields0=true)
-{
- $hasvalue = false;
-
- if ($multiple or is_array($defstr)) {
- if ($size==0) $size=5;
- $attr = ' multiple size="'.$size.'"';
- if (!strpos($name,'[]')) $name .= '[]';
- } else if ($size) $attr = ' size="'.$size.'"';
- else $attr ='';
-
- $s = '\n";
-}
-
-// Requires $ADODB_FETCH_MODE = ADODB_FETCH_NUM
-function _adodb_getmenu_gp(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=false,
- $size=0, $selectAttr='',$compareFields0=true)
-{
- $hasvalue = false;
-
- if ($multiple or is_array($defstr)) {
- if ($size==0) $size=5;
- $attr = ' multiple size="'.$size.'"';
- if (!strpos($name,'[]')) $name .= '[]';
- } else if ($size) $attr = ' size="'.$size.'"';
- else $attr ='';
-
- $s = '\n";
-}
-
-
-/*
- Count the number of records this sql statement will return by using
- query rewriting heuristics...
-
- Does not work with UNIONs, except with postgresql and oracle.
-
- Usage:
-
- $conn->Connect(...);
- $cnt = _adodb_getcount($conn, $sql);
-
-*/
-function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0)
-{
- $qryRecs = 0;
-
- if (!empty($zthis->_nestedSQL) || preg_match("/^\s*SELECT\s+DISTINCT/is", $sql) ||
- preg_match('/\s+GROUP\s+BY\s+/is',$sql) ||
- preg_match('/\s+UNION\s+/is',$sql)) {
-
- $rewritesql = adodb_strip_order_by($sql);
-
- // ok, has SELECT DISTINCT or GROUP BY so see if we can use a table alias
- // but this is only supported by oracle and postgresql...
- if ($zthis->dataProvider == 'oci8') {
- // Allow Oracle hints to be used for query optimization, Chris Wrye
- if (preg_match('#/\\*+.*?\\*\\/#', $sql, $hint)) {
- $rewritesql = "SELECT ".$hint[0]." COUNT(*) FROM (".$rewritesql.")";
- } else
- $rewritesql = "SELECT COUNT(*) FROM (".$rewritesql.")";
-
- } else if (strncmp($zthis->databaseType,'postgres',8) == 0 || strncmp($zthis->databaseType,'mysql',5) == 0) {
- $rewritesql = "SELECT COUNT(*) FROM ($rewritesql) _ADODB_ALIAS_";
- } else {
- $rewritesql = "SELECT COUNT(*) FROM ($rewritesql)";
- }
- } else {
- // now replace SELECT ... FROM with SELECT COUNT(*) FROM
- if ( strpos($sql, '_ADODB_COUNT') !== FALSE ) {
- $rewritesql = preg_replace('/^\s*?SELECT\s+_ADODB_COUNT(.*)_ADODB_COUNT\s/is','SELECT COUNT(*) ',$sql);
- } else {
- $rewritesql = preg_replace('/^\s*SELECT\s.*\s+FROM\s/Uis','SELECT COUNT(*) FROM ',$sql);
- }
- // fix by alexander zhukov, alex#unipack.ru, because count(*) and 'order by' fails
- // with mssql, access and postgresql. Also a good speedup optimization - skips sorting!
- // also see http://phplens.com/lens/lensforum/msgs.php?id=12752
- $rewritesql = adodb_strip_order_by($rewritesql);
- }
-
- if (isset($rewritesql) && $rewritesql != $sql) {
- if (preg_match('/\sLIMIT\s+[0-9]+/i',$sql,$limitarr)) $rewritesql .= $limitarr[0];
-
- if ($secs2cache) {
- // we only use half the time of secs2cache because the count can quickly
- // become inaccurate if new records are added
- $qryRecs = $zthis->CacheGetOne($secs2cache/2,$rewritesql,$inputarr);
-
- } else {
- $qryRecs = $zthis->GetOne($rewritesql,$inputarr);
- }
- if ($qryRecs !== false) return $qryRecs;
- }
- //--------------------------------------------
- // query rewrite failed - so try slower way...
-
-
- // strip off unneeded ORDER BY if no UNION
- if (preg_match('/\s*UNION\s*/is', $sql)) $rewritesql = $sql;
- else $rewritesql = $rewritesql = adodb_strip_order_by($sql);
-
- if (preg_match('/\sLIMIT\s+[0-9]+/i',$sql,$limitarr)) $rewritesql .= $limitarr[0];
-
- if ($secs2cache) {
- $rstest = $zthis->CacheExecute($secs2cache,$rewritesql,$inputarr);
- if (!$rstest) $rstest = $zthis->CacheExecute($secs2cache,$sql,$inputarr);
- } else {
- $rstest = $zthis->Execute($rewritesql,$inputarr);
- if (!$rstest) $rstest = $zthis->Execute($sql,$inputarr);
- }
- if ($rstest) {
- $qryRecs = $rstest->RecordCount();
- if ($qryRecs == -1) {
- global $ADODB_EXTENSION;
- // some databases will return -1 on MoveLast() - change to MoveNext()
- if ($ADODB_EXTENSION) {
- while(!$rstest->EOF) {
- adodb_movenext($rstest);
- }
- } else {
- while(!$rstest->EOF) {
- $rstest->MoveNext();
- }
- }
- $qryRecs = $rstest->_currentRow;
- }
- $rstest->Close();
- if ($qryRecs == -1) return 0;
- }
- return $qryRecs;
-}
-
-/*
- Code originally from "Cornel G" LOGSQL Insert Failed: $isql $this->helpurl. ".$this->conn->ErrorMsg()." $this->helpurl. ".$this->conn->ErrorMsg()." $this->helpurl. ".$this->conn->ErrorMsg()." Clear SQL Log ".htmlspecialchars($sqls)." No Recordset returned %s: '%s' not implemented for driver '%s' Testing gregorian <=> julian conversion ";
- $t = adodb_mktime(0,0,0,10,11,1492);
- //http://www.holidayorigins.com/html/columbus_day.html - Friday check
- if (!(adodb_date('D Y-m-d',$t) == 'Fri 1492-10-11')) print 'Error in Columbus landing Testing overflow ";
-
- $t = adodb_mktime(0,0,0,3,33,1965);
- if (!(adodb_date('Y-m-d',$t) == '1965-04-02')) print 'Error in day overflow 1 ";
- if (adodb_year_digit_check(00) != 2000) print "Err 2-digit 2000 Testing date formating ";
- $pos = strcmp($s1,$s2);
-
- if (($s1) != ($s2)) {
- for ($j=0,$k=strlen($s1); $j < $k; $j++) {
- if ($s1[$j] != $s2[$j]) {
- print substr($s1,$j).' ';
- break;
- }
- }
- print "Error date(): $ts ";
- $fail = true;
- }
- }
-
- // Test generation of dates outside 1901-2038
- print " Testing random dates between 100 and 4000 ';
- $start = 1960+rand(0,10);
- $yrs = 12;
- $i = 365.25*86400*($start-1970);
- $offset = 36000+rand(10000,60000);
- $max = 365*$yrs*86400;
- $lastyear = 0;
-
- // we generate a timestamp, convert it to a date, and convert it back to a timestamp
- // and check if the roundtrip broke the original timestamp value.
- print "Testing $start to ".($start+$yrs).", or $max seconds, offset=$offset: ";
- $cnt = 0;
- for ($max += $i; $i < $max; $i += $offset) {
- $ret = adodb_date('m,d,Y,H,i,s',$i);
- $arr = explode(',',$ret);
- if ($lastyear != $arr[2]) {
- $lastyear = $arr[2];
- print " $lastyear ";
- flush();
- }
- $newi = adodb_mktime($arr[3],$arr[4],$arr[5],$arr[0],$arr[1],$arr[2]);
- if ($i != $newi) {
- print "Error at $i, adodb_mktime returned $newi ($ret)";
- $fail = true;
- break;
- }
- $cnt += 1;
- }
- echo "Tested $cnt dates Passed ! Failed :-( Bad $rs in %s. Connection or SQL invalid. Try using $connection->debug=true; Insert_ID error Affected_Rows error ADONewConnection: Unable to load database driver '$db' ",$t,' ';var_dump($f->value); echo ' ",$t,' ';var_dump($f->value); echo ' --- Error in type matching $t ----- --- Error in type matching $t ----- Connect: 1st argument should be left blank for $this->databaseType Connect: 1st argument should be left blank for $this->databaseType Eval string = $eval '.htmlspecialchars($ss).'';
- }
- if ($zthis->debug === -1)
- ADOConnection::outp( "
\n($dbt): ".htmlspecialchars($sqlTxt)." $ss\n
\n",false);
- else if ($zthis->debug !== -99)
- ADOConnection::outp( "
\n($dbt): ".htmlspecialchars($sqlTxt)." $ss\n
\n",false);
- } else {
- $ss = "\n ".$ss;
- if ($zthis->debug !== -99)
- ADOConnection::outp("-----
\n($dbt): ".$sqlTxt." $ss\n-----
\n",false);
- }
-
- $qID = $zthis->_query($sql,$inputarr);
-
- /*
- Alexios Fakios notes that ErrorMsg() must be called before ErrorNo() for mssql
- because ErrorNo() calls Execute('SELECT @ERROR'), causing recursion
- */
- if ($zthis->databaseType == 'mssql') {
- // ErrorNo is a slow function call in mssql, and not reliable in PHP 4.0.6
-
- if($emsg = $zthis->ErrorMsg()) {
- if ($err = $zthis->ErrorNo()) {
- if ($zthis->debug === -99)
- ADOConnection::outp( "
\n($dbt): ".htmlspecialchars($sqlTxt)." $ss\n
\n",false);
-
- ADOConnection::outp($err.': '.$emsg);
- }
- }
- } else if (!$qID) {
-
- if ($zthis->debug === -99)
- if ($inBrowser) ADOConnection::outp( "
\n($dbt): ".htmlspecialchars($sqlTxt)." $ss\n
\n",false);
- else ADOConnection::outp("-----
\n($dbt): ".$sqlTxt."$ss\n-----
\n",false);
-
- ADOConnection::outp($zthis->ErrorNo() .': '. $zthis->ErrorMsg());
- }
-
- if ($zthis->debug === 99) _adodb_backtrace(true,9999,2);
- return $qID;
-}
-
-# pretty print the debug_backtrace function
-function _adodb_backtrace($printOrArr=true,$levels=9999,$skippy=0,$ishtml=null)
-{
- if (!function_exists('debug_backtrace')) return '';
-
- if ($ishtml === null) $html = (isset($_SERVER['HTTP_USER_AGENT']));
- else $html = $ishtml;
-
- $fmt = ($html) ? " %% line %4d, file: %s" : "%% line %4d, file: %s";
-
- $MAXSTRLEN = 128;
-
- $s = ($html) ? '' : '';
-
- if (is_array($printOrArr)) $traceArr = $printOrArr;
- else $traceArr = debug_backtrace();
- array_shift($traceArr);
- array_shift($traceArr);
- $tabs = sizeof($traceArr)-2;
-
- foreach ($traceArr as $arr) {
- if ($skippy) {$skippy -= 1; continue;}
- $levels -= 1;
- if ($levels < 0) break;
-
- $args = array();
- for ($i=0; $i < $tabs; $i++) $s .= ($html) ? ' ' : "\t";
- $tabs -= 1;
- if ($html) $s .= '';
- if (isset($arr['class'])) $s .= $arr['class'].'.';
- if (isset($arr['args']))
- foreach($arr['args'] as $v) {
- if (is_null($v)) $args[] = 'null';
- else if (is_array($v)) $args[] = 'Array['.sizeof($v).']';
- else if (is_object($v)) $args[] = 'Object:'.get_class($v);
- else if (is_bool($v)) $args[] = $v ? 'true' : 'false';
- else {
- $v = (string) @$v;
- $str = htmlspecialchars(str_replace(array("\r","\n"),' ',substr($v,0,$MAXSTRLEN)));
- if (strlen($v) > $MAXSTRLEN) $str .= '...';
- $args[] = $str;
- }
- }
- $s .= $arr['function'].'('.implode(', ',$args).')';
-
-
- $s .= @sprintf($fmt, $arr['line'],$arr['file'],basename($arr['file']));
-
- $s .= "\n";
- }
- if ($html) $s .= '';
- if ($printOrArr) print $s;
-
- return $s;
-}
-/*
-function _adodb_find_from($sql)
-{
-
- $sql = str_replace(array("\n","\r"), ' ', $sql);
- $charCount = strlen($sql);
-
- $inString = false;
- $quote = '';
- $parentheseCount = 0;
- $prevChars = '';
- $nextChars = '';
-
-
- for($i = 0; $i < $charCount; $i++) {
-
- $char = substr($sql,$i,1);
- $prevChars = substr($sql,0,$i);
- $nextChars = substr($sql,$i+1);
-
- if((($char == "'" || $char == '"' || $char == '`') && substr($prevChars,-1,1) != '\\') && $inString === false) {
- $quote = $char;
- $inString = true;
- }
-
- elseif((($char == "'" || $char == '"' || $char == '`') && substr($prevChars,-1,1) != '\\') && $inString === true && $quote == $char) {
- $quote = "";
- $inString = false;
- }
-
- elseif($char == "(" && $inString === false)
- $parentheseCount++;
-
- elseif($char == ")" && $inString === false && $parentheseCount > 0)
- $parentheseCount--;
-
- elseif($parentheseCount <= 0 && $inString === false && $char == " " && strtoupper(substr($prevChars,-5,5)) == " FROM")
- return $i;
-
- }
-}
-*/
diff --git a/vendor/adodb/adodb-php/adodb-memcache.lib.inc.php b/vendor/adodb/adodb-php/adodb-memcache.lib.inc.php
deleted file mode 100644
index 42d2be62..00000000
--- a/vendor/adodb/adodb-php/adodb-memcache.lib.inc.php
+++ /dev/null
@@ -1,190 +0,0 @@
-memCache = true; /// should we use memCache instead of caching in files
-$db->memCacheHost = array($ip1, $ip2, $ip3);
-$db->memCachePort = 11211; /// this is default memCache port
-$db->memCacheCompress = false; /// Use 'true' to store the item compressed (uses zlib)
-
-$db->Connect(...);
-$db->CacheExecute($sql);
-
- Note the memcache class is shared by all connections, is created during the first call to Connect/PConnect.
-
- Class instance is stored in $ADODB_CACHE
-*/
-
- class ADODB_Cache_MemCache {
- var $createdir = false; // create caching directory structure?
-
- //-----------------------------
- // memcache specific variables
-
- var $hosts; // array of hosts
- var $port = 11211;
- var $compress = false; // memcache compression with zlib
-
- var $_connected = false;
- var $_memcache = false;
-
- function __construct(&$obj)
- {
- $this->hosts = $obj->memCacheHost;
- $this->port = $obj->memCachePort;
- $this->compress = $obj->memCacheCompress;
- }
-
- // implement as lazy connection. The connection only occurs on CacheExecute call
- function connect(&$err)
- {
- if (!function_exists('memcache_pconnect')) {
- $err = 'Memcache module PECL extension not found!';
- return false;
- }
-
- $memcache = new MemCache;
-
- if (!is_array($this->hosts)) $this->hosts = array($this->hosts);
-
- $failcnt = 0;
- foreach($this->hosts as $host) {
- if (!@$memcache->addServer($host,$this->port,true)) {
- $failcnt += 1;
- }
- }
- if ($failcnt == sizeof($this->hosts)) {
- $err = 'Can\'t connect to any memcache server';
- return false;
- }
- $this->_connected = true;
- $this->_memcache = $memcache;
- return true;
- }
-
- // returns true or false. true if successful save
- function writecache($filename, $contents, $debug, $secs2cache)
- {
- if (!$this->_connected) {
- $err = '';
- if (!$this->connect($err) && $debug) ADOConnection::outp($err);
- }
- if (!$this->_memcache) return false;
-
- if (!$this->_memcache->set($filename, $contents, $this->compress ? MEMCACHE_COMPRESSED : 0, $secs2cache)) {
- if ($debug) ADOConnection::outp(" Failed to save data at the memcached server!
\n");
- return false;
- }
-
- return true;
- }
-
- // returns a recordset
- function readcache($filename, &$err, $secs2cache, $rsClass)
- {
- $false = false;
- if (!$this->_connected) $this->connect($err);
- if (!$this->_memcache) return $false;
-
- $rs = $this->_memcache->get($filename);
- if (!$rs) {
- $err = 'Item with such key doesn\'t exists on the memcached server.';
- return $false;
- }
-
- // hack, should actually use _csv2rs
- $rs = explode("\n", $rs);
- unset($rs[0]);
- $rs = join("\n", $rs);
- $rs = unserialize($rs);
- if (! is_object($rs)) {
- $err = 'Unable to unserialize $rs';
- return $false;
- }
- if ($rs->timeCreated == 0) return $rs; // apparently have been reports that timeCreated was set to 0 somewhere
-
- $tdiff = intval($rs->timeCreated+$secs2cache - time());
- if ($tdiff <= 2) {
- switch($tdiff) {
- case 2:
- if ((rand() & 15) == 0) {
- $err = "Timeout 2";
- return $false;
- }
- break;
- case 1:
- if ((rand() & 3) == 0) {
- $err = "Timeout 1";
- return $false;
- }
- break;
- default:
- $err = "Timeout 0";
- return $false;
- }
- }
- return $rs;
- }
-
- function flushall($debug=false)
- {
- if (!$this->_connected) {
- $err = '';
- if (!$this->connect($err) && $debug) ADOConnection::outp($err);
- }
- if (!$this->_memcache) return false;
-
- $del = $this->_memcache->flush();
-
- if ($debug)
- if (!$del) ADOConnection::outp("flushall: failed!
\n");
- else ADOConnection::outp("flushall: succeeded!
\n");
-
- return $del;
- }
-
- function flushcache($filename, $debug=false)
- {
- if (!$this->_connected) {
- $err = '';
- if (!$this->connect($err) && $debug) ADOConnection::outp($err);
- }
- if (!$this->_memcache) return false;
-
- $del = $this->_memcache->delete($filename);
-
- if ($debug)
- if (!$del) ADOConnection::outp("flushcache: $key entry doesn't exist on memcached server!
\n");
- else ADOConnection::outp("flushcache: $key entry flushed from memcached server!
\n");
-
- return $del;
- }
-
- // not used for memcache
- function createdir($dir, $hash)
- {
- return true;
- }
- }
diff --git a/vendor/adodb/adodb-php/adodb-pager.inc.php b/vendor/adodb/adodb-php/adodb-pager.inc.php
deleted file mode 100644
index fa77d55c..00000000
--- a/vendor/adodb/adodb-php/adodb-pager.inc.php
+++ /dev/null
@@ -1,289 +0,0 @@
- implemented Render_PageLinks().
-
- Please note, this class is entirely unsupported,
- and no free support requests except for bug reports
- will be entertained by the author.
-
-*/
-class ADODB_Pager {
- var $id; // unique id for pager (defaults to 'adodb')
- var $db; // ADODB connection object
- var $sql; // sql used
- var $rs; // recordset generated
- var $curr_page; // current page number before Render() called, calculated in constructor
- var $rows; // number of rows per page
- var $linksPerPage=10; // number of links per page in navigation bar
- var $showPageLinks;
-
- var $gridAttributes = 'width=100% border=1 bgcolor=white';
-
- // Localize text strings here
- var $first = '|<';
- var $prev = '<<';
- var $next = '>>';
- var $last = '>|';
- var $moreLinks = '...';
- var $startLinks = '...';
- var $gridHeader = false;
- var $htmlSpecialChars = true;
- var $page = 'Page';
- var $linkSelectedColor = 'red';
- var $cache = 0; #secs to cache with CachePageExecute()
-
- //----------------------------------------------
- // constructor
- //
- // $db adodb connection object
- // $sql sql statement
- // $id optional id to identify which pager,
- // if you have multiple on 1 page.
- // $id should be only be [a-z0-9]*
- //
- function __construct(&$db,$sql,$id = 'adodb', $showPageLinks = false)
- {
- global $PHP_SELF;
-
- $curr_page = $id.'_curr_page';
- if (!empty($PHP_SELF)) $PHP_SELF = htmlspecialchars($_SERVER['PHP_SELF']); // htmlspecialchars() to prevent XSS attacks
-
- $this->sql = $sql;
- $this->id = $id;
- $this->db = $db;
- $this->showPageLinks = $showPageLinks;
-
- $next_page = $id.'_next_page';
-
- if (isset($_GET[$next_page])) {
- $_SESSION[$curr_page] = (integer) $_GET[$next_page];
- }
- if (empty($_SESSION[$curr_page])) $_SESSION[$curr_page] = 1; ## at first page
-
- $this->curr_page = $_SESSION[$curr_page];
-
- }
-
- //---------------------------
- // Display link to first page
- function Render_First($anchor=true)
- {
- global $PHP_SELF;
- if ($anchor) {
- ?>
- first;?>
- first ";
- }
- }
-
- //--------------------------
- // Display link to next page
- function render_next($anchor=true)
- {
- global $PHP_SELF;
-
- if ($anchor) {
- ?>
- next;?>
- next ";
- }
- }
-
- //------------------
- // Link to last page
- //
- // for better performance with large recordsets, you can set
- // $this->db->pageExecuteCountRows = false, which disables
- // last page counting.
- function render_last($anchor=true)
- {
- global $PHP_SELF;
-
- if (!$this->db->pageExecuteCountRows) return;
-
- if ($anchor) {
- ?>
- last;?>
- last ";
- }
- }
-
- //---------------------------------------------------
- // original code by "Pablo Costa" Query failed: $this->sql
";
- return;
- }
-
- if (!$rs->EOF && (!$rs->AtFirstPage() || !$rs->AtLastPage()))
- $header = $this->RenderNav();
- else
- $header = " ";
-
- $grid = $this->RenderGrid();
- $footer = $this->RenderPageCount();
-
- $this->RenderLayout($header,$grid,$footer);
-
- $rs->Close();
- $this->rs = false;
- }
-
- //------------------------------------------------------
- // override this to control overall layout and formating
- function RenderLayout($header,$grid,$footer,$attributes='border=1 bgcolor=beige')
- {
- echo "
";
- }
-}
diff --git a/vendor/adodb/adodb-php/adodb-pear.inc.php b/vendor/adodb/adodb-php/adodb-pear.inc.php
deleted file mode 100644
index c8f09331..00000000
--- a/vendor/adodb/adodb-php/adodb-pear.inc.php
+++ /dev/null
@@ -1,370 +0,0 @@
- |
- * and Tomas V.V.Cox ",
- $header,
- " ",
- $grid,
- " ",
- $footer,
- "
'.$_SERVER['HTTP_HOST'];
- if (isset($_SERVER['PHP_SELF'])) $tracer .= htmlspecialchars($_SERVER['PHP_SELF']);
- } else
- if (isset($_SERVER['PHP_SELF'])) $tracer .= '
'.htmlspecialchars($_SERVER['PHP_SELF']);
- //$tracer .= (string) adodb_backtrace(false);
-
- $tracer = (string) substr($tracer,0,500);
-
- if (is_array($inputarr)) {
- if (is_array(reset($inputarr))) $params = 'Array sizeof='.sizeof($inputarr);
- else {
- // Quote string parameters so we can see them in the
- // performance stats. This helps spot disabled indexes.
- $xar_params = $inputarr;
- foreach ($xar_params as $xar_param_key => $xar_param) {
- if (gettype($xar_param) == 'string')
- $xar_params[$xar_param_key] = '"' . $xar_param . '"';
- }
- $params = implode(', ', $xar_params);
- if (strlen($params) >= 3000) $params = substr($params, 0, 3000);
- }
- } else {
- $params = '';
- }
-
- if (is_array($sql)) $sql = $sql[0];
- if ($prefix) $sql = $prefix.$sql;
- $arr = array('b'=>strlen($sql).'.'.crc32($sql),
- 'c'=>substr($sql,0,3900), 'd'=>$params,'e'=>$tracer,'f'=>adodb_round($time,6));
- //var_dump($arr);
- $saved = $conn->debug;
- $conn->debug = 0;
-
- $d = $conn->sysTimeStamp;
- if (empty($d)) $d = date("'Y-m-d H:i:s'");
- if ($conn->dataProvider == 'oci8' && $dbT != 'oci8po') {
- $isql = "insert into $perf_table values($d,:b,:c,:d,:e,:f)";
- } else if ($dbT == 'odbc_mssql' || $dbT == 'informix' || strncmp($dbT,'odbtp',4)==0) {
- $timer = $arr['f'];
- if ($dbT == 'informix') $sql2 = substr($sql2,0,230);
-
- $sql1 = $conn->qstr($arr['b']);
- $sql2 = $conn->qstr($arr['c']);
- $params = $conn->qstr($arr['d']);
- $tracer = $conn->qstr($arr['e']);
-
- $isql = "insert into $perf_table (created,sql0,sql1,params,tracer,timer) values($d,$sql1,$sql2,$params,$tracer,$timer)";
- if ($dbT == 'informix') $isql = str_replace(chr(10),' ',$isql);
- $arr = false;
- } else {
- if ($dbT == 'db2') $arr['f'] = (float) $arr['f'];
- $isql = "insert into $perf_table (created,sql0,sql1,params,tracer,timer) values( $d,?,?,?,?,?)";
- }
-
- global $ADODB_PERF_MIN;
- if ($errN != 0 || $time >= $ADODB_PERF_MIN) {
- $ok = $conn->Execute($isql,$arr);
- } else
- $ok = true;
-
- $conn->debug = $saved;
-
- if ($ok) {
- $conn->_logsql = true;
- } else {
- $err2 = $conn->ErrorMsg();
- $conn->_logsql = true; // enable logsql error simulation
- $perf = NewPerfMonitor($conn);
- if ($perf) {
- if ($perf->CreateLogTable()) $ok = $conn->Execute($isql,$arr);
- } else {
- $ok = $conn->Execute("create table $perf_table (
- created varchar(50),
- sql0 varchar(250),
- sql1 varchar(4000),
- params varchar(3000),
- tracer varchar(500),
- timer decimal(16,6))");
- }
- if (!$ok) {
- ADOConnection::outp( "
$err2';
- var $titles = '
\n";
- $this->conn->fnExecute = $saveE;
-
- return $html;
- }
-
- function Tables($orderby='1')
- {
- if (!$this->tablesSQL) return false;
-
- $savelog = $this->conn->LogSQL(false);
- $rs = $this->conn->Execute($this->tablesSQL.' order by '.$orderby);
- $this->conn->LogSQL($savelog);
- $html = rs2html($rs,false,false,false,false);
- return $html;
- }
-
-
- function CreateLogTable()
- {
- if (!$this->createTableSQL) return false;
-
- $table = $this->table();
- $sql = str_replace('adodb_logsql',$table,$this->createTableSQL);
- $savelog = $this->conn->LogSQL(false);
- $ok = $this->conn->Execute($sql);
- $this->conn->LogSQL($savelog);
- return ($ok) ? true : false;
- }
-
- function DoSQLForm()
- {
-
-
- $PHP_SELF = htmlspecialchars($_SERVER['PHP_SELF']);
- $sql = isset($_REQUEST['sql']) ? $_REQUEST['sql'] : '';
-
- if (isset($_SESSION['phplens_sqlrows'])) $rows = $_SESSION['phplens_sqlrows'];
- else $rows = 3;
-
- if (isset($_REQUEST['SMALLER'])) {
- $rows /= 2;
- if ($rows < 3) $rows = 3;
- $_SESSION['phplens_sqlrows'] = $rows;
- }
- if (isset($_REQUEST['BIGGER'])) {
- $rows *= 2;
- $_SESSION['phplens_sqlrows'] = $rows;
- }
-
-?>
-
-
-
-undomq(trim($sql));
- if (substr($sql,strlen($sql)-1) === ';') {
- $print = true;
- $sqla = $this->SplitSQL($sql);
- } else {
- $print = false;
- $sqla = array($sql);
- }
- foreach($sqla as $sqls) {
-
- if (!$sqls) continue;
-
- if ($print) {
- print " ';
- var $warnRatio = 90;
- var $tablesSQL = false;
- var $cliFormat = "%32s => %s \r\n";
- var $sql1 = 'sql1'; // used for casting sql1 to text for mssql
- var $explain = true;
- var $helpurl = 'LogSQL help';
- var $createTableSQL = false;
- var $maxLength = 2000;
-
- // Sets the tablename to be used
- static function table($newtable = false)
- {
- static $_table;
-
- if (!empty($newtable)) $_table = $newtable;
- if (empty($_table)) $_table = 'adodb_logsql';
- return $_table;
- }
-
- // returns array with info to calculate CPU Load
- function _CPULoad()
- {
-/*
-
-cpu 524152 2662 2515228 336057010
-cpu0 264339 1408 1257951 168025827
-cpu1 259813 1254 1257277 168031181
-page 622307 25475680
-swap 24 1891
-intr 890153570 868093576 6 0 4 4 0 6 1 2 0 0 0 124 0 8098760 2 13961053 0 0 0 0 0 0 0 0 0 0 0 0 0 16 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-disk_io: (3,0):(3144904,54369,610378,3090535,50936192) (3,1):(3630212,54097,633016,3576115,50951320)
-ctxt 66155838
-btime 1062315585
-processes 69293
-
-*/
- // Algorithm is taken from
- // http://social.technet.microsoft.com/Forums/en-US/winservergen/thread/414b0e1b-499c-411e-8a02-6a12e339c0f1/
- if (strncmp(PHP_OS,'WIN',3)==0) {
- if (PHP_VERSION == '5.0.0') return false;
- if (PHP_VERSION == '5.0.1') return false;
- if (PHP_VERSION == '5.0.2') return false;
- if (PHP_VERSION == '5.0.3') return false;
- if (PHP_VERSION == '4.3.10') return false; # see http://bugs.php.net/bug.php?id=31737
-
- static $FAIL = false;
- if ($FAIL) return false;
-
- $objName = "winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\CIMV2";
- $myQuery = "SELECT * FROM Win32_PerfFormattedData_PerfOS_Processor WHERE Name = '_Total'";
-
- try {
- @$objWMIService = new COM($objName);
- if (!$objWMIService) {
- $FAIL = true;
- return false;
- }
-
- $info[0] = -1;
- $info[1] = 0;
- $info[2] = 0;
- $info[3] = 0;
- foreach($objWMIService->ExecQuery($myQuery) as $objItem) {
- $info[0] = $objItem->PercentProcessorTime();
- }
-
- } catch(Exception $e) {
- $FAIL = true;
- echo $e->getMessage();
- return false;
- }
-
- return $info;
- }
-
- // Algorithm - Steve Blinch (BlitzAffe Online, http://www.blitzaffe.com)
- $statfile = '/proc/stat';
- if (!file_exists($statfile)) return false;
-
- $fd = fopen($statfile,"r");
- if (!$fd) return false;
-
- $statinfo = explode("\n",fgets($fd, 1024));
- fclose($fd);
- foreach($statinfo as $line) {
- $info = explode(" ",$line);
- if($info[0]=="cpu") {
- array_shift($info); // pop off "cpu"
- if(!$info[0]) array_shift($info); // pop off blank space (if any)
- return $info;
- }
- }
-
- return false;
-
- }
-
- /* NOT IMPLEMENTED */
- function MemInfo()
- {
- /*
-
- total: used: free: shared: buffers: cached:
-Mem: 1055289344 917299200 137990144 0 165437440 599773184
-Swap: 2146775040 11055104 2135719936
-MemTotal: 1030556 kB
-MemFree: 134756 kB
-MemShared: 0 kB
-Buffers: 161560 kB
-Cached: 581384 kB
-SwapCached: 4332 kB
-Active: 494468 kB
-Inact_dirty: 322856 kB
-Inact_clean: 24256 kB
-Inact_target: 168316 kB
-HighTotal: 131064 kB
-HighFree: 1024 kB
-LowTotal: 899492 kB
-LowFree: 133732 kB
-SwapTotal: 2096460 kB
-SwapFree: 2085664 kB
-Committed_AS: 348732 kB
- */
- }
-
-
- /*
- Remember that this is client load, not db server load!
- */
- var $_lastLoad;
- function CPULoad()
- {
- $info = $this->_CPULoad();
- if (!$info) return false;
-
- if (strncmp(PHP_OS,'WIN',3)==0) {
- return (integer) $info[0];
- }else {
- if (empty($this->_lastLoad)) {
- sleep(1);
- $this->_lastLoad = $info;
- $info = $this->_CPULoad();
- }
-
- $last = $this->_lastLoad;
- $this->_lastLoad = $info;
-
- $d_user = $info[0] - $last[0];
- $d_nice = $info[1] - $last[1];
- $d_system = $info[2] - $last[2];
- $d_idle = $info[3] - $last[3];
-
- //printf("Delta - User: %f Nice: %f System: %f Idle: %fParameter Value Description
",$d_user,$d_nice,$d_system,$d_idle);
-
- $total=$d_user+$d_nice+$d_system+$d_idle;
- if ($total<1) $total=1;
- return 100*($d_user+$d_nice+$d_system)/$total;
- }
- }
-
- function Tracer($sql)
- {
- $perf_table = adodb_perf::table();
- $saveE = $this->conn->fnExecute;
- $this->conn->fnExecute = false;
-
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $sqlq = $this->conn->qstr($sql);
- $arr = $this->conn->GetArray(
-"select count(*),tracer
- from $perf_table where sql1=$sqlq
- group by tracer
- order by 1 desc");
- $s = '';
- if ($arr) {
- $s .= 'Scripts Affected
';
- foreach($arr as $k) {
- $s .= sprintf("%4d",$k[0]).' '.strip_tags($k[1]).'
';
- }
- }
-
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $ADODB_CACHE_MODE = $save;
- $this->conn->fnExecute = $saveE;
- return $s;
- }
-
- /*
- Explain Plan for $sql.
- If only a snippet of the $sql is passed in, then $partial will hold the crc32 of the
- actual sql.
- */
- function Explain($sql,$partial=false)
- {
- return false;
- }
-
- function InvalidSQL($numsql = 10)
- {
-
- if (isset($_GET['sql'])) return;
- $s = 'Invalid SQL
';
- $saveE = $this->conn->fnExecute;
- $this->conn->fnExecute = false;
- $perf_table = adodb_perf::table();
- $rs = $this->conn->SelectLimit("select distinct count(*),sql1,tracer as error_msg from $perf_table where tracer like 'ERROR:%' group by sql1,tracer order by 1 desc",$numsql);//,$numsql);
- $this->conn->fnExecute = $saveE;
- if ($rs) {
- $s .= rs2html($rs,false,false,false,false);
- } else
- return "Suspicious SQL
-The following SQL have high average execution times
-
";
-
- }
-
- function CheckMemory()
- {
- return '';
- }
-
-
- function SuspiciousSQL($numsql=10)
- {
- return adodb_perf::_SuspiciousSQL($numsql);
- }
-
- function ExpensiveSQL($numsql=10)
- {
- return adodb_perf::_ExpensiveSQL($numsql);
- }
-
-
- /*
- This reports the percentage of load on the instance due to the most
- expensive few SQL statements. Tuning these statements can often
- make huge improvements in overall system performance.
- */
- function _ExpensiveSQL($numsql = 10)
- {
- global $ADODB_FETCH_MODE;
-
- $perf_table = adodb_perf::table();
- $saveE = $this->conn->fnExecute;
- $this->conn->fnExecute = false;
-
- if (isset($_GET['expe']) && isset($_GET['sql'])) {
- $partial = !empty($_GET['part']);
- echo "".$this->Explain($_GET['sql'],$partial)."\n";
- }
-
- if (isset($_GET['sql'])) return;
-
- $sql1 = $this->sql1;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $rs = $this->conn->SelectLimit(
- "select sum(timer) as total,$sql1,count(*),max(timer) as max_timer,min(timer) as min_timer
- from $perf_table
- where {$this->conn->upperCase}({$this->conn->substr}(sql0,1,5)) not in ('DROP ','INSER','COMMI','CREAT')
- and (tracer is null or tracer not like 'ERROR:%')
- group by sql1
- having count(*)>1
- order by 1 desc",$numsql);
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $this->conn->fnExecute = $saveE;
- $ADODB_FETCH_MODE = $save;
- if (!$rs) return " \n";
- $max = $this->maxLength;
- while (!$rs->EOF) {
- $sql = $rs->fields[1];
- $raw = urlencode($sql);
- if (strlen($raw)>$max-100) {
- $sql2 = substr($sql,0,$max-500);
- $raw = urlencode($sql2).'&part='.crc32($sql);
- }
- $prefix = "";
- $suffix = "";
- if ($this->explain == false || strlen($prefix)>$max) {
- $suffix = ' ... String too long for GET parameter: '.strlen($prefix).'';
- $prefix = '';
- }
- $s .= "Avg Time Count SQL Max Min ";
- $rs->MoveNext();
- }
- return $s."".adodb_round($rs->fields[0],6)." ".$rs->fields[2]." ".$prefix.htmlspecialchars($sql).$suffix."".
- " ".$rs->fields[3]." ".$rs->fields[4]." Expensive SQL
-Tuning the following SQL could reduce the server load substantially
-
";
- }
-
- /*
- Raw function to return parameter value from $settings.
- */
- function DBParameter($param)
- {
- if (empty($this->settings[$param])) return false;
- $sql = $this->settings[$param][1];
- return $this->_DBParameter($sql);
- }
-
- /*
- Raw function returning array of poll paramters
- */
- function PollParameters()
- {
- $arr[0] = (float)$this->DBParameter('data cache hit ratio');
- $arr[1] = (float)$this->DBParameter('data reads');
- $arr[2] = (float)$this->DBParameter('data writes');
- $arr[3] = (integer) $this->DBParameter('current connections');
- return $arr;
- }
-
- /*
- Low-level Get Database Parameter
- */
- function _DBParameter($sql)
- {
- $savelog = $this->conn->LogSQL(false);
- if (is_array($sql)) {
- global $ADODB_FETCH_MODE;
-
- $sql1 = $sql[0];
- $key = $sql[1];
- if (sizeof($sql)>2) $pos = $sql[2];
- else $pos = 1;
- if (sizeof($sql)>3) $coef = $sql[3];
- else $coef = false;
- $ret = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $rs = $this->conn->Execute($sql1);
-
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- if ($rs) {
- while (!$rs->EOF) {
- $keyf = reset($rs->fields);
- if (trim($keyf) == $key) {
- $ret = $rs->fields[$pos];
- if ($coef) $ret *= $coef;
- break;
- }
- $rs->MoveNext();
- }
- $rs->Close();
- }
- $this->conn->LogSQL($savelog);
- return $ret;
- } else {
- if (strncmp($sql,'=',1) == 0) {
- $fn = substr($sql,1);
- return $this->$fn();
- }
- $sql = str_replace('$DATABASE',$this->conn->database,$sql);
- $ret = $this->conn->GetOne($sql);
- $this->conn->LogSQL($savelog);
-
- return $ret;
- }
- }
-
- /*
- Warn if cache ratio falls below threshold. Displayed in "Description" column.
- */
- function WarnCacheRatio($val)
- {
- if ($val < $this->warnRatio)
- return 'Cache ratio should be at least '.$this->warnRatio.'%';
- else return '';
- }
-
- function clearsql()
- {
- $perf_table = adodb_perf::table();
- $this->conn->Execute("delete from $perf_table where created<".$this->conn->sysTimeStamp);
- }
- /***********************************************************************************************/
- // HIGH LEVEL UI FUNCTIONS
- /***********************************************************************************************/
-
-
- function UI($pollsecs=5)
- {
- global $ADODB_LOG_CONN;
-
- $perf_table = adodb_perf::table();
- $conn = $this->conn;
-
- $app = $conn->host;
- if ($conn->host && $conn->database) $app .= ', db=';
- $app .= $conn->database;
-
- if ($app) $app .= ', ';
- $savelog = $this->conn->LogSQL(false);
- $info = $conn->ServerInfo();
- if (isset($_GET['clearsql'])) {
- $this->clearsql();
- }
- $this->conn->LogSQL($savelog);
-
- // magic quotes
-
- if (isset($_GET['sql']) && get_magic_quotes_gpc()) {
- $_GET['sql'] = $_GET['sql'] = str_replace(array("\\'",'\"'),array("'",'"'),$_GET['sql']);
- }
-
- if (!isset($_SESSION['ADODB_PERF_SQL'])) $nsql = $_SESSION['ADODB_PERF_SQL'] = 10;
- else $nsql = $_SESSION['ADODB_PERF_SQL'];
-
- $app .= $info['description'];
-
-
- if (isset($_GET['do'])) $do = $_GET['do'];
- else if (isset($_POST['do'])) $do = $_POST['do'];
- else if (isset($_GET['sql'])) $do = 'viewsql';
- else $do = 'stats';
-
- if (isset($_GET['nsql'])) {
- if ($_GET['nsql'] > 0) $nsql = $_SESSION['ADODB_PERF_SQL'] = (integer) $_GET['nsql'];
- }
- echo " \n";
- $max = $this->maxLength;
- while (!$rs->EOF) {
- $sql = $rs->fields[1];
- $raw = urlencode($sql);
- if (strlen($raw)>$max-100) {
- $sql2 = substr($sql,0,$max-500);
- $raw = urlencode($sql2).'&part='.crc32($sql);
- }
- $prefix = "";
- $suffix = "";
- if($this->explain == false || strlen($prefix>$max)) {
- $prefix = '';
- $suffix = '';
- }
- $s .= "Load Count SQL Max Min ";
- $rs->MoveNext();
- }
- return $s."".adodb_round($rs->fields[0],6)." ".$rs->fields[2]." ".$prefix.htmlspecialchars($sql).$suffix."".
- " ".$rs->fields[3]." ".$rs->fields[4]." ";
- else $form = " ";
-
- $allowsql = !defined('ADODB_PERF_NO_RUN_SQL');
- global $ADODB_PERF_MIN;
- $app .= " (Min sql timing \$ADODB_PERF_MIN=$ADODB_PERF_MIN secs)";
-
- if (empty($_GET['hidem']))
- echo "
";
-
-
- switch ($do) {
- default:
- case 'stats':
- if (empty($ADODB_LOG_CONN))
- echo "
- ADOdb Performance Monitor for $app
- Performance Stats View SQL
- View Tables Poll Stats",
- $allowsql ? ' Run SQL' : '',
- "$form",
- "
";
- echo $this->HealthCheck();
- //$this->conn->debug=1;
- echo $this->CheckMemory();
- break;
- case 'poll':
- $self = htmlspecialchars($_SERVER['PHP_SELF']);
- echo "";
- break;
- case 'poll2':
- echo "";
- $this->Poll($pollsecs);
- break;
-
- case 'dosql':
- if (!$allowsql) break;
-
- $this->DoSQLForm();
- break;
- case 'viewsql':
- if (empty($_GET['hidem']))
- echo " Clear SQL Log
";
- echo($this->SuspiciousSQL($nsql));
- echo($this->ExpensiveSQL($nsql));
- echo($this->InvalidSQL($nsql));
- break;
- case 'tables':
- echo $this->Tables(); break;
- }
- global $ADODB_vers;
- echo " '.$this->titles;
-
- $oldc = false;
- $bgc = '';
- foreach($this->settings as $name => $arr) {
- if ($arr === false) break;
-
- if (!is_string($name)) {
- if ($cli) $html .= " -- $arr -- \n";
- else $html .= "'.$this->conn->databaseType.'
color> ";
- continue;
- }
-
- if (!is_array($arr)) break;
- $category = $arr[0];
- $how = $arr[1];
- if (sizeof($arr)>2) $desc = $arr[2];
- else $desc = ' ';
-
-
- if ($category == 'HIDE') continue;
-
- $val = $this->_DBParameter($how);
-
- if ($desc && strncmp($desc,"=",1) === 0) {
- $fn = substr($desc,1);
- $desc = $this->$fn($val);
- }
-
- if ($val === false) {
- $m = $this->conn->ErrorMsg();
- $val = "Error: $m";
- } else {
- if (is_numeric($val) && $val >= 256*1024) {
- if ($val % (1024*1024) == 0) {
- $val /= (1024*1024);
- $val .= 'M';
- } else if ($val % 1024 == 0) {
- $val /= 1024;
- $val .= 'K';
- }
- //$val = htmlspecialchars($val);
- }
- }
- if ($category != $oldc) {
- $oldc = $category;
- //$bgc = ($bgc == ' bgcolor='.$this->color) ? ' bgcolor=white' : ' bgcolor='.$this->color;
- }
- if (strlen($desc)==0) $desc = ' ';
- if (strlen($val)==0) $val = ' ';
- if ($cli) {
- $html .= str_replace(' ','',sprintf($this->cliFormat,strip_tags($name),strip_tags($val),strip_tags($desc)));
-
- }else {
- $html .= "$arr \n";
- }
- }
-
- if (!$cli) $html .= "".$name.' '.$val.' '.$desc."
";
- rs2html($rs);
- }
- } else {
- $e1 = (integer) $this->conn->ErrorNo();
- $e2 = $this->conn->ErrorMsg();
- if (($e1) || ($e2)) {
- if (empty($e1)) $e1 = '-1'; // postgresql fix
- print ' '.$e1.': '.$e2;
- } else {
- print "
- * optimizeTables( 'tableA');
- *
- *
- * optimizeTables( 'tableA', 'tableB', 'tableC');
- *
- *
- * optimizeTables( 'tableA', 'tableB', ADODB_OPT_LOW);
- *
- *
- * @param string table name of the table to optimize
- * @param int mode optimization-mode
- * ADODB_OPT_HIGH for full optimization
- * ADODB_OPT_LOW for CPU-less optimization
- * Default is LOW ADODB_OPT_LOW
- * @author Markus Staab
- * @return Returns true on success and false on error
- */
- function OptimizeTables()
- {
- $args = func_get_args();
- $numArgs = func_num_args();
-
- if ( $numArgs == 0) return false;
-
- $mode = ADODB_OPT_LOW;
- $lastArg = $args[ $numArgs - 1];
- if ( !is_string($lastArg)) {
- $mode = $lastArg;
- unset( $args[ $numArgs - 1]);
- }
-
- foreach( $args as $table) {
- $this->optimizeTable( $table, $mode);
- }
- }
-
- /**
- * Reorganise the table-indices/statistics/.. depending on the given mode.
- * Default Implementation throws an error.
- *
- * @param string table name of the table to optimize
- * @param int mode optimization-mode
- * ADODB_OPT_HIGH for full optimization
- * ADODB_OPT_LOW for CPU-less optimization
- * Default is LOW ADODB_OPT_LOW
- * @author Markus Staab
- * @return Returns true on success and false on error
- */
- function OptimizeTable( $table, $mode = ADODB_OPT_LOW)
- {
- ADOConnection::outp( sprintf( "MetaTables() and
- * optimize each using optmizeTable()
- *
- * @author Markus Staab
- * @return Returns true on success and false on error
- */
- function optimizeDatabase()
- {
- $conn = $this->conn;
- if ( !$conn) return false;
-
- $tables = $conn->MetaTables( 'TABLES');
- if ( !$tables ) return false;
-
- foreach( $tables as $table) {
- if ( !$this->optimizeTable( $table)) {
- return false;
- }
- }
-
- return true;
- }
- // end hack
-}
diff --git a/vendor/adodb/adodb-php/adodb-php4.inc.php b/vendor/adodb/adodb-php/adodb-php4.inc.php
deleted file mode 100644
index 132f25d0..00000000
--- a/vendor/adodb/adodb-php/adodb-php4.inc.php
+++ /dev/null
@@ -1,16 +0,0 @@
- 4 digit year conversion. The maximum is billions of years in the
-future, but this is a theoretical limit as the computation of that year
-would take too long with the current implementation of adodb_mktime().
-
-This library replaces native functions as follows:
-
-
- getdate() with adodb_getdate()
- date() with adodb_date()
- gmdate() with adodb_gmdate()
- mktime() with adodb_mktime()
- gmmktime() with adodb_gmmktime()
- strftime() with adodb_strftime()
- strftime() with adodb_gmstrftime()
-
-
-The parameters are identical, except that adodb_date() accepts a subset
-of date()'s field formats. Mktime() will convert from local time to GMT,
-and date() will convert from GMT to local time, but daylight savings is
-not handled currently.
-
-This library is independant of the rest of ADOdb, and can be used
-as standalone code.
-
-PERFORMANCE
-
-For high speed, this library uses the native date functions where
-possible, and only switches to PHP code when the dates fall outside
-the 32-bit signed integer range.
-
-GREGORIAN CORRECTION
-
-Pope Gregory shortened October of A.D. 1582 by ten days. Thursday,
-October 4, 1582 (Julian) was followed immediately by Friday, October 15,
-1582 (Gregorian).
-
-Since 0.06, we handle this correctly, so:
-
-adodb_mktime(0,0,0,10,15,1582) - adodb_mktime(0,0,0,10,4,1582)
- == 24 * 3600 (1 day)
-
-=============================================================================
-
-COPYRIGHT
-
-(c) 2003-2014 John Lim and released under BSD-style license except for code by
-jackbbs, which includes adodb_mktime, adodb_get_gmt_diff, adodb_is_leap_year
-and originally found at http://www.php.net/manual/en/function.mktime.php
-
-=============================================================================
-
-BUG REPORTS
-
-These should be posted to the ADOdb forums at
-
- http://phplens.com/lens/lensforum/topics.php?id=4
-
-=============================================================================
-
-FUNCTION DESCRIPTIONS
-
-** FUNCTION adodb_time()
-
-Returns the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) as an unsigned integer.
-
-** FUNCTION adodb_getdate($date=false)
-
-Returns an array containing date information, as getdate(), but supports
-dates greater than 1901 to 2038. The local date/time format is derived from a
-heuristic the first time adodb_getdate is called.
-
-
-** FUNCTION adodb_date($fmt, $timestamp = false)
-
-Convert a timestamp to a formatted local date. If $timestamp is not defined, the
-current timestamp is used. Unlike the function date(), it supports dates
-outside the 1901 to 2038 range.
-
-The format fields that adodb_date supports:
-
-
- a - "am" or "pm"
- A - "AM" or "PM"
- d - day of the month, 2 digits with leading zeros; i.e. "01" to "31"
- D - day of the week, textual, 3 letters; e.g. "Fri"
- F - month, textual, long; e.g. "January"
- g - hour, 12-hour format without leading zeros; i.e. "1" to "12"
- G - hour, 24-hour format without leading zeros; i.e. "0" to "23"
- h - hour, 12-hour format; i.e. "01" to "12"
- H - hour, 24-hour format; i.e. "00" to "23"
- i - minutes; i.e. "00" to "59"
- j - day of the month without leading zeros; i.e. "1" to "31"
- l (lowercase 'L') - day of the week, textual, long; e.g. "Friday"
- L - boolean for whether it is a leap year; i.e. "0" or "1"
- m - month; i.e. "01" to "12"
- M - month, textual, 3 letters; e.g. "Jan"
- n - month without leading zeros; i.e. "1" to "12"
- O - Difference to Greenwich time in hours; e.g. "+0200"
- Q - Quarter, as in 1, 2, 3, 4
- r - RFC 2822 formatted date; e.g. "Thu, 21 Dec 2000 16:01:07 +0200"
- s - seconds; i.e. "00" to "59"
- S - English ordinal suffix for the day of the month, 2 characters;
- i.e. "st", "nd", "rd" or "th"
- t - number of days in the given month; i.e. "28" to "31"
- T - Timezone setting of this machine; e.g. "EST" or "MDT"
- U - seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
- w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday)
- Y - year, 4 digits; e.g. "1999"
- y - year, 2 digits; e.g. "99"
- z - day of the year; i.e. "0" to "365"
- Z - timezone offset in seconds (i.e. "-43200" to "43200").
- The offset for timezones west of UTC is always negative,
- and for those east of UTC is always positive.
-
-
-Unsupported:
-
- B - Swatch Internet time
- I (capital i) - "1" if Daylight Savings Time, "0" otherwise.
- W - ISO-8601 week number of year, weeks starting on Monday
-
-
-
-
-** FUNCTION adodb_date2($fmt, $isoDateString = false)
-Same as adodb_date, but 2nd parameter accepts iso date, eg.
-
- adodb_date2('d-M-Y H:i','2003-12-25 13:01:34');
-
-
-** FUNCTION adodb_gmdate($fmt, $timestamp = false)
-
-Convert a timestamp to a formatted GMT date. If $timestamp is not defined, the
-current timestamp is used. Unlike the function date(), it supports dates
-outside the 1901 to 2038 range.
-
-
-** FUNCTION adodb_mktime($hr, $min, $sec[, $month, $day, $year])
-
-Converts a local date to a unix timestamp. Unlike the function mktime(), it supports
-dates outside the 1901 to 2038 range. All parameters are optional.
-
-
-** FUNCTION adodb_gmmktime($hr, $min, $sec [, $month, $day, $year])
-
-Converts a gmt date to a unix timestamp. Unlike the function gmmktime(), it supports
-dates outside the 1901 to 2038 range. Differs from gmmktime() in that all parameters
-are currently compulsory.
-
-** FUNCTION adodb_gmstrftime($fmt, $timestamp = false)
-Convert a timestamp to a formatted GMT date.
-
-** FUNCTION adodb_strftime($fmt, $timestamp = false)
-
-Convert a timestamp to a formatted local date. Internally converts $fmt into
-adodb_date format, then echo result.
-
-For best results, you can define the local date format yourself. Define a global
-variable $ADODB_DATE_LOCALE which is an array, 1st element is date format using
-adodb_date syntax, and 2nd element is the time format, also in adodb_date syntax.
-
- eg. $ADODB_DATE_LOCALE = array('d/m/Y','H:i:s');
-
- Supported format codes:
-
-
- %a - abbreviated weekday name according to the current locale
- %A - full weekday name according to the current locale
- %b - abbreviated month name according to the current locale
- %B - full month name according to the current locale
- %c - preferred date and time representation for the current locale
- %d - day of the month as a decimal number (range 01 to 31)
- %D - same as %m/%d/%y
- %e - day of the month as a decimal number, a single digit is preceded by a space (range ' 1' to '31')
- %h - same as %b
- %H - hour as a decimal number using a 24-hour clock (range 00 to 23)
- %I - hour as a decimal number using a 12-hour clock (range 01 to 12)
- %m - month as a decimal number (range 01 to 12)
- %M - minute as a decimal number
- %n - newline character
- %p - either `am' or `pm' according to the given time value, or the corresponding strings for the current locale
- %r - time in a.m. and p.m. notation
- %R - time in 24 hour notation
- %S - second as a decimal number
- %t - tab character
- %T - current time, equal to %H:%M:%S
- %x - preferred date representation for the current locale without the time
- %X - preferred time representation for the current locale without the date
- %y - year as a decimal number without a century (range 00 to 99)
- %Y - year as a decimal number including the century
- %Z - time zone or name or abbreviation
- %% - a literal `%' character
-
-
- Unsupported codes:
-
- %C - century number (the year divided by 100 and truncated to an integer, range 00 to 99)
- %g - like %G, but without the century.
- %G - The 4-digit year corresponding to the ISO week number (see %V).
- This has the same format and value as %Y, except that if the ISO week number belongs
- to the previous or next year, that year is used instead.
- %j - day of the year as a decimal number (range 001 to 366)
- %u - weekday as a decimal number [1,7], with 1 representing Monday
- %U - week number of the current year as a decimal number, starting
- with the first Sunday as the first day of the first week
- %V - The ISO 8601:1988 week number of the current year as a decimal number,
- range 01 to 53, where week 1 is the first week that has at least 4 days in the
- current year, and with Monday as the first day of the week. (Use %G or %g for
- the year component that corresponds to the week number for the specified timestamp.)
- %w - day of the week as a decimal, Sunday being 0
- %W - week number of the current year as a decimal number, starting with the
- first Monday as the first day of the first week
-
-
-=============================================================================
-
-NOTES
-
-Useful url for generating test timestamps:
- http://www.4webhelp.net/us/timestamp.php
-
-Possible future optimizations include
-
-a. Using an algorithm similar to Plauger's in "The Standard C Library"
-(page 428, xttotm.c _Ttotm() function). Plauger's algorithm will not
-work outside 32-bit signed range, so i decided not to implement it.
-
-b. Implement daylight savings, which looks awfully complicated, see
- http://webexhibits.org/daylightsaving/
-
-
-CHANGELOG
-- 16 Jan 2011 0.36
-Added adodb_time() which returns current time. If > 2038, will return as float
-
-- 7 Feb 2011 0.35
-Changed adodb_date to be symmetric with adodb_mktime. See $jan1_71. fix for bc.
-
-- 13 July 2010 0.34
-Changed adodb_get_gm_diff to use DateTimeZone().
-
-- 11 Feb 2008 0.33
-* Bug in 0.32 fix for hour handling. Fixed.
-
-- 1 Feb 2008 0.32
-* Now adodb_mktime(0,0,0,12+$m,20,2040) works properly.
-
-- 10 Jan 2008 0.31
-* Now adodb_mktime(0,0,0,24,1,2037) works correctly.
-
-- 15 July 2007 0.30
-Added PHP 5.2.0 compatability fixes.
- * gmtime behaviour for 1970 has changed. We use the actual date if it is between 1970 to 2038 to get the
- * timezone, otherwise we use the current year as the baseline to retrieve the timezone.
- * Also the timezone's in php 5.2.* support historical data better, eg. if timezone today was +8, but
- in 1970 it was +7:30, then php 5.2 return +7:30, while this library will use +8.
- *
-
-- 19 March 2006 0.24
-Changed strftime() locale detection, because some locales prepend the day of week to the date when %c is used.
-
-- 10 Feb 2006 0.23
-PHP5 compat: when we detect PHP5, the RFC2822 format for gmt 0000hrs is changed from -0000 to +0000.
- In PHP4, we will still use -0000 for 100% compat with PHP4.
-
-- 08 Sept 2005 0.22
-In adodb_date2(), $is_gmt not supported properly. Fixed.
-
-- 18 July 2005 0.21
-In PHP 4.3.11, the 'r' format has changed. Leading 0 in day is added. Changed for compat.
-Added support for negative months in adodb_mktime().
-
-- 24 Feb 2005 0.20
-Added limited strftime/gmstrftime support. x10 improvement in performance of adodb_date().
-
-- 21 Dec 2004 0.17
-In adodb_getdate(), the timestamp was accidentally converted to gmt when $is_gmt is false.
-Also adodb_mktime(0,0,0) did not work properly. Both fixed thx Mauro.
-
-- 17 Nov 2004 0.16
-Removed intval typecast in adodb_mktime() for secs, allowing:
- adodb_mktime(0,0,0 + 2236672153,1,1,1934);
-Suggested by Ryan.
-
-- 18 July 2004 0.15
-All params in adodb_mktime were formerly compulsory. Now only the hour, min, secs is compulsory.
-This brings it more in line with mktime (still not identical).
-
-- 23 June 2004 0.14
-
-Allow you to define your own daylights savings function, adodb_daylight_sv.
-If the function is defined (somewhere in an include), then you can correct for daylights savings.
-
-In this example, we apply daylights savings in June or July, adding one hour. This is extremely
-unrealistic as it does not take into account time-zone, geographic location, current year.
-
-function adodb_daylight_sv(&$arr, $is_gmt)
-{
- if ($is_gmt) return;
- $m = $arr['mon'];
- if ($m == 6 || $m == 7) $arr['hours'] += 1;
-}
-
-This is only called by adodb_date() and not by adodb_mktime().
-
-The format of $arr is
-Array (
- [seconds] => 0
- [minutes] => 0
- [hours] => 0
- [mday] => 1 # day of month, eg 1st day of the month
- [mon] => 2 # month (eg. Feb)
- [year] => 2102
- [yday] => 31 # days in current year
- [leap] => # true if leap year
- [ndays] => 28 # no of days in current month
- )
-
-
-- 28 Apr 2004 0.13
-Fixed adodb_date to properly support $is_gmt. Thx to Dimitar Angelov.
-
-- 20 Mar 2004 0.12
-Fixed month calculation error in adodb_date. 2102-June-01 appeared as 2102-May-32.
-
-- 26 Oct 2003 0.11
-Because of daylight savings problems (some systems apply daylight savings to
-January!!!), changed adodb_get_gmt_diff() to ignore daylight savings.
-
-- 9 Aug 2003 0.10
-Fixed bug with dates after 2038.
-See http://phplens.com/lens/lensforum/msgs.php?id=6980
-
-- 1 July 2003 0.09
-Added support for Q (Quarter).
-Added adodb_date2(), which accepts ISO date in 2nd param
-
-- 3 March 2003 0.08
-Added support for 'S' adodb_date() format char. Added constant ADODB_ALLOW_NEGATIVE_TS
-if you want PHP to handle negative timestamps between 1901 to 1969.
-
-- 27 Feb 2003 0.07
-All negative numbers handled by adodb now because of RH 7.3+ problems.
-See http://bugs.php.net/bug.php?id=20048&edit=2
-
-- 4 Feb 2003 0.06
-Fixed a typo, 1852 changed to 1582! This means that pre-1852 dates
-are now correctly handled.
-
-- 29 Jan 2003 0.05
-
-Leap year checking differs under Julian calendar (pre 1582). Also
-leap year code optimized by checking for most common case first.
-
-We also handle month overflow correctly in mktime (eg month set to 13).
-
-Day overflow for less than one month's days is supported.
-
-- 28 Jan 2003 0.04
-
-Gregorian correction handled. In PHP5, we might throw an error if
-mktime uses invalid dates around 5-14 Oct 1582. Released with ADOdb 3.10.
-Added limbo 5-14 Oct 1582 check, when we set to 15 Oct 1582.
-
-- 27 Jan 2003 0.03
-
-Fixed some more month problems due to gmt issues. Added constant ADODB_DATE_VERSION.
-Fixed calculation of days since start of year for <1970.
-
-- 27 Jan 2003 0.02
-
-Changed _adodb_getdate() to inline leap year checking for better performance.
-Fixed problem with time-zones west of GMT +0000.
-
-- 24 Jan 2003 0.01
-
-First implementation.
-*/
-
-
-/* Initialization */
-
-/*
- Version Number
-*/
-define('ADODB_DATE_VERSION',0.35);
-
-$ADODB_DATETIME_CLASS = (PHP_VERSION >= 5.2);
-
-/*
- This code was originally for windows. But apparently this problem happens
- also with Linux, RH 7.3 and later!
-
- glibc-2.2.5-34 and greater has been changed to return -1 for dates <
- 1970. This used to work. The problem exists with RedHat 7.3 and 8.0
- echo (mktime(0, 0, 0, 1, 1, 1960)); // prints -1
-
- References:
- http://bugs.php.net/bug.php?id=20048&edit=2
- http://lists.debian.org/debian-glibc/2002/debian-glibc-200205/msg00010.html
-*/
-
-if (!defined('ADODB_ALLOW_NEGATIVE_TS')) define('ADODB_NO_NEGATIVE_TS',1);
-
-function adodb_date_test_date($y1,$m,$d=13)
-{
- $h = round(rand()% 24);
- $t = adodb_mktime($h,0,0,$m,$d,$y1);
- $rez = adodb_date('Y-n-j H:i:s',$t);
- if ($h == 0) $h = '00';
- else if ($h < 10) $h = '0'.$h;
- if ("$y1-$m-$d $h:00:00" != $rez) {
- print "$y1 error, expected=$y1-$m-$d $h:00:00, adodb=$rez
";
- return false;
- }
- return true;
-}
-
-function adodb_date_test_strftime($fmt)
-{
- $s1 = strftime($fmt);
- $s2 = adodb_strftime($fmt);
-
- if ($s1 == $s2) return true;
-
- echo "error for $fmt, strftime=$s1, adodb=$s2
";
- return false;
-}
-
-/**
- Test Suite
-*/
-function adodb_date_test()
-{
-
- for ($m=-24; $m<=24; $m++)
- echo "$m :",adodb_date('d-m-Y',adodb_mktime(0,0,0,1+$m,20,2040)),"
";
-
- error_reporting(E_ALL);
- print "Testing adodb_date and adodb_mktime. version=".ADODB_DATE_VERSION.' PHP='.PHP_VERSION."
";
- @set_time_limit(0);
- $fail = false;
-
- // This flag disables calling of PHP native functions, so we can properly test the code
- if (!defined('ADODB_TEST_DATES')) define('ADODB_TEST_DATES',1);
-
- $t = time();
-
-
- $fmt = 'Y-m-d H:i:s';
- echo '';
- echo 'adodb: ',adodb_date($fmt,$t),'
';
-
- adodb_date_test_strftime('%Y %m %x %X');
- adodb_date_test_strftime("%A %d %B %Y");
- adodb_date_test_strftime("%H %M S");
-
- $t = adodb_mktime(0,0,0);
- if (!(adodb_date('Y-m-d') == date('Y-m-d'))) print 'Error in '.adodb_mktime(0,0,0).'
';
- echo 'php : ',date($fmt,$t),'
';
- echo '
';
-
- $t = adodb_mktime(0,0,0,6,1,2102);
- if (!(adodb_date('Y-m-d',$t) == '2102-06-01')) print 'Error in '.adodb_date('Y-m-d',$t).'
';
-
- $t = adodb_mktime(0,0,0,2,1,2102);
- if (!(adodb_date('Y-m-d',$t) == '2102-02-01')) print 'Error in '.adodb_date('Y-m-d',$t).'
';
-
-
- print "
';
-
- $t = adodb_mktime(0,0,0,2,29,1500);
- if (!(adodb_date('Y-m-d',$t) == '1500-02-29')) print 'Error in julian leap years
';
-
- $t = adodb_mktime(0,0,0,2,29,1700);
- if (!(adodb_date('Y-m-d',$t) == '1700-03-01')) print 'Error in gregorian leap years
';
-
- print adodb_mktime(0,0,0,10,4,1582).' ';
- print adodb_mktime(0,0,0,10,15,1582);
- $diff = (adodb_mktime(0,0,0,10,15,1582) - adodb_mktime(0,0,0,10,4,1582));
- if ($diff != 3600*24) print " Error in gregorian correction = ".($diff/3600/24)." days
";
-
- print " 15 Oct 1582, Fri=".(adodb_dow(1582,10,15) == 5 ? 'Fri' : 'Error')."
";
- print " 4 Oct 1582, Thu=".(adodb_dow(1582,10,4) == 4 ? 'Thu' : 'Error')."
";
-
- print "
';
- $t = adodb_mktime(0,0,0,4,33,1971);
- if (!(adodb_date('Y-m-d',$t) == '1971-05-03')) print 'Error in day overflow 2
';
- $t = adodb_mktime(0,0,0,1,60,1965);
- if (!(adodb_date('Y-m-d',$t) == '1965-03-01')) print 'Error in day overflow 3 '.adodb_date('Y-m-d',$t).'
';
- $t = adodb_mktime(0,0,0,12,32,1965);
- if (!(adodb_date('Y-m-d',$t) == '1966-01-01')) print 'Error in day overflow 4 '.adodb_date('Y-m-d',$t).'
';
- $t = adodb_mktime(0,0,0,12,63,1965);
- if (!(adodb_date('Y-m-d',$t) == '1966-02-01')) print 'Error in day overflow 5 '.adodb_date('Y-m-d',$t).'
';
- $t = adodb_mktime(0,0,0,13,3,1965);
- if (!(adodb_date('Y-m-d',$t) == '1966-01-03')) print 'Error in mth overflow 1
';
-
- print "Testing 2-digit => 4-digit year conversion
";
- if (adodb_year_digit_check(10) != 2010) print "Err 2-digit 2010
";
- if (adodb_year_digit_check(20) != 2020) print "Err 2-digit 2020
";
- if (adodb_year_digit_check(30) != 2030) print "Err 2-digit 2030
";
- if (adodb_year_digit_check(40) != 1940) print "Err 2-digit 1940
";
- if (adodb_year_digit_check(50) != 1950) print "Err 2-digit 1950
";
- if (adodb_year_digit_check(90) != 1990) print "Err 2-digit 1990
";
-
- // Test string formating
- print "
$s1
$s2
";
- }
- flush();
- for ($i=100; --$i > 0; ) {
-
- $ts = 3600.0*((rand()%60000)+(rand()%60000))+(rand()%60000);
- $s1 = date($fmt,$ts);
- $s2 = adodb_date($fmt,$ts);
- //print "$s1
$s2
- \"$s1\" (date len=".strlen($s1).")
- \"$s2\" (adodb_date len=".strlen($s2).")
";
- $fail = true;
- }
-
- $a1 = getdate($ts);
- $a2 = adodb_getdate($ts);
- $rez = array_diff($a1,$a2);
- if (sizeof($rez)>0) {
- print "Error getdate() $ts
";
- print_r($a1);
- print "
";
- print_r($a2);
- print "
";
- if (!$fail) print "
";
- }
-}
-adodb_date_gentable();
-
-for ($i=1970; $i > 1500; $i--) {
-
-echo "
$i ";
- adodb_date_test_date($i,1,1);
-}
-
-*/
-
-
-$_month_table_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31);
-$_month_table_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31);
-
-function adodb_validdate($y,$m,$d)
-{
-global $_month_table_normal,$_month_table_leaf;
-
- if (_adodb_is_leap_year($y)) $marr = $_month_table_leaf;
- else $marr = $_month_table_normal;
-
- if ($m > 12 || $m < 1) return false;
-
- if ($d > 31 || $d < 1) return false;
-
- if ($marr[$m] < $d) return false;
-
- if ($y < 1000 && $y > 3000) return false;
-
- return true;
-}
-
-/**
- Low-level function that returns the getdate() array. We have a special
- $fast flag, which if set to true, will return fewer array values,
- and is much faster as it does not calculate dow, etc.
-*/
-function _adodb_getdate($origd=false,$fast=false,$is_gmt=false)
-{
-static $YRS;
-global $_month_table_normal,$_month_table_leaf;
-
- $d = $origd - ($is_gmt ? 0 : adodb_get_gmt_diff_ts($origd));
- $_day_power = 86400;
- $_hour_power = 3600;
- $_min_power = 60;
-
- if ($d < -12219321600) $d -= 86400*10; // if 15 Oct 1582 or earlier, gregorian correction
-
- $_month_table_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31);
- $_month_table_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31);
-
- $d366 = $_day_power * 366;
- $d365 = $_day_power * 365;
-
- if ($d < 0) {
-
- if (empty($YRS)) $YRS = array(
- 1970 => 0,
- 1960 => -315619200,
- 1950 => -631152000,
- 1940 => -946771200,
- 1930 => -1262304000,
- 1920 => -1577923200,
- 1910 => -1893456000,
- 1900 => -2208988800,
- 1890 => -2524521600,
- 1880 => -2840140800,
- 1870 => -3155673600,
- 1860 => -3471292800,
- 1850 => -3786825600,
- 1840 => -4102444800,
- 1830 => -4417977600,
- 1820 => -4733596800,
- 1810 => -5049129600,
- 1800 => -5364662400,
- 1790 => -5680195200,
- 1780 => -5995814400,
- 1770 => -6311347200,
- 1760 => -6626966400,
- 1750 => -6942499200,
- 1740 => -7258118400,
- 1730 => -7573651200,
- 1720 => -7889270400,
- 1710 => -8204803200,
- 1700 => -8520336000,
- 1690 => -8835868800,
- 1680 => -9151488000,
- 1670 => -9467020800,
- 1660 => -9782640000,
- 1650 => -10098172800,
- 1640 => -10413792000,
- 1630 => -10729324800,
- 1620 => -11044944000,
- 1610 => -11360476800,
- 1600 => -11676096000);
-
- if ($is_gmt) $origd = $d;
- // The valid range of a 32bit signed timestamp is typically from
- // Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT
- //
-
- # old algorithm iterates through all years. new algorithm does it in
- # 10 year blocks
-
- /*
- # old algo
- for ($a = 1970 ; --$a >= 0;) {
- $lastd = $d;
-
- if ($leaf = _adodb_is_leap_year($a)) $d += $d366;
- else $d += $d365;
-
- if ($d >= 0) {
- $year = $a;
- break;
- }
- }
- */
-
- $lastsecs = 0;
- $lastyear = 1970;
- foreach($YRS as $year => $secs) {
- if ($d >= $secs) {
- $a = $lastyear;
- break;
- }
- $lastsecs = $secs;
- $lastyear = $year;
- }
-
- $d -= $lastsecs;
- if (!isset($a)) $a = $lastyear;
-
- //echo ' yr=',$a,' ', $d,'.';
-
- for (; --$a >= 0;) {
- $lastd = $d;
-
- if ($leaf = _adodb_is_leap_year($a)) $d += $d366;
- else $d += $d365;
-
- if ($d >= 0) {
- $year = $a;
- break;
- }
- }
- /**/
-
- $secsInYear = 86400 * ($leaf ? 366 : 365) + $lastd;
-
- $d = $lastd;
- $mtab = ($leaf) ? $_month_table_leaf : $_month_table_normal;
- for ($a = 13 ; --$a > 0;) {
- $lastd = $d;
- $d += $mtab[$a] * $_day_power;
- if ($d >= 0) {
- $month = $a;
- $ndays = $mtab[$a];
- break;
- }
- }
-
- $d = $lastd;
- $day = $ndays + ceil(($d+1) / ($_day_power));
-
- $d += ($ndays - $day+1)* $_day_power;
- $hour = floor($d/$_hour_power);
-
- } else {
- for ($a = 1970 ;; $a++) {
- $lastd = $d;
-
- if ($leaf = _adodb_is_leap_year($a)) $d -= $d366;
- else $d -= $d365;
- if ($d < 0) {
- $year = $a;
- break;
- }
- }
- $secsInYear = $lastd;
- $d = $lastd;
- $mtab = ($leaf) ? $_month_table_leaf : $_month_table_normal;
- for ($a = 1 ; $a <= 12; $a++) {
- $lastd = $d;
- $d -= $mtab[$a] * $_day_power;
- if ($d < 0) {
- $month = $a;
- $ndays = $mtab[$a];
- break;
- }
- }
- $d = $lastd;
- $day = ceil(($d+1) / $_day_power);
- $d = $d - ($day-1) * $_day_power;
- $hour = floor($d /$_hour_power);
- }
-
- $d -= $hour * $_hour_power;
- $min = floor($d/$_min_power);
- $secs = $d - $min * $_min_power;
- if ($fast) {
- return array(
- 'seconds' => $secs,
- 'minutes' => $min,
- 'hours' => $hour,
- 'mday' => $day,
- 'mon' => $month,
- 'year' => $year,
- 'yday' => floor($secsInYear/$_day_power),
- 'leap' => $leaf,
- 'ndays' => $ndays
- );
- }
-
-
- $dow = adodb_dow($year,$month,$day);
-
- return array(
- 'seconds' => $secs,
- 'minutes' => $min,
- 'hours' => $hour,
- 'mday' => $day,
- 'wday' => $dow,
- 'mon' => $month,
- 'year' => $year,
- 'yday' => floor($secsInYear/$_day_power),
- 'weekday' => gmdate('l',$_day_power*(3+$dow)),
- 'month' => gmdate('F',mktime(0,0,0,$month,2,1971)),
- 0 => $origd
- );
-}
-/*
- if ($isphp5)
- $dates .= sprintf('%s%04d',($gmt<=0)?'+':'-',abs($gmt)/36);
- else
- $dates .= sprintf('%s%04d',($gmt<0)?'+':'-',abs($gmt)/36);
- break;*/
-function adodb_tz_offset($gmt,$isphp5)
-{
- $zhrs = abs($gmt)/3600;
- $hrs = floor($zhrs);
- if ($isphp5)
- return sprintf('%s%02d%02d',($gmt<=0)?'+':'-',floor($zhrs),($zhrs-$hrs)*60);
- else
- return sprintf('%s%02d%02d',($gmt<0)?'+':'-',floor($zhrs),($zhrs-$hrs)*60);
-}
-
-
-function adodb_gmdate($fmt,$d=false)
-{
- return adodb_date($fmt,$d,true);
-}
-
-// accepts unix timestamp and iso date format in $d
-function adodb_date2($fmt, $d=false, $is_gmt=false)
-{
- if ($d !== false) {
- if (!preg_match(
- "|^([0-9]{4})[-/\.]?([0-9]{1,2})[-/\.]?([0-9]{1,2})[ -]?(([0-9]{1,2}):?([0-9]{1,2}):?([0-9\.]{1,4}))?|",
- ($d), $rr)) return adodb_date($fmt,false,$is_gmt);
-
- if ($rr[1] <= 100 && $rr[2]<= 1) return adodb_date($fmt,false,$is_gmt);
-
- // h-m-s-MM-DD-YY
- if (!isset($rr[5])) $d = adodb_mktime(0,0,0,$rr[2],$rr[3],$rr[1],false,$is_gmt);
- else $d = @adodb_mktime($rr[5],$rr[6],$rr[7],$rr[2],$rr[3],$rr[1],false,$is_gmt);
- }
-
- return adodb_date($fmt,$d,$is_gmt);
-}
-
-
-/**
- Return formatted date based on timestamp $d
-*/
-function adodb_date($fmt,$d=false,$is_gmt=false)
-{
-static $daylight;
-global $ADODB_DATETIME_CLASS;
-static $jan1_1971;
-
-
- if (!isset($daylight)) {
- $daylight = function_exists('adodb_daylight_sv');
- if (empty($jan1_1971)) $jan1_1971 = mktime(0,0,0,1,1,1971); // we only use date() when > 1970 as adodb_mktime() only uses mktime() when > 1970
- }
-
- if ($d === false) return ($is_gmt)? @gmdate($fmt): @date($fmt);
- if (!defined('ADODB_TEST_DATES')) {
- if ((abs($d) <= 0x7FFFFFFF)) { // check if number in 32-bit signed range
-
- if (!defined('ADODB_NO_NEGATIVE_TS') || $d >= $jan1_1971) // if windows, must be +ve integer
- return ($is_gmt)? @gmdate($fmt,$d): @date($fmt,$d);
-
- }
- }
- $_day_power = 86400;
-
- $arr = _adodb_getdate($d,true,$is_gmt);
-
- if ($daylight) adodb_daylight_sv($arr, $is_gmt);
-
- $year = $arr['year'];
- $month = $arr['mon'];
- $day = $arr['mday'];
- $hour = $arr['hours'];
- $min = $arr['minutes'];
- $secs = $arr['seconds'];
-
- $max = strlen($fmt);
- $dates = '';
-
- $isphp5 = PHP_VERSION >= 5;
-
- /*
- at this point, we have the following integer vars to manipulate:
- $year, $month, $day, $hour, $min, $secs
- */
- for ($i=0; $i < $max; $i++) {
- switch($fmt[$i]) {
- case 'e':
- $dates .= date('e');
- break;
- case 'T':
- if ($ADODB_DATETIME_CLASS) {
- $dt = new DateTime();
- $dt->SetDate($year,$month,$day);
- $dates .= $dt->Format('T');
- } else
- $dates .= date('T');
- break;
- // YEAR
- case 'L': $dates .= $arr['leap'] ? '1' : '0'; break;
- case 'r': // Thu, 21 Dec 2000 16:01:07 +0200
-
- // 4.3.11 uses '04 Jun 2004'
- // 4.3.8 uses ' 4 Jun 2004'
- $dates .= gmdate('D',$_day_power*(3+adodb_dow($year,$month,$day))).', '
- . ($day<10?'0'.$day:$day) . ' '.date('M',mktime(0,0,0,$month,2,1971)).' '.$year.' ';
-
- if ($hour < 10) $dates .= '0'.$hour; else $dates .= $hour;
-
- if ($min < 10) $dates .= ':0'.$min; else $dates .= ':'.$min;
-
- if ($secs < 10) $dates .= ':0'.$secs; else $dates .= ':'.$secs;
-
- $gmt = adodb_get_gmt_diff($year,$month,$day);
-
- $dates .= ' '.adodb_tz_offset($gmt,$isphp5);
- break;
-
- case 'Y': $dates .= $year; break;
- case 'y': $dates .= substr($year,strlen($year)-2,2); break;
- // MONTH
- case 'm': if ($month<10) $dates .= '0'.$month; else $dates .= $month; break;
- case 'Q': $dates .= ($month+3)>>2; break;
- case 'n': $dates .= $month; break;
- case 'M': $dates .= date('M',mktime(0,0,0,$month,2,1971)); break;
- case 'F': $dates .= date('F',mktime(0,0,0,$month,2,1971)); break;
- // DAY
- case 't': $dates .= $arr['ndays']; break;
- case 'z': $dates .= $arr['yday']; break;
- case 'w': $dates .= adodb_dow($year,$month,$day); break;
- case 'l': $dates .= gmdate('l',$_day_power*(3+adodb_dow($year,$month,$day))); break;
- case 'D': $dates .= gmdate('D',$_day_power*(3+adodb_dow($year,$month,$day))); break;
- case 'j': $dates .= $day; break;
- case 'd': if ($day<10) $dates .= '0'.$day; else $dates .= $day; break;
- case 'S':
- $d10 = $day % 10;
- if ($d10 == 1) $dates .= 'st';
- else if ($d10 == 2 && $day != 12) $dates .= 'nd';
- else if ($d10 == 3) $dates .= 'rd';
- else $dates .= 'th';
- break;
-
- // HOUR
- case 'Z':
- $dates .= ($is_gmt) ? 0 : -adodb_get_gmt_diff($year,$month,$day); break;
- case 'O':
- $gmt = ($is_gmt) ? 0 : adodb_get_gmt_diff($year,$month,$day);
-
- $dates .= adodb_tz_offset($gmt,$isphp5);
- break;
-
- case 'H':
- if ($hour < 10) $dates .= '0'.$hour;
- else $dates .= $hour;
- break;
- case 'h':
- if ($hour > 12) $hh = $hour - 12;
- else {
- if ($hour == 0) $hh = '12';
- else $hh = $hour;
- }
-
- if ($hh < 10) $dates .= '0'.$hh;
- else $dates .= $hh;
- break;
-
- case 'G':
- $dates .= $hour;
- break;
-
- case 'g':
- if ($hour > 12) $hh = $hour - 12;
- else {
- if ($hour == 0) $hh = '12';
- else $hh = $hour;
- }
- $dates .= $hh;
- break;
- // MINUTES
- case 'i': if ($min < 10) $dates .= '0'.$min; else $dates .= $min; break;
- // SECONDS
- case 'U': $dates .= $d; break;
- case 's': if ($secs < 10) $dates .= '0'.$secs; else $dates .= $secs; break;
- // AM/PM
- // Note 00:00 to 11:59 is AM, while 12:00 to 23:59 is PM
- case 'a':
- if ($hour>=12) $dates .= 'pm';
- else $dates .= 'am';
- break;
- case 'A':
- if ($hour>=12) $dates .= 'PM';
- else $dates .= 'AM';
- break;
- default:
- $dates .= $fmt[$i]; break;
- // ESCAPE
- case "\\":
- $i++;
- if ($i < $max) $dates .= $fmt[$i];
- break;
- }
- }
- return $dates;
-}
-
-/**
- Returns a timestamp given a GMT/UTC time.
- Note that $is_dst is not implemented and is ignored.
-*/
-function adodb_gmmktime($hr,$min,$sec,$mon=false,$day=false,$year=false,$is_dst=false)
-{
- return adodb_mktime($hr,$min,$sec,$mon,$day,$year,$is_dst,true);
-}
-
-/**
- Return a timestamp given a local time. Originally by jackbbs.
- Note that $is_dst is not implemented and is ignored.
-
- Not a very fast algorithm - O(n) operation. Could be optimized to O(1).
-*/
-function adodb_mktime($hr,$min,$sec,$mon=false,$day=false,$year=false,$is_dst=false,$is_gmt=false)
-{
- if (!defined('ADODB_TEST_DATES')) {
-
- if ($mon === false) {
- return $is_gmt? @gmmktime($hr,$min,$sec): @mktime($hr,$min,$sec);
- }
-
- // for windows, we don't check 1970 because with timezone differences,
- // 1 Jan 1970 could generate negative timestamp, which is illegal
- $usephpfns = (1970 < $year && $year < 2038
- || !defined('ADODB_NO_NEGATIVE_TS') && (1901 < $year && $year < 2038)
- );
-
-
- if ($usephpfns && ($year + $mon/12+$day/365.25+$hr/(24*365.25) >= 2038)) $usephpfns = false;
-
- if ($usephpfns) {
- return $is_gmt ?
- @gmmktime($hr,$min,$sec,$mon,$day,$year):
- @mktime($hr,$min,$sec,$mon,$day,$year);
- }
- }
-
- $gmt_different = ($is_gmt) ? 0 : adodb_get_gmt_diff($year,$mon,$day);
-
- /*
- # disabled because some people place large values in $sec.
- # however we need it for $mon because we use an array...
- $hr = intval($hr);
- $min = intval($min);
- $sec = intval($sec);
- */
- $mon = intval($mon);
- $day = intval($day);
- $year = intval($year);
-
-
- $year = adodb_year_digit_check($year);
-
- if ($mon > 12) {
- $y = floor(($mon-1)/ 12);
- $year += $y;
- $mon -= $y*12;
- } else if ($mon < 1) {
- $y = ceil((1-$mon) / 12);
- $year -= $y;
- $mon += $y*12;
- }
-
- $_day_power = 86400;
- $_hour_power = 3600;
- $_min_power = 60;
-
- $_month_table_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31);
- $_month_table_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31);
-
- $_total_date = 0;
- if ($year >= 1970) {
- for ($a = 1970 ; $a <= $year; $a++) {
- $leaf = _adodb_is_leap_year($a);
- if ($leaf == true) {
- $loop_table = $_month_table_leaf;
- $_add_date = 366;
- } else {
- $loop_table = $_month_table_normal;
- $_add_date = 365;
- }
- if ($a < $year) {
- $_total_date += $_add_date;
- } else {
- for($b=1;$b<$mon;$b++) {
- $_total_date += $loop_table[$b];
- }
- }
- }
- $_total_date +=$day-1;
- $ret = $_total_date * $_day_power + $hr * $_hour_power + $min * $_min_power + $sec + $gmt_different;
-
- } else {
- for ($a = 1969 ; $a >= $year; $a--) {
- $leaf = _adodb_is_leap_year($a);
- if ($leaf == true) {
- $loop_table = $_month_table_leaf;
- $_add_date = 366;
- } else {
- $loop_table = $_month_table_normal;
- $_add_date = 365;
- }
- if ($a > $year) { $_total_date += $_add_date;
- } else {
- for($b=12;$b>$mon;$b--) {
- $_total_date += $loop_table[$b];
- }
- }
- }
- $_total_date += $loop_table[$mon] - $day;
-
- $_day_time = $hr * $_hour_power + $min * $_min_power + $sec;
- $_day_time = $_day_power - $_day_time;
- $ret = -( $_total_date * $_day_power + $_day_time - $gmt_different);
- if ($ret < -12220185600) $ret += 10*86400; // if earlier than 5 Oct 1582 - gregorian correction
- else if ($ret < -12219321600) $ret = -12219321600; // if in limbo, reset to 15 Oct 1582.
- }
- //print " dmy=$day/$mon/$year $hr:$min:$sec => " .$ret;
- return $ret;
-}
-
-function adodb_gmstrftime($fmt, $ts=false)
-{
- return adodb_strftime($fmt,$ts,true);
-}
-
-// hack - convert to adodb_date
-function adodb_strftime($fmt, $ts=false,$is_gmt=false)
-{
-global $ADODB_DATE_LOCALE;
-
- if (!defined('ADODB_TEST_DATES')) {
- if ((abs($ts) <= 0x7FFFFFFF)) { // check if number in 32-bit signed range
- if (!defined('ADODB_NO_NEGATIVE_TS') || $ts >= 0) // if windows, must be +ve integer
- return ($is_gmt)? @gmstrftime($fmt,$ts): @strftime($fmt,$ts);
-
- }
- }
-
- if (empty($ADODB_DATE_LOCALE)) {
- /*
- $tstr = strtoupper(gmstrftime('%c',31366800)); // 30 Dec 1970, 1 am
- $sep = substr($tstr,2,1);
- $hasAM = strrpos($tstr,'M') !== false;
- */
- # see http://phplens.com/lens/lensforum/msgs.php?id=14865 for reasoning, and changelog for version 0.24
- $dstr = gmstrftime('%x',31366800); // 30 Dec 1970, 1 am
- $sep = substr($dstr,2,1);
- $tstr = strtoupper(gmstrftime('%X',31366800)); // 30 Dec 1970, 1 am
- $hasAM = strrpos($tstr,'M') !== false;
-
- $ADODB_DATE_LOCALE = array();
- $ADODB_DATE_LOCALE[] = strncmp($tstr,'30',2) == 0 ? 'd'.$sep.'m'.$sep.'y' : 'm'.$sep.'d'.$sep.'y';
- $ADODB_DATE_LOCALE[] = ($hasAM) ? 'h:i:s a' : 'H:i:s';
-
- }
- $inpct = false;
- $fmtdate = '';
- for ($i=0,$max = strlen($fmt); $i < $max; $i++) {
- $ch = $fmt[$i];
- if ($ch == '%') {
- if ($inpct) {
- $fmtdate .= '%';
- $inpct = false;
- } else
- $inpct = true;
- } else if ($inpct) {
-
- $inpct = false;
- switch($ch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'E':
- case 'O':
- /* ignore format modifiers */
- $inpct = true;
- break;
-
- case 'a': $fmtdate .= 'D'; break;
- case 'A': $fmtdate .= 'l'; break;
- case 'h':
- case 'b': $fmtdate .= 'M'; break;
- case 'B': $fmtdate .= 'F'; break;
- case 'c': $fmtdate .= $ADODB_DATE_LOCALE[0].$ADODB_DATE_LOCALE[1]; break;
- case 'C': $fmtdate .= '\C?'; break; // century
- case 'd': $fmtdate .= 'd'; break;
- case 'D': $fmtdate .= 'm/d/y'; break;
- case 'e': $fmtdate .= 'j'; break;
- case 'g': $fmtdate .= '\g?'; break; //?
- case 'G': $fmtdate .= '\G?'; break; //?
- case 'H': $fmtdate .= 'H'; break;
- case 'I': $fmtdate .= 'h'; break;
- case 'j': $fmtdate .= '?z'; $parsej = true; break; // wrong as j=1-based, z=0-basd
- case 'm': $fmtdate .= 'm'; break;
- case 'M': $fmtdate .= 'i'; break;
- case 'n': $fmtdate .= "\n"; break;
- case 'p': $fmtdate .= 'a'; break;
- case 'r': $fmtdate .= 'h:i:s a'; break;
- case 'R': $fmtdate .= 'H:i:s'; break;
- case 'S': $fmtdate .= 's'; break;
- case 't': $fmtdate .= "\t"; break;
- case 'T': $fmtdate .= 'H:i:s'; break;
- case 'u': $fmtdate .= '?u'; $parseu = true; break; // wrong strftime=1-based, date=0-based
- case 'U': $fmtdate .= '?U'; $parseU = true; break;// wrong strftime=1-based, date=0-based
- case 'x': $fmtdate .= $ADODB_DATE_LOCALE[0]; break;
- case 'X': $fmtdate .= $ADODB_DATE_LOCALE[1]; break;
- case 'w': $fmtdate .= '?w'; $parseu = true; break; // wrong strftime=1-based, date=0-based
- case 'W': $fmtdate .= '?W'; $parseU = true; break;// wrong strftime=1-based, date=0-based
- case 'y': $fmtdate .= 'y'; break;
- case 'Y': $fmtdate .= 'Y'; break;
- case 'Z': $fmtdate .= 'T'; break;
- }
- } else if (('A' <= ($ch) && ($ch) <= 'Z' ) || ('a' <= ($ch) && ($ch) <= 'z' ))
- $fmtdate .= "\\".$ch;
- else
- $fmtdate .= $ch;
- }
- //echo "fmt=",$fmtdate,"
";
- if ($ts === false) $ts = time();
- $ret = adodb_date($fmtdate, $ts, $is_gmt);
- return $ret;
-}
diff --git a/vendor/adodb/adodb-php/adodb-xmlschema.inc.php b/vendor/adodb/adodb-php/adodb-xmlschema.inc.php
deleted file mode 100644
index ca5fa567..00000000
--- a/vendor/adodb/adodb-php/adodb-xmlschema.inc.php
+++ /dev/null
@@ -1,2224 +0,0 @@
-parent = $parent;
- }
-
- /**
- * XML Callback to process start elements
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
-
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
-
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
-
- }
-
- function create(&$xmls) {
- return array();
- }
-
- /**
- * Destroys the object
- */
- function destroy() {
- }
-
- /**
- * Checks whether the specified RDBMS is supported by the current
- * database object or its ranking ancestor.
- *
- * @param string $platform RDBMS platform name (from ADODB platform list).
- * @return boolean TRUE if RDBMS is supported; otherwise returns FALSE.
- */
- function supportedPlatform( $platform = NULL ) {
- return is_object( $this->parent ) ? $this->parent->supportedPlatform( $platform ) : TRUE;
- }
-
- /**
- * Returns the prefix set by the ranking ancestor of the database object.
- *
- * @param string $name Prefix string.
- * @return string Prefix.
- */
- function prefix( $name = '' ) {
- return is_object( $this->parent ) ? $this->parent->prefix( $name ) : $name;
- }
-
- /**
- * Extracts a field ID from the specified field.
- *
- * @param string $field Field.
- * @return string Field ID.
- */
- function FieldID( $field ) {
- return strtoupper( preg_replace( '/^`(.+)`$/', '$1', $field ) );
- }
-}
-
-/**
-* Creates a table object in ADOdb's datadict format
-*
-* This class stores information about a database table. As charactaristics
-* of the table are loaded from the external source, methods and properties
-* of this class are used to build up the table description in ADOdb's
-* datadict format.
-*
-* @package axmls
-* @access private
-*/
-class dbTable extends dbObject {
-
- /**
- * @var string Table name
- */
- var $name;
-
- /**
- * @var array Field specifier: Meta-information about each field
- */
- var $fields = array();
-
- /**
- * @var array List of table indexes.
- */
- var $indexes = array();
-
- /**
- * @var array Table options: Table-level options
- */
- var $opts = array();
-
- /**
- * @var string Field index: Keeps track of which field is currently being processed
- */
- var $current_field;
-
- /**
- * @var boolean Mark table for destruction
- * @access private
- */
- var $drop_table;
-
- /**
- * @var boolean Mark field for destruction (not yet implemented)
- * @access private
- */
- var $drop_field = array();
-
- /**
- * Iniitializes a new table object.
- *
- * @param string $prefix DB Object prefix
- * @param array $attributes Array of table attributes.
- */
- function __construct( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
- $this->name = $this->prefix($attributes['NAME']);
- }
-
- /**
- * XML Callback to process start elements. Elements currently
- * processed are: INDEX, DROP, FIELD, KEY, NOTNULL, AUTOINCREMENT & DEFAULT.
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'INDEX':
- if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
- $index = $this->addIndex( $attributes );
- xml_set_object( $parser, $index );
- }
- break;
- case 'DATA':
- if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
- $data = $this->addData( $attributes );
- xml_set_object( $parser, $data );
- }
- break;
- case 'DROP':
- $this->drop();
- break;
- case 'FIELD':
- // Add a field
- $fieldName = $attributes['NAME'];
- $fieldType = $attributes['TYPE'];
- $fieldSize = isset( $attributes['SIZE'] ) ? $attributes['SIZE'] : NULL;
- $fieldOpts = isset( $attributes['OPTS'] ) ? $attributes['OPTS'] : NULL;
-
- $this->addField( $fieldName, $fieldType, $fieldSize, $fieldOpts );
- break;
- case 'KEY':
- case 'NOTNULL':
- case 'AUTOINCREMENT':
- // Add a field option
- $this->addFieldOpt( $this->current_field, $this->currentElement );
- break;
- case 'DEFAULT':
- // Add a field option to the table object
-
- // Work around ADOdb datadict issue that misinterprets empty strings.
- if( $attributes['VALUE'] == '' ) {
- $attributes['VALUE'] = " '' ";
- }
-
- $this->addFieldOpt( $this->current_field, $this->currentElement, $attributes['VALUE'] );
- break;
- case 'DEFDATE':
- case 'DEFTIMESTAMP':
- // Add a field option to the table object
- $this->addFieldOpt( $this->current_field, $this->currentElement );
- break;
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Table constraint
- case 'CONSTRAINT':
- if( isset( $this->current_field ) ) {
- $this->addFieldOpt( $this->current_field, $this->currentElement, $cdata );
- } else {
- $this->addTableOpt( $cdata );
- }
- break;
- // Table option
- case 'OPT':
- $this->addTableOpt( $cdata );
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'TABLE':
- $this->parent->addSQL( $this->create( $this->parent ) );
- xml_set_object( $parser, $this->parent );
- $this->destroy();
- break;
- case 'FIELD':
- unset($this->current_field);
- break;
-
- }
- }
-
- /**
- * Adds an index to a table object
- *
- * @param array $attributes Index attributes
- * @return object dbIndex object
- */
- function addIndex( $attributes ) {
- $name = strtoupper( $attributes['NAME'] );
- $this->indexes[$name] = new dbIndex( $this, $attributes );
- return $this->indexes[$name];
- }
-
- /**
- * Adds data to a table object
- *
- * @param array $attributes Data attributes
- * @return object dbData object
- */
- function addData( $attributes ) {
- if( !isset( $this->data ) ) {
- $this->data = new dbData( $this, $attributes );
- }
- return $this->data;
- }
-
- /**
- * Adds a field to a table object
- *
- * $name is the name of the table to which the field should be added.
- * $type is an ADODB datadict field type. The following field types
- * are supported as of ADODB 3.40:
- * - C: varchar
- * - X: CLOB (character large object) or largest varchar size
- * if CLOB is not supported
- * - C2: Multibyte varchar
- * - X2: Multibyte CLOB
- * - B: BLOB (binary large object)
- * - D: Date (some databases do not support this, and we return a datetime type)
- * - T: Datetime or Timestamp
- * - L: Integer field suitable for storing booleans (0 or 1)
- * - I: Integer (mapped to I4)
- * - I1: 1-byte integer
- * - I2: 2-byte integer
- * - I4: 4-byte integer
- * - I8: 8-byte integer
- * - F: Floating point number
- * - N: Numeric or decimal number
- *
- * @param string $name Name of the table to which the field will be added.
- * @param string $type ADODB datadict field type.
- * @param string $size Field size
- * @param array $opts Field options array
- * @return array Field specifier array
- */
- function addField( $name, $type, $size = NULL, $opts = NULL ) {
- $field_id = $this->FieldID( $name );
-
- // Set the field index so we know where we are
- $this->current_field = $field_id;
-
- // Set the field name (required)
- $this->fields[$field_id]['NAME'] = $name;
-
- // Set the field type (required)
- $this->fields[$field_id]['TYPE'] = $type;
-
- // Set the field size (optional)
- if( isset( $size ) ) {
- $this->fields[$field_id]['SIZE'] = $size;
- }
-
- // Set the field options
- if( isset( $opts ) ) {
- $this->fields[$field_id]['OPTS'][] = $opts;
- }
- }
-
- /**
- * Adds a field option to the current field specifier
- *
- * This method adds a field option allowed by the ADOdb datadict
- * and appends it to the given field.
- *
- * @param string $field Field name
- * @param string $opt ADOdb field option
- * @param mixed $value Field option value
- * @return array Field specifier array
- */
- function addFieldOpt( $field, $opt, $value = NULL ) {
- if( !isset( $value ) ) {
- $this->fields[$this->FieldID( $field )]['OPTS'][] = $opt;
- // Add the option and value
- } else {
- $this->fields[$this->FieldID( $field )]['OPTS'][] = array( $opt => $value );
- }
- }
-
- /**
- * Adds an option to the table
- *
- * This method takes a comma-separated list of table-level options
- * and appends them to the table object.
- *
- * @param string $opt Table option
- * @return array Options
- */
- function addTableOpt( $opt ) {
- if(isset($this->currentPlatform)) {
- $this->opts[$this->parent->db->databaseType] = $opt;
- }
- return $this->opts;
- }
-
-
- /**
- * Generates the SQL that will create the table in the database
- *
- * @param object $xmls adoSchema object
- * @return array Array containing table creation SQL
- */
- function create( &$xmls ) {
- $sql = array();
-
- // drop any existing indexes
- if( is_array( $legacy_indexes = $xmls->dict->MetaIndexes( $this->name ) ) ) {
- foreach( $legacy_indexes as $index => $index_details ) {
- $sql[] = $xmls->dict->DropIndexSQL( $index, $this->name );
- }
- }
-
- // remove fields to be dropped from table object
- foreach( $this->drop_field as $field ) {
- unset( $this->fields[$field] );
- }
-
- // if table exists
- if( is_array( $legacy_fields = $xmls->dict->MetaColumns( $this->name ) ) ) {
- // drop table
- if( $this->drop_table ) {
- $sql[] = $xmls->dict->DropTableSQL( $this->name );
-
- return $sql;
- }
-
- // drop any existing fields not in schema
- foreach( $legacy_fields as $field_id => $field ) {
- if( !isset( $this->fields[$field_id] ) ) {
- $sql[] = $xmls->dict->DropColumnSQL( $this->name, '`'.$field->name.'`' );
- }
- }
- // if table doesn't exist
- } else {
- if( $this->drop_table ) {
- return $sql;
- }
-
- $legacy_fields = array();
- }
-
- // Loop through the field specifier array, building the associative array for the field options
- $fldarray = array();
-
- foreach( $this->fields as $field_id => $finfo ) {
- // Set an empty size if it isn't supplied
- if( !isset( $finfo['SIZE'] ) ) {
- $finfo['SIZE'] = '';
- }
-
- // Initialize the field array with the type and size
- $fldarray[$field_id] = array(
- 'NAME' => $finfo['NAME'],
- 'TYPE' => $finfo['TYPE'],
- 'SIZE' => $finfo['SIZE']
- );
-
- // Loop through the options array and add the field options.
- if( isset( $finfo['OPTS'] ) ) {
- foreach( $finfo['OPTS'] as $opt ) {
- // Option has an argument.
- if( is_array( $opt ) ) {
- $key = key( $opt );
- $value = $opt[key( $opt )];
- @$fldarray[$field_id][$key] .= $value;
- // Option doesn't have arguments
- } else {
- $fldarray[$field_id][$opt] = $opt;
- }
- }
- }
- }
-
- if( empty( $legacy_fields ) ) {
- // Create the new table
- $sql[] = $xmls->dict->CreateTableSQL( $this->name, $fldarray, $this->opts );
- logMsg( end( $sql ), 'Generated CreateTableSQL' );
- } else {
- // Upgrade an existing table
- logMsg( "Upgrading {$this->name} using '{$xmls->upgrade}'" );
- switch( $xmls->upgrade ) {
- // Use ChangeTableSQL
- case 'ALTER':
- logMsg( 'Generated ChangeTableSQL (ALTERing table)' );
- $sql[] = $xmls->dict->ChangeTableSQL( $this->name, $fldarray, $this->opts );
- break;
- case 'REPLACE':
- logMsg( 'Doing upgrade REPLACE (testing)' );
- $sql[] = $xmls->dict->DropTableSQL( $this->name );
- $sql[] = $xmls->dict->CreateTableSQL( $this->name, $fldarray, $this->opts );
- break;
- // ignore table
- default:
- return array();
- }
- }
-
- foreach( $this->indexes as $index ) {
- $sql[] = $index->create( $xmls );
- }
-
- if( isset( $this->data ) ) {
- $sql[] = $this->data->create( $xmls );
- }
-
- return $sql;
- }
-
- /**
- * Marks a field or table for destruction
- */
- function drop() {
- if( isset( $this->current_field ) ) {
- // Drop the current field
- logMsg( "Dropping field '{$this->current_field}' from table '{$this->name}'" );
- // $this->drop_field[$this->current_field] = $xmls->dict->DropColumnSQL( $this->name, $this->current_field );
- $this->drop_field[$this->current_field] = $this->current_field;
- } else {
- // Drop the current table
- logMsg( "Dropping table '{$this->name}'" );
- // $this->drop_table = $xmls->dict->DropTableSQL( $this->name );
- $this->drop_table = TRUE;
- }
- }
-}
-
-/**
-* Creates an index object in ADOdb's datadict format
-*
-* This class stores information about a database index. As charactaristics
-* of the index are loaded from the external source, methods and properties
-* of this class are used to build up the index description in ADOdb's
-* datadict format.
-*
-* @package axmls
-* @access private
-*/
-class dbIndex extends dbObject {
-
- /**
- * @var string Index name
- */
- var $name;
-
- /**
- * @var array Index options: Index-level options
- */
- var $opts = array();
-
- /**
- * @var array Indexed fields: Table columns included in this index
- */
- var $columns = array();
-
- /**
- * @var boolean Mark index for destruction
- * @access private
- */
- var $drop = FALSE;
-
- /**
- * Initializes the new dbIndex object.
- *
- * @param object $parent Parent object
- * @param array $attributes Attributes
- *
- * @internal
- */
- function __construct( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
-
- $this->name = $this->prefix ($attributes['NAME']);
- }
-
- /**
- * XML Callback to process start elements
- *
- * Processes XML opening tags.
- * Elements currently processed are: DROP, CLUSTERED, BITMAP, UNIQUE, FULLTEXT & HASH.
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'DROP':
- $this->drop();
- break;
- case 'CLUSTERED':
- case 'BITMAP':
- case 'UNIQUE':
- case 'FULLTEXT':
- case 'HASH':
- // Add index Option
- $this->addIndexOpt( $this->currentElement );
- break;
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * Processes XML cdata.
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Index field name
- case 'COL':
- $this->addField( $cdata );
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'INDEX':
- xml_set_object( $parser, $this->parent );
- break;
- }
- }
-
- /**
- * Adds a field to the index
- *
- * @param string $name Field name
- * @return string Field list
- */
- function addField( $name ) {
- $this->columns[$this->FieldID( $name )] = $name;
-
- // Return the field list
- return $this->columns;
- }
-
- /**
- * Adds options to the index
- *
- * @param string $opt Comma-separated list of index options.
- * @return string Option list
- */
- function addIndexOpt( $opt ) {
- $this->opts[] = $opt;
-
- // Return the options list
- return $this->opts;
- }
-
- /**
- * Generates the SQL that will create the index in the database
- *
- * @param object $xmls adoSchema object
- * @return array Array containing index creation SQL
- */
- function create( &$xmls ) {
- if( $this->drop ) {
- return NULL;
- }
-
- // eliminate any columns that aren't in the table
- foreach( $this->columns as $id => $col ) {
- if( !isset( $this->parent->fields[$id] ) ) {
- unset( $this->columns[$id] );
- }
- }
-
- return $xmls->dict->CreateIndexSQL( $this->name, $this->parent->name, $this->columns, $this->opts );
- }
-
- /**
- * Marks an index for destruction
- */
- function drop() {
- $this->drop = TRUE;
- }
-}
-
-/**
-* Creates a data object in ADOdb's datadict format
-*
-* This class stores information about table data.
-*
-* @package axmls
-* @access private
-*/
-class dbData extends dbObject {
-
- var $data = array();
-
- var $row;
-
- /**
- * Initializes the new dbIndex object.
- *
- * @param object $parent Parent object
- * @param array $attributes Attributes
- *
- * @internal
- */
- function __construct( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
- }
-
- /**
- * XML Callback to process start elements
- *
- * Processes XML opening tags.
- * Elements currently processed are: DROP, CLUSTERED, BITMAP, UNIQUE, FULLTEXT & HASH.
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'ROW':
- $this->row = count( $this->data );
- $this->data[$this->row] = array();
- break;
- case 'F':
- $this->addField($attributes);
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * Processes XML cdata.
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Index field name
- case 'F':
- $this->addData( $cdata );
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'DATA':
- xml_set_object( $parser, $this->parent );
- break;
- }
- }
-
- /**
- * Adds a field to the index
- *
- * @param string $name Field name
- * @return string Field list
- */
- function addField( $attributes ) {
- if( isset( $attributes['NAME'] ) ) {
- $name = $attributes['NAME'];
- } else {
- $name = count($this->data[$this->row]);
- }
-
- // Set the field index so we know where we are
- $this->current_field = $this->FieldID( $name );
- }
-
- /**
- * Adds options to the index
- *
- * @param string $opt Comma-separated list of index options.
- * @return string Option list
- */
- function addData( $cdata ) {
- if( !isset( $this->data[$this->row] ) ) {
- $this->data[$this->row] = array();
- }
-
- if( !isset( $this->data[$this->row][$this->current_field] ) ) {
- $this->data[$this->row][$this->current_field] = '';
- }
-
- $this->data[$this->row][$this->current_field] .= $cdata;
- }
-
- /**
- * Generates the SQL that will create the index in the database
- *
- * @param object $xmls adoSchema object
- * @return array Array containing index creation SQL
- */
- function create( &$xmls ) {
- $table = $xmls->dict->TableName($this->parent->name);
- $table_field_count = count($this->parent->fields);
- $sql = array();
-
- // eliminate any columns that aren't in the table
- foreach( $this->data as $row ) {
- $table_fields = $this->parent->fields;
- $fields = array();
-
- foreach( $row as $field_id => $field_data ) {
- if( !array_key_exists( $field_id, $table_fields ) ) {
- if( is_numeric( $field_id ) ) {
- $field_id = reset( array_keys( $table_fields ) );
- } else {
- continue;
- }
- }
-
- $name = $table_fields[$field_id]['NAME'];
-
- switch( $table_fields[$field_id]['TYPE'] ) {
- case 'C':
- case 'C2':
- case 'X':
- case 'X2':
- $fields[$name] = $xmls->db->qstr( $field_data );
- break;
- case 'I':
- case 'I1':
- case 'I2':
- case 'I4':
- case 'I8':
- $fields[$name] = intval($field_data);
- break;
- default:
- $fields[$name] = $field_data;
- }
-
- unset($table_fields[$field_id]);
- }
-
- // check that at least 1 column is specified
- if( empty( $fields ) ) {
- continue;
- }
-
- // check that no required columns are missing
- if( count( $fields ) < $table_field_count ) {
- foreach( $table_fields as $field ) {
- if (isset( $field['OPTS'] ))
- if( ( in_array( 'NOTNULL', $field['OPTS'] ) || in_array( 'KEY', $field['OPTS'] ) ) && !in_array( 'AUTOINCREMENT', $field['OPTS'] ) ) {
- continue(2);
- }
- }
- }
-
- $sql[] = 'INSERT INTO '. $table .' ('. implode( ',', array_keys( $fields ) ) .') VALUES ('. implode( ',', $fields ) .')';
- }
-
- return $sql;
- }
-}
-
-/**
-* Creates the SQL to execute a list of provided SQL queries
-*
-* @package axmls
-* @access private
-*/
-class dbQuerySet extends dbObject {
-
- /**
- * @var array List of SQL queries
- */
- var $queries = array();
-
- /**
- * @var string String used to build of a query line by line
- */
- var $query;
-
- /**
- * @var string Query prefix key
- */
- var $prefixKey = '';
-
- /**
- * @var boolean Auto prefix enable (TRUE)
- */
- var $prefixMethod = 'AUTO';
-
- /**
- * Initializes the query set.
- *
- * @param object $parent Parent object
- * @param array $attributes Attributes
- */
- function __construct( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
-
- // Overrides the manual prefix key
- if( isset( $attributes['KEY'] ) ) {
- $this->prefixKey = $attributes['KEY'];
- }
-
- $prefixMethod = isset( $attributes['PREFIXMETHOD'] ) ? strtoupper( trim( $attributes['PREFIXMETHOD'] ) ) : '';
-
- // Enables or disables automatic prefix prepending
- switch( $prefixMethod ) {
- case 'AUTO':
- $this->prefixMethod = 'AUTO';
- break;
- case 'MANUAL':
- $this->prefixMethod = 'MANUAL';
- break;
- case 'NONE':
- $this->prefixMethod = 'NONE';
- break;
- }
- }
-
- /**
- * XML Callback to process start elements. Elements currently
- * processed are: QUERY.
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'QUERY':
- // Create a new query in a SQL queryset.
- // Ignore this query set if a platform is specified and it's different than the
- // current connection platform.
- if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
- $this->newQuery();
- } else {
- $this->discardQuery();
- }
- break;
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Line of queryset SQL data
- case 'QUERY':
- $this->buildQuery( $cdata );
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'QUERY':
- // Add the finished query to the open query set.
- $this->addQuery();
- break;
- case 'SQL':
- $this->parent->addSQL( $this->create( $this->parent ) );
- xml_set_object( $parser, $this->parent );
- $this->destroy();
- break;
- default:
-
- }
- }
-
- /**
- * Re-initializes the query.
- *
- * @return boolean TRUE
- */
- function newQuery() {
- $this->query = '';
-
- return TRUE;
- }
-
- /**
- * Discards the existing query.
- *
- * @return boolean TRUE
- */
- function discardQuery() {
- unset( $this->query );
-
- return TRUE;
- }
-
- /**
- * Appends a line to a query that is being built line by line
- *
- * @param string $data Line of SQL data or NULL to initialize a new query
- * @return string SQL query string.
- */
- function buildQuery( $sql = NULL ) {
- if( !isset( $this->query ) OR empty( $sql ) ) {
- return FALSE;
- }
-
- $this->query .= $sql;
-
- return $this->query;
- }
-
- /**
- * Adds a completed query to the query list
- *
- * @return string SQL of added query
- */
- function addQuery() {
- if( !isset( $this->query ) ) {
- return FALSE;
- }
-
- $this->queries[] = $return = trim($this->query);
-
- unset( $this->query );
-
- return $return;
- }
-
- /**
- * Creates and returns the current query set
- *
- * @param object $xmls adoSchema object
- * @return array Query set
- */
- function create( &$xmls ) {
- foreach( $this->queries as $id => $query ) {
- switch( $this->prefixMethod ) {
- case 'AUTO':
- // Enable auto prefix replacement
-
- // Process object prefix.
- // Evaluate SQL statements to prepend prefix to objects
- $query = $this->prefixQuery( '/^\s*((?is)INSERT\s+(INTO\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
- $query = $this->prefixQuery( '/^\s*((?is)UPDATE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
- $query = $this->prefixQuery( '/^\s*((?is)DELETE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
-
- // SELECT statements aren't working yet
- #$data = preg_replace( '/(?ias)(^\s*SELECT\s+.*\s+FROM)\s+(\W\s*,?\s*)+((?i)\s+WHERE.*$)/', "\1 $prefix\2 \3", $data );
-
- case 'MANUAL':
- // If prefixKey is set and has a value then we use it to override the default constant XMLS_PREFIX.
- // If prefixKey is not set, we use the default constant XMLS_PREFIX
- if( isset( $this->prefixKey ) AND( $this->prefixKey !== '' ) ) {
- // Enable prefix override
- $query = str_replace( $this->prefixKey, $xmls->objectPrefix, $query );
- } else {
- // Use default replacement
- $query = str_replace( XMLS_PREFIX , $xmls->objectPrefix, $query );
- }
- }
-
- $this->queries[$id] = trim( $query );
- }
-
- // Return the query set array
- return $this->queries;
- }
-
- /**
- * Rebuilds the query with the prefix attached to any objects
- *
- * @param string $regex Regex used to add prefix
- * @param string $query SQL query string
- * @param string $prefix Prefix to be appended to tables, indices, etc.
- * @return string Prefixed SQL query string.
- */
- function prefixQuery( $regex, $query, $prefix = NULL ) {
- if( !isset( $prefix ) ) {
- return $query;
- }
-
- if( preg_match( $regex, $query, $match ) ) {
- $preamble = $match[1];
- $postamble = $match[5];
- $objectList = explode( ',', $match[3] );
- // $prefix = $prefix . '_';
-
- $prefixedList = '';
-
- foreach( $objectList as $object ) {
- if( $prefixedList !== '' ) {
- $prefixedList .= ', ';
- }
-
- $prefixedList .= $prefix . trim( $object );
- }
-
- $query = $preamble . ' ' . $prefixedList . ' ' . $postamble;
- }
-
- return $query;
- }
-}
-
-/**
-* Loads and parses an XML file, creating an array of "ready-to-run" SQL statements
-*
-* This class is used to load and parse the XML file, to create an array of SQL statements
-* that can be used to build a database, and to build the database using the SQL array.
-*
-* @tutorial getting_started.pkg
-*
-* @author Richard Tango-Lowy & Dan Cech
-* @version $Revision: 1.12 $
-*
-* @package axmls
-*/
-class adoSchema {
-
- /**
- * @var array Array containing SQL queries to generate all objects
- * @access private
- */
- var $sqlArray;
-
- /**
- * @var object ADOdb connection object
- * @access private
- */
- var $db;
-
- /**
- * @var object ADOdb Data Dictionary
- * @access private
- */
- var $dict;
-
- /**
- * @var string Current XML element
- * @access private
- */
- var $currentElement = '';
-
- /**
- * @var string If set (to 'ALTER' or 'REPLACE'), upgrade an existing database
- * @access private
- */
- var $upgrade = '';
-
- /**
- * @var string Optional object prefix
- * @access private
- */
- var $objectPrefix = '';
-
- /**
- * @var long Original Magic Quotes Runtime value
- * @access private
- */
- var $mgq;
-
- /**
- * @var long System debug
- * @access private
- */
- var $debug;
-
- /**
- * @var string Regular expression to find schema version
- * @access private
- */
- var $versionRegex = '/' . "\n";
-
- foreach( $msg as $label => $details ) {
- $error_details .= '
';
-
- trigger_error( $error_details, E_USER_ERROR );
- }
-
- /**
- * Returns the AXMLS Schema Version of the requested XML schema file.
- *
- * Call this method to obtain the AXMLS DTD version of the requested XML schema file.
- * @see SchemaStringVersion()
- *
- * @param string $filename AXMLS schema file
- * @return string Schema version number or FALSE on error
- */
- function SchemaFileVersion( $filename ) {
- // Open the file
- if( !($fp = fopen( $filename, 'r' )) ) {
- // die( 'Unable to open file' );
- return FALSE;
- }
-
- // Process the file
- while( $data = fread( $fp, 4096 ) ) {
- if( preg_match( $this->versionRegex, $data, $matches ) ) {
- return !empty( $matches[2] ) ? $matches[2] : XMLS_DEFAULT_SCHEMA_VERSION;
- }
- }
-
- return FALSE;
- }
-
- /**
- * Returns the AXMLS Schema Version of the provided XML schema string.
- *
- * Call this method to obtain the AXMLS DTD version of the provided XML schema string.
- * @see SchemaFileVersion()
- *
- * @param string $xmlstring XML schema string
- * @return string Schema version number or FALSE on error
- */
- function SchemaStringVersion( $xmlstring ) {
- if( !is_string( $xmlstring ) OR empty( $xmlstring ) ) {
- return FALSE;
- }
-
- if( preg_match( $this->versionRegex, $xmlstring, $matches ) ) {
- return !empty( $matches[2] ) ? $matches[2] : XMLS_DEFAULT_SCHEMA_VERSION;
- }
-
- return FALSE;
- }
-
- /**
- * Extracts an XML schema from an existing database.
- *
- * Call this method to create an XML schema string from an existing database.
- * If the data parameter is set to TRUE, AXMLS will include the data from the database
- * in the schema.
- *
- * @param boolean $data Include data in schema dump
- * @return string Generated XML schema
- */
- function ExtractSchema( $data = FALSE ) {
- $old_mode = $this->db->SetFetchMode( ADODB_FETCH_NUM );
-
- $schema = '' . "\n"
- . ' ' . "\n";
- }
-
- $error_details .= '' . $label . ': ' . htmlentities( $details ) . ' ' . "\n";
-
- // grab details from database
- $rs = $this->db->Execute( 'SELECT * FROM ' . $table . ' WHERE 1=1' );
- $fields = $this->db->MetaColumns( $table );
- $indexes = $this->db->MetaIndexes( $table );
-
- if( is_array( $fields ) ) {
- foreach( $fields as $details ) {
- $extra = '';
- $content = array();
-
- if( $details->max_length > 0 ) {
- $extra .= ' size="' . $details->max_length . '"';
- }
-
- if( $details->primary_key ) {
- $content[] = '
' . "\n";
- }
- }
-
- $this->db->SetFetchMode( $old_mode );
-
- $schema .= '';
-
- if( isset( $title ) ) {
- echo '';
- }
-}
diff --git a/vendor/adodb/adodb-php/adodb-xmlschema03.inc.php b/vendor/adodb/adodb-php/adodb-xmlschema03.inc.php
deleted file mode 100644
index c1ecb885..00000000
--- a/vendor/adodb/adodb-php/adodb-xmlschema03.inc.php
+++ /dev/null
@@ -1,2406 +0,0 @@
-parent = $parent;
- }
-
- /**
- * XML Callback to process start elements
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
-
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
-
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
-
- }
-
- function create(&$xmls) {
- return array();
- }
-
- /**
- * Destroys the object
- */
- function destroy() {
- }
-
- /**
- * Checks whether the specified RDBMS is supported by the current
- * database object or its ranking ancestor.
- *
- * @param string $platform RDBMS platform name (from ADODB platform list).
- * @return boolean TRUE if RDBMS is supported; otherwise returns FALSE.
- */
- function supportedPlatform( $platform = NULL ) {
- return is_object( $this->parent ) ? $this->parent->supportedPlatform( $platform ) : TRUE;
- }
-
- /**
- * Returns the prefix set by the ranking ancestor of the database object.
- *
- * @param string $name Prefix string.
- * @return string Prefix.
- */
- function prefix( $name = '' ) {
- return is_object( $this->parent ) ? $this->parent->prefix( $name ) : $name;
- }
-
- /**
- * Extracts a field ID from the specified field.
- *
- * @param string $field Field.
- * @return string Field ID.
- */
- function FieldID( $field ) {
- return strtoupper( preg_replace( '/^`(.+)`$/', '$1', $field ) );
- }
-}
-
-/**
-* Creates a table object in ADOdb's datadict format
-*
-* This class stores information about a database table. As charactaristics
-* of the table are loaded from the external source, methods and properties
-* of this class are used to build up the table description in ADOdb's
-* datadict format.
-*
-* @package axmls
-* @access private
-*/
-class dbTable extends dbObject {
-
- /**
- * @var string Table name
- */
- var $name;
-
- /**
- * @var array Field specifier: Meta-information about each field
- */
- var $fields = array();
-
- /**
- * @var array List of table indexes.
- */
- var $indexes = array();
-
- /**
- * @var array Table options: Table-level options
- */
- var $opts = array();
-
- /**
- * @var string Field index: Keeps track of which field is currently being processed
- */
- var $current_field;
-
- /**
- * @var boolean Mark table for destruction
- * @access private
- */
- var $drop_table;
-
- /**
- * @var boolean Mark field for destruction (not yet implemented)
- * @access private
- */
- var $drop_field = array();
-
- /**
- * @var array Platform-specific options
- * @access private
- */
- var $currentPlatform = true;
-
-
- /**
- * Iniitializes a new table object.
- *
- * @param string $prefix DB Object prefix
- * @param array $attributes Array of table attributes.
- */
- function __construct( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
- $this->name = $this->prefix($attributes['NAME']);
- }
-
- /**
- * XML Callback to process start elements. Elements currently
- * processed are: INDEX, DROP, FIELD, KEY, NOTNULL, AUTOINCREMENT & DEFAULT.
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'INDEX':
- if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
- $index = $this->addIndex( $attributes );
- xml_set_object( $parser, $index );
- }
- break;
- case 'DATA':
- if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
- $data = $this->addData( $attributes );
- xml_set_object( $parser, $data );
- }
- break;
- case 'DROP':
- $this->drop();
- break;
- case 'FIELD':
- // Add a field
- $fieldName = $attributes['NAME'];
- $fieldType = $attributes['TYPE'];
- $fieldSize = isset( $attributes['SIZE'] ) ? $attributes['SIZE'] : NULL;
- $fieldOpts = !empty( $attributes['OPTS'] ) ? $attributes['OPTS'] : NULL;
-
- $this->addField( $fieldName, $fieldType, $fieldSize, $fieldOpts );
- break;
- case 'KEY':
- case 'NOTNULL':
- case 'AUTOINCREMENT':
- case 'DEFDATE':
- case 'DEFTIMESTAMP':
- case 'UNSIGNED':
- // Add a field option
- $this->addFieldOpt( $this->current_field, $this->currentElement );
- break;
- case 'DEFAULT':
- // Add a field option to the table object
-
- // Work around ADOdb datadict issue that misinterprets empty strings.
- if( $attributes['VALUE'] == '' ) {
- $attributes['VALUE'] = " '' ";
- }
-
- $this->addFieldOpt( $this->current_field, $this->currentElement, $attributes['VALUE'] );
- break;
- case 'OPT':
- case 'CONSTRAINT':
- // Accept platform-specific options
- $this->currentPlatform = ( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) );
- break;
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Table/field constraint
- case 'CONSTRAINT':
- if( isset( $this->current_field ) ) {
- $this->addFieldOpt( $this->current_field, $this->currentElement, $cdata );
- } else {
- $this->addTableOpt( $cdata );
- }
- break;
- // Table/field option
- case 'OPT':
- if( isset( $this->current_field ) ) {
- $this->addFieldOpt( $this->current_field, $cdata );
- } else {
- $this->addTableOpt( $cdata );
- }
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'TABLE':
- $this->parent->addSQL( $this->create( $this->parent ) );
- xml_set_object( $parser, $this->parent );
- $this->destroy();
- break;
- case 'FIELD':
- unset($this->current_field);
- break;
- case 'OPT':
- case 'CONSTRAINT':
- $this->currentPlatform = true;
- break;
- default:
-
- }
- }
-
- /**
- * Adds an index to a table object
- *
- * @param array $attributes Index attributes
- * @return object dbIndex object
- */
- function addIndex( $attributes ) {
- $name = strtoupper( $attributes['NAME'] );
- $this->indexes[$name] = new dbIndex( $this, $attributes );
- return $this->indexes[$name];
- }
-
- /**
- * Adds data to a table object
- *
- * @param array $attributes Data attributes
- * @return object dbData object
- */
- function addData( $attributes ) {
- if( !isset( $this->data ) ) {
- $this->data = new dbData( $this, $attributes );
- }
- return $this->data;
- }
-
- /**
- * Adds a field to a table object
- *
- * $name is the name of the table to which the field should be added.
- * $type is an ADODB datadict field type. The following field types
- * are supported as of ADODB 3.40:
- * - C: varchar
- * - X: CLOB (character large object) or largest varchar size
- * if CLOB is not supported
- * - C2: Multibyte varchar
- * - X2: Multibyte CLOB
- * - B: BLOB (binary large object)
- * - D: Date (some databases do not support this, and we return a datetime type)
- * - T: Datetime or Timestamp
- * - L: Integer field suitable for storing booleans (0 or 1)
- * - I: Integer (mapped to I4)
- * - I1: 1-byte integer
- * - I2: 2-byte integer
- * - I4: 4-byte integer
- * - I8: 8-byte integer
- * - F: Floating point number
- * - N: Numeric or decimal number
- *
- * @param string $name Name of the table to which the field will be added.
- * @param string $type ADODB datadict field type.
- * @param string $size Field size
- * @param array $opts Field options array
- * @return array Field specifier array
- */
- function addField( $name, $type, $size = NULL, $opts = NULL ) {
- $field_id = $this->FieldID( $name );
-
- // Set the field index so we know where we are
- $this->current_field = $field_id;
-
- // Set the field name (required)
- $this->fields[$field_id]['NAME'] = $name;
-
- // Set the field type (required)
- $this->fields[$field_id]['TYPE'] = $type;
-
- // Set the field size (optional)
- if( isset( $size ) ) {
- $this->fields[$field_id]['SIZE'] = $size;
- }
-
- // Set the field options
- if( isset( $opts ) ) {
- $this->fields[$field_id]['OPTS'] = array($opts);
- } else {
- $this->fields[$field_id]['OPTS'] = array();
- }
- }
-
- /**
- * Adds a field option to the current field specifier
- *
- * This method adds a field option allowed by the ADOdb datadict
- * and appends it to the given field.
- *
- * @param string $field Field name
- * @param string $opt ADOdb field option
- * @param mixed $value Field option value
- * @return array Field specifier array
- */
- function addFieldOpt( $field, $opt, $value = NULL ) {
- if( $this->currentPlatform ) {
- if( !isset( $value ) ) {
- $this->fields[$this->FieldID( $field )]['OPTS'][] = $opt;
- // Add the option and value
- } else {
- $this->fields[$this->FieldID( $field )]['OPTS'][] = array( $opt => $value );
- }
- }
- }
-
- /**
- * Adds an option to the table
- *
- * This method takes a comma-separated list of table-level options
- * and appends them to the table object.
- *
- * @param string $opt Table option
- * @return array Options
- */
- function addTableOpt( $opt ) {
- if(isset($this->currentPlatform)) {
- $this->opts[$this->parent->db->databaseType] = $opt;
- }
- return $this->opts;
- }
-
-
- /**
- * Generates the SQL that will create the table in the database
- *
- * @param object $xmls adoSchema object
- * @return array Array containing table creation SQL
- */
- function create( &$xmls ) {
- $sql = array();
-
- // drop any existing indexes
- if( is_array( $legacy_indexes = $xmls->dict->MetaIndexes( $this->name ) ) ) {
- foreach( $legacy_indexes as $index => $index_details ) {
- $sql[] = $xmls->dict->DropIndexSQL( $index, $this->name );
- }
- }
-
- // remove fields to be dropped from table object
- foreach( $this->drop_field as $field ) {
- unset( $this->fields[$field] );
- }
-
- // if table exists
- if( is_array( $legacy_fields = $xmls->dict->MetaColumns( $this->name ) ) ) {
- // drop table
- if( $this->drop_table ) {
- $sql[] = $xmls->dict->DropTableSQL( $this->name );
-
- return $sql;
- }
-
- // drop any existing fields not in schema
- foreach( $legacy_fields as $field_id => $field ) {
- if( !isset( $this->fields[$field_id] ) ) {
- $sql[] = $xmls->dict->DropColumnSQL( $this->name, $field->name );
- }
- }
- // if table doesn't exist
- } else {
- if( $this->drop_table ) {
- return $sql;
- }
-
- $legacy_fields = array();
- }
-
- // Loop through the field specifier array, building the associative array for the field options
- $fldarray = array();
-
- foreach( $this->fields as $field_id => $finfo ) {
- // Set an empty size if it isn't supplied
- if( !isset( $finfo['SIZE'] ) ) {
- $finfo['SIZE'] = '';
- }
-
- // Initialize the field array with the type and size
- $fldarray[$field_id] = array(
- 'NAME' => $finfo['NAME'],
- 'TYPE' => $finfo['TYPE'],
- 'SIZE' => $finfo['SIZE']
- );
-
- // Loop through the options array and add the field options.
- if( isset( $finfo['OPTS'] ) ) {
- foreach( $finfo['OPTS'] as $opt ) {
- // Option has an argument.
- if( is_array( $opt ) ) {
- $key = key( $opt );
- $value = $opt[key( $opt )];
- @$fldarray[$field_id][$key] .= $value;
- // Option doesn't have arguments
- } else {
- $fldarray[$field_id][$opt] = $opt;
- }
- }
- }
- }
-
- if( empty( $legacy_fields ) ) {
- // Create the new table
- $sql[] = $xmls->dict->CreateTableSQL( $this->name, $fldarray, $this->opts );
- logMsg( end( $sql ), 'Generated CreateTableSQL' );
- } else {
- // Upgrade an existing table
- logMsg( "Upgrading {$this->name} using '{$xmls->upgrade}'" );
- switch( $xmls->upgrade ) {
- // Use ChangeTableSQL
- case 'ALTER':
- logMsg( 'Generated ChangeTableSQL (ALTERing table)' );
- $sql[] = $xmls->dict->ChangeTableSQL( $this->name, $fldarray, $this->opts );
- break;
- case 'REPLACE':
- logMsg( 'Doing upgrade REPLACE (testing)' );
- $sql[] = $xmls->dict->DropTableSQL( $this->name );
- $sql[] = $xmls->dict->CreateTableSQL( $this->name, $fldarray, $this->opts );
- break;
- // ignore table
- default:
- return array();
- }
- }
-
- foreach( $this->indexes as $index ) {
- $sql[] = $index->create( $xmls );
- }
-
- if( isset( $this->data ) ) {
- $sql[] = $this->data->create( $xmls );
- }
-
- return $sql;
- }
-
- /**
- * Marks a field or table for destruction
- */
- function drop() {
- if( isset( $this->current_field ) ) {
- // Drop the current field
- logMsg( "Dropping field '{$this->current_field}' from table '{$this->name}'" );
- // $this->drop_field[$this->current_field] = $xmls->dict->DropColumnSQL( $this->name, $this->current_field );
- $this->drop_field[$this->current_field] = $this->current_field;
- } else {
- // Drop the current table
- logMsg( "Dropping table '{$this->name}'" );
- // $this->drop_table = $xmls->dict->DropTableSQL( $this->name );
- $this->drop_table = TRUE;
- }
- }
-}
-
-/**
-* Creates an index object in ADOdb's datadict format
-*
-* This class stores information about a database index. As charactaristics
-* of the index are loaded from the external source, methods and properties
-* of this class are used to build up the index description in ADOdb's
-* datadict format.
-*
-* @package axmls
-* @access private
-*/
-class dbIndex extends dbObject {
-
- /**
- * @var string Index name
- */
- var $name;
-
- /**
- * @var array Index options: Index-level options
- */
- var $opts = array();
-
- /**
- * @var array Indexed fields: Table columns included in this index
- */
- var $columns = array();
-
- /**
- * @var boolean Mark index for destruction
- * @access private
- */
- var $drop = FALSE;
-
- /**
- * Initializes the new dbIndex object.
- *
- * @param object $parent Parent object
- * @param array $attributes Attributes
- *
- * @internal
- */
- function __construct( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
-
- $this->name = $this->prefix ($attributes['NAME']);
- }
-
- /**
- * XML Callback to process start elements
- *
- * Processes XML opening tags.
- * Elements currently processed are: DROP, CLUSTERED, BITMAP, UNIQUE, FULLTEXT & HASH.
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'DROP':
- $this->drop();
- break;
- case 'CLUSTERED':
- case 'BITMAP':
- case 'UNIQUE':
- case 'FULLTEXT':
- case 'HASH':
- // Add index Option
- $this->addIndexOpt( $this->currentElement );
- break;
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * Processes XML cdata.
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Index field name
- case 'COL':
- $this->addField( $cdata );
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'INDEX':
- xml_set_object( $parser, $this->parent );
- break;
- }
- }
-
- /**
- * Adds a field to the index
- *
- * @param string $name Field name
- * @return string Field list
- */
- function addField( $name ) {
- $this->columns[$this->FieldID( $name )] = $name;
-
- // Return the field list
- return $this->columns;
- }
-
- /**
- * Adds options to the index
- *
- * @param string $opt Comma-separated list of index options.
- * @return string Option list
- */
- function addIndexOpt( $opt ) {
- $this->opts[] = $opt;
-
- // Return the options list
- return $this->opts;
- }
-
- /**
- * Generates the SQL that will create the index in the database
- *
- * @param object $xmls adoSchema object
- * @return array Array containing index creation SQL
- */
- function create( &$xmls ) {
- if( $this->drop ) {
- return NULL;
- }
-
- // eliminate any columns that aren't in the table
- foreach( $this->columns as $id => $col ) {
- if( !isset( $this->parent->fields[$id] ) ) {
- unset( $this->columns[$id] );
- }
- }
-
- return $xmls->dict->CreateIndexSQL( $this->name, $this->parent->name, $this->columns, $this->opts );
- }
-
- /**
- * Marks an index for destruction
- */
- function drop() {
- $this->drop = TRUE;
- }
-}
-
-/**
-* Creates a data object in ADOdb's datadict format
-*
-* This class stores information about table data, and is called
-* when we need to load field data into a table.
-*
-* @package axmls
-* @access private
-*/
-class dbData extends dbObject {
-
- var $data = array();
-
- var $row;
-
- /**
- * Initializes the new dbData object.
- *
- * @param object $parent Parent object
- * @param array $attributes Attributes
- *
- * @internal
- */
- function __construct( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
- }
-
- /**
- * XML Callback to process start elements
- *
- * Processes XML opening tags.
- * Elements currently processed are: ROW and F (field).
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'ROW':
- $this->row = count( $this->data );
- $this->data[$this->row] = array();
- break;
- case 'F':
- $this->addField($attributes);
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * Processes XML cdata.
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Index field name
- case 'F':
- $this->addData( $cdata );
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'DATA':
- xml_set_object( $parser, $this->parent );
- break;
- }
- }
-
- /**
- * Adds a field to the insert
- *
- * @param string $name Field name
- * @return string Field list
- */
- function addField( $attributes ) {
- // check we're in a valid row
- if( !isset( $this->row ) || !isset( $this->data[$this->row] ) ) {
- return;
- }
-
- // Set the field index so we know where we are
- if( isset( $attributes['NAME'] ) ) {
- $this->current_field = $this->FieldID( $attributes['NAME'] );
- } else {
- $this->current_field = count( $this->data[$this->row] );
- }
-
- // initialise data
- if( !isset( $this->data[$this->row][$this->current_field] ) ) {
- $this->data[$this->row][$this->current_field] = '';
- }
- }
-
- /**
- * Adds options to the index
- *
- * @param string $opt Comma-separated list of index options.
- * @return string Option list
- */
- function addData( $cdata ) {
- // check we're in a valid field
- if ( isset( $this->data[$this->row][$this->current_field] ) ) {
- // add data to field
- $this->data[$this->row][$this->current_field] .= $cdata;
- }
- }
-
- /**
- * Generates the SQL that will add/update the data in the database
- *
- * @param object $xmls adoSchema object
- * @return array Array containing index creation SQL
- */
- function create( &$xmls ) {
- $table = $xmls->dict->TableName($this->parent->name);
- $table_field_count = count($this->parent->fields);
- $tables = $xmls->db->MetaTables();
- $sql = array();
-
- $ukeys = $xmls->db->MetaPrimaryKeys( $table );
- if( !empty( $this->parent->indexes ) and !empty( $ukeys ) ) {
- foreach( $this->parent->indexes as $indexObj ) {
- if( !in_array( $indexObj->name, $ukeys ) ) $ukeys[] = $indexObj->name;
- }
- }
-
- // eliminate any columns that aren't in the table
- foreach( $this->data as $row ) {
- $table_fields = $this->parent->fields;
- $fields = array();
- $rawfields = array(); // Need to keep some of the unprocessed data on hand.
-
- foreach( $row as $field_id => $field_data ) {
- if( !array_key_exists( $field_id, $table_fields ) ) {
- if( is_numeric( $field_id ) ) {
- $field_id = reset( array_keys( $table_fields ) );
- } else {
- continue;
- }
- }
-
- $name = $table_fields[$field_id]['NAME'];
-
- switch( $table_fields[$field_id]['TYPE'] ) {
- case 'I':
- case 'I1':
- case 'I2':
- case 'I4':
- case 'I8':
- $fields[$name] = intval($field_data);
- break;
- case 'C':
- case 'C2':
- case 'X':
- case 'X2':
- default:
- $fields[$name] = $xmls->db->qstr( $field_data );
- $rawfields[$name] = $field_data;
- }
-
- unset($table_fields[$field_id]);
-
- }
-
- // check that at least 1 column is specified
- if( empty( $fields ) ) {
- continue;
- }
-
- // check that no required columns are missing
- if( count( $fields ) < $table_field_count ) {
- foreach( $table_fields as $field ) {
- if( isset( $field['OPTS'] ) and ( in_array( 'NOTNULL', $field['OPTS'] ) || in_array( 'KEY', $field['OPTS'] ) ) && !in_array( 'AUTOINCREMENT', $field['OPTS'] ) ) {
- continue(2);
- }
- }
- }
-
- // The rest of this method deals with updating existing data records.
-
- if( !in_array( $table, $tables ) or ( $mode = $xmls->existingData() ) == XMLS_MODE_INSERT ) {
- // Table doesn't yet exist, so it's safe to insert.
- logMsg( "$table doesn't exist, inserting or mode is INSERT" );
- $sql[] = 'INSERT INTO '. $table .' ('. implode( ',', array_keys( $fields ) ) .') VALUES ('. implode( ',', $fields ) .')';
- continue;
- }
-
- // Prepare to test for potential violations. Get primary keys and unique indexes
- $mfields = array_merge( $fields, $rawfields );
- $keyFields = array_intersect( $ukeys, array_keys( $mfields ) );
-
- if( empty( $ukeys ) or count( $keyFields ) == 0 ) {
- // No unique keys in schema, so safe to insert
- logMsg( "Either schema or data has no unique keys, so safe to insert" );
- $sql[] = 'INSERT INTO '. $table .' ('. implode( ',', array_keys( $fields ) ) .') VALUES ('. implode( ',', $fields ) .')';
- continue;
- }
-
- // Select record containing matching unique keys.
- $where = '';
- foreach( $ukeys as $key ) {
- if( isset( $mfields[$key] ) and $mfields[$key] ) {
- if( $where ) $where .= ' AND ';
- $where .= $key . ' = ' . $xmls->db->qstr( $mfields[$key] );
- }
- }
- $records = $xmls->db->Execute( 'SELECT * FROM ' . $table . ' WHERE ' . $where );
- switch( $records->RecordCount() ) {
- case 0:
- // No matching record, so safe to insert.
- logMsg( "No matching records. Inserting new row with unique data" );
- $sql[] = $xmls->db->GetInsertSQL( $records, $mfields );
- break;
- case 1:
- // Exactly one matching record, so we can update if the mode permits.
- logMsg( "One matching record..." );
- if( $mode == XMLS_MODE_UPDATE ) {
- logMsg( "...Updating existing row from unique data" );
- $sql[] = $xmls->db->GetUpdateSQL( $records, $mfields );
- }
- break;
- default:
- // More than one matching record; the result is ambiguous, so we must ignore the row.
- logMsg( "More than one matching record. Ignoring row." );
- }
- }
- return $sql;
- }
-}
-
-/**
-* Creates the SQL to execute a list of provided SQL queries
-*
-* @package axmls
-* @access private
-*/
-class dbQuerySet extends dbObject {
-
- /**
- * @var array List of SQL queries
- */
- var $queries = array();
-
- /**
- * @var string String used to build of a query line by line
- */
- var $query;
-
- /**
- * @var string Query prefix key
- */
- var $prefixKey = '';
-
- /**
- * @var boolean Auto prefix enable (TRUE)
- */
- var $prefixMethod = 'AUTO';
-
- /**
- * Initializes the query set.
- *
- * @param object $parent Parent object
- * @param array $attributes Attributes
- */
- function __construct( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
-
- // Overrides the manual prefix key
- if( isset( $attributes['KEY'] ) ) {
- $this->prefixKey = $attributes['KEY'];
- }
-
- $prefixMethod = isset( $attributes['PREFIXMETHOD'] ) ? strtoupper( trim( $attributes['PREFIXMETHOD'] ) ) : '';
-
- // Enables or disables automatic prefix prepending
- switch( $prefixMethod ) {
- case 'AUTO':
- $this->prefixMethod = 'AUTO';
- break;
- case 'MANUAL':
- $this->prefixMethod = 'MANUAL';
- break;
- case 'NONE':
- $this->prefixMethod = 'NONE';
- break;
- }
- }
-
- /**
- * XML Callback to process start elements. Elements currently
- * processed are: QUERY.
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'QUERY':
- // Create a new query in a SQL queryset.
- // Ignore this query set if a platform is specified and it's different than the
- // current connection platform.
- if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
- $this->newQuery();
- } else {
- $this->discardQuery();
- }
- break;
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Line of queryset SQL data
- case 'QUERY':
- $this->buildQuery( $cdata );
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'QUERY':
- // Add the finished query to the open query set.
- $this->addQuery();
- break;
- case 'SQL':
- $this->parent->addSQL( $this->create( $this->parent ) );
- xml_set_object( $parser, $this->parent );
- $this->destroy();
- break;
- default:
-
- }
- }
-
- /**
- * Re-initializes the query.
- *
- * @return boolean TRUE
- */
- function newQuery() {
- $this->query = '';
-
- return TRUE;
- }
-
- /**
- * Discards the existing query.
- *
- * @return boolean TRUE
- */
- function discardQuery() {
- unset( $this->query );
-
- return TRUE;
- }
-
- /**
- * Appends a line to a query that is being built line by line
- *
- * @param string $data Line of SQL data or NULL to initialize a new query
- * @return string SQL query string.
- */
- function buildQuery( $sql = NULL ) {
- if( !isset( $this->query ) OR empty( $sql ) ) {
- return FALSE;
- }
-
- $this->query .= $sql;
-
- return $this->query;
- }
-
- /**
- * Adds a completed query to the query list
- *
- * @return string SQL of added query
- */
- function addQuery() {
- if( !isset( $this->query ) ) {
- return FALSE;
- }
-
- $this->queries[] = $return = trim($this->query);
-
- unset( $this->query );
-
- return $return;
- }
-
- /**
- * Creates and returns the current query set
- *
- * @param object $xmls adoSchema object
- * @return array Query set
- */
- function create( &$xmls ) {
- foreach( $this->queries as $id => $query ) {
- switch( $this->prefixMethod ) {
- case 'AUTO':
- // Enable auto prefix replacement
-
- // Process object prefix.
- // Evaluate SQL statements to prepend prefix to objects
- $query = $this->prefixQuery( '/^\s*((?is)INSERT\s+(INTO\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
- $query = $this->prefixQuery( '/^\s*((?is)UPDATE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
- $query = $this->prefixQuery( '/^\s*((?is)DELETE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
-
- // SELECT statements aren't working yet
- #$data = preg_replace( '/(?ias)(^\s*SELECT\s+.*\s+FROM)\s+(\W\s*,?\s*)+((?i)\s+WHERE.*$)/', "\1 $prefix\2 \3", $data );
-
- case 'MANUAL':
- // If prefixKey is set and has a value then we use it to override the default constant XMLS_PREFIX.
- // If prefixKey is not set, we use the default constant XMLS_PREFIX
- if( isset( $this->prefixKey ) AND( $this->prefixKey !== '' ) ) {
- // Enable prefix override
- $query = str_replace( $this->prefixKey, $xmls->objectPrefix, $query );
- } else {
- // Use default replacement
- $query = str_replace( XMLS_PREFIX , $xmls->objectPrefix, $query );
- }
- }
-
- $this->queries[$id] = trim( $query );
- }
-
- // Return the query set array
- return $this->queries;
- }
-
- /**
- * Rebuilds the query with the prefix attached to any objects
- *
- * @param string $regex Regex used to add prefix
- * @param string $query SQL query string
- * @param string $prefix Prefix to be appended to tables, indices, etc.
- * @return string Prefixed SQL query string.
- */
- function prefixQuery( $regex, $query, $prefix = NULL ) {
- if( !isset( $prefix ) ) {
- return $query;
- }
-
- if( preg_match( $regex, $query, $match ) ) {
- $preamble = $match[1];
- $postamble = $match[5];
- $objectList = explode( ',', $match[3] );
- // $prefix = $prefix . '_';
-
- $prefixedList = '';
-
- foreach( $objectList as $object ) {
- if( $prefixedList !== '' ) {
- $prefixedList .= ', ';
- }
-
- $prefixedList .= $prefix . trim( $object );
- }
-
- $query = $preamble . ' ' . $prefixedList . ' ' . $postamble;
- }
-
- return $query;
- }
-}
-
-/**
-* Loads and parses an XML file, creating an array of "ready-to-run" SQL statements
-*
-* This class is used to load and parse the XML file, to create an array of SQL statements
-* that can be used to build a database, and to build the database using the SQL array.
-*
-* @tutorial getting_started.pkg
-*
-* @author Richard Tango-Lowy & Dan Cech
-* @version $Revision: 1.62 $
-*
-* @package axmls
-*/
-class adoSchema {
-
- /**
- * @var array Array containing SQL queries to generate all objects
- * @access private
- */
- var $sqlArray;
-
- /**
- * @var object ADOdb connection object
- * @access private
- */
- var $db;
-
- /**
- * @var object ADOdb Data Dictionary
- * @access private
- */
- var $dict;
-
- /**
- * @var string Current XML element
- * @access private
- */
- var $currentElement = '';
-
- /**
- * @var string If set (to 'ALTER' or 'REPLACE'), upgrade an existing database
- * @access private
- */
- var $upgrade = '';
-
- /**
- * @var string Optional object prefix
- * @access private
- */
- var $objectPrefix = '';
-
- /**
- * @var long Original Magic Quotes Runtime value
- * @access private
- */
- var $mgq;
-
- /**
- * @var long System debug
- * @access private
- */
- var $debug;
-
- /**
- * @var string Regular expression to find schema version
- * @access private
- */
- var $versionRegex = '/' . htmlentities( $title ) . '
';
- }
-
- if( is_object( $this ) ) {
- echo '[' . get_class( $this ) . '] ';
- }
-
- print_r( $msg );
-
- echo '' . "\n";
-
- foreach( $msg as $label => $details ) {
- $error_details .= '
';
-
- trigger_error( $error_details, E_USER_ERROR );
- }
-
- /**
- * Returns the AXMLS Schema Version of the requested XML schema file.
- *
- * Call this method to obtain the AXMLS DTD version of the requested XML schema file.
- * @see SchemaStringVersion()
- *
- * @param string $filename AXMLS schema file
- * @return string Schema version number or FALSE on error
- */
- function SchemaFileVersion( $filename ) {
- // Open the file
- if( !($fp = fopen( $filename, 'r' )) ) {
- // die( 'Unable to open file' );
- return FALSE;
- }
-
- // Process the file
- while( $data = fread( $fp, 4096 ) ) {
- if( preg_match( $this->versionRegex, $data, $matches ) ) {
- return !empty( $matches[2] ) ? $matches[2] : XMLS_DEFAULT_SCHEMA_VERSION;
- }
- }
-
- return FALSE;
- }
-
- /**
- * Returns the AXMLS Schema Version of the provided XML schema string.
- *
- * Call this method to obtain the AXMLS DTD version of the provided XML schema string.
- * @see SchemaFileVersion()
- *
- * @param string $xmlstring XML schema string
- * @return string Schema version number or FALSE on error
- */
- function SchemaStringVersion( $xmlstring ) {
- if( !is_string( $xmlstring ) OR empty( $xmlstring ) ) {
- return FALSE;
- }
-
- if( preg_match( $this->versionRegex, $xmlstring, $matches ) ) {
- return !empty( $matches[2] ) ? $matches[2] : XMLS_DEFAULT_SCHEMA_VERSION;
- }
-
- return FALSE;
- }
-
- /**
- * Extracts an XML schema from an existing database.
- *
- * Call this method to create an XML schema string from an existing database.
- * If the data parameter is set to TRUE, AXMLS will include the data from the database
- * in the schema.
- *
- * @param boolean $data Include data in schema dump
- * @indent string indentation to use
- * @prefix string extract only tables with given prefix
- * @stripprefix strip prefix string when storing in XML schema
- * @return string Generated XML schema
- */
- function ExtractSchema( $data = FALSE, $indent = ' ', $prefix = '' , $stripprefix=false) {
- $old_mode = $this->db->SetFetchMode( ADODB_FETCH_NUM );
-
- $schema = '' . "\n"
- . ' ' . "\n";
- }
-
- $error_details .= '' . $label . ': ' . htmlentities( $details ) . ' ' . "\n";
-
- // grab details from database
- $rs = $this->db->Execute( 'SELECT * FROM ' . $table . ' WHERE -1' );
- $fields = $this->db->MetaColumns( $table );
- $indexes = $this->db->MetaIndexes( $table );
-
- if( is_array( $fields ) ) {
- foreach( $fields as $details ) {
- $extra = '';
- $content = array();
-
- if( isset($details->max_length) && $details->max_length > 0 ) {
- $extra .= ' size="' . $details->max_length . '"';
- }
-
- if( isset($details->primary_key) && $details->primary_key ) {
- $content[] = '
\n";
- }
- }
-
- $this->db->SetFetchMode( $old_mode );
-
- $schema .= '';
-
- if( isset( $title ) ) {
- echo '';
- }
-}
diff --git a/vendor/adodb/adodb-php/adodb.inc.php b/vendor/adodb/adodb-php/adodb.inc.php
deleted file mode 100644
index 62607a25..00000000
--- a/vendor/adodb/adodb-php/adodb.inc.php
+++ /dev/null
@@ -1,4975 +0,0 @@
-fields is available on EOF
- $ADODB_FETCH_MODE, // DEFAULT, NUM, ASSOC or BOTH. Default follows native driver default...
- $ADODB_GETONE_EOF,
- $ADODB_QUOTE_FIELDNAMES; // Allows you to force quotes (backticks) around field names in queries generated by getinsertsql and getupdatesql.
-
- //==============================================================================================
- // GLOBAL SETUP
- //==============================================================================================
-
- $ADODB_EXTENSION = defined('ADODB_EXTENSION');
-
- // ********************************************************
- // Controls $ADODB_FORCE_TYPE mode. Default is ADODB_FORCE_VALUE (3).
- // Used in GetUpdateSql and GetInsertSql functions. Thx to Niko, nuko#mbnet.fi
- //
- // 0 = ignore empty fields. All empty fields in array are ignored.
- // 1 = force null. All empty, php null and string 'null' fields are changed to sql NULL values.
- // 2 = force empty. All empty, php null and string 'null' fields are changed to sql empty '' or 0 values.
- // 3 = force value. Value is left as it is. Php null and string 'null' are set to sql NULL values and empty fields '' are set to empty '' sql values.
-
- define('ADODB_FORCE_IGNORE',0);
- define('ADODB_FORCE_NULL',1);
- define('ADODB_FORCE_EMPTY',2);
- define('ADODB_FORCE_VALUE',3);
- // ********************************************************
-
-
- if (!$ADODB_EXTENSION || ADODB_EXTENSION < 4.0) {
-
- define('ADODB_BAD_RS','' . htmlentities( $title ) . '
';
- }
-
- if( @is_object( $this ) ) {
- echo '[' . get_class( $this ) . '] ';
- }
-
- print_r( $msg );
-
- echo '\n". $rez."
");
- }
- }
- return $rez;
- }
-
- // flush one file in cache
- function flushcache($f, $debug=false) {
- if (!@unlink($f)) {
- if ($debug) {
- ADOConnection::outp( "flushcache: failed for $f");
- }
- }
- }
-
- function getdirname($hash) {
- global $ADODB_CACHE_DIR;
- if (!isset($this->notSafeMode)) {
- $this->notSafeMode = !ini_get('safe_mode');
- }
- return ($this->notSafeMode) ? $ADODB_CACHE_DIR.'/'.substr($hash,0,2) : $ADODB_CACHE_DIR;
- }
-
- // create temp directories
- function createdir($hash, $debug) {
- global $ADODB_CACHE_PERMS;
-
- $dir = $this->getdirname($hash);
- if ($this->notSafeMode && !file_exists($dir)) {
- $oldu = umask(0);
- if (!@mkdir($dir, empty($ADODB_CACHE_PERMS) ? 0771 : $ADODB_CACHE_PERMS)) {
- if(!is_dir($dir) && $debug) {
- ADOConnection::outp("Cannot create $dir");
- }
- }
- umask($oldu);
- }
-
- return $dir;
- }
-
- /**
- * Private function to erase all of the files and subdirectories in a directory.
- *
- * Just specify the directory, and tell it if you want to delete the directory or just clear it out.
- * Note: $kill_top_level is used internally in the function to flush subdirectories.
- */
- function _dirFlush($dir, $kill_top_level = false) {
- if(!$dh = @opendir($dir)) return;
-
- while (($obj = readdir($dh))) {
- if($obj=='.' || $obj=='..') continue;
- $f = $dir.'/'.$obj;
-
- if (strpos($obj,'.cache')) {
- @unlink($f);
- }
- if (is_dir($f)) {
- $this->_dirFlush($f, true);
- }
- }
- if ($kill_top_level === true) {
- @rmdir($dir);
- }
- return true;
- }
- }
-
- //==============================================================================================
- // CLASS ADOConnection
- //==============================================================================================
-
- /**
- * Connection object. For connecting to databases, and executing queries.
- */
- abstract class ADOConnection {
- //
- // PUBLIC VARS
- //
- var $dataProvider = 'native';
- var $databaseType = ''; /// RDBMS currently in use, eg. odbc, mysql, mssql
- var $database = ''; /// Name of database to be used.
- var $host = ''; /// The hostname of the database server
- var $user = ''; /// The username which is used to connect to the database server.
- var $password = ''; /// Password for the username. For security, we no longer store it.
- var $debug = false; /// if set to true will output sql statements
- var $maxblobsize = 262144; /// maximum size of blobs or large text fields (262144 = 256K)-- some db's die otherwise like foxpro
- var $concat_operator = '+'; /// default concat operator -- change to || for Oracle/Interbase
- var $substr = 'substr'; /// substring operator
- var $length = 'length'; /// string length ofperator
- var $random = 'rand()'; /// random function
- var $upperCase = 'upper'; /// uppercase function
- 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 A'"; /// used by DBTimeStamp as the default timestamp fmt.
- var $true = '1'; /// string that represents TRUE for a database
- var $false = '0'; /// string that represents FALSE for a database
- var $replaceQuote = "\\'"; /// string to use to replace quotes
- var $nameQuote = '"'; /// string to use to quote identifiers and names
- var $charSet=false; /// character set to use - only for interbase, postgres and oci8
- var $metaDatabasesSQL = '';
- var $metaTablesSQL = '';
- var $uniqueOrderBy = false; /// All order by columns have to be unique
- var $emptyDate = ' ';
- var $emptyTimeStamp = ' ';
- var $lastInsID = false;
- //--
- var $hasInsertID = false; /// supports autoincrement ID?
- var $hasAffectedRows = false; /// supports affected rows for update/delete?
- var $hasTop = false; /// support mssql/access SELECT TOP 10 * FROM TABLE
- var $hasLimit = false; /// support pgsql/mysql SELECT * FROM TABLE LIMIT 10
- var $readOnly = false; /// this is a readonly database - used by phpLens
- var $hasMoveFirst = false; /// has ability to run MoveFirst(), scrolling backwards
- var $hasGenID = false; /// can generate sequences using GenID();
- var $hasTransactions = true; /// has transactions
- //--
- var $genID = 0; /// sequence id used by GenID();
- var $raiseErrorFn = false; /// error function to call
- var $isoDates = false; /// accepts dates in ISO format
- var $cacheSecs = 3600; /// cache for 1 hour
-
- // memcache
- var $memCache = false; /// should we use memCache instead of caching in files
- var $memCacheHost; /// memCache host
- var $memCachePort = 11211; /// memCache port
- var $memCacheCompress = false; /// Use 'true' to store the item compressed (uses zlib)
-
- var $sysDate = false; /// name of function that returns the current date
- var $sysTimeStamp = false; /// name of function that returns the current timestamp
- var $sysUTimeStamp = false; // name of function that returns the current timestamp accurate to the microsecond or nearest fraction
- var $arrayClass = 'ADORecordSet_array'; /// name of class used to generate array recordsets, which are pre-downloaded recordsets
-
- var $noNullStrings = false; /// oracle specific stuff - if true ensures that '' is converted to ' '
- var $numCacheHits = 0;
- var $numCacheMisses = 0;
- var $pageExecuteCountRows = true;
- var $uniqueSort = false; /// indicates that all fields in order by must be unique
- var $leftOuter = false; /// operator to use for left outer join in WHERE clause
- var $rightOuter = false; /// operator to use for right outer join in WHERE clause
- var $ansiOuter = false; /// whether ansi outer join syntax supported
- var $autoRollback = false; // autoRollback on PConnect().
- var $poorAffectedRows = false; // affectedRows not working or unreliable
-
- var $fnExecute = false;
- var $fnCacheExecute = false;
- var $blobEncodeType = false; // false=not required, 'I'=encode to integer, 'C'=encode to char
- var $rsPrefix = "ADORecordSet_";
-
- var $autoCommit = true; /// do not modify this yourself - actually private
- var $transOff = 0; /// temporarily disable transactions
- var $transCnt = 0; /// count of nested transactions
-
- var $fetchMode=false;
-
- var $null2null = 'null'; // in autoexecute/getinsertsql/getupdatesql, this value will be converted to a null
- var $bulkBind = false; // enable 2D Execute array
- //
- // PRIVATE VARS
- //
- var $_oldRaiseFn = false;
- var $_transOK = null;
- var $_connectionID = false; /// The returned link identifier whenever a successful database connection is made.
- var $_errorMsg = false; /// A variable which was used to keep the returned last error message. The value will
- /// then returned by the errorMsg() function
- var $_errorCode = false; /// Last error code, not guaranteed to be used - only by oci8
- var $_queryID = false; /// This variable keeps the last created result link identifier
-
- var $_isPersistentConnection = false; /// A boolean variable to state whether its a persistent connection or normal connection. */
- var $_bindInputArray = false; /// set to true if ADOConnection.Execute() permits binding of array parameters.
- var $_evalAll = false;
- var $_affected = false;
- var $_logsql = false;
- var $_transmode = ''; // transaction mode
-
- /*
- * Additional parameters that may be passed to drivers in the connect string
- * Driver must be coded to accept the parameters
- */
- protected $connectionParameters = array();
-
- /**
- * Adds a parameter to the connection string.
- *
- * These parameters are added to the connection string when connecting,
- * if the driver is coded to use it.
- *
- * @param string $parameter The name of the parameter to set
- * @param string $value The value of the parameter
- *
- * @return null
- *
- * @example, for mssqlnative driver ('CharacterSet','UTF-8')
- */
- final public function setConnectionParameter($parameter,$value)
- {
-
- $this->connectionParameters[$parameter] = $value;
-
- }
-
- static function Version() {
- global $ADODB_vers;
-
- // Semantic Version number matching regex
- $regex = '^[vV]?(\d+\.\d+\.\d+' // Version number (X.Y.Z) with optional 'V'
- . '(?:-(?:' // Optional preprod version: a '-'
- . 'dev|' // followed by 'dev'
- . '(?:(?:alpha|beta|rc)(?:\.\d+))' // or a preprod suffix and version number
- . '))?)(?:\s|$)'; // Whitespace or end of string
-
- if (!preg_match("/$regex/", $ADODB_vers, $matches)) {
- // This should normally not happen... Return whatever is between the start
- // of the string and the first whitespace (or the end of the string).
- self::outp("Invalid version number: '$ADODB_vers'", 'Version');
- $regex = '^[vV]?(.*?)(?:\s|$)';
- preg_match("/$regex/", $ADODB_vers, $matches);
- }
- return $matches[1];
- }
-
- /**
- Get server version info...
-
- @returns An array with 2 elements: $arr['string'] is the description string,
- and $arr[version] is the version (also a string).
- */
- function ServerInfo() {
- return array('description' => '', 'version' => '');
- }
-
- function IsConnected() {
- return !empty($this->_connectionID);
- }
-
- function _findvers($str) {
- if (preg_match('/([0-9]+\.([0-9\.])+)/',$str, $arr)) {
- return $arr[1];
- } else {
- return '';
- }
- }
-
- /**
- * All error messages go through this bottleneck function.
- * You can define your own handler by defining the function name in ADODB_OUTP.
- */
- static function outp($msg,$newline=true) {
- global $ADODB_FLUSH,$ADODB_OUTP;
-
- if (defined('ADODB_OUTP')) {
- $fn = ADODB_OUTP;
- $fn($msg,$newline);
- return;
- } else if (isset($ADODB_OUTP)) {
- $fn = $ADODB_OUTP;
- $fn($msg,$newline);
- return;
- }
-
- if ($newline) {
- $msg .= "
\n";
- }
-
- if (isset($_SERVER['HTTP_USER_AGENT']) || !$newline) {
- echo $msg;
- } else {
- echo strip_tags($msg);
- }
-
-
- if (!empty($ADODB_FLUSH) && ob_get_length() !== false) {
- flush(); // do not flush if output buffering enabled - useless - thx to Jesse Mullan
- }
-
- }
-
- function Time() {
- $rs = $this->_Execute("select $this->sysTimeStamp");
- if ($rs && !$rs->EOF) {
- return $this->UnixTimeStamp(reset($rs->fields));
- }
-
- return false;
- }
-
- /**
- * Connect to database
- *
- * @param [argHostname] Host to connect to
- * @param [argUsername] Userid to login
- * @param [argPassword] Associated password
- * @param [argDatabaseName] database
- * @param [forceNew] force new connection
- *
- * @return true or false
- */
- function Connect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "", $forceNew = false) {
- if ($argHostname != "") {
- $this->host = $argHostname;
- }
- if ( strpos($this->host, ':') > 0 && isset($this->port) ) {
- list($this->host, $this->port) = explode(":", $this->host, 2);
- }
- if ($argUsername != "") {
- $this->user = $argUsername;
- }
- if ($argPassword != "") {
- $this->password = 'not stored'; // not stored for security reasons
- }
- if ($argDatabaseName != "") {
- $this->database = $argDatabaseName;
- }
-
- $this->_isPersistentConnection = false;
-
- if ($forceNew) {
- if ($rez=$this->_nconnect($this->host, $this->user, $argPassword, $this->database)) {
- return true;
- }
- } else {
- if ($rez=$this->_connect($this->host, $this->user, $argPassword, $this->database)) {
- return true;
- }
- }
- if (isset($rez)) {
- $err = $this->ErrorMsg();
- $errno = $this->ErrorNo();
- if (empty($err)) {
- $err = "Connection error to server '$argHostname' with user '$argUsername'";
- }
- } else {
- $err = "Missing extension for ".$this->dataProvider;
- $errno = 0;
- }
- if ($fn = $this->raiseErrorFn) {
- $fn($this->databaseType, 'CONNECT', $errno, $err, $this->host, $this->database, $this);
- }
-
- $this->_connectionID = false;
- if ($this->debug) {
- ADOConnection::outp( $this->host.': '.$err);
- }
- return false;
- }
-
- function _nconnect($argHostname, $argUsername, $argPassword, $argDatabaseName) {
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabaseName);
- }
-
-
- /**
- * Always force a new connection to database - currently only works with oracle
- *
- * @param [argHostname] Host to connect to
- * @param [argUsername] Userid to login
- * @param [argPassword] Associated password
- * @param [argDatabaseName] database
- *
- * @return true or false
- */
- function NConnect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "") {
- return $this->Connect($argHostname, $argUsername, $argPassword, $argDatabaseName, true);
- }
-
- /**
- * Establish persistent connect to database
- *
- * @param [argHostname] Host to connect to
- * @param [argUsername] Userid to login
- * @param [argPassword] Associated password
- * @param [argDatabaseName] database
- *
- * @return return true or false
- */
- function PConnect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "") {
-
- if (defined('ADODB_NEVER_PERSIST')) {
- return $this->Connect($argHostname,$argUsername,$argPassword,$argDatabaseName);
- }
-
- if ($argHostname != "") {
- $this->host = $argHostname;
- }
- if ( strpos($this->host, ':') > 0 && isset($this->port) ) {
- list($this->host, $this->port) = explode(":", $this->host, 2);
- }
- if ($argUsername != "") {
- $this->user = $argUsername;
- }
- if ($argPassword != "") {
- $this->password = 'not stored';
- }
- if ($argDatabaseName != "") {
- $this->database = $argDatabaseName;
- }
-
- $this->_isPersistentConnection = true;
-
- if ($rez = $this->_pconnect($this->host, $this->user, $argPassword, $this->database)) {
- return true;
- }
- if (isset($rez)) {
- $err = $this->ErrorMsg();
- if (empty($err)) {
- $err = "Connection error to server '$argHostname' with user '$argUsername'";
- }
- $ret = false;
- } else {
- $err = "Missing extension for ".$this->dataProvider;
- $ret = 0;
- }
- if ($fn = $this->raiseErrorFn) {
- $fn($this->databaseType,'PCONNECT',$this->ErrorNo(),$err,$this->host,$this->database,$this);
- }
-
- $this->_connectionID = false;
- if ($this->debug) {
- ADOConnection::outp( $this->host.': '.$err);
- }
- return $ret;
- }
-
- function outp_throw($msg,$src='WARN',$sql='') {
- if (defined('ADODB_ERROR_HANDLER') && ADODB_ERROR_HANDLER == 'adodb_throw') {
- adodb_throw($this->databaseType,$src,-9999,$msg,$sql,false,$this);
- return;
- }
- ADOConnection::outp($msg);
- }
-
- // create cache class. Code is backward compat with old memcache implementation
- function _CreateCache() {
- global $ADODB_CACHE, $ADODB_CACHE_CLASS;
-
- if ($this->memCache) {
- global $ADODB_INCLUDED_MEMCACHE;
-
- if (empty($ADODB_INCLUDED_MEMCACHE)) {
- include_once(ADODB_DIR.'/adodb-memcache.lib.inc.php');
- }
- $ADODB_CACHE = new ADODB_Cache_MemCache($this);
- } else {
- $ADODB_CACHE = new $ADODB_CACHE_CLASS($this);
- }
- }
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false) {
- if (!$col) {
- $col = $this->sysDate;
- }
- return $col; // child class implement
- }
-
- /**
- * Should prepare the sql statement and return the stmt resource.
- * For databases that do not support this, we return the $sql. To ensure
- * compatibility with databases that do not support prepare:
- *
- * $stmt = $db->Prepare("insert into table (id, name) values (?,?)");
- * $db->Execute($stmt,array(1,'Jill')) or die('insert failed');
- * $db->Execute($stmt,array(2,'Joe')) or die('insert failed');
- *
- * @param sql SQL to send to database
- *
- * @return return FALSE, or the prepared statement, or the original sql if
- * if the database does not support prepare.
- *
- */
- function Prepare($sql) {
- return $sql;
- }
-
- /**
- * Some databases, eg. mssql require a different function for preparing
- * stored procedures. So we cannot use Prepare().
- *
- * Should prepare the stored procedure and return the stmt resource.
- * For databases that do not support this, we return the $sql. To ensure
- * compatibility with databases that do not support prepare:
- *
- * @param sql SQL to send to database
- *
- * @return return FALSE, or the prepared statement, or the original sql if
- * if the database does not support prepare.
- *
- */
- function PrepareSP($sql,$param=true) {
- return $this->Prepare($sql,$param);
- }
-
- /**
- * PEAR DB Compat
- */
- function Quote($s) {
- return $this->qstr($s,false);
- }
-
- /**
- * Requested by "Karsten Dambekalns"
- * b. CompleteTrans auto-detects SQL errors, and will rollback on errors, commit otherwise.
- * c. All BeginTrans/CommitTrans/RollbackTrans inside a StartTrans/CompleteTrans block
- * are disabled, making it backward compatible.
- */
- function StartTrans($errfn = 'ADODB_TransMonitor') {
- if ($this->transOff > 0) {
- $this->transOff += 1;
- return true;
- }
-
- $this->_oldRaiseFn = $this->raiseErrorFn;
- $this->raiseErrorFn = $errfn;
- $this->_transOK = true;
-
- if ($this->debug && $this->transCnt > 0) {
- ADOConnection::outp("Bad Transaction: StartTrans called within BeginTrans");
- }
- $ok = $this->BeginTrans();
- $this->transOff = 1;
- return $ok;
- }
-
-
- /**
- Used together with StartTrans() to end a transaction. Monitors connection
- for sql errors, and will commit or rollback as appropriate.
-
- @autoComplete if true, monitor sql errors and commit and rollback as appropriate,
- and if set to false force rollback even if no SQL error detected.
- @returns true on commit, false on rollback.
- */
- function CompleteTrans($autoComplete = true) {
- if ($this->transOff > 1) {
- $this->transOff -= 1;
- return true;
- }
- $this->raiseErrorFn = $this->_oldRaiseFn;
-
- $this->transOff = 0;
- if ($this->_transOK && $autoComplete) {
- if (!$this->CommitTrans()) {
- $this->_transOK = false;
- if ($this->debug) {
- ADOConnection::outp("Smart Commit failed");
- }
- } else {
- if ($this->debug) {
- ADOConnection::outp("Smart Commit occurred");
- }
- }
- } else {
- $this->_transOK = false;
- $this->RollbackTrans();
- if ($this->debug) {
- ADOCOnnection::outp("Smart Rollback occurred");
- }
- }
-
- return $this->_transOK;
- }
-
- /*
- At the end of a StartTrans/CompleteTrans block, perform a rollback.
- */
- function FailTrans() {
- if ($this->debug)
- if ($this->transOff == 0) {
- ADOConnection::outp("FailTrans outside StartTrans/CompleteTrans");
- } else {
- ADOConnection::outp("FailTrans was called");
- adodb_backtrace();
- }
- $this->_transOK = false;
- }
-
- /**
- Check if transaction has failed, only for Smart Transactions.
- */
- function HasFailedTrans() {
- if ($this->transOff > 0) {
- return $this->_transOK == false;
- }
- return false;
- }
-
- /**
- * 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);
- # is_object check because oci8 descriptors can be passed in
- $array_2d = $this->bulkBind && is_array($element0) && !is_object(reset($element0));
-
- //remove extra memory copy of input -mikefedyk
- unset($element0);
-
- if (!is_array($sql) && !$this->_bindInputArray) {
- // @TODO this would consider a '?' within a string as a parameter...
- $sqlarr = explode('?',$sql);
- $nparams = sizeof($sqlarr)-1;
-
- if (!$array_2d) {
- // When not Bind Bulk - convert to array of arguments list
- $inputarr = array($inputarr);
- } else {
- // Bulk bind - Make sure all list of params have the same number of elements
- $countElements = array_map('count', $inputarr);
- if (1 != count(array_unique($countElements))) {
- $this->outp_throw(
- "[bulk execute] Input array has different number of params [" . print_r($countElements, true) . "].",
- 'Execute'
- );
- return false;
- }
- unset($countElements);
- }
- // Make sure the number of parameters provided in the input
- // array matches what the query expects
- $element0 = reset($inputarr);
- if ($nparams != count($element0)) {
- $this->outp_throw(
- "Input array has " . count($element0) .
- " params, does not match query: '" . htmlspecialchars($sql) . "'",
- 'Execute'
- );
- return false;
- }
-
- // clean memory
- unset($element0);
-
- foreach($inputarr as $arr) {
- $sql = ''; $i = 0;
- //Use each() instead of foreach to reduce memory usage -mikefedyk
- while(list(, $v) = each($arr)) {
- $sql .= $sqlarr[$i];
- // from Ron Baldwin \n";print_r($var);echo "
\n";
- } else {
- print_r($var);
- }
-
- if ($as_string) {
- $s = ob_get_contents();
- ob_end_clean();
- return $s;
- }
- }
-
- /*
- Perform a stack-crawl and pretty print it.
-
- @param printOrArr Pass in a boolean to indicate print, or an $exception->trace array (assumes that print is true then).
- @param levels Number of levels to display
- */
- function adodb_backtrace($printOrArr=true,$levels=9999,$ishtml=null) {
- global $ADODB_INCLUDED_LIB;
- if (empty($ADODB_INCLUDED_LIB)) {
- include(ADODB_DIR.'/adodb-lib.inc.php');
- }
- return _adodb_backtrace($printOrArr,$levels,0,$ishtml);
- }
-
-}
diff --git a/vendor/adodb/adodb-php/composer.json b/vendor/adodb/adodb-php/composer.json
deleted file mode 100644
index 21bd25f9..00000000
--- a/vendor/adodb/adodb-php/composer.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "name" : "adodb/adodb-php",
- "description" : "ADOdb is a PHP database abstraction layer library",
- "license" : [ "BSD-3-Clause", "LGPL-2.1" ],
- "authors" : [
- {
- "name": "John Lim",
- "email" : "jlim@natsoft.com",
- "role": "Author"
- },
- {
- "name": "Damien Regad",
- "role": "Current maintainer"
- },
- {
- "name": "Mark Newnham",
- "role": "Developer"
- }
- ],
-
- "keywords" : [ "database", "abstraction", "layer", "library", "php" ],
-
- "homepage": "http://adodb.org/",
- "support" : {
- "issues" : "https://github.com/ADOdb/ADOdb/issues",
- "source" : "https://github.com/ADOdb/ADOdb"
- },
-
- "require" : {
- "php" : ">=5.3.2"
- },
-
- "autoload" : {
- "files" : ["adodb.inc.php"]
- }
-
-}
diff --git a/vendor/adodb/adodb-php/contrib/toxmlrpc.inc.php b/vendor/adodb/adodb-php/contrib/toxmlrpc.inc.php
deleted file mode 100644
index f769cc5f..00000000
--- a/vendor/adodb/adodb-php/contrib/toxmlrpc.inc.php
+++ /dev/null
@@ -1,181 +0,0 @@
-GetArray()) would work with:
- * - ADODB_FETCH_BOTH
- * - null values
- */
-
- /**
- * Include the main libraries
- */
- require_once('xmlrpc.inc');
- if (!defined('ADODB_DIR')) require_once('adodb.inc.php');
-
- /**
- * Builds an xmlrpc struct value out of an AdoDB recordset
- */
- function rs2xmlrpcval(&$adodbrs) {
-
- $header = rs2xmlrpcval_header($adodbrs);
- $body = rs2xmlrpcval_body($adodbrs);
-
- // put it all together and build final xmlrpc struct
- $xmlrpcrs = new xmlrpcval ( array(
- "header" => $header,
- "body" => $body,
- ), "struct");
-
- return $xmlrpcrs;
-
- }
-
- /**
- * Builds an xmlrpc struct value describing an AdoDB recordset
- */
- function rs2xmlrpcval_header($adodbrs)
- {
- $numfields = $adodbrs->FieldCount();
- $numrecords = $adodbrs->RecordCount();
-
- // build structure holding recordset information
- $fieldstruct = array();
- for ($i = 0; $i < $numfields; $i++) {
- $fld = $adodbrs->FetchField($i);
- $fieldarray = array();
- if (isset($fld->name))
- $fieldarray["name"] = new xmlrpcval ($fld->name);
- if (isset($fld->type))
- $fieldarray["type"] = new xmlrpcval ($fld->type);
- if (isset($fld->max_length))
- $fieldarray["max_length"] = new xmlrpcval ($fld->max_length, "int");
- if (isset($fld->not_null))
- $fieldarray["not_null"] = new xmlrpcval ($fld->not_null, "boolean");
- if (isset($fld->has_default))
- $fieldarray["has_default"] = new xmlrpcval ($fld->has_default, "boolean");
- if (isset($fld->default_value))
- $fieldarray["default_value"] = new xmlrpcval ($fld->default_value);
- $fieldstruct[$i] = new xmlrpcval ($fieldarray, "struct");
- }
- $fieldcount = new xmlrpcval ($numfields, "int");
- $recordcount = new xmlrpcval ($numrecords, "int");
- $sql = new xmlrpcval ($adodbrs->sql);
- $fieldinfo = new xmlrpcval ($fieldstruct, "array");
-
- $header = new xmlrpcval ( array(
- "fieldcount" => $fieldcount,
- "recordcount" => $recordcount,
- "sql" => $sql,
- "fieldinfo" => $fieldinfo
- ), "struct");
-
- return $header;
- }
-
- /**
- * Builds an xmlrpc struct value out of an AdoDB recordset
- * (data values only, no data definition)
- */
- function rs2xmlrpcval_body($adodbrs)
- {
- $numfields = $adodbrs->FieldCount();
-
- // build structure containing recordset data
- $adodbrs->MoveFirst();
- $rows = array();
- while (!$adodbrs->EOF) {
- $columns = array();
- // This should work on all cases of fetch mode: assoc, num, both or default
- if ($adodbrs->fetchMode == 'ADODB_FETCH_BOTH' || count($adodbrs->fields) == 2 * $adodbrs->FieldCount())
- for ($i = 0; $i < $numfields; $i++)
- if ($adodbrs->fields[$i] === null)
- $columns[$i] = new xmlrpcval ('');
- else
- $columns[$i] = xmlrpc_encode ($adodbrs->fields[$i]);
- else
- foreach ($adodbrs->fields as $val)
- if ($val === null)
- $columns[] = new xmlrpcval ('');
- else
- $columns[] = xmlrpc_encode ($val);
-
- $rows[] = new xmlrpcval ($columns, "array");
-
- $adodbrs->MoveNext();
- }
- $body = new xmlrpcval ($rows, "array");
-
- return $body;
- }
-
- /**
- * Returns an xmlrpc struct value as string out of an AdoDB recordset
- */
- function rs2xmlrpcstring (&$adodbrs) {
- $xmlrpc = rs2xmlrpcval ($adodbrs);
- if ($xmlrpc)
- return $xmlrpc->serialize();
- else
- return null;
- }
-
- /**
- * Given a well-formed xmlrpc struct object returns an AdoDB object
- *
- * @todo add some error checking on the input value
- */
- function xmlrpcval2rs (&$xmlrpcval) {
-
- $fields_array = array();
- $data_array = array();
-
- // rebuild column information
- $header = $xmlrpcval->structmem('header');
-
- $numfields = $header->structmem('fieldcount');
- $numfields = $numfields->scalarval();
- $numrecords = $header->structmem('recordcount');
- $numrecords = $numrecords->scalarval();
- $sqlstring = $header->structmem('sql');
- $sqlstring = $sqlstring->scalarval();
-
- $fieldinfo = $header->structmem('fieldinfo');
- for ($i = 0; $i < $numfields; $i++) {
- $temp = $fieldinfo->arraymem($i);
- $fld = new ADOFieldObject();
- while (list($key,$value) = $temp->structeach()) {
- if ($key == "name") $fld->name = $value->scalarval();
- if ($key == "type") $fld->type = $value->scalarval();
- if ($key == "max_length") $fld->max_length = $value->scalarval();
- if ($key == "not_null") $fld->not_null = $value->scalarval();
- if ($key == "has_default") $fld->has_default = $value->scalarval();
- if ($key == "default_value") $fld->default_value = $value->scalarval();
- } // while
- $fields_array[] = $fld;
- } // for
-
- // fetch recordset information into php array
- $body = $xmlrpcval->structmem('body');
- for ($i = 0; $i < $numrecords; $i++) {
- $data_array[$i]= array();
- $xmlrpcrs_row = $body->arraymem($i);
- for ($j = 0; $j < $numfields; $j++) {
- $temp = $xmlrpcrs_row->arraymem($j);
- $data_array[$i][$j] = $temp->scalarval();
- } // for j
- } // for i
-
- // finally build in-memory recordset object and return it
- $rs = new ADORecordSet_array();
- $rs->InitArrayFields($data_array,$fields_array);
- return $rs;
-
- }
diff --git a/vendor/adodb/adodb-php/cute_icons_for_site/adodb.gif b/vendor/adodb/adodb-php/cute_icons_for_site/adodb.gif
deleted file mode 100644
index c5e8dfc6..00000000
Binary files a/vendor/adodb/adodb-php/cute_icons_for_site/adodb.gif and /dev/null differ
diff --git a/vendor/adodb/adodb-php/cute_icons_for_site/adodb2.gif b/vendor/adodb/adodb-php/cute_icons_for_site/adodb2.gif
deleted file mode 100644
index f12ae203..00000000
Binary files a/vendor/adodb/adodb-php/cute_icons_for_site/adodb2.gif and /dev/null differ
diff --git a/vendor/adodb/adodb-php/datadict/datadict-access.inc.php b/vendor/adodb/adodb-php/datadict/datadict-access.inc.php
deleted file mode 100644
index c1459154..00000000
--- a/vendor/adodb/adodb-php/datadict/datadict-access.inc.php
+++ /dev/null
@@ -1,95 +0,0 @@
-debug) ADOConnection::outp("Warning: Access does not supported DEFAULT values (field $fname)");
- }
- if ($fnotnull) $suffix .= ' NOT NULL';
- if ($fconstraint) $suffix .= ' '.$fconstraint;
- return $suffix;
- }
-
- function CreateDatabase($dbname,$options=false)
- {
- return array();
- }
-
-
- function SetSchema($schema)
- {
- }
-
- function AlterColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
- {
- if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
- return array();
- }
-
-
- function DropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
- {
- if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
- return array();
- }
-
-}
diff --git a/vendor/adodb/adodb-php/datadict/datadict-db2.inc.php b/vendor/adodb/adodb-php/datadict/datadict-db2.inc.php
deleted file mode 100644
index 7d201ff1..00000000
--- a/vendor/adodb/adodb-php/datadict/datadict-db2.inc.php
+++ /dev/null
@@ -1,143 +0,0 @@
-debug) ADOConnection::outp("AlterColumnSQL not supported");
- return array();
- }
-
-
- function DropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
- {
- if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
- return array();
- }
-
-
- function ChangeTableSQL($tablename, $flds, $tableoptions = false)
- {
-
- /**
- Allow basic table changes to DB2 databases
- DB2 will fatally reject changes to non character columns
-
- */
-
- $validTypes = array("CHAR","VARC");
- $invalidTypes = array("BIGI","BLOB","CLOB","DATE", "DECI","DOUB", "INTE", "REAL","SMAL", "TIME");
- // check table exists
- $cols = $this->MetaColumns($tablename);
- if ( empty($cols)) {
- return $this->CreateTableSQL($tablename, $flds, $tableoptions);
- }
-
- // already exists, alter table instead
- list($lines,$pkey) = $this->_GenFields($flds);
- $alter = 'ALTER TABLE ' . $this->TableName($tablename);
- $sql = array();
-
- foreach ( $lines as $id => $v ) {
- if ( isset($cols[$id]) && is_object($cols[$id]) ) {
- /**
- If the first field of $v is the fieldname, and
- the second is the field type/size, we assume its an
- attempt to modify the column size, so check that it is allowed
- $v can have an indeterminate number of blanks between the
- fields, so account for that too
- */
- $vargs = explode(' ' , $v);
- // assume that $vargs[0] is the field name.
- $i=0;
- // Find the next non-blank value;
- for ($i=1;$i
";
-```
-
- As he says, the LOBs limitations are:
- - use OCINewDescriptor before binding
- - if Param is IN, uses save() before each execute. This is done automatically for you.
- - if Param is OUT, uses load() after each execute. This is done automatically for you.
- - when we bind $var as LOB, we create new descriptor and return it as a Bind Result, so if we want to use OUT parameters, we have to store somewhere &$var to load() data from LOB to it.
- - IN OUT params are not working now (should not be a big problem to fix it)
- - now mass binding not working too (I've wrote about it before)
-- Simplified Connect() and PConnect() error handling.
-- When extension not loaded, Connect() and PConnect() will return null. On connect error, the fns will return false.
-- CacheGetArray() added to code.
-- Added Init() to adorecordset_empty().
-- Changed postgres64 driver, MetaColumns() to not strip off quotes in default value if :: detected (type-casting of default).
-- Added test: if (!defined('ADODB_DIR')) die(). Useful to prevent hackers from detecting file paths.
-- Changed metaTablesSQL to ignore Postgres 7.4 information schemas (sql_*).
-- New polish language file by Grzegorz Pacan
-- Added support for UNION in _adodb_getcount().
-- Added security check for ADODB_DIR to limit path disclosure issues. Requested by postnuke team.
-- Added better error message support to oracle driver. Thx to Gaetano Giunta.
-- Added showSchema support to mysql.
-- Bind in oci8 did not handle $name=false properly. Fixed.
-- If extension not loaded, Connect(), PConnect(), NConnect() will return null.
-
-## 4.22 - 15 Apr 2004
-
-- Moved docs to own adodb/docs folder.
-- Fixed session bug when quoting compressed/encrypted data in Replace().
-- Netezza Driver and LDAP drivers contributed by Josh Eldridge.
-- GetMenu now uses rtrim() on values instead of trim().
-- Changed MetaColumnNames to return an associative array, keys being the field names in uppercase.
-- Suggested fix to adodb-ado.inc.php affected_rows to support PHP5 variants. Thx to Alexios Fakos.
-- Contributed bulgarian language file by Valentin Sheiretsky valio#valio.eu.org.
-- Contributed romanian language file by stefan bogdan.
-- GetInsertSQL now checks for table name (string) in $rs, and will create a recordset for that table automatically. Contributed by Walt Boring. Also added OCI_B_BLOB in bind on Walt's request - hope it doesn't break anything :-)
-- Some minor postgres speedups in `_initrs()`.
-- ChangeTableSQL checks now if MetaColumns returns empty. Thx Jason Judge.
-- Added ADOConnection::Time(), returns current database time in unix timestamp format, or false.
-
-## 4.21 - 20 Mar 2004
-
-- We no longer in SelectLimit for VFP driver add SELECT TOP X unless an ORDER BY exists.
-- Pim Koeman contributed dutch language file adodb-nl.inc.php.
-- Rick Hickerson added CLOB support to db2 datadict.
-- Added odbtp driver. Thx to "stefan bogdan" sbogdan#rsb.ro.
-- Changed PrepareSP() 2nd parameter, $cursor, to default to true (formerly false). Fixes oci8 backward compat problems with OUT params.
-- Fixed month calculation error in adodb-time.inc.php. 2102-June-01 appeared as 2102-May-32.
-- Updated PHP5 RC1 iterator support. API changed, hasMore() renamed to valid().
-- Changed internal format of serialized cache recordsets. As we store a version number, this should be backward compatible.
-- Error handling when driver file not found was flawed in ADOLoadCode(). Fixed.
-
-## 4.20 - 27 Feb 2004
-
-- Updated to AXMLS 1.01.
-- MetaForeignKeys for postgres7 modified by Edward Jaramilla, works on pg 7.4.
-- Now numbers accepts function calls or sequences for GetInsertSQL/GetUpdateSQL numeric fields.
-- Changed quotes of 'delete from $perf_table' to "". Thx Kehui (webmaster#kehui.net)
-- Added ServerInfo() for ifx, and putenv trim fix. Thx Fernando Ortiz.
-- Added addq(), which is analogous to addslashes().
-- Tested with php5b4. Fix some php5 compat problems with exceptions and sybase.
-- Carl-Christian Salvesen added patch to mssql _query to support binds greater than 4000 chars.
-- Mike suggested patch to PHP5 exception handler. $errno must be numeric.
-- Added double quotes (") to ADODB_TABLE_REGEX.
-- For oci8, Prepare(...,$cursor), $cursor's meaning was accidentally inverted in 4.11. This causes problems with ExecuteCursor() too, which calls Prepare() internally. Thx to William Lovaton.
-- Now dateHasTime property in connection object renamed to datetime for consistency. This could break bc.
-- Csongor Halmai reports that db2 SelectLimit with input array is not working. Fixed..
-
-## 4.11 - 27 Jan 2004
-
-- Csongor Halmai reports db2 binding not working. Reverted back to emulated binding.
-- Dan Cech modifies datadict code. Adds support for DropIndex. Minor cleanups.
-- Table misspelt in perf-oci8.inc.php. Changed v$conn_cache_advice to v$db_cache_advice. Reported by Steve W.
-- UserTimeStamp and DBTimeStamp did not handle YYYYMMDDHHMMSS format properly. Reported by Mike Muir. Fixed.
-- Changed oci8 Prepare(). Does not auto-allocate OCINewCursor automatically, unless 2nd param is set to true. This will break backward compat, if Prepare/Execute is used instead of ExecuteCursor. Reported by Chris Jones.
-- Added InParameter() and OutParameter(). Wrapper functions to Parameter(), but nicer because they are self-documenting.
-- Added 'R' handling in ActualType() to datadict-mysql.inc.php
-- Added ADOConnection::SerializableRS($rs). Returns a recordset that can be serialized in a session.
-- Added "Run SQL" to performance UI().
-- Misc spelling corrections in adodb-mysqli.inc.php, adodb-oci8.inc.php and datadict-oci8.inc.php, from Heinz Hombergs.
-- MetaIndexes() for ibase contributed by Heinz Hombergs.
-
-## 4.10 - 12 Jan 2004
-
-- Dan Cech contributed extensive changes to data dictionary to support name quoting (with `\``), and drop table/index.
-- Informix added cursorType property. Default remains IFX_SCROLL, but you can change to 0 (non-scrollable cursor) for performance.
-- Added ADODB_View_PrimaryKeys() for returning view primary keys to MetaPrimaryKeys().
-- Simplified chinese file, adodb-cn.inc.php from cysoft.
-- Added check for ctype_alnum in adodb-datadict.inc.php. Thx to Jason Judge.
-- Added connection parameter to ibase Prepare(). Fix by Daniel Hassan.
-- Added nameQuote for quoting identifiers and names to connection obj. Requested by Jason Judge. Also the data dictionary parser now detects `field name` and generates column names with spaces correctly.
-- BOOL type not recognised correctly as L. Fixed.
-- Fixed paths in ADODB_DIR for session files, and back-ported it to 4.05 (15 Dec 2003)
-- Added Schema to postgresql MetaTables. Thx to col#gear.hu
-- Empty postgresql recordsets that had blob fields did not set EOF properly. Fixed.
-- CacheSelectLimit internal parameters to SelectLimit were wrong. Thx to Nio.
-- Modified adodb_pr() and adodb_backtrace() to support command-line usage (eg. no html).
-- Fixed some fr and it lang errors. Thx to Gaetano G.
-- Added contrib directory, with adodb rs to xmlrpc convertor by Gaetano G.
-- Fixed array recordset bugs when `_skiprow1` is true. Thx to Gaetano G.
-- Fixed pivot table code when count is false.
-
-## 4.05 - 13 Dec 2003
-
-- Added MetaIndexes to data-dict code - thx to Dan Cech.
-- Rewritten session code by Ross Smith. Moved code to adodb/session directory.
-- Added function exists check on connecting to most drivers, so we don't crash with the unknown function error.
-- Smart Transactions failed with GenID() when it no seq table has been created because the sql statement fails. Fix by Mark Newnham.
-- Added $db->length, which holds name of function that returns strlen.
-- Fixed error handling for bad driver in ADONewConnection - passed too few params to error-handler.
-- Datadict did not handle types like 16.0 properly in _GetSize. Fixed.
-- Oci8 driver SelectLimit() bug &= instead of =& used. Thx to Swen Thümmler.
-- Jesse Mullan suggested not flushing outp when output buffering enabled. Due to Apache 2.0 bug. Added.
-- MetaTables/MetaColumns return ref bug with PHP5 fixed in adodb-datadict.inc.php.
-- New mysqli driver contributed by Arjen de Rijke. Based on adodb 3.40 driver. Then jlim added BeginTrans, CommitTrans, RollbackTrans, IfNull, SQLDate. Also fixed return ref bug.
-- $ADODB_FLUSH added, if true then force flush in debugging outp. Default is false. In earlier versions, outp defaulted to flush, which is not compat with apache 2.0.
-- Mysql driver's GenID() function did not work when when sql logging is on. Fixed.
-- $ADODB_SESSION_TBL not declared as global var. Not available if adodb-session.inc.php included in function. Fixed.
-- The input array not passed to Execute() in _adodb_getcount(). Fixed.
-
-## 4.04 - 13 Nov 2003
-
-- Switched back to foreach - faster than list-each.
-- Fixed bug in ado driver - wiping out $this->fields with date fields.
-- Performance Monitor, View SQL, Explain Plan did not work if strlen($SQL)>max($_GET length). Fixed.
-- Performance monitor, oci8 driver added memory sort ratio.
-- Added random property, returns SQL to generate a floating point number between 0 and 1;
-
-## 4.03 - 6 Nov 2003
-
-- The path to adodb-php4.inc.php and adodb-iterators.inc.php was not setup properly.
-- Patched SQLDate in interbase to support hours/mins/secs. Thx to ari kuorikoski.
-- Force autorollback for pgsql persistent connections - apparently pgsql did not autorollback properly before 4.3.4. See http://bugs.php.net/bug.php?id=25404
-
-## 4.02 - 5 Nov 2003
-
-- Some errors in adodb_error_pg() fixed. Thx to Styve.
-- Spurious Insert_ID() error was generated by LogSQL(). Fixed.
-- Insert_ID was interfering with Affected_Rows() and Replace() when LogSQL() enabled. Fixed.
-- More foreach loops optimized with list/each.
-- Null dates not handled properly in ADO driver (it becomes 31 Dec 1969!).
-- Heinz Hombergs contributed patches for mysql MetaColumns - adding scale, made interbase MetaColumns work with firebird/interbase, and added lang/adodb-de.inc.php.
-- Added INFORMIXSERVER environment variable.
-- Added $ADODB_ANSI_PADDING_OFF for interbase/firebird.
-- PHP 5 beta 2 compat check. Foreach (Iterator) support. Exceptions support.
-
-## 4.01 - 23 Oct 2003
-
-- Fixed bug in rs2html(), tohtml.inc.php, that generated blank table cells.
-- Fixed insert_id() incorrectly generated when logsql() enabled.
-- Modified PostgreSQL _fixblobs to use list/each instead of foreach.
-- Informix ErrorNo() implemented correctly.
-- Modified several places to use list/each, including GetRowAssoc().
-- Added UserTimeStamp() to connection class.
-- Added $ADODB_ANSI_PADDING_OFF for oci8po.
-
-## 4.00 - 20 Oct 2003
-
-- Upgraded adodb-xmlschema to 1 Oct 2003 snapshot.
-- Fix to rs2html warning message. Thx to Filo.
-- Fix for odbc_mssql/mssql SQLDate(), hours was wrong.
-- Added MetaColumns and MetaPrimaryKeys for sybase. Thx to Chris Phillipson.
-- Added autoquoting to datadict for MySQL and PostgreSQL. Suggestion by Karsten Dambekalns
diff --git a/vendor/adodb/adodb-php/drivers/adodb-access.inc.php b/vendor/adodb/adodb-php/drivers/adodb-access.inc.php
deleted file mode 100644
index 3a5a8edc..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-access.inc.php
+++ /dev/null
@@ -1,88 +0,0 @@
-_connectionID);
- $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();
- //print_pre($arr);
- $arr2 = array();
- for ($i=0; $i < sizeof($arr); $i++) {
- if ($arr[$i][2] && $arr[$i][3] != 'SYSTEM TABLE')
- $arr2[] = $arr[$i][2];
- }
- return $arr2;
- }*/
-}
-
-
-class ADORecordSet_access extends ADORecordSet_odbc {
-
- var $databaseType = "access";
-
- function __construct($id,$mode=false)
- {
- return parent::__construct($id,$mode);
- }
-}// class
-}
diff --git a/vendor/adodb/adodb-php/drivers/adodb-ado.inc.php b/vendor/adodb/adodb-php/drivers/adodb-ado.inc.php
deleted file mode 100644
index 449cdd00..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-ado.inc.php
+++ /dev/null
@@ -1,660 +0,0 @@
-_affectedRows = new VARIANT;
- }
-
- function ServerInfo()
- {
- if (!empty($this->_connectionID)) $desc = $this->_connectionID->provider;
- return array('description' => $desc, 'version' => '');
- }
-
- function _affectedrows()
- {
- if (PHP_VERSION >= 5) return $this->_affectedRows;
-
- return $this->_affectedRows->value;
- }
-
- // you can also pass a connection string like this:
- //
- // $DB->Connect('USER ID=sa;PASSWORD=pwd;SERVER=mangrove;DATABASE=ai',false,false,'SQLOLEDB');
- function _connect($argHostname, $argUsername, $argPassword, $argProvider= 'MSDASQL')
- {
- $u = 'UID';
- $p = 'PWD';
-
- if (!empty($this->charPage))
- $dbc = new COM('ADODB.Connection',null,$this->charPage);
- else
- $dbc = new COM('ADODB.Connection');
-
- if (! $dbc) return false;
-
- /* special support if provider is mssql or access */
- if ($argProvider=='mssql') {
- $u = 'User Id'; //User parameter name for OLEDB
- $p = 'Password';
- $argProvider = "SQLOLEDB"; // SQL Server Provider
-
- // not yet
- //if ($argDatabasename) $argHostname .= ";Initial Catalog=$argDatabasename";
-
- //use trusted conection for SQL if username not specified
- if (!$argUsername) $argHostname .= ";Trusted_Connection=Yes";
- } else if ($argProvider=='access')
- $argProvider = "Microsoft.Jet.OLEDB.4.0"; // Microsoft Jet Provider
-
- if ($argProvider) $dbc->Provider = $argProvider;
-
- if ($argUsername) $argHostname .= ";$u=$argUsername";
- if ($argPassword)$argHostname .= ";$p=$argPassword";
-
- if ($this->debug) ADOConnection::outp( "Host=".$argHostname."
\n version=$dbc->version");
- // @ added below for php 4.0.1 and earlier
- @$dbc->Open((string) $argHostname);
-
- $this->_connectionID = $dbc;
-
- $dbc->CursorLocation = $this->_cursor_location;
- return $dbc->State > 0;
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argProvider='MSDASQL')
- {
- return $this->_connect($argHostname,$argUsername,$argPassword,$argProvider);
- }
-
-/*
- adSchemaCatalogs = 1,
- adSchemaCharacterSets = 2,
- adSchemaCollations = 3,
- adSchemaColumns = 4,
- adSchemaCheckConstraints = 5,
- adSchemaConstraintColumnUsage = 6,
- adSchemaConstraintTableUsage = 7,
- adSchemaKeyColumnUsage = 8,
- adSchemaReferentialContraints = 9,
- adSchemaTableConstraints = 10,
- adSchemaColumnsDomainUsage = 11,
- adSchemaIndexes = 12,
- adSchemaColumnPrivileges = 13,
- adSchemaTablePrivileges = 14,
- adSchemaUsagePrivileges = 15,
- adSchemaProcedures = 16,
- adSchemaSchemata = 17,
- adSchemaSQLLanguages = 18,
- adSchemaStatistics = 19,
- adSchemaTables = 20,
- adSchemaTranslations = 21,
- adSchemaProviderTypes = 22,
- adSchemaViews = 23,
- adSchemaViewColumnUsage = 24,
- adSchemaViewTableUsage = 25,
- adSchemaProcedureParameters = 26,
- adSchemaForeignKeys = 27,
- adSchemaPrimaryKeys = 28,
- adSchemaProcedureColumns = 29,
- adSchemaDBInfoKeywords = 30,
- adSchemaDBInfoLiterals = 31,
- adSchemaCubes = 32,
- adSchemaDimensions = 33,
- adSchemaHierarchies = 34,
- adSchemaLevels = 35,
- adSchemaMeasures = 36,
- adSchemaProperties = 37,
- adSchemaMembers = 38
-
-*/
-
- function MetaTables($ttype = false, $showSchema = false, $mask = false)
- {
- $arr= array();
- $dbc = $this->_connectionID;
-
- $adors=@$dbc->OpenSchema(20);//tables
- if ($adors){
- $f = $adors->Fields(2);//table/view name
- $t = $adors->Fields(3);//table type
- while (!$adors->EOF){
- $tt=substr($t->value,0,6);
- if ($tt!='SYSTEM' && $tt !='ACCESS')
- $arr[]=$f->value;
- //print $f->value . ' ' . $t->value.'
';
- $adors->MoveNext();
- }
- $adors->Close();
- }
-
- return $arr;
- }
-
- function MetaColumns($table, $normalize=true)
- {
- $table = strtoupper($table);
- $arr = array();
- $dbc = $this->_connectionID;
-
- $adors=@$dbc->OpenSchema(4);//tables
-
- if ($adors){
- $t = $adors->Fields(2);//table/view name
- while (!$adors->EOF){
-
-
- if (strtoupper($t->Value) == $table) {
-
- $fld = new ADOFieldObject();
- $c = $adors->Fields(3);
- $fld->name = $c->Value;
- $fld->type = 'CHAR'; // cannot discover type in ADO!
- $fld->max_length = -1;
- $arr[strtoupper($fld->name)]=$fld;
- }
-
- $adors->MoveNext();
- }
- $adors->Close();
- }
- $false = false;
- return empty($arr) ? $false : $arr;
- }
-
-
-
-
- /* returns queryID or false */
- function _query($sql,$inputarr=false)
- {
-
- $dbc = $this->_connectionID;
- $false = false;
-
- // return rs
- if ($inputarr) {
-
- if (!empty($this->charPage))
- $oCmd = new COM('ADODB.Command',null,$this->charPage);
- else
- $oCmd = new COM('ADODB.Command');
- $oCmd->ActiveConnection = $dbc;
- $oCmd->CommandText = $sql;
- $oCmd->CommandType = 1;
-
- // Map by http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmthcreateparam.asp
- // Check issue http://bugs.php.net/bug.php?id=40664 !!!
- while(list(, $val) = each($inputarr)) {
- $type = gettype($val);
- $len=strlen($val);
- if ($type == 'boolean')
- $this->adoParameterType = 11;
- else if ($type == 'integer')
- $this->adoParameterType = 3;
- else if ($type == 'double')
- $this->adoParameterType = 5;
- elseif ($type == 'string')
- $this->adoParameterType = 202;
- else if (($val === null) || (!defined($val)))
- $len=1;
- else
- $this->adoParameterType = 130;
-
- // name, type, direction 1 = input, len,
- $p = $oCmd->CreateParameter('name',$this->adoParameterType,1,$len,$val);
-
- $oCmd->Parameters->Append($p);
- }
- $p = false;
- $rs = $oCmd->Execute();
- $e = $dbc->Errors;
- if ($dbc->Errors->Count > 0) return $false;
- return $rs;
- }
-
- $rs = @$dbc->Execute($sql,$this->_affectedRows, $this->_execute_option);
-
- if ($dbc->Errors->Count > 0) return $false;
- if (! $rs) return $false;
-
- if ($rs->State == 0) {
- $true = true;
- return $true; // 0 = adStateClosed means no records returned
- }
- return $rs;
- }
-
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
-
- if (isset($this->_thisTransactions))
- if (!$this->_thisTransactions) return false;
- else {
- $o = $this->_connectionID->Properties("Transaction DDL");
- $this->_thisTransactions = $o ? true : false;
- if (!$o) return false;
- }
- @$this->_connectionID->BeginTrans();
- $this->transCnt += 1;
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if (!$ok) return $this->RollbackTrans();
- if ($this->transOff) return true;
-
- @$this->_connectionID->CommitTrans();
- if ($this->transCnt) @$this->transCnt -= 1;
- return true;
- }
- function RollbackTrans() {
- if ($this->transOff) return true;
- @$this->_connectionID->RollbackTrans();
- if ($this->transCnt) @$this->transCnt -= 1;
- return true;
- }
-
- /* Returns: the last error message from previous database operation */
-
- function ErrorMsg()
- {
- if (!$this->_connectionID) return "No connection established";
- $errc = $this->_connectionID->Errors;
- if (!$errc) return "No Errors object found";
- if ($errc->Count == 0) return '';
- $err = $errc->Item($errc->Count-1);
- return $err->Description;
- }
-
- function ErrorNo()
- {
- $errc = $this->_connectionID->Errors;
- if ($errc->Count == 0) return 0;
- $err = $errc->Item($errc->Count-1);
- return $err->NativeError;
- }
-
- // returns true or false
- function _close()
- {
- if ($this->_connectionID) $this->_connectionID->Close();
- $this->_connectionID = false;
- return true;
- }
-
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_ado extends ADORecordSet {
-
- var $bind = false;
- var $databaseType = "ado";
- var $dataProvider = "ado";
- var $_tarr = false; // caches the types
- var $_flds; // and field objects
- var $canSeek = true;
- var $hideErrors = true;
-
- function __construct($id,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- $this->fetchMode = $mode;
- return parent::__construct($id,$mode);
- }
-
-
- // returns the field object
- function FetchField($fieldOffset = -1) {
- $off=$fieldOffset+1; // offsets begin at 1
-
- $o= new ADOFieldObject();
- $rs = $this->_queryID;
- $f = $rs->Fields($fieldOffset);
- $o->name = $f->Name;
- $t = $f->Type;
- $o->type = $this->MetaType($t);
- $o->max_length = $f->DefinedSize;
- $o->ado_type = $t;
-
- //print "off=$off name=$o->name type=$o->type len=$o->max_length
";
- 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()
- {
- $rs = $this->_queryID;
- $this->_numOfRows = $rs->RecordCount;
-
- $f = $rs->Fields;
- $this->_numOfFields = $f->Count;
- }
-
-
- // should only be used to move forward as we normally use forward-only cursors
- function _seek($row)
- {
- $rs = $this->_queryID;
- // absoluteposition doesn't work -- my maths is wrong ?
- // $rs->AbsolutePosition->$row-2;
- // return true;
- if ($this->_currentRow > $row) return false;
- @$rs->Move((integer)$row - $this->_currentRow-1); //adBookmarkFirst
- return true;
- }
-
-/*
- OLEDB types
-
- enum DBTYPEENUM
- { DBTYPE_EMPTY = 0,
- DBTYPE_NULL = 1,
- DBTYPE_I2 = 2,
- DBTYPE_I4 = 3,
- DBTYPE_R4 = 4,
- DBTYPE_R8 = 5,
- DBTYPE_CY = 6,
- DBTYPE_DATE = 7,
- DBTYPE_BSTR = 8,
- DBTYPE_IDISPATCH = 9,
- DBTYPE_ERROR = 10,
- DBTYPE_BOOL = 11,
- DBTYPE_VARIANT = 12,
- DBTYPE_IUNKNOWN = 13,
- DBTYPE_DECIMAL = 14,
- DBTYPE_UI1 = 17,
- DBTYPE_ARRAY = 0x2000,
- DBTYPE_BYREF = 0x4000,
- DBTYPE_I1 = 16,
- DBTYPE_UI2 = 18,
- DBTYPE_UI4 = 19,
- DBTYPE_I8 = 20,
- DBTYPE_UI8 = 21,
- DBTYPE_GUID = 72,
- DBTYPE_VECTOR = 0x1000,
- DBTYPE_RESERVED = 0x8000,
- DBTYPE_BYTES = 128,
- DBTYPE_STR = 129,
- DBTYPE_WSTR = 130,
- DBTYPE_NUMERIC = 131,
- DBTYPE_UDT = 132,
- DBTYPE_DBDATE = 133,
- DBTYPE_DBTIME = 134,
- DBTYPE_DBTIMESTAMP = 135
-
- ADO Types
-
- adEmpty = 0,
- adTinyInt = 16,
- adSmallInt = 2,
- adInteger = 3,
- adBigInt = 20,
- adUnsignedTinyInt = 17,
- adUnsignedSmallInt = 18,
- adUnsignedInt = 19,
- adUnsignedBigInt = 21,
- adSingle = 4,
- adDouble = 5,
- adCurrency = 6,
- adDecimal = 14,
- adNumeric = 131,
- adBoolean = 11,
- adError = 10,
- adUserDefined = 132,
- adVariant = 12,
- adIDispatch = 9,
- adIUnknown = 13,
- adGUID = 72,
- adDate = 7,
- adDBDate = 133,
- adDBTime = 134,
- adDBTimeStamp = 135,
- adBSTR = 8,
- adChar = 129,
- adVarChar = 200,
- adLongVarChar = 201,
- adWChar = 130,
- adVarWChar = 202,
- adLongVarWChar = 203,
- adBinary = 128,
- adVarBinary = 204,
- adLongVarBinary = 205,
- adChapter = 136,
- adFileTime = 64,
- adDBFileTime = 137,
- adPropVariant = 138,
- adVarNumeric = 139
-*/
- function MetaType($t,$len=-1,$fieldobj=false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
-
- if (!is_numeric($t)) return $t;
-
- switch ($t) {
- case 0:
- case 12: // variant
- case 8: // bstr
- case 129: //char
- case 130: //wc
- case 200: // varc
- case 202:// varWC
- case 128: // bin
- case 204: // varBin
- case 72: // guid
- if ($len <= $this->blobSize) return 'C';
-
- case 201:
- case 203:
- return 'X';
- case 128:
- case 204:
- case 205:
- return 'B';
- case 7:
- case 133: return 'D';
-
- case 134:
- case 135: return 'T';
-
- case 11: return 'L';
-
- case 16:// adTinyInt = 16,
- case 2://adSmallInt = 2,
- case 3://adInteger = 3,
- case 4://adBigInt = 20,
- case 17://adUnsignedTinyInt = 17,
- case 18://adUnsignedSmallInt = 18,
- case 19://adUnsignedInt = 19,
- case 20://adUnsignedBigInt = 21,
- return 'I';
- default: return 'N';
- }
- }
-
- // time stamp not supported yet
- function _fetch()
- {
- $rs = $this->_queryID;
- if (!$rs or $rs->EOF) {
- $this->fields = false;
- return false;
- }
- $this->fields = array();
-
- if (!$this->_tarr) {
- $tarr = array();
- $flds = array();
- for ($i=0,$max = $this->_numOfFields; $i < $max; $i++) {
- $f = $rs->Fields($i);
- $flds[] = $f;
- $tarr[] = $f->Type;
- }
- // bind types and flds only once
- $this->_tarr = $tarr;
- $this->_flds = $flds;
- }
- $t = reset($this->_tarr);
- $f = reset($this->_flds);
-
- if ($this->hideErrors) $olde = error_reporting(E_ERROR|E_CORE_ERROR);// sometimes $f->value be null
- for ($i=0,$max = $this->_numOfFields; $i < $max; $i++) {
- //echo "
\n version=$dbc->version");
- // @ added below for php 4.0.1 and earlier
- @$dbc->Open((string) $argHostname);
-
- $this->_connectionID = $dbc;
-
- $dbc->CursorLocation = $this->_cursor_location;
- return $dbc->State > 0;
- } catch (exception $e) {
- if ($this->debug) echo "",$argHostname,"\n",$e,"
\n";
- }
-
- return false;
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argProvider='MSDASQL')
- {
- return $this->_connect($argHostname,$argUsername,$argPassword,$argProvider);
- }
-
-/*
- adSchemaCatalogs = 1,
- adSchemaCharacterSets = 2,
- adSchemaCollations = 3,
- adSchemaColumns = 4,
- adSchemaCheckConstraints = 5,
- adSchemaConstraintColumnUsage = 6,
- adSchemaConstraintTableUsage = 7,
- adSchemaKeyColumnUsage = 8,
- adSchemaReferentialContraints = 9,
- adSchemaTableConstraints = 10,
- adSchemaColumnsDomainUsage = 11,
- adSchemaIndexes = 12,
- adSchemaColumnPrivileges = 13,
- adSchemaTablePrivileges = 14,
- adSchemaUsagePrivileges = 15,
- adSchemaProcedures = 16,
- adSchemaSchemata = 17,
- adSchemaSQLLanguages = 18,
- adSchemaStatistics = 19,
- adSchemaTables = 20,
- adSchemaTranslations = 21,
- adSchemaProviderTypes = 22,
- adSchemaViews = 23,
- adSchemaViewColumnUsage = 24,
- adSchemaViewTableUsage = 25,
- adSchemaProcedureParameters = 26,
- adSchemaForeignKeys = 27,
- adSchemaPrimaryKeys = 28,
- adSchemaProcedureColumns = 29,
- adSchemaDBInfoKeywords = 30,
- adSchemaDBInfoLiterals = 31,
- adSchemaCubes = 32,
- adSchemaDimensions = 33,
- adSchemaHierarchies = 34,
- adSchemaLevels = 35,
- adSchemaMeasures = 36,
- adSchemaProperties = 37,
- adSchemaMembers = 38
-
-*/
-
- function MetaTables($ttype = false, $showSchema = false, $mask = false)
- {
- $arr= array();
- $dbc = $this->_connectionID;
-
- $adors=@$dbc->OpenSchema(20);//tables
- if ($adors){
- $f = $adors->Fields(2);//table/view name
- $t = $adors->Fields(3);//table type
- while (!$adors->EOF){
- $tt=substr($t->value,0,6);
- if ($tt!='SYSTEM' && $tt !='ACCESS')
- $arr[]=$f->value;
- //print $f->value . ' ' . $t->value.'
';
- $adors->MoveNext();
- }
- $adors->Close();
- }
-
- return $arr;
- }
-
- function MetaColumns($table, $normalize=true)
- {
- $table = strtoupper($table);
- $arr= array();
- $dbc = $this->_connectionID;
-
- $adors=@$dbc->OpenSchema(4);//tables
-
- if ($adors){
- $t = $adors->Fields(2);//table/view name
- while (!$adors->EOF){
-
-
- if (strtoupper($t->Value) == $table) {
-
- $fld = new ADOFieldObject();
- $c = $adors->Fields(3);
- $fld->name = $c->Value;
- $fld->type = 'CHAR'; // cannot discover type in ADO!
- $fld->max_length = -1;
- $arr[strtoupper($fld->name)]=$fld;
- }
-
- $adors->MoveNext();
- }
- $adors->Close();
- }
-
- return $arr;
- }
-
- /* returns queryID or false */
- function _query($sql,$inputarr=false)
- {
- try { // In PHP5, all COM errors are exceptions, so to maintain old behaviour...
-
- $dbc = $this->_connectionID;
-
- // return rs
-
- $false = false;
-
- if ($inputarr) {
-
- if (!empty($this->charPage))
- $oCmd = new COM('ADODB.Command',null,$this->charPage);
- else
- $oCmd = new COM('ADODB.Command');
- $oCmd->ActiveConnection = $dbc;
- $oCmd->CommandText = $sql;
- $oCmd->CommandType = 1;
-
- while(list(, $val) = each($inputarr)) {
- $type = gettype($val);
- $len=strlen($val);
- if ($type == 'boolean')
- $this->adoParameterType = 11;
- else if ($type == 'integer')
- $this->adoParameterType = 3;
- else if ($type == 'double')
- $this->adoParameterType = 5;
- elseif ($type == 'string')
- $this->adoParameterType = 202;
- else if (($val === null) || (!defined($val)))
- $len=1;
- else
- $this->adoParameterType = 130;
-
- // name, type, direction 1 = input, len,
- $p = $oCmd->CreateParameter('name',$this->adoParameterType,1,$len,$val);
-
- $oCmd->Parameters->Append($p);
- }
-
- $p = false;
- $rs = $oCmd->Execute();
- $e = $dbc->Errors;
- if ($dbc->Errors->Count > 0) return $false;
- return $rs;
- }
-
- $rs = @$dbc->Execute($sql,$this->_affectedRows, $this->_execute_option);
-
- if ($dbc->Errors->Count > 0) return $false;
- if (! $rs) return $false;
-
- if ($rs->State == 0) {
- $true = true;
- return $true; // 0 = adStateClosed means no records returned
- }
- return $rs;
-
- } catch (exception $e) {
-
- }
- return $false;
- }
-
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
-
- if (isset($this->_thisTransactions))
- if (!$this->_thisTransactions) return false;
- else {
- $o = $this->_connectionID->Properties("Transaction DDL");
- $this->_thisTransactions = $o ? true : false;
- if (!$o) return false;
- }
- @$this->_connectionID->BeginTrans();
- $this->transCnt += 1;
- return true;
- }
- function CommitTrans($ok=true)
- {
- if (!$ok) return $this->RollbackTrans();
- if ($this->transOff) return true;
-
- @$this->_connectionID->CommitTrans();
- if ($this->transCnt) @$this->transCnt -= 1;
- return true;
- }
- function RollbackTrans() {
- if ($this->transOff) return true;
- @$this->_connectionID->RollbackTrans();
- if ($this->transCnt) @$this->transCnt -= 1;
- return true;
- }
-
- /* Returns: the last error message from previous database operation */
-
- function ErrorMsg()
- {
- if (!$this->_connectionID) return "No connection established";
- $errmsg = '';
-
- try {
- $errc = $this->_connectionID->Errors;
- if (!$errc) return "No Errors object found";
- if ($errc->Count == 0) return '';
- $err = $errc->Item($errc->Count-1);
- $errmsg = $err->Description;
- }catch(exception $e) {
- }
- return $errmsg;
- }
-
- function ErrorNo()
- {
- $errc = $this->_connectionID->Errors;
- if ($errc->Count == 0) return 0;
- $err = $errc->Item($errc->Count-1);
- return $err->NativeError;
- }
-
- // returns true or false
- function _close()
- {
- if ($this->_connectionID) $this->_connectionID->Close();
- $this->_connectionID = false;
- return true;
- }
-
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_ado extends ADORecordSet {
-
- var $bind = false;
- var $databaseType = "ado";
- var $dataProvider = "ado";
- var $_tarr = false; // caches the types
- var $_flds; // and field objects
- var $canSeek = true;
- var $hideErrors = true;
-
- function __construct($id,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- $this->fetchMode = $mode;
- return parent::__construct($id,$mode);
- }
-
-
- // returns the field object
- function FetchField($fieldOffset = -1) {
- $off=$fieldOffset+1; // offsets begin at 1
-
- $o= new ADOFieldObject();
- $rs = $this->_queryID;
- if (!$rs) return false;
-
- $f = $rs->Fields($fieldOffset);
- $o->name = $f->Name;
- $t = $f->Type;
- $o->type = $this->MetaType($t);
- $o->max_length = $f->DefinedSize;
- $o->ado_type = $t;
-
-
- //print "off=$off name=$o->name type=$o->type len=$o->max_length
";
- 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()
- {
- $rs = $this->_queryID;
-
- try {
- $this->_numOfRows = $rs->RecordCount;
- } catch (Exception $e) {
- $this->_numOfRows = -1;
- }
- $f = $rs->Fields;
- $this->_numOfFields = $f->Count;
- }
-
-
- // should only be used to move forward as we normally use forward-only cursors
- function _seek($row)
- {
- $rs = $this->_queryID;
- // absoluteposition doesn't work -- my maths is wrong ?
- // $rs->AbsolutePosition->$row-2;
- // return true;
- if ($this->_currentRow > $row) return false;
- @$rs->Move((integer)$row - $this->_currentRow-1); //adBookmarkFirst
- return true;
- }
-
-/*
- OLEDB types
-
- enum DBTYPEENUM
- { DBTYPE_EMPTY = 0,
- DBTYPE_NULL = 1,
- DBTYPE_I2 = 2,
- DBTYPE_I4 = 3,
- DBTYPE_R4 = 4,
- DBTYPE_R8 = 5,
- DBTYPE_CY = 6,
- DBTYPE_DATE = 7,
- DBTYPE_BSTR = 8,
- DBTYPE_IDISPATCH = 9,
- DBTYPE_ERROR = 10,
- DBTYPE_BOOL = 11,
- DBTYPE_VARIANT = 12,
- DBTYPE_IUNKNOWN = 13,
- DBTYPE_DECIMAL = 14,
- DBTYPE_UI1 = 17,
- DBTYPE_ARRAY = 0x2000,
- DBTYPE_BYREF = 0x4000,
- DBTYPE_I1 = 16,
- DBTYPE_UI2 = 18,
- DBTYPE_UI4 = 19,
- DBTYPE_I8 = 20,
- DBTYPE_UI8 = 21,
- DBTYPE_GUID = 72,
- DBTYPE_VECTOR = 0x1000,
- DBTYPE_RESERVED = 0x8000,
- DBTYPE_BYTES = 128,
- DBTYPE_STR = 129,
- DBTYPE_WSTR = 130,
- DBTYPE_NUMERIC = 131,
- DBTYPE_UDT = 132,
- DBTYPE_DBDATE = 133,
- DBTYPE_DBTIME = 134,
- DBTYPE_DBTIMESTAMP = 135
-
- ADO Types
-
- adEmpty = 0,
- adTinyInt = 16,
- adSmallInt = 2,
- adInteger = 3,
- adBigInt = 20,
- adUnsignedTinyInt = 17,
- adUnsignedSmallInt = 18,
- adUnsignedInt = 19,
- adUnsignedBigInt = 21,
- adSingle = 4,
- adDouble = 5,
- adCurrency = 6,
- adDecimal = 14,
- adNumeric = 131,
- adBoolean = 11,
- adError = 10,
- adUserDefined = 132,
- adVariant = 12,
- adIDispatch = 9,
- adIUnknown = 13,
- adGUID = 72,
- adDate = 7,
- adDBDate = 133,
- adDBTime = 134,
- adDBTimeStamp = 135,
- adBSTR = 8,
- adChar = 129,
- adVarChar = 200,
- adLongVarChar = 201,
- adWChar = 130,
- adVarWChar = 202,
- adLongVarWChar = 203,
- adBinary = 128,
- adVarBinary = 204,
- adLongVarBinary = 205,
- adChapter = 136,
- adFileTime = 64,
- adDBFileTime = 137,
- adPropVariant = 138,
- adVarNumeric = 139
-*/
- function MetaType($t,$len=-1,$fieldobj=false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
-
- if (!is_numeric($t)) return $t;
-
- switch ($t) {
- case 0:
- case 12: // variant
- case 8: // bstr
- case 129: //char
- case 130: //wc
- case 200: // varc
- case 202:// varWC
- case 128: // bin
- case 204: // varBin
- case 72: // guid
- if ($len <= $this->blobSize) return 'C';
-
- case 201:
- case 203:
- return 'X';
- case 128:
- case 204:
- case 205:
- return 'B';
- case 7:
- case 133: return 'D';
-
- case 134:
- case 135: return 'T';
-
- case 11: return 'L';
-
- case 16:// adTinyInt = 16,
- case 2://adSmallInt = 2,
- case 3://adInteger = 3,
- case 4://adBigInt = 20,
- case 17://adUnsignedTinyInt = 17,
- case 18://adUnsignedSmallInt = 18,
- case 19://adUnsignedInt = 19,
- case 20://adUnsignedBigInt = 21,
- return 'I';
- default: return 'N';
- }
- }
-
- // time stamp not supported yet
- function _fetch()
- {
- $rs = $this->_queryID;
- if (!$rs or $rs->EOF) {
- $this->fields = false;
- return false;
- }
- $this->fields = array();
-
- if (!$this->_tarr) {
- $tarr = array();
- $flds = array();
- for ($i=0,$max = $this->_numOfFields; $i < $max; $i++) {
- $f = $rs->Fields($i);
- $flds[] = $f;
- $tarr[] = $f->Type;
- }
- // bind types and flds only once
- $this->_tarr = $tarr;
- $this->_flds = $flds;
- }
- $t = reset($this->_tarr);
- $f = reset($this->_flds);
-
- if ($this->hideErrors) $olde = error_reporting(E_ERROR|E_CORE_ERROR);// sometimes $f->value be null
- for ($i=0,$max = $this->_numOfFields; $i < $max; $i++) {
- //echo "
"; flush();
- if ($this->curmode === false) $this->_connectionID = ads_connect($argDSN,$argUsername,$argPassword);
- else $this->_connectionID = ads_pconnect($argDSN,$argUsername,$argPassword,$this->curmode);
-
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- if ($this->_connectionID && $this->autoRollback) @ads_rollback($this->_connectionID);
- if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
-
- return $this->_connectionID != false;
- }
-
- // returns the Server version and Description
- function ServerInfo()
- {
-
- if (!empty($this->host) && ADODB_PHPVER >= 0x4300) {
- $stmt = $this->Prepare('EXECUTE PROCEDURE sp_mgGetInstallInfo()');
- $res = $this->Execute($stmt);
- if(!$res)
- print $this->ErrorMsg();
- else{
- $ret["version"]= $res->fields[3];
- $ret["description"]="Advantage Database Server";
- return $ret;
- }
- }
- else {
- return ADOConnection::ServerInfo();
- }
- }
-
-
- // returns true or false
- function CreateSequence($seqname = 'adodbseq', $start = 1)
- {
- $res = $this->Execute("CREATE TABLE $seqname ( ID autoinc( 1 ) ) IN DATABASE");
- if(!$res){
- print $this->ErrorMsg();
- return false;
- }
- else
- return true;
-
- }
-
- // returns true or false
- function DropSequence($seqname = 'adodbseq')
- {
- $res = $this->Execute("DROP TABLE $seqname");
- if(!$res){
- print $this->ErrorMsg();
- return false;
- }
- else
- return true;
- }
-
-
- // returns the generated ID or false
- // checks if the table already exists, else creates the table and inserts a record into the table
- // and gets the ID number of the last inserted record.
- function GenID($seqname = 'adodbseq', $start = 1)
- {
- $go = $this->Execute("select * from $seqname");
- if (!$go){
- $res = $this->Execute("CREATE TABLE $seqname ( ID autoinc( 1 ) ) IN DATABASE");
- if(!res){
- print $this->ErrorMsg();
- return false;
- }
- }
- $res = $this->Execute("INSERT INTO $seqname VALUES( DEFAULT )");
- if(!$res){
- print $this->ErrorMsg();
- return false;
- }
- else{
- $gen = $this->Execute("SELECT LastAutoInc( STATEMENT ) FROM system.iota");
- $ret = $gen->fields[0];
- return $ret;
- }
-
- }
-
-
-
-
- function ErrorMsg()
- {
- if ($this->_haserrorfunctions) {
- if ($this->_errorMsg !== false) return $this->_errorMsg;
- if (empty($this->_connectionID)) return @ads_errormsg();
- return @ads_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 = @ads_error();
- else $e = @ads_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 ads_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 = ads_commit($this->_connectionID);
- ads_autocommit($this->_connectionID,true);
- return $ret;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $this->_autocommit = true;
- $ret = ads_rollback($this->_connectionID);
- ads_autocommit($this->_connectionID,true);
- return $ret;
- }
-
-
- // Returns tables,Views or both on succesfull execution. Returns
- // tables by default on succesfull execustion.
- function &MetaTables($ttype = false, $showSchema = false, $mask = false)
- {
- $recordSet1 = $this->Execute("select * from system.tables");
- if(!$recordSet1){
- print $this->ErrorMsg();
- return false;
- }
- $recordSet2 = $this->Execute("select * from system.views");
- if(!$recordSet2){
- print $this->ErrorMsg();
- return false;
- }
- $i=0;
- while (!$recordSet1->EOF){
- $arr["$i"] = $recordSet1->fields[0];
- $recordSet1->MoveNext();
- $i=$i+1;
- }
- if($ttype=='FALSE'){
- while (!$recordSet2->EOF){
- $arr["$i"] = $recordSet2->fields[0];
- $recordSet2->MoveNext();
- $i=$i+1;
- }
- return $arr;
- }
- elseif($ttype=='VIEWS'){
- while (!$recordSet2->EOF){
- $arrV["$i"] = $recordSet2->fields[0];
- $recordSet2->MoveNext();
- $i=$i+1;
- }
- return $arrV;
- }
- else{
- return $arr;
- }
-
- }
-
- function &MetaPrimaryKeys($table, $owner = false)
- {
- $recordSet = $this->Execute("select table_primary_key from system.tables where name='$table'");
- if(!$recordSet){
- print $this->ErrorMsg();
- return false;
- }
- $i=0;
- while (!$recordSet->EOF){
- $arr["$i"] = $recordSet->fields[0];
- $recordSet->MoveNext();
- $i=$i+1;
- }
- return $arr;
- }
-
-/*
-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 = ads_tables($this->_connectionID);
- $rs = new ADORecordSet_ads($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 = ads_columns($this->_connectionID,$q,$o,strtoupper($table),'%');
- } */
-
- switch ($this->databaseType) {
- case 'access':
- case 'vfp':
- $qid = ads_columns($this->_connectionID);#,'%','',strtoupper($table),'%');
- break;
-
-
- case 'db2':
- $colname = "%";
- $qid = ads_columns($this->_connectionID, "", $schema, $table, $colname);
- break;
-
- default:
- $qid = @ads_columns($this->_connectionID,'%','%',strtoupper($table),'%');
- if (empty($qid)) $qid = ads_columns($this->_connectionID);
- break;
- }
- if (empty($qid)) return $false;
-
- $rs = new ADORecordSet_ads($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;
- }
-
- // Returns an array of columns names for a given table
- function &MetaColumnNames($table, $numIndexes = false, $useattnum = false)
- {
- $recordSet = $this->Execute("select name from system.columns where parent='$table'");
- if(!$recordSet){
- print $this->ErrorMsg();
- return false;
- }
- else{
- $i=0;
- while (!$recordSet->EOF){
- $arr["FIELD$i"] = $recordSet->fields[0];
- $recordSet->MoveNext();
- $i=$i+1;
- }
- return $arr;
- }
- }
-
-
- function Prepare($sql)
- {
- if (! $this->_bindInputArray) return $sql; // no binding
- $stmt = ads_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 = ads_prepare($this->_connectionID,$sql);
-
- if ($stmtid == false) {
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- return false;
- }
- }
-
- if (! ads_execute($stmtid,$inputarr)) {
- //@ads_free_result($stmtid);
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = ads_errormsg();
- $this->_errorCode = ads_error();
- }
- return false;
- }
-
- } else if (is_array($sql)) {
- $stmtid = $sql[1];
- if (!ads_execute($stmtid)) {
- //@ads_free_result($stmtid);
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = ads_errormsg();
- $this->_errorCode = ads_error();
- }
- return false;
- }
- } else
- {
-
- $stmtid = ads_exec($this->_connectionID,$sql);
-
- }
-
- $this->_lastAffectedRows = 0;
-
- if ($stmtid)
- {
-
- if (@ads_num_fields($stmtid) == 0) {
- $this->_lastAffectedRows = ads_num_rows($stmtid);
- $stmtid = true;
-
- } else {
-
- $this->_lastAffectedRows = 0;
- ads_binmode($stmtid,$this->binmode);
- ads_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 = ads_errormsg();
- $this->_errorCode = ads_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')
- {
- $sql = "UPDATE $table SET $column=? WHERE $where";
- $stmtid = ads_prepare($this->_connectionID,$sql);
- if ($stmtid == false){
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- return false;
- }
- if (! ads_execute($stmtid,array($val),array(SQL_BINARY) )){
- if ($this->_haserrorfunctions){
- $this->_errorMsg = ads_errormsg();
- $this->_errorCode = ads_error();
- }
- return false;
- }
- return TRUE;
- }
-
- // returns true or false
- function _close()
- {
- $ret = @ads_close($this->_connectionID);
- $this->_connectionID = false;
- return $ret;
- }
-
- function _affectedrows()
- {
- return $this->_lastAffectedRows;
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_ads extends ADORecordSet {
-
- var $bind = false;
- var $databaseType = "ads";
- var $dataProvider = "ads";
- var $useFetchArray;
- var $_has_stupid_odbc_fetch_api_change;
-
- function __construct($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;
- //parent::__construct($id);
- }
-
-
- // returns the field object
- function &FetchField($fieldOffset = -1)
- {
-
- $off=$fieldOffset+1; // offsets begin at 1
-
- $o= new ADOFieldObject();
- $o->name = @ads_field_name($this->_queryID,$off);
- $o->type = @ads_field_type($this->_queryID,$off);
- $o->max_length = @ads_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) ? @ads_num_rows($this->_queryID) : -1;
- $this->_numOfFields = @ads_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();
- }
-
- $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 = @ads_fetch_into($this->_queryID,$this->fields);
- else {
- $row = 0;
- $rez = @ads_fetch_into($this->_queryID,$row,$this->fields);
- }
- if ($rez) {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) {
- $this->fields =& $this->GetRowAssoc();
- }
- return true;
- }
- return false;
- }
-
- function _close()
- {
- return @ads_free_result($this->_queryID);
- }
-
-}
diff --git a/vendor/adodb/adodb-php/drivers/adodb-borland_ibase.inc.php b/vendor/adodb/adodb-php/drivers/adodb-borland_ibase.inc.php
deleted file mode 100644
index d3de2caa..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-borland_ibase.inc.php
+++ /dev/null
@@ -1,87 +0,0 @@
-transOff) return true;
- $this->transCnt += 1;
- $this->autoCommit = false;
- $this->_transactionID = ibase_trans($this->ibasetrans, $this->_connectionID);
- return $this->_transactionID;
- }
-
- function ServerInfo()
- {
- $arr['dialect'] = $this->dialect;
- switch($arr['dialect']) {
- case '':
- case '1': $s = 'Interbase 6.5, Dialect 1'; break;
- case '2': $s = 'Interbase 6.5, Dialect 2'; break;
- default:
- case '3': $s = 'Interbase 6.5, Dialect 3'; break;
- }
- $arr['version'] = '6.5';
- $arr['description'] = $s;
- return $arr;
- }
-
- // Note that Interbase 6.5 uses ROWS instead - don't you love forking wars!
- // SELECT col1, col2 FROM table ROWS 5 -- get 5 rows
- // SELECT col1, col2 FROM TABLE ORDER BY col1 ROWS 3 TO 7 -- first 5 skip 2
- // Firebird uses
- // SELECT FIRST 5 SKIP 2 col1, col2 FROM TABLE
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
- {
- if ($nrows > 0) {
- if ($offset <= 0) $str = " ROWS $nrows ";
- else {
- $a = $offset+1;
- $b = $offset+$nrows;
- $str = " ROWS $a TO $b";
- }
- } else {
- // ok, skip
- $a = $offset + 1;
- $str = " ROWS $a TO 999999999"; // 999 million
- }
- $sql .= $str;
-
- return ($secs2cache) ?
- $this->CacheExecute($secs2cache,$sql,$inputarr)
- :
- $this->Execute($sql,$inputarr);
- }
-
-};
-
-
-class ADORecordSet_borland_ibase extends ADORecordSet_ibase {
-
- var $databaseType = "borland_ibase";
-
- function __construct($id,$mode=false)
- {
- parent::__construct($id,$mode);
- }
-}
diff --git a/vendor/adodb/adodb-php/drivers/adodb-csv.inc.php b/vendor/adodb/adodb-php/drivers/adodb-csv.inc.php
deleted file mode 100644
index fd47784d..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-csv.inc.php
+++ /dev/null
@@ -1,207 +0,0 @@
-_insertid;
- }
-
- function _affectedrows()
- {
- return $this->_affectedrows;
- }
-
- function MetaDatabases()
- {
- return false;
- }
-
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (strtolower(substr($argHostname,0,7)) !== 'http://') return false;
- $this->_url = $argHostname;
- return true;
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (strtolower(substr($argHostname,0,7)) !== 'http://') return false;
- $this->_url = $argHostname;
- return true;
- }
-
- function MetaColumns($table, $normalize=true)
- {
- return false;
- }
-
-
- // parameters use PostgreSQL convention, not MySQL
- function SelectLimit($sql, $nrows = -1, $offset = -1, $inputarr = false, $secs2cache = 0)
- {
- global $ADODB_FETCH_MODE;
-
- $url = $this->_url.'?sql='.urlencode($sql)."&nrows=$nrows&fetch=".
- (($this->fetchMode !== false)?$this->fetchMode : $ADODB_FETCH_MODE).
- "&offset=$offset";
- $err = false;
- $rs = csv2rs($url,$err,false);
-
- if ($this->debug) print "$url
$err
";
-
- $at = strpos($err,'::::');
- if ($at === false) {
- $this->_errorMsg = $err;
- $this->_errorNo = (integer)$err;
- } else {
- $this->_errorMsg = substr($err,$at+4,1024);
- $this->_errorNo = -9999;
- }
- if ($this->_errorNo)
- if ($fn = $this->raiseErrorFn) {
- $fn($this->databaseType,'EXECUTE',$this->ErrorNo(),$this->ErrorMsg(),$sql,'');
- }
-
- if (is_object($rs)) {
-
- $rs->databaseType='csv';
- $rs->fetchMode = ($this->fetchMode !== false) ? $this->fetchMode : $ADODB_FETCH_MODE;
- $rs->connection = $this;
- }
- return $rs;
- }
-
- // returns queryID or false
- function _Execute($sql,$inputarr=false)
- {
- global $ADODB_FETCH_MODE;
-
- if (!$this->_bindInputArray && $inputarr) {
- $sqlarr = explode('?',$sql);
- $sql = '';
- $i = 0;
- foreach($inputarr as $v) {
-
- $sql .= $sqlarr[$i];
- if (gettype($v) == 'string')
- $sql .= $this->qstr($v);
- else if ($v === null)
- $sql .= 'NULL';
- else
- $sql .= $v;
- $i += 1;
-
- }
- $sql .= $sqlarr[$i];
- if ($i+1 != sizeof($sqlarr))
- print "Input Array does not match ?: ".htmlspecialchars($sql);
- $inputarr = false;
- }
-
- $url = $this->_url.'?sql='.urlencode($sql)."&fetch=".
- (($this->fetchMode !== false)?$this->fetchMode : $ADODB_FETCH_MODE);
- $err = false;
-
-
- $rs = csv2rs($url,$err,false);
- if ($this->debug) print urldecode($url)."
$err
";
- $at = strpos($err,'::::');
- if ($at === false) {
- $this->_errorMsg = $err;
- $this->_errorNo = (integer)$err;
- } else {
- $this->_errorMsg = substr($err,$at+4,1024);
- $this->_errorNo = -9999;
- }
-
- if ($this->_errorNo)
- if ($fn = $this->raiseErrorFn) {
- $fn($this->databaseType,'EXECUTE',$this->ErrorNo(),$this->ErrorMsg(),$sql,$inputarr);
- }
- if (is_object($rs)) {
- $rs->fetchMode = ($this->fetchMode !== false) ? $this->fetchMode : $ADODB_FETCH_MODE;
-
- $this->_affectedrows = $rs->affectedrows;
- $this->_insertid = $rs->insertid;
- $rs->databaseType='csv';
- $rs->connection = $this;
- }
- return $rs;
- }
-
- /* Returns: the last error message from previous database operation */
- function ErrorMsg()
- {
- return $this->_errorMsg;
- }
-
- /* Returns: the last error number from previous database operation */
- function ErrorNo()
- {
- return $this->_errorNo;
- }
-
- // returns true or false
- function _close()
- {
- return true;
- }
-} // class
-
-class ADORecordset_csv extends ADORecordset {
- function __construct($id,$mode=false)
- {
- parent::__construct($id,$mode);
- }
-
- function _close()
- {
- return true;
- }
-}
-
-} // define
diff --git a/vendor/adodb/adodb-php/drivers/adodb-db2.inc.php b/vendor/adodb/adodb-php/drivers/adodb-db2.inc.php
deleted file mode 100644
index e7b9dbdd..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-db2.inc.php
+++ /dev/null
@@ -1,849 +0,0 @@
-_haserrorfunctions = ADODB_PHPVER >= 0x4050;
- }
-
- // returns true or false
- function _connect($argDSN, $argUsername, $argPassword, $argDatabasename)
- {
- global $php_errormsg;
-
- if (!function_exists('db2_connect')) {
- ADOConnection::outp("Warning: The old ODBC based DB2 driver has been renamed 'odbc_db2'. This ADOdb driver calls PHP's native db2 extension which is not installed.");
- return null;
- }
- // This needs to be set before the connect().
- // Replaces the odbc_binmode() call that was in Execute()
- ini_set('ibm_db2.binmode', $this->binmode);
-
- if ($argDatabasename && empty($argDSN)) {
-
- if (stripos($argDatabasename,'UID=') && stripos($argDatabasename,'PWD=')) $this->_connectionID = db2_connect($argDatabasename,null,null);
- else $this->_connectionID = db2_connect($argDatabasename,$argUsername,$argPassword);
- } else {
- if ($argDatabasename) $schema = $argDatabasename;
- if (stripos($argDSN,'UID=') && stripos($argDSN,'PWD=')) $this->_connectionID = db2_connect($argDSN,null,null);
- else $this->_connectionID = db2_connect($argDSN,$argUsername,$argPassword);
- }
- if (isset($php_errormsg)) $php_errormsg = '';
-
- // For db2_connect(), there is an optional 4th arg. If present, it must be
- // an array of valid options. So far, we don't use them.
-
- $this->_errorMsg = @db2_conn_errormsg();
- if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
-
- if ($this->_connectionID && isset($schema)) $this->Execute("SET SCHEMA=$schema");
- return $this->_connectionID != false;
- }
-
- // returns true or false
- function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
- {
- global $php_errormsg;
-
- if (!function_exists('db2_connect')) return null;
-
- // This needs to be set before the connect().
- // Replaces the odbc_binmode() call that was in Execute()
- ini_set('ibm_db2.binmode', $this->binmode);
-
- if (isset($php_errormsg)) $php_errormsg = '';
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
-
- if ($argDatabasename && empty($argDSN)) {
-
- if (stripos($argDatabasename,'UID=') && stripos($argDatabasename,'PWD=')) $this->_connectionID = db2_pconnect($argDatabasename,null,null);
- else $this->_connectionID = db2_pconnect($argDatabasename,$argUsername,$argPassword);
- } else {
- if ($argDatabasename) $schema = $argDatabasename;
- if (stripos($argDSN,'UID=') && stripos($argDSN,'PWD=')) $this->_connectionID = db2_pconnect($argDSN,null,null);
- else $this->_connectionID = db2_pconnect($argDSN,$argUsername,$argPassword);
- }
- if (isset($php_errormsg)) $php_errormsg = '';
-
- $this->_errorMsg = @db2_conn_errormsg();
- if ($this->_connectionID && $this->autoRollback) @db2_rollback($this->_connectionID);
- if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
-
- if ($this->_connectionID && isset($schema)) $this->Execute("SET SCHEMA=$schema");
- return $this->_connectionID != false;
- }
-
- // format and return date string in database timestamp format
- function DBTimeStamp($ts, $isfld = false)
- {
- if (empty($ts) && $ts !== 0) return 'null';
- if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
- return 'TO_DATE('.adodb_date($this->fmtTimeStamp,$ts).",'YYYY-MM-DD HH24:MI:SS')";
- }
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- // use right() and replace() ?
- if (!$col) $col = $this->sysDate;
-
- /* use TO_CHAR() if $fmt is TO_CHAR() allowed fmt */
- if ($fmt== 'Y-m-d H:i:s')
- return 'TO_CHAR('.$col.", 'YYYY-MM-DD HH24:MI:SS')";
-
- $s = '';
-
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- if ($s) $s .= $this->concat_operator;
- $ch = $fmt[$i];
- switch($ch) {
- case 'Y':
- case 'y':
- if ($len==1) return "year($col)";
- $s .= "char(year($col))";
- break;
- case 'M':
- if ($len==1) return "monthname($col)";
- $s .= "substr(monthname($col),1,3)";
- break;
- case 'm':
- if ($len==1) return "month($col)";
- $s .= "right(digits(month($col)),2)";
- break;
- case 'D':
- case 'd':
- if ($len==1) return "day($col)";
- $s .= "right(digits(day($col)),2)";
- break;
- case 'H':
- case 'h':
- if ($len==1) return "hour($col)";
- if ($col != $this->sysDate) $s .= "right(digits(hour($col)),2)";
- else $s .= "''";
- break;
- case 'i':
- case 'I':
- if ($len==1) return "minute($col)";
- if ($col != $this->sysDate)
- $s .= "right(digits(minute($col)),2)";
- else $s .= "''";
- break;
- case 'S':
- case 's':
- if ($len==1) return "second($col)";
- if ($col != $this->sysDate)
- $s .= "right(digits(second($col)),2)";
- else $s .= "''";
- break;
- default:
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- $s .= $this->qstr($ch);
- }
- }
- return $s;
- }
-
-
- function ServerInfo()
- {
- $row = $this->GetRow("SELECT service_level, fixpack_num FROM TABLE(sysproc.env_get_inst_info())
- as INSTANCEINFO");
-
-
- if ($row) {
- $info['version'] = $row[0].':'.$row[1];
- $info['fixpack'] = $row[1];
- $info['description'] = '';
- } else {
- return ADOConnection::ServerInfo();
- }
-
- return $info;
- }
-
- function CreateSequence($seqname='adodbseq',$start=1)
- {
- if (empty($this->_genSeqSQL)) return false;
- $ok = $this->Execute(sprintf($this->_genSeqSQL,$seqname,$start));
- if (!$ok) return false;
- return true;
- }
-
- function DropSequence($seqname = 'adodbseq')
- {
- if (empty($this->_dropSeqSQL)) return false;
- return $this->Execute(sprintf($this->_dropSeqSQL,$seqname));
- }
-
- function SelectLimit($sql, $nrows = -1, $offset = -1, $inputArr = false, $secs2cache = 0)
- {
- $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;
- }
-
- /*
- 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!
- $num = $this->GetOne("VALUES NEXTVAL FOR $seq");
- return $num;
- }
-
-
- function ErrorMsg()
- {
- if ($this->_haserrorfunctions) {
- if ($this->_errorMsg !== false) return $this->_errorMsg;
- if (empty($this->_connectionID)) return @db2_conn_errormsg();
- return @db2_conn_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 = @db2_conn_error();
- else $e = @db2_conn_error($this->_connectionID);
-
- // bug in 4.0.6, error number can be corrupted string (should be 6 digits)
- // so we check and patch
- 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 db2_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 = db2_commit($this->_connectionID);
- db2_autocommit($this->_connectionID,true);
- return $ret;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $this->_autocommit = true;
- $ret = db2_rollback($this->_connectionID);
- db2_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 = @db2_primarykeys($this->_connectionID,'',$schema,$table);
-
- if (!$qid) {
- $ADODB_FETCH_MODE = $savem;
- return false;
- }
- $rs = new ADORecordSet_db2($qid);
- $ADODB_FETCH_MODE = $savem;
-
- if (!$rs) return false;
-
- $arr = $rs->GetArray();
- $rs->Close();
- $arr2 = array();
- for ($i=0; $i < sizeof($arr); $i++) {
- if ($arr[$i][3]) $arr2[] = $arr[$i][3];
- }
- return $arr2;
- }
-
- function MetaForeignKeys($table, $owner = FALSE, $upper = FALSE, $asociative = FALSE )
- {
- global $ADODB_FETCH_MODE;
-
- if ($this->uCaseTables) $table = strtoupper($table);
- $schema = '';
- $this->_findschema($table,$schema);
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $qid = @db2_foreign_keys($this->_connectionID,'',$schema,$table);
- if (!$qid) {
- $ADODB_FETCH_MODE = $savem;
- return false;
- }
- $rs = new ADORecordSet_db2($qid);
-
- $ADODB_FETCH_MODE = $savem;
- /*
- $rs->fields indices
- 0 PKTABLE_CAT
- 1 PKTABLE_SCHEM
- 2 PKTABLE_NAME
- 3 PKCOLUMN_NAME
- 4 FKTABLE_CAT
- 5 FKTABLE_SCHEM
- 6 FKTABLE_NAME
- 7 FKCOLUMN_NAME
- */
- if (!$rs) return false;
-
- $foreign_keys = array();
- while (!$rs->EOF) {
- if (strtoupper(trim($rs->fields[2])) == $table && (!$schema || strtoupper($rs->fields[1]) == $schema)) {
- if (!is_array($foreign_keys[$rs->fields[5].'.'.$rs->fields[6]]))
- $foreign_keys[$rs->fields[5].'.'.$rs->fields[6]] = array();
- $foreign_keys[$rs->fields[5].'.'.$rs->fields[6]][$rs->fields[7]] = $rs->fields[3];
- }
- $rs->MoveNext();
- }
-
- $rs->Close();
- return $foreign_key;
- }
-
-
- function MetaTables($ttype = false, $schema = false, $mask = false)
- {
- global $ADODB_FETCH_MODE;
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $qid = db2_tables($this->_connectionID);
-
- $rs = new ADORecordSet_db2($qid);
-
- $ADODB_FETCH_MODE = $savem;
- if (!$rs) {
- $false = false;
- return $false;
- }
-
- $arr = $rs->GetArray();
- $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];
- $owner = $arr[$i][1];
- $schemaval = ($schema) ? $arr[$i][1].'.' : '';
- if ($ttype) {
- if ($isview) {
- if (strncmp($type,'V',1) === 0) $arr2[] = $schemaval.$arr[$i][2];
- } else if (strncmp($owner,'SYS',3) !== 0) $arr2[] = $schemaval.$arr[$i][2];
- } else if (strncmp($owner,'SYS',3) !== 0) $arr2[] = $schemaval.$arr[$i][2];
- }
- return $arr2;
- }
-
-/*
-See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/db2/htm/db2datetime_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 (DB2VER >= 0x0300)
-#define SQL_DATETIME 9
-#endif
-#define SQL_VARCHAR 12
-
-
-/ One-parameter shortcuts for date/time data types /
-#if (DB2VER >= 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 DB2Types($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;
-
- $colname = "%";
- $qid = db2_columns($this->_connectionID, "", $schema, $table, $colname);
- if (empty($qid)) return $false;
-
- $rs = new ADORecordSet_db2($qid);
- $ADODB_FETCH_MODE = $savem;
-
- if (!$rs) return $false;
- $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) {
- if (strtoupper(trim($rs->fields[2])) == $table && (!$schema || strtoupper($rs->fields[1]) == $schema)) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[3];
- $fld->type = $this->DB2Types($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 ($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];
- $fld->primary_key = false;
- $retarr[strtoupper($fld->name)] = $fld;
- } else if (sizeof($retarr)>0)
- break;
- $rs->MoveNext();
- }
- $rs->Close();
- if (empty($retarr)) $retarr = false;
-
- $qid = db2_primary_keys($this->_connectionID, "", $schema, $table);
- if (empty($qid)) return $false;
-
- $rs = new ADORecordSet_db2($qid);
- $ADODB_FETCH_MODE = $savem;
-
- if (!$rs) return $retarr;
- $rs->_fetch();
-
- /*
- $rs->fields indices
- 0 TABLE_CAT
- 1 TABLE_SCHEM
- 2 TABLE_NAME
- 3 COLUMN_NAME
- 4 KEY_SEQ
- 5 PK_NAME
- */
- while (!$rs->EOF) {
- if (strtoupper(trim($rs->fields[2])) == $table && (!$schema || strtoupper($rs->fields[1]) == $schema)) {
- $retarr[strtoupper($rs->fields[3])]->primary_key = true;
- } else if (sizeof($retarr)>0)
- break;
- $rs->MoveNext();
- }
- $rs->Close();
-
- if (empty($retarr)) $retarr = false;
- return $retarr;
- }
-
-
- function Prepare($sql)
- {
- if (! $this->_bindInputArray) return $sql; // no binding
- $stmt = db2_prepare($this->_connectionID,$sql);
- if (!$stmt) {
- // we don't know whether db2 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 = db2_prepare($this->_connectionID,$sql);
-
- if ($stmtid == false) {
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- return false;
- }
- }
-
- if (! db2_execute($stmtid,$inputarr)) {
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = db2_stmt_errormsg();
- $this->_errorCode = db2_stmt_error();
- }
- return false;
- }
-
- } else if (is_array($sql)) {
- $stmtid = $sql[1];
- if (!db2_execute($stmtid)) {
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = db2_stmt_errormsg();
- $this->_errorCode = db2_stmt_error();
- }
- return false;
- }
- } else
- $stmtid = @db2_exec($this->_connectionID,$sql);
-
- $this->_lastAffectedRows = 0;
- if ($stmtid) {
- if (@db2_num_fields($stmtid) == 0) {
- $this->_lastAffectedRows = db2_num_rows($stmtid);
- $stmtid = true;
- } else {
- $this->_lastAffectedRows = 0;
- }
-
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = '';
- $this->_errorCode = 0;
- } else
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- } else {
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = db2_stmt_errormsg();
- $this->_errorCode = db2_stmt_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 = @db2_close($this->_connectionID);
- $this->_connectionID = false;
- return $ret;
- }
-
- function _affectedrows()
- {
- return $this->_lastAffectedRows;
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_db2 extends ADORecordSet {
-
- var $bind = false;
- var $databaseType = "db2";
- var $dataProvider = "db2";
- var $useFetchArray;
-
- function __construct($id,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- $this->fetchMode = $mode;
-
- $this->_queryID = $id;
- }
-
-
- // returns the field object
- function FetchField($offset = -1)
- {
- $o= new ADOFieldObject();
- $o->name = @db2_field_name($this->_queryID,$offset);
- $o->type = @db2_field_type($this->_queryID,$offset);
- $o->max_length = db2_field_width($this->_queryID,$offset);
- 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) ? @db2_num_rows($this->_queryID) : -1;
- $this->_numOfFields = @db2_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;
- }
-
- 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();
- }
-
- $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++;
-
- $this->fields = @db2_fetch_array($this->_queryID);
- if ($this->fields) {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) {
- $this->fields = $this->GetRowAssoc();
- }
- return true;
- }
- }
- $this->fields = false;
- $this->EOF = true;
- return false;
- }
-
- function _fetch()
- {
-
- $this->fields = db2_fetch_array($this->_queryID);
- if ($this->fields) {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) {
- $this->fields = $this->GetRowAssoc();
- }
- return true;
- }
- $this->fields = false;
- return false;
- }
-
- function _close()
- {
- return @db2_free_result($this->_queryID);
- }
-
-}
diff --git a/vendor/adodb/adodb-php/drivers/adodb-db2oci.inc.php b/vendor/adodb/adodb-php/drivers/adodb-db2oci.inc.php
deleted file mode 100644
index 91d61af1..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-db2oci.inc.php
+++ /dev/null
@@ -1,226 +0,0 @@
- $_COLONSZ) return $p;
- $_COLONARR[] = $v;
- return '?';
-}
-
-// smart remapping of :0, :1 bind vars to ? ?
-function _colonscope($sql,$arr)
-{
-global $_COLONARR,$_COLONSZ;
-
- $_COLONARR = array();
- $_COLONSZ = sizeof($arr);
-
- $sql2 = preg_replace("/(:[0-9]+)/e","_colontrack('\\1')",$sql);
-
- if (empty($_COLONARR)) return array($sql,$arr);
-
- foreach($_COLONARR as $k => $v) {
- $arr2[] = $arr[$v];
- }
-
- return array($sql2,$arr2);
-}
-*/
-
-/*
- Smart remapping of :0, :1 bind vars to ? ?
-
- Handles colons in comments -- and / * * / and in quoted strings.
-*/
-
-function _colonparser($sql,$arr)
-{
- $lensql = strlen($sql);
- $arrsize = sizeof($arr);
- $state = 'NORM';
- $at = 1;
- $ch = $sql[0];
- $ch2 = @$sql[1];
- $sql2 = '';
- $arr2 = array();
- $nprev = 0;
-
-
- while (strlen($ch)) {
-
- switch($ch) {
- case '/':
- if ($state == 'NORM' && $ch2 == '*') {
- $state = 'COMMENT';
-
- $at += 1;
- $ch = $ch2;
- $ch2 = $at < $lensql ? $sql[$at] : '';
- }
- break;
-
- case '*':
- if ($state == 'COMMENT' && $ch2 == '/') {
- $state = 'NORM';
-
- $at += 1;
- $ch = $ch2;
- $ch2 = $at < $lensql ? $sql[$at] : '';
- }
- break;
-
- case "\n":
- case "\r":
- if ($state == 'COMMENT2') $state = 'NORM';
- break;
-
- case "'":
- do {
- $at += 1;
- $ch = $ch2;
- $ch2 = $at < $lensql ? $sql[$at] : '';
- } while ($ch !== "'");
- break;
-
- case ':':
- if ($state == 'COMMENT' || $state == 'COMMENT2') break;
-
- //echo "$at=$ch $ch2, ";
- if ('0' <= $ch2 && $ch2 <= '9') {
- $n = '';
- $nat = $at;
- do {
- $at += 1;
- $ch = $ch2;
- $n .= $ch;
- $ch2 = $at < $lensql ? $sql[$at] : '';
- } while ('0' <= $ch && $ch <= '9');
- #echo "$n $arrsize ] ";
- $n = (integer) $n;
- if ($n < $arrsize) {
- $sql2 .= substr($sql,$nprev,$nat-$nprev-1).'?';
- $nprev = $at-1;
- $arr2[] = $arr[$n];
- }
- }
- break;
-
- case '-':
- if ($state == 'NORM') {
- if ($ch2 == '-') $state = 'COMMENT2';
- $at += 1;
- $ch = $ch2;
- $ch2 = $at < $lensql ? $sql[$at] : '';
- }
- break;
- }
-
- $at += 1;
- $ch = $ch2;
- $ch2 = $at < $lensql ? $sql[$at] : '';
- }
-
- if ($nprev == 0) {
- $sql2 = $sql;
- } else {
- $sql2 .= substr($sql,$nprev);
- }
-
- return array($sql2,$arr2);
-}
-
-class ADODB_db2oci extends ADODB_db2 {
- var $databaseType = "db2oci";
- var $sysTimeStamp = 'sysdate';
- var $sysDate = 'trunc(sysdate)';
- var $_bindInputArray = true;
-
- function Param($name,$type='C')
- {
- return ':'.$name;
- }
-
-
- function MetaTables($ttype = false, $schema = false, $mask = false)
- {
- global $ADODB_FETCH_MODE;
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $qid = db2_tables($this->_connectionID);
-
- $rs = new ADORecordSet_db2($qid);
-
- $ADODB_FETCH_MODE = $savem;
- if (!$rs) {
- $false = false;
- return $false;
- }
-
- $arr = $rs->GetArray();
- $rs->Close();
- $arr2 = array();
- // adodb_pr($arr);
- if ($ttype) {
- $isview = strncmp($ttype,'V',1) === 0;
- }
- for ($i=0; $i < sizeof($arr); $i++) {
- if (!$arr[$i][2]) continue;
- $type = $arr[$i][3];
- $schemaval = ($schema) ? $arr[$i][1].'.' : '';
- $name = $schemaval.$arr[$i][2];
- $owner = $arr[$i][1];
- if (substr($name,0,8) == 'EXPLAIN_') continue;
- if ($ttype) {
- if ($isview) {
- if (strncmp($type,'V',1) === 0) $arr2[] = $name;
- } else if (strncmp($type,'T',1) === 0 && strncmp($owner,'SYS',3) !== 0) $arr2[] = $name;
- } else if (strncmp($type,'T',1) === 0 && strncmp($owner,'SYS',3) !== 0) $arr2[] = $name;
- }
- return $arr2;
- }
-
- function _Execute($sql, $inputarr=false )
- {
- if ($inputarr) list($sql,$inputarr) = _colonparser($sql, $inputarr);
- return parent::_Execute($sql, $inputarr);
- }
-};
-
-
-class ADORecordSet_db2oci extends ADORecordSet_db2 {
-
- var $databaseType = "db2oci";
-
- function __construct($id,$mode=false)
- {
- return parent::__construct($id,$mode);
- }
-}
-
-} //define
diff --git a/vendor/adodb/adodb-php/drivers/adodb-db2ora.inc.php b/vendor/adodb/adodb-php/drivers/adodb-db2ora.inc.php
deleted file mode 100644
index 1261689d..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-db2ora.inc.php
+++ /dev/null
@@ -1,86 +0,0 @@
- $_COLONSZ) return $p[1];
- $_COLONARR[] = $v;
- return '?';
-}
-
-/**
- * smart remapping of :0, :1 bind vars to ? ?
- * @param string $sql SQL statement
- * @param array $arr parameters
- * @return array
- */
-function _colonscope($sql,$arr)
-{
-global $_COLONARR,$_COLONSZ;
-
- $_COLONARR = array();
- $_COLONSZ = sizeof($arr);
-
- $sql2 = preg_replace_callback('/(:[0-9]+)/', '_colontrack', $sql);
-
- if (empty($_COLONARR)) return array($sql,$arr);
-
- foreach($_COLONARR as $k => $v) {
- $arr2[] = $arr[$v];
- }
-
- return array($sql2,$arr2);
-}
-
-class ADODB_db2oci extends ADODB_db2 {
- var $databaseType = "db2oci";
- var $sysTimeStamp = 'sysdate';
- var $sysDate = 'trunc(sysdate)';
-
- function _Execute($sql, $inputarr = false)
- {
- if ($inputarr) list($sql,$inputarr) = _colonscope($sql, $inputarr);
- return parent::_Execute($sql, $inputarr);
- }
-};
-
-
-class ADORecordSet_db2oci extends ADORecordSet_odbc {
-
- var $databaseType = "db2oci";
-
- function __construct($id,$mode=false)
- {
- return parent::__construct($id,$mode);
- }
-}
-
-} //define
diff --git a/vendor/adodb/adodb-php/drivers/adodb-fbsql.inc.php b/vendor/adodb/adodb-php/drivers/adodb-fbsql.inc.php
deleted file mode 100644
index 9a2440cf..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-fbsql.inc.php
+++ /dev/null
@@ -1,267 +0,0 @@
-.
- Set tabs to 8.
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-if (! defined("_ADODB_FBSQL_LAYER")) {
- define("_ADODB_FBSQL_LAYER", 1 );
-
-class ADODB_fbsql extends ADOConnection {
- var $databaseType = 'fbsql';
- var $hasInsertID = true;
- var $hasAffectedRows = true;
- var $metaTablesSQL = "SHOW TABLES";
- var $metaColumnsSQL = "SHOW COLUMNS FROM %s";
- var $fmtTimeStamp = "'Y-m-d H:i:s'";
- var $hasLimit = false;
-
- function __construct()
- {
- }
-
- function _insertid()
- {
- return fbsql_insert_id($this->_connectionID);
- }
-
- function _affectedrows()
- {
- return fbsql_affected_rows($this->_connectionID);
- }
-
- function MetaDatabases()
- {
- $qid = fbsql_list_dbs($this->_connectionID);
- $arr = array();
- $i = 0;
- $max = fbsql_num_rows($qid);
- while ($i < $max) {
- $arr[] = fbsql_tablename($qid,$i);
- $i += 1;
- }
- return $arr;
- }
-
- // returns concatenated string
- function Concat()
- {
- $s = "";
- $arr = func_get_args();
- $first = true;
-
- $s = implode(',',$arr);
- if (sizeof($arr) > 0) return "CONCAT($s)";
- else return '';
- }
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- $this->_connectionID = fbsql_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)
- {
- $this->_connectionID = fbsql_pconnect($argHostname,$argUsername,$argPassword);
- if ($this->_connectionID === false) return false;
- if ($argDatabasename) return $this->SelectDB($argDatabasename);
- return true;
- }
-
- function MetaColumns($table, $normalize=true)
- {
- if ($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[0];
- $fld->type = $rs->fields[1];
-
- // split type into type(length):
- if (preg_match("/^(.+)\((\d+)\)$/", $fld->type, $query_array)) {
- $fld->type = $query_array[1];
- $fld->max_length = $query_array[2];
- } else {
- $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($fld->type,'blob') !== false);
-
- $retarr[strtoupper($fld->name)] = $fld;
- $rs->MoveNext();
- }
- $rs->Close();
- return $retarr;
- }
- return false;
- }
-
- // returns true or false
- function SelectDB($dbName)
- {
- $this->database = $dbName;
- if ($this->_connectionID) {
- return @fbsql_select_db($dbName,$this->_connectionID);
- }
- else return false;
- }
-
-
- // returns queryID or false
- function _query($sql,$inputarr=false)
- {
- return fbsql_query("$sql;",$this->_connectionID);
- }
-
- /* Returns: the last error message from previous database operation */
- function ErrorMsg()
- {
- $this->_errorMsg = @fbsql_error($this->_connectionID);
- return $this->_errorMsg;
- }
-
- /* Returns: the last error number from previous database operation */
- function ErrorNo()
- {
- return @fbsql_errno($this->_connectionID);
- }
-
- // returns true or false
- function _close()
- {
- return @fbsql_close($this->_connectionID);
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_fbsql extends ADORecordSet{
-
- var $databaseType = "fbsql";
- var $canSeek = true;
-
- function __construct($queryID,$mode=false)
- {
- if (!$mode) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode) {
- case ADODB_FETCH_NUM: $this->fetchMode = FBSQL_NUM; break;
- case ADODB_FETCH_ASSOC: $this->fetchMode = FBSQL_ASSOC; break;
- case ADODB_FETCH_BOTH:
- default:
- $this->fetchMode = FBSQL_BOTH; break;
- }
- return parent::__construct($queryID);
- }
-
- function _initrs()
- {
- GLOBAL $ADODB_COUNTRECS;
- $this->_numOfRows = ($ADODB_COUNTRECS) ? @fbsql_num_rows($this->_queryID):-1;
- $this->_numOfFields = @fbsql_num_fields($this->_queryID);
- }
-
-
-
- function FetchField($fieldOffset = -1) {
- if ($fieldOffset != -1) {
- $o = @fbsql_fetch_field($this->_queryID, $fieldOffset);
- //$o->max_length = -1; // fbsql returns the max length less spaces -- so it is unrealiable
- $f = @fbsql_field_flags($this->_queryID,$fieldOffset);
- $o->binary = (strpos($f,'binary')!== false);
- }
- else if ($fieldOffset == -1) { /* The $fieldOffset argument is not provided thus its -1 */
- $o = @fbsql_fetch_field($this->_queryID);// fbsql returns the max length less spaces -- so it is unrealiable
- //$o->max_length = -1;
- }
-
- return $o;
- }
-
- function _seek($row)
- {
- return @fbsql_data_seek($this->_queryID,$row);
- }
-
- function _fetch($ignore_fields=false)
- {
- $this->fields = @fbsql_fetch_array($this->_queryID,$this->fetchMode);
- return ($this->fields == true);
- }
-
- function _close() {
- return @fbsql_free_result($this->_queryID);
- }
-
- function MetaType($t,$len=-1,$fieldobj=false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
- $len = -1; // fbsql max_length is not accurate
- switch (strtoupper($t)) {
- case 'CHARACTER':
- case 'CHARACTER VARYING':
- case 'BLOB':
- case 'CLOB':
- case 'BIT':
- case 'BIT VARYING':
- if ($len <= $this->blobSize) return 'C';
-
- // so we have to check whether binary...
- case 'IMAGE':
- case 'LONGBLOB':
- case 'BLOB':
- case 'MEDIUMBLOB':
- return !empty($fieldobj->binary) ? 'B' : 'X';
-
- case 'DATE': return 'D';
-
- case 'TIME':
- case 'TIME WITH TIME ZONE':
- case 'TIMESTAMP':
- case 'TIMESTAMP WITH TIME ZONE': return 'T';
-
- case 'PRIMARY_KEY':
- return 'R';
- case 'INTEGER':
- case 'SMALLINT':
- case 'BOOLEAN':
-
- if (!empty($fieldobj->primary_key)) return 'R';
- else return 'I';
-
- default: return 'N';
- }
- }
-
-} //class
-} // defined
diff --git a/vendor/adodb/adodb-php/drivers/adodb-firebird.inc.php b/vendor/adodb/adodb-php/drivers/adodb-firebird.inc.php
deleted file mode 100644
index 415f66f2..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-firebird.inc.php
+++ /dev/null
@@ -1,73 +0,0 @@
-dialect;
- switch($arr['dialect']) {
- case '':
- case '1': $s = 'Firebird Dialect 1'; break;
- case '2': $s = 'Firebird Dialect 2'; break;
- default:
- case '3': $s = 'Firebird Dialect 3'; break;
- }
- $arr['version'] = ADOConnection::_findvers($s);
- $arr['description'] = $s;
- return $arr;
- }
-
- // Note that Interbase 6.5 uses this ROWS instead - don't you love forking wars!
- // SELECT col1, col2 FROM table ROWS 5 -- get 5 rows
- // SELECT col1, col2 FROM TABLE ORDER BY col1 ROWS 3 TO 7 -- first 5 skip 2
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false, $secs=0)
- {
- $nrows = (integer) $nrows;
- $offset = (integer) $offset;
- $str = 'SELECT ';
- if ($nrows >= 0) $str .= "FIRST $nrows ";
- $str .=($offset>=0) ? "SKIP $offset " : '';
-
- $sql = preg_replace('/^[ \t]*select/i',$str,$sql);
- if ($secs)
- $rs = $this->CacheExecute($secs,$sql,$inputarr);
- else
- $rs = $this->Execute($sql,$inputarr);
-
- return $rs;
- }
-
-
-};
-
-
-class ADORecordSet_firebird extends ADORecordSet_ibase {
-
- var $databaseType = "firebird";
-
- function __construct($id,$mode=false)
- {
- parent::__construct($id,$mode);
- }
-}
diff --git a/vendor/adodb/adodb-php/drivers/adodb-ibase.inc.php b/vendor/adodb/adodb-php/drivers/adodb-ibase.inc.php
deleted file mode 100644
index c4f0cbdb..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-ibase.inc.php
+++ /dev/null
@@ -1,918 +0,0 @@
-
- changed transaction handling and added experimental blob stuff
-
- Docs to interbase at the website
- http://www.synectics.co.za/php3/tutorial/IB_PHP3_API.html
-
- To use gen_id(), see
- http://www.volny.cz/iprenosil/interbase/ip_ib_code.htm#_code_creategen
-
- $rs = $conn->Execute('select gen_id(adodb,1) from rdb$database');
- $id = $rs->fields[0];
- $conn->Execute("insert into table (id, col1,...) values ($id, $val1,...)");
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-class ADODB_ibase extends ADOConnection {
- var $databaseType = "ibase";
- var $dataProvider = "ibase";
- var $replaceQuote = "''"; // string to use to replace quotes
- var $ibase_datefmt = '%Y-%m-%d'; // For hours,mins,secs change to '%Y-%m-%d %H:%M:%S';
- var $fmtDate = "'Y-m-d'";
- var $ibase_timestampfmt = "%Y-%m-%d %H:%M:%S";
- var $ibase_timefmt = "%H:%M:%S";
- var $fmtTimeStamp = "'Y-m-d, H:i:s'";
- var $concat_operator='||';
- var $_transactionID;
- var $metaTablesSQL = "select rdb\$relation_name from rdb\$relations where rdb\$relation_name not like 'RDB\$%'";
- //OPN STUFF start
- var $metaColumnsSQL = "select a.rdb\$field_name, a.rdb\$null_flag, a.rdb\$default_source, b.rdb\$field_length, b.rdb\$field_scale, b.rdb\$field_sub_type, b.rdb\$field_precision, b.rdb\$field_type from rdb\$relation_fields a, rdb\$fields b where a.rdb\$field_source = b.rdb\$field_name and a.rdb\$relation_name = '%s' order by a.rdb\$field_position asc";
- //OPN STUFF end
- var $ibasetrans;
- var $hasGenID = true;
- var $_bindInputArray = true;
- var $buffers = 0;
- var $dialect = 1;
- var $sysDate = "cast('TODAY' as timestamp)";
- var $sysTimeStamp = "CURRENT_TIMESTAMP"; //"cast('NOW' as timestamp)";
- var $ansiOuter = true;
- var $hasAffectedRows = false;
- var $poorAffectedRows = true;
- var $blobEncodeType = 'C';
- var $role = false;
-
- function __construct()
- {
- if (defined('IBASE_DEFAULT')) $this->ibasetrans = IBASE_DEFAULT;
- }
-
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename,$persist=false)
- {
- if (!function_exists('ibase_pconnect')) return null;
- if ($argDatabasename) $argHostname .= ':'.$argDatabasename;
- $fn = ($persist) ? 'ibase_pconnect':'ibase_connect';
- if ($this->role)
- $this->_connectionID = $fn($argHostname,$argUsername,$argPassword,
- $this->charSet,$this->buffers,$this->dialect,$this->role);
- else
- $this->_connectionID = $fn($argHostname,$argUsername,$argPassword,
- $this->charSet,$this->buffers,$this->dialect);
-
- if ($this->dialect != 1) { // http://www.ibphoenix.com/ibp_60_del_id_ds.html
- $this->replaceQuote = "''";
- }
- if ($this->_connectionID === false) {
- $this->_handleerror();
- return false;
- }
-
- // PHP5 change.
- if (function_exists('ibase_timefmt')) {
- ibase_timefmt($this->ibase_datefmt,IBASE_DATE );
- if ($this->dialect == 1) {
- ibase_timefmt($this->ibase_datefmt,IBASE_TIMESTAMP );
- }
- else {
- ibase_timefmt($this->ibase_timestampfmt,IBASE_TIMESTAMP );
- }
- ibase_timefmt($this->ibase_timefmt,IBASE_TIME );
-
- } else {
- ini_set("ibase.timestampformat", $this->ibase_timestampfmt);
- ini_set("ibase.dateformat", $this->ibase_datefmt);
- ini_set("ibase.timeformat", $this->ibase_timefmt);
- }
- return true;
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename,true);
- }
-
-
- function MetaPrimaryKeys($table,$owner_notused=false,$internalKey=false)
- {
- if ($internalKey) {
- return array('RDB$DB_KEY');
- }
-
- $table = strtoupper($table);
-
- $sql = 'SELECT S.RDB$FIELD_NAME AFIELDNAME
- FROM RDB$INDICES I JOIN RDB$INDEX_SEGMENTS S ON I.RDB$INDEX_NAME=S.RDB$INDEX_NAME
- WHERE I.RDB$RELATION_NAME=\''.$table.'\' and I.RDB$INDEX_NAME like \'RDB$PRIMARY%\'
- ORDER BY I.RDB$INDEX_NAME,S.RDB$FIELD_POSITION';
-
- $a = $this->GetCol($sql,false,true);
- if ($a && sizeof($a)>0) return $a;
- return false;
- }
-
- function ServerInfo()
- {
- $arr['dialect'] = $this->dialect;
- switch($arr['dialect']) {
- case '':
- case '1': $s = 'Interbase 5.5 or earlier'; break;
- case '2': $s = 'Interbase 5.6'; break;
- default:
- case '3': $s = 'Interbase 6.0'; break;
- }
- $arr['version'] = ADOConnection::_findvers($s);
- $arr['description'] = $s;
- return $arr;
- }
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
- $this->transCnt += 1;
- $this->autoCommit = false;
- $this->_transactionID = $this->_connectionID;//ibase_trans($this->ibasetrans, $this->_connectionID);
- return $this->_transactionID;
- }
-
- function CommitTrans($ok=true)
- {
- if (!$ok) {
- return $this->RollbackTrans();
- }
- if ($this->transOff) {
- return true;
- }
- if ($this->transCnt) {
- $this->transCnt -= 1;
- }
- $ret = false;
- $this->autoCommit = true;
- if ($this->_transactionID) {
- //print ' commit ';
- $ret = ibase_commit($this->_transactionID);
- }
- $this->_transactionID = false;
- return $ret;
- }
-
- // there are some compat problems with ADODB_COUNTRECS=false and $this->_logsql currently.
- // it appears that ibase extension cannot support multiple concurrent queryid's
- function _Execute($sql,$inputarr=false)
- {
- global $ADODB_COUNTRECS;
-
- if ($this->_logsql) {
- $savecrecs = $ADODB_COUNTRECS;
- $ADODB_COUNTRECS = true; // force countrecs
- $ret = ADOConnection::_Execute($sql,$inputarr);
- $ADODB_COUNTRECS = $savecrecs;
- } else {
- $ret = ADOConnection::_Execute($sql,$inputarr);
- }
- return $ret;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $ret = false;
- $this->autoCommit = true;
- if ($this->_transactionID) {
- $ret = ibase_rollback($this->_transactionID);
- }
- $this->_transactionID = false;
-
- 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);
- }
- $table = strtoupper($table);
- $sql = "SELECT * FROM RDB\$INDICES WHERE RDB\$RELATION_NAME = '".$table."'";
- if (!$primary) {
- $sql .= " AND RDB\$INDEX_NAME NOT LIKE 'RDB\$%'";
- } else {
- $sql .= " AND RDB\$INDEX_NAME NOT LIKE 'RDB\$FOREIGN%'";
- }
- // get index details
- $rs = $this->Execute($sql);
- if (!is_object($rs)) {
- // restore fetchmode
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
- return $false;
- }
-
- $indexes = array();
- while ($row = $rs->FetchRow()) {
- $index = $row[0];
- if (!isset($indexes[$index])) {
- if (is_null($row[3])) {
- $row[3] = 0;
- }
- $indexes[$index] = array(
- 'unique' => ($row[3] == 1),
- 'columns' => array()
- );
- }
- $sql = "SELECT * FROM RDB\$INDEX_SEGMENTS WHERE RDB\$INDEX_NAME = '".$index."' ORDER BY RDB\$FIELD_POSITION ASC";
- $rs1 = $this->Execute($sql);
- while ($row1 = $rs1->FetchRow()) {
- $indexes[$index]['columns'][$row1[2]] = $row1[1];
- }
- }
- // restore fetchmode
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- return $indexes;
- }
-
-
- // See http://community.borland.com/article/0,1410,25844,00.html
- function RowLock($tables,$where,$col=false)
- {
- if ($this->autoCommit) {
- $this->BeginTrans();
- }
- $this->Execute("UPDATE $table SET $col=$col WHERE $where "); // is this correct - jlim?
- return 1;
- }
-
-
- function CreateSequence($seqname = 'adodbseq', $startID = 1)
- {
- $ok = $this->Execute(("INSERT INTO RDB\$GENERATORS (RDB\$GENERATOR_NAME) VALUES (UPPER('$seqname'))" ));
- if (!$ok) return false;
- return $this->Execute("SET GENERATOR $seqname TO ".($startID-1).';');
- }
-
- function DropSequence($seqname = 'adodbseq')
- {
- $seqname = strtoupper($seqname);
- $this->Execute("delete from RDB\$GENERATORS where RDB\$GENERATOR_NAME='$seqname'");
- }
-
- function GenID($seqname='adodbseq',$startID=1)
- {
- $getnext = ("SELECT Gen_ID($seqname,1) FROM RDB\$DATABASE");
- $rs = @$this->Execute($getnext);
- if (!$rs) {
- $this->Execute(("INSERT INTO RDB\$GENERATORS (RDB\$GENERATOR_NAME) VALUES (UPPER('$seqname'))" ));
- $this->Execute("SET GENERATOR $seqname TO ".($startID-1).';');
- $rs = $this->Execute($getnext);
- }
- if ($rs && !$rs->EOF) {
- $this->genID = (integer) reset($rs->fields);
- }
- else {
- $this->genID = 0; // false
- }
-
- if ($rs) {
- $rs->Close();
- }
-
- return $this->genID;
- }
-
- function SelectDB($dbName)
- {
- return false;
- }
-
- function _handleerror()
- {
- $this->_errorMsg = ibase_errmsg();
- }
-
- function ErrorNo()
- {
- if (preg_match('/error code = ([\-0-9]*)/i', $this->_errorMsg,$arr)) return (integer) $arr[1];
- else return 0;
- }
-
- function ErrorMsg()
- {
- return $this->_errorMsg;
- }
-
- function Prepare($sql)
- {
- $stmt = ibase_prepare($this->_connectionID,$sql);
- if (!$stmt) return false;
- return array($sql,$stmt);
- }
-
- // returns query ID if successful, otherwise false
- // there have been reports of problems with nested queries - the code is probably not re-entrant?
- function _query($sql,$iarr=false)
- {
-
- if (!$this->autoCommit && $this->_transactionID) {
- $conn = $this->_transactionID;
- $docommit = false;
- } else {
- $conn = $this->_connectionID;
- $docommit = true;
- }
- if (is_array($sql)) {
- $fn = 'ibase_execute';
- $sql = $sql[1];
- if (is_array($iarr)) {
- if (ADODB_PHPVER >= 0x4050) { // actually 4.0.4
- if ( !isset($iarr[0]) ) $iarr[0] = ''; // PHP5 compat hack
- $fnarr = array_merge( array($sql) , $iarr);
- $ret = call_user_func_array($fn,$fnarr);
- } else {
- switch(sizeof($iarr)) {
- case 1: $ret = $fn($sql,$iarr[0]); break;
- case 2: $ret = $fn($sql,$iarr[0],$iarr[1]); break;
- case 3: $ret = $fn($sql,$iarr[0],$iarr[1],$iarr[2]); break;
- case 4: $ret = $fn($sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3]); break;
- case 5: $ret = $fn($sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4]); break;
- case 6: $ret = $fn($sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4],$iarr[5]); break;
- case 7: $ret = $fn($sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4],$iarr[5],$iarr[6]); break;
- default: ADOConnection::outp( "Too many parameters to ibase query $sql");
- case 8: $ret = $fn($sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4],$iarr[5],$iarr[6],$iarr[7]); break;
- }
- }
- } else $ret = $fn($sql);
- } else {
- $fn = 'ibase_query';
-
- if (is_array($iarr)) {
- if (ADODB_PHPVER >= 0x4050) { // actually 4.0.4
- if (sizeof($iarr) == 0) $iarr[0] = ''; // PHP5 compat hack
- $fnarr = array_merge( array($conn,$sql) , $iarr);
- $ret = call_user_func_array($fn,$fnarr);
- } else {
- switch(sizeof($iarr)) {
- case 1: $ret = $fn($conn,$sql,$iarr[0]); break;
- case 2: $ret = $fn($conn,$sql,$iarr[0],$iarr[1]); break;
- case 3: $ret = $fn($conn,$sql,$iarr[0],$iarr[1],$iarr[2]); break;
- case 4: $ret = $fn($conn,$sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3]); break;
- case 5: $ret = $fn($conn,$sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4]); break;
- case 6: $ret = $fn($conn,$sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4],$iarr[5]); break;
- case 7: $ret = $fn($conn,$sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4],$iarr[5],$iarr[6]); break;
- default: ADOConnection::outp( "Too many parameters to ibase query $sql");
- case 8: $ret = $fn($conn,$sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4],$iarr[5],$iarr[6],$iarr[7]); break;
- }
- }
- } else $ret = $fn($conn,$sql);
- }
- if ($docommit && $ret === true) {
- ibase_commit($this->_connectionID);
- }
-
- $this->_handleerror();
- return $ret;
- }
-
- // returns true or false
- function _close()
- {
- if (!$this->autoCommit) {
- @ibase_rollback($this->_connectionID);
- }
- return @ibase_close($this->_connectionID);
- }
-
- //OPN STUFF start
- function _ConvertFieldType(&$fld, $ftype, $flen, $fscale, $fsubtype, $fprecision, $dialect3)
- {
- $fscale = abs($fscale);
- $fld->max_length = $flen;
- $fld->scale = null;
- switch($ftype){
- case 7:
- case 8:
- if ($dialect3) {
- switch($fsubtype){
- case 0:
- $fld->type = ($ftype == 7 ? 'smallint' : 'integer');
- break;
- case 1:
- $fld->type = 'numeric';
- $fld->max_length = $fprecision;
- $fld->scale = $fscale;
- break;
- case 2:
- $fld->type = 'decimal';
- $fld->max_length = $fprecision;
- $fld->scale = $fscale;
- break;
- } // switch
- } else {
- if ($fscale !=0) {
- $fld->type = 'decimal';
- $fld->scale = $fscale;
- $fld->max_length = ($ftype == 7 ? 4 : 9);
- } else {
- $fld->type = ($ftype == 7 ? 'smallint' : 'integer');
- }
- }
- break;
- case 16:
- if ($dialect3) {
- switch($fsubtype){
- case 0:
- $fld->type = 'decimal';
- $fld->max_length = 18;
- $fld->scale = 0;
- break;
- case 1:
- $fld->type = 'numeric';
- $fld->max_length = $fprecision;
- $fld->scale = $fscale;
- break;
- case 2:
- $fld->type = 'decimal';
- $fld->max_length = $fprecision;
- $fld->scale = $fscale;
- break;
- } // switch
- }
- break;
- case 10:
- $fld->type = 'float';
- break;
- case 14:
- $fld->type = 'char';
- break;
- case 27:
- if ($fscale !=0) {
- $fld->type = 'decimal';
- $fld->max_length = 15;
- $fld->scale = 5;
- } else {
- $fld->type = 'double';
- }
- break;
- case 35:
- if ($dialect3) {
- $fld->type = 'timestamp';
- } else {
- $fld->type = 'date';
- }
- break;
- case 12:
- $fld->type = 'date';
- break;
- case 13:
- $fld->type = 'time';
- break;
- case 37:
- $fld->type = 'varchar';
- break;
- case 40:
- $fld->type = 'cstring';
- break;
- case 261:
- $fld->type = 'blob';
- $fld->max_length = -1;
- break;
- } // switch
- }
- //OPN STUFF end
-
- // returns array of ADOFieldObjects for current table
- function MetaColumns($table, $normalize=true)
- {
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,strtoupper($table)));
-
- $ADODB_FETCH_MODE = $save;
- $false = false;
- if ($rs === false) {
- return $false;
- }
-
- $retarr = array();
- //OPN STUFF start
- $dialect3 = ($this->dialect==3 ? true : false);
- //OPN STUFF end
- while (!$rs->EOF) { //print_r($rs->fields);
- $fld = new ADOFieldObject();
- $fld->name = trim($rs->fields[0]);
- //OPN STUFF start
- $this->_ConvertFieldType($fld, $rs->fields[7], $rs->fields[3], $rs->fields[4], $rs->fields[5], $rs->fields[6], $dialect3);
- if (isset($rs->fields[1]) && $rs->fields[1]) {
- $fld->not_null = true;
- }
- if (isset($rs->fields[2])) {
-
- $fld->has_default = true;
- $d = substr($rs->fields[2],strlen('default '));
- switch ($fld->type)
- {
- case 'smallint':
- case 'integer': $fld->default_value = (int) $d; break;
- case 'char':
- case 'blob':
- case 'text':
- case 'varchar': $fld->default_value = (string) substr($d,1,strlen($d)-2); break;
- case 'double':
- case 'float': $fld->default_value = (float) $d; break;
- default: $fld->default_value = $d; break;
- }
- // case 35:$tt = 'TIMESTAMP'; break;
- }
- if ((isset($rs->fields[5])) && ($fld->type == 'blob')) {
- $fld->sub_type = $rs->fields[5];
- } else {
- $fld->sub_type = null;
- }
- //OPN STUFF end
- 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 BlobEncode( $blob )
- {
- $blobid = ibase_blob_create( $this->_connectionID);
- ibase_blob_add( $blobid, $blob );
- return ibase_blob_close( $blobid );
- }
-
- // since we auto-decode all blob's since 2.42,
- // BlobDecode should not do any transforms
- function BlobDecode($blob)
- {
- return $blob;
- }
-
-
-
-
- // old blobdecode function
- // still used to auto-decode all blob's
- function _BlobDecode_old( $blob )
- {
- $blobid = ibase_blob_open($this->_connectionID, $blob );
- $realblob = ibase_blob_get( $blobid,$this->maxblobsize); // 2nd param is max size of blob -- Kevin Boillet ");
- 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('WarningsReturnAsErrors', 0);
- } else {
- sqlsrv_set_error_handling(0);
- sqlsrv_log_set_severity(0);
- sqlsrv_log_set_subsystems(SQLSRV_LOG_SYSTEM_ALL);
- sqlsrv_configure('WarningsReturnAsErrors', 0);
- }
- }
-
- /**
- * Initializes the SQL Server version.
- * Dies if connected to a non-supported version (2000 and older)
- */
- function ServerVersion() {
- $data = $this->ServerInfo();
- preg_match('/^\d{2}/', $data['version'], $matches);
- $version = (int)reset($matches);
-
- // We only support SQL Server 2005 and up
- if($version < 9) {
- die("SQL SERVER VERSION {$data['version']} NOT SUPPORTED IN mssqlnative DRIVER");
- }
-
- $this->mssql_version = $version;
- }
-
- 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($seq, $start);
- break;
- default:
- return $this->GenID2012($seq, $start);
- break;
- }
- }
-
- function CreateSequence($seq='adodbseq',$start=1)
- {
- if (!$this->mssql_version)
- $this->ServerVersion();
-
- switch($this->mssql_version){
- case 9:
- case 10:
- return $this->CreateSequence2008($seq, $start);
- break;
- default:
- return $this->CreateSequence2012($seq, $start);
- break;
- }
-
- }
-
- /**
- * For Server 2005,2008, duplicate a sequence with an identity table
- */
- function CreateSequence2008($seq='adodbseq',$start=1)
- {
- if($this->debug) ADOConnection::outp("
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) ADOConnection::outp("
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='adodbseq',$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) ADOConnection::outp("
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) ADOConnection::outp("
Error: ROLLBACK");
- sqlsrv_rollback($this->_connectionID);
- return false;
- }
- }
- $num = $this->GetOne("select id from $seq");
- sqlsrv_commit($this->_connectionID);
- return $num;
- }
- /**
- * 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, $start);
-
- }
- $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) ADOConnection::outp('
begin transaction');
- sqlsrv_begin_transaction($this->_connectionID);
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if ($this->debug) ADOConnection::outp('
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) ADOConnection::outp('
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()
- {
- $err = sqlsrv_errors(SQLSRV_ERR_ALL);
- if($err[0]) return $err[0]['code'];
- else return 0;
- }
-
- // 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;
-
- foreach ($this->connectionParameters as $parameter=>$value)
- $connectionInfo[$parameter] = $value;
-
- if ($this->debug) ADOConnection::outp("
connecting... hostname: $argHostname params: ".var_export($connectionInfo,true));
- //if ($this->debug) ADOConnection::outp("
_connectionID before: ".serialize($this->_connectionID));
- if(!($this->_connectionID = sqlsrv_connect($argHostname,$connectionInfo))) {
- if ($this->debug) ADOConnection::outp( "
errors: ".print_r( sqlsrv_errors(), true));
- return false;
- }
- //if ($this->debug) ADOConnection::outp(" _connectionID after: ".serialize($this->_connectionID));
- //if ($this->debug) ADOConnection::outp("
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[\s\w()",.]+values\s*\((?:[^;\']|\'\'|(?:(?:\'\')*\'[^\']+\'(?:\'\')*))*;?$/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) ADOConnection::outp("
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)
- while ( 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
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) ADOConnection::outp("
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()
- {
- if(is_object($this->_queryID)) {
- $rez = sqlsrv_free_stmt($this->_queryID);
- $this->_queryID = false;
- return $rez;
- }
- return true;
- }
-
- // 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 __construct($id=-1,$mode=false)
- {
- parent::__construct($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/vendor/adodb/adodb-php/drivers/adodb-mssqlpo.inc.php b/vendor/adodb/adodb-php/drivers/adodb-mssqlpo.inc.php
deleted file mode 100644
index cd6a2850..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-mssqlpo.inc.php
+++ /dev/null
@@ -1,58 +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 __construct($id,$mode=false)
- {
- parent::__construct($id,$mode);
- }
-}
diff --git a/vendor/adodb/adodb-php/drivers/adodb-mysql.inc.php b/vendor/adodb/adodb-php/drivers/adodb-mysql.inc.php
deleted file mode 100644
index 2d999c6b..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-mysql.inc.php
+++ /dev/null
@@ -1,891 +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 if not exists %s (id int not null)";
- var $_genSeqCountSQL = "select count(*) from %s";
- var $_genSeq2SQL = "insert into %s values (%s)";
- var $_dropSeqSQL = "drop table if exists %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"
";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]);
- }
- elseif ($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)) {
- // suggested by g.giunta@libero.
- if (sizeof($v) == 2) {
- 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;
-
- function __construct($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode) {
- case ADODB_FETCH_ASSOC:
- $this->fetchMode = OCI_ASSOC;
- break;
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- $this->fetchMode = OCI_NUM + OCI_ASSOC;
- break;
- case ADODB_FETCH_NUM:
- default:
- $this->fetchMode = OCI_NUM;
- break;
- }
- $this->fetchMode += OCI_RETURN_NULLS + OCI_RETURN_LOBS;
- $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);
- if (ADODB_ASSOC_CASE == ADODB_ASSOC_CASE_LOWER) {
- $fld->name = strtolower($fld->name);
- }
- $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];
- }
-
-
- function MoveNext()
- {
- if ($this->fields = @oci_fetch_array($this->_queryID,$this->fetchMode)) {
- $this->_currentRow += 1;
- $this->_updatefields();
- return true;
- }
- if (!$this->EOF) {
- $this->_currentRow += 1;
- $this->EOF = true;
- }
- return false;
- }
-
- // 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;
- }
- $this->_updatefields();
- $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()
- {
- $this->fields = @oci_fetch_array($this->_queryID,$this->fetchMode);
- $this->_updatefields();
-
- 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()
- {
- 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 __construct($queryID,$mode=false)
- {
- parent::__construct($queryID, $mode);
- }
-
- function MoveNext()
- {
- return adodb_movenext($this);
- }
-}
diff --git a/vendor/adodb/adodb-php/drivers/adodb-oci805.inc.php b/vendor/adodb/adodb-php/drivers/adodb-oci805.inc.php
deleted file mode 100644
index 112e9ecc..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-oci805.inc.php
+++ /dev/null
@@ -1,55 +0,0 @@
- 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 __construct($id,$mode=false)
- {
- parent::__construct($id,$mode);
- }
-}
diff --git a/vendor/adodb/adodb-php/drivers/adodb-oci8po.inc.php b/vendor/adodb/adodb-php/drivers/adodb-oci8po.inc.php
deleted file mode 100644
index 6b939b0a..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-oci8po.inc.php
+++ /dev/null
@@ -1,227 +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 __construct()
- {
- $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);
- }
-
- /**
- * The optimizations performed by ADODB_oci8::SelectLimit() are not
- * compatible with the oci8po driver, so we rely on the slower method
- * from the base class.
- * We can't properly handle prepared statements either due to preprocessing
- * of query parameters, so we treat them as regular SQL statements.
- */
- function SelectLimit($sql, $nrows=-1, $offset=-1, $inputarr=false, $secs2cache=0)
- {
- if(is_array($sql)) {
-// $sql = $sql[0];
- }
- return ADOConnection::SelectLimit($sql, $nrows, $offset, $inputarr, $secs2cache);
- }
-
- // 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 {
- // Need to identify if the ? is inside a quoted string, and if
- // so not use it as a bind variable
- preg_match_all('/".*\??"|\'.*\?.*?\'/', $sql, $matches);
- foreach($matches[0] as $qmMatch){
- $qmReplace = str_replace('?', '-QUESTIONMARK-', $qmMatch);
- $sql = str_replace($qmMatch, $qmReplace, $sql);
- }
-
- // Replace parameters if any were found
- $sqlarr = explode('?',$sql);
- if(count($sqlarr) > 1) {
- $sql = $sqlarr[0];
-
- foreach ($inputarr as $k => $v) {
- $sql .= ":$k" . $sqlarr[++$i];
- }
- }
-
- $sql = str_replace('-QUESTIONMARK-', '?', $sql);
- }
- }
- return ADODB_oci8::_query($sql,$inputarr);
- }
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordset_oci8po extends ADORecordset_oci8 {
-
- var $databaseType = 'oci8po';
-
- function __construct($queryID,$mode=false)
- {
- parent::__construct($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 == ADODB_ASSOC_CASE_LOWER) {
- $fld->name = strtolower($fld->name);
- }
- $fld->type = OCIcolumntype($this->_queryID, $fieldOffset);
- $fld->max_length = OCIcolumnsize($this->_queryID, $fieldOffset);
- if ($fld->type == 'NUMBER') {
- $sc = OCIColumnScale($this->_queryID, $fieldOffset);
- if ($sc == 0) {
- $fld->type = 'INT';
- }
- }
- return $fld;
- }
-
- // 10% speedup to move MoveNext to child class
- function MoveNext()
- {
- $ret = @oci_fetch_array($this->_queryID,$this->fetchMode);
- if($ret !== false) {
- global $ADODB_ANSI_PADDING_OFF;
- $this->fields = $ret;
- $this->_currentRow++;
- $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;
- }
- $ret = @oci_fetch_array($this->_queryID,$this->fetchMode);
- if ($ret === false) {
- $arr = array();
- return $arr;
- }
- $this->fields = $ret;
- $this->_updatefields();
- $results = array();
- $cnt = 0;
- while (!$this->EOF && $nrows != $cnt) {
- $results[$cnt++] = $this->fields;
- $this->MoveNext();
- }
-
- return $results;
- }
-
- function _fetch()
- {
- global $ADODB_ANSI_PADDING_OFF;
-
- $ret = @oci_fetch_array($this->_queryID,$this->fetchMode);
- if ($ret) {
- $this->fields = $ret;
- $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 !== false;
- }
-
-}
diff --git a/vendor/adodb/adodb-php/drivers/adodb-oci8quercus.inc.php b/vendor/adodb/adodb-php/drivers/adodb-oci8quercus.inc.php
deleted file mode 100644
index 1940e802..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-oci8quercus.inc.php
+++ /dev/null
@@ -1,89 +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 __construct()
- {
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordset_oci8quercus extends ADORecordset_oci8 {
-
- var $databaseType = 'oci8quercus';
-
- function __construct($queryID,$mode=false)
- {
- parent::__construct($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/vendor/adodb/adodb-php/drivers/adodb-odbc.inc.php b/vendor/adodb/adodb-php/drivers/adodb-odbc.inc.php
deleted file mode 100644
index efaa5bb1..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-odbc.inc.php
+++ /dev/null
@@ -1,738 +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 = 'adodbseq')
- {
- 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 __construct($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;
- //parent::__construct($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();
- }
-
- $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();
- }
- return true;
- }
- return false;
- }
-
- function _close()
- {
- return @odbc_free_result($this->_queryID);
- }
-
-}
diff --git a/vendor/adodb/adodb-php/drivers/adodb-odbc_db2.inc.php b/vendor/adodb/adodb-php/drivers/adodb-odbc_db2.inc.php
deleted file mode 100644
index fa6d8b84..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-odbc_db2.inc.php
+++ /dev/null
@@ -1,369 +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 __construct()
- {
- if (strncmp(PHP_OS,'WIN',3) === 0) $this->curmode = SQL_CUR_USE_ODBC;
- parent::__construct();
- }
-
- 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, $secs2cache = 0)
- {
- $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 __construct($id,$mode=false)
- {
- parent::__construct($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/vendor/adodb/adodb-php/drivers/adodb-odbc_mssql.inc.php b/vendor/adodb/adodb-php/drivers/adodb-odbc_mssql.inc.php
deleted file mode 100644
index aa643168..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-odbc_mssql.inc.php
+++ /dev/null
@@ -1,363 +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 __construct()
- {
- parent::__construct();
- //$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"
";
- return $sql;
- }
- return array($sql,$stmt,false);
- }
-
- function PrepareSP($sql, $param = true)
- {
- 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 __construct($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- $this->fetchMode = $mode;
- parent::__construct($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 __construct($id,$mode=false)
- {
- return parent::__construct($id,$mode);
- }
-}
-
-class ADORecordSet_odbtp_access extends ADORecordSet_odbtp {
-
- var $databaseType = 'odbtp_access';
-
- function __construct($id,$mode=false)
- {
- return parent::__construct($id,$mode);
- }
-}
-
-class ADORecordSet_odbtp_vfp extends ADORecordSet_odbtp {
-
- var $databaseType = 'odbtp_vfp';
-
- function __construct($id,$mode=false)
- {
- return parent::__construct($id,$mode);
- }
-}
-
-class ADORecordSet_odbtp_oci8 extends ADORecordSet_odbtp {
-
- var $databaseType = 'odbtp_oci8';
-
- function __construct($id,$mode=false)
- {
- return parent::__construct($id,$mode);
- }
-}
-
-class ADORecordSet_odbtp_sybase extends ADORecordSet_odbtp {
-
- var $databaseType = 'odbtp_sybase';
-
- function __construct($id,$mode=false)
- {
- return parent::__construct($id,$mode);
- }
-}
diff --git a/vendor/adodb/adodb-php/drivers/adodb-odbtp_unicode.inc.php b/vendor/adodb/adodb-php/drivers/adodb-odbtp_unicode.inc.php
deleted file mode 100644
index 5ca03e71..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-odbtp_unicode.inc.php
+++ /dev/null
@@ -1,35 +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;
-}
diff --git a/vendor/adodb/adodb-php/drivers/adodb-oracle.inc.php b/vendor/adodb/adodb-php/drivers/adodb-oracle.inc.php
deleted file mode 100644
index ca737d66..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-oracle.inc.php
+++ /dev/null
@@ -1,343 +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, $isfld = false)
- {
-
- 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;
-
- //
$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 "
\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 __construct(&$conn,$mode=false)
- {
- parent::__construct();
- $this->InitArray($conn->_rezarray,$conn->_reztypes,$conn->_reznames);
- $conn->_rezarray = false;
- }
-
-} // class ADORecordSet_text
-
-
-} // defined
diff --git a/vendor/adodb/adodb-php/drivers/adodb-vfp.inc.php b/vendor/adodb/adodb-php/drivers/adodb-vfp.inc.php
deleted file mode 100644
index 840c9c10..00000000
--- a/vendor/adodb/adodb-php/drivers/adodb-vfp.inc.php
+++ /dev/null
@@ -1,103 +0,0 @@
-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 __construct($id,$mode=false)
- {
- return parent::__construct($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 '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/vendor/adodb/adodb-php/lang/adodb-ar.inc.php b/vendor/adodb/adodb-php/lang/adodb-ar.inc.php
deleted file mode 100644
index 0b8f12ff..00000000
--- a/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/vendor/adodb/adodb-php/lang/adodb-bg.inc.php b/vendor/adodb/adodb-php/lang/adodb-bg.inc.php
deleted file mode 100644
index 07069b42..00000000
--- a/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/vendor/adodb/adodb-php/lang/adodb-ca.inc.php b/vendor/adodb/adodb-php/lang/adodb-ca.inc.php
deleted file mode 100644
index adbafac9..00000000
--- a/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 vàlid',
- DB_ERROR_INVALID_DATE => 'la data o l\'hora no són vàlides',
- DB_ERROR_INVALID_NUMBER => 'el nombre no és vàlid',
- DB_ERROR_MISMATCH => 'no hi ha coincidència',
- DB_ERROR_NODBSELECTED => 'cap base de dades seleccionada',
- DB_ERROR_NOSUCHFIELD => 'camp inexistent',
- DB_ERROR_NOSUCHTABLE => 'taula inexistent',
- DB_ERROR_NOT_CAPABLE => 'l\'execució secundària 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 vàlid',
- DB_ERROR_CONNECT_FAILED => 'connexió fallida',
- 0 => 'cap error', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'les dades subministrades són 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/vendor/adodb/adodb-php/lang/adodb-cn.inc.php b/vendor/adodb/adodb-php/lang/adodb-cn.inc.php
deleted file mode 100644
index 9c973413..00000000
--- a/vendor/adodb/adodb-php/lang/adodb-cn.inc.php
+++ /dev/null
@@ -1,33 +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/vendor/adodb/adodb-php/lang/adodb-cz.inc.php b/vendor/adodb/adodb-php/lang/adodb-cz.inc.php
deleted file mode 100644
index d79d7142..00000000
--- a/vendor/adodb/adodb-php/lang/adodb-cz.inc.php
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'cz',
- DB_ERROR => 'neznámá 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í omezující podmínky',
- 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á databáze není vybrána',
- DB_ERROR_NOSUCHFIELD => 'pole nenalezeno',
- DB_ERROR_NOSUCHTABLE => 'tabulka nenalezena',
- DB_ERROR_NOT_CAPABLE => 'nepodporováno',
- DB_ERROR_NOT_FOUND => 'nenalezeno',
- DB_ERROR_NOT_LOCKED => 'nezam?eno',
- DB_ERROR_SYNTAX => 'syntaktická chyba',
- DB_ERROR_UNSUPPORTED => 'nepodporováno',
- 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 => 'málo zdrojových dat',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'roz?í?ení nenalezeno',
- DB_ERROR_NOSUCHDB => 'databáze neexistuje',
- DB_ERROR_ACCESS_VIOLATION => 'nedostate?ná práva'
-);
diff --git a/vendor/adodb/adodb-php/lang/adodb-da.inc.php b/vendor/adodb/adodb-php/lang/adodb-da.inc.php
deleted file mode 100644
index 14e720b8..00000000
--- a/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/vendor/adodb/adodb-php/lang/adodb-de.inc.php b/vendor/adodb/adodb-php/lang/adodb-de.inc.php
deleted file mode 100644
index dca4ffef..00000000
--- a/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/vendor/adodb/adodb-php/lang/adodb-en.inc.php b/vendor/adodb/adodb-php/lang/adodb-en.inc.php
deleted file mode 100644
index 05828554..00000000
--- a/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/vendor/adodb/adodb-php/lang/adodb-eo.inc.php b/vendor/adodb/adodb-php/lang/adodb-eo.inc.php
deleted file mode 100644
index baa589c1..00000000
--- a/vendor/adodb/adodb-php/lang/adodb-eo.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 kondiĉoj 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 => 'ĉio bone', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'ne sufiĉe da datumo',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'etendo ne trovita',
- DB_ERROR_NOSUCHDB => 'datumbazo ne ekzistas',
- DB_ERROR_ACCESS_VIOLATION => 'ne sufiĉe da rajto por atingo'
-);
diff --git a/vendor/adodb/adodb-php/lang/adodb-es.inc.php b/vendor/adodb/adodb-php/lang/adodb-es.inc.php
deleted file mode 100644
index a80a6441..00000000
--- a/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/vendor/adodb/adodb-php/lang/adodb-fa.inc.php b/vendor/adodb/adodb-php/lang/adodb-fa.inc.php
deleted file mode 100644
index 7fa46183..00000000
--- a/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/vendor/adodb/adodb-php/lang/adodb-fr.inc.php b/vendor/adodb/adodb-php/lang/adodb-fr.inc.php
deleted file mode 100644
index 620196b4..00000000
--- a/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éation 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ées sé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/vendor/adodb/adodb-php/lang/adodb-hu.inc.php b/vendor/adodb/adodb-php/lang/adodb-hu.inc.php
deleted file mode 100644
index 49357ce2..00000000
--- a/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 => 'már létezik',
- DB_ERROR_CANNOT_CREATE => 'nem sikerült létrehozni',
- DB_ERROR_CANNOT_DELETE => 'nem sikerült törölni',
- DB_ERROR_CANNOT_DROP => 'nem sikerült eldobni',
- DB_ERROR_CONSTRAINT => 'szabályok megszegése',
- DB_ERROR_DIVZERO => 'osztás nullával',
- DB_ERROR_INVALID => 'érvénytelen',
- DB_ERROR_INVALID_DATE => 'érvénytelen dátum vagy idő',
- DB_ERROR_INVALID_NUMBER => 'érvénytelen szám',
- DB_ERROR_MISMATCH => 'nem megfelelő',
- DB_ERROR_NODBSELECTED => 'nincs kiválasztott adatbázis',
- DB_ERROR_NOSUCHFIELD => 'nincs ilyen mező',
- DB_ERROR_NOSUCHTABLE => 'nincs ilyen tábla',
- DB_ERROR_NOT_CAPABLE => 'DB backend nem támogatja',
- DB_ERROR_NOT_FOUND => 'nem található',
- DB_ERROR_NOT_LOCKED => 'nincs lezárva',
- DB_ERROR_SYNTAX => 'szintaktikai hiba',
- DB_ERROR_UNSUPPORTED => 'nem támogatott',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'soron végzett érték számlálás',
- DB_ERROR_INVALID_DSN => 'hibás DSN',
- DB_ERROR_CONNECT_FAILED => 'sikertelen csatlakozás',
- 0 => 'nincs hiba', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'túl kevés az adat',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'bővítmény nem található',
- DB_ERROR_NOSUCHDB => 'nincs ilyen adatbázis',
- DB_ERROR_ACCESS_VIOLATION => 'nincs jogosultság'
-);
diff --git a/vendor/adodb/adodb-php/lang/adodb-it.inc.php b/vendor/adodb/adodb-php/lang/adodb-it.inc.php
deleted file mode 100644
index 80524e1d..00000000
--- a/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/vendor/adodb/adodb-php/lang/adodb-nl.inc.php b/vendor/adodb/adodb-php/lang/adodb-nl.inc.php
deleted file mode 100644
index 43e3ee69..00000000
--- a/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/vendor/adodb/adodb-php/lang/adodb-pl.inc.php b/vendor/adodb/adodb-php/lang/adodb-pl.inc.php
deleted file mode 100644
index ffa10e33..00000000
--- a/vendor/adodb/adodb-php/lang/adodb-pl.inc.php
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'pl',
- DB_ERROR => 'niezidentyfikowany błąd',
- DB_ERROR_ALREADY_EXISTS => 'już istnieją',
- DB_ERROR_CANNOT_CREATE => 'nie można stworzyć',
- DB_ERROR_CANNOT_DELETE => 'nie można usunąć',
- DB_ERROR_CANNOT_DROP => 'nie można porzucić',
- DB_ERROR_CONSTRAINT => 'pogwałcenie uprawnień',
- DB_ERROR_DIVZERO => 'dzielenie przez zero',
- DB_ERROR_INVALID => 'błędny',
- DB_ERROR_INVALID_DATE => 'błędna godzina lub data',
- DB_ERROR_INVALID_NUMBER => 'błędny numer',
- DB_ERROR_MISMATCH => 'niedopasowanie',
- DB_ERROR_NODBSELECTED => 'baza danych nie została 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 zakmnięty',
- DB_ERROR_SYNTAX => 'błąd składni',
- DB_ERROR_UNSUPPORTED => 'nie obsługuje',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'wartość liczona w szeregu',
- DB_ERROR_INVALID_DSN => 'błędny DSN',
- DB_ERROR_CONNECT_FAILED => 'połączenie nie zostało zrealizowane',
- 0 => 'brak błędów', // 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/vendor/adodb/adodb-php/lang/adodb-pt-br.inc.php b/vendor/adodb/adodb-php/lang/adodb-pt-br.inc.php
deleted file mode 100644
index 9c687b06..00000000
--- a/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 => 'impossível criar',
- DB_ERROR_CANNOT_DELETE => 'impossível excluír',
- DB_ERROR_CANNOT_DROP => 'impossível remover',
- DB_ERROR_CONSTRAINT => 'violação do confinamente',
- DB_ERROR_DIVZERO => 'divisão por zero',
- DB_ERROR_INVALID => 'inválido',
- DB_ERROR_INVALID_DATE => 'data ou hora inválida',
- DB_ERROR_INVALID_NUMBER => 'número inválido',
- DB_ERROR_MISMATCH => 'erro',
- DB_ERROR_NODBSELECTED => 'nenhum banco de dados selecionado',
- DB_ERROR_NOSUCHFIELD => 'campo inválido',
- DB_ERROR_NOSUCHTABLE => 'tabela inexistente',
- DB_ERROR_NOT_CAPABLE => 'capacidade inválida para este BD',
- DB_ERROR_NOT_FOUND => 'não encontrado',
- DB_ERROR_NOT_LOCKED => 'não bloqueado',
- DB_ERROR_SYNTAX => 'erro de sintaxe',
- DB_ERROR_UNSUPPORTED =>
-'não suportado',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'a quantidade de colunas não corresponde ao de valores',
- DB_ERROR_INVALID_DSN => 'DSN inválido',
- DB_ERROR_CONNECT_FAILED => 'falha na conexão',
- 0 => 'sem erro', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'dados insuficientes',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'extensão não encontrada',
- DB_ERROR_NOSUCHDB => 'banco de dados não encontrado',
- DB_ERROR_ACCESS_VIOLATION => 'permissão insuficiente'
-);
diff --git a/vendor/adodb/adodb-php/lang/adodb-ro.inc.php b/vendor/adodb/adodb-php/lang/adodb-ro.inc.php
deleted file mode 100644
index b6ddd313..00000000
--- a/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/vendor/adodb/adodb-php/lang/adodb-ru.inc.php b/vendor/adodb/adodb-php/lang/adodb-ru.inc.php
deleted file mode 100644
index 67d80f2c..00000000
--- a/vendor/adodb/adodb-php/lang/adodb-ru.inc.php
+++ /dev/null
@@ -1,34 +0,0 @@
- 'ru',
- 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/vendor/adodb/adodb-php/lang/adodb-sv.inc.php b/vendor/adodb/adodb-php/lang/adodb-sv.inc.php
deleted file mode 100644
index d3be6b0e..00000000
--- a/vendor/adodb/adodb-php/lang/adodb-sv.inc.php
+++ /dev/null
@@ -1,32 +0,0 @@
- 'en',
- DB_ERROR => 'Okänt 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 släppa',
- DB_ERROR_CONSTRAINT => 'begränsning kränkt',
- 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 sådant fält',
- DB_ERROR_NOSUCHTABLE => 'ingen sådan tabell',
- DB_ERROR_NOT_CAPABLE => 'DB backend klarar det inte',
- DB_ERROR_NOT_FOUND => 'finns inte',
- DB_ERROR_NOT_LOCKED => 'inte låst',
- DB_ERROR_SYNTAX => 'syntaxfel',
- DB_ERROR_UNSUPPORTED => 'stöds ej',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'värde räknat på rad',
- DB_ERROR_INVALID_DSN => 'ogiltig DSN',
- DB_ERROR_CONNECT_FAILED => 'anslutning misslyckades',
- 0 => 'inget fel', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'otillräckligt med data angivet',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'utökning hittades ej',
- DB_ERROR_NOSUCHDB => 'ingen sådan databas',
- DB_ERROR_ACCESS_VIOLATION => 'otillräckliga rättigheter'
-);
diff --git a/vendor/adodb/adodb-php/lang/adodb-th.inc.php b/vendor/adodb/adodb-php/lang/adodb-th.inc.php
deleted file mode 100644
index a0685645..00000000
--- a/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_ERROR_NEED_MORE_DATA => 'ข้อมูลไม่เพียงพอ',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'ไม่พบ extension',
- DB_ERROR_NOSUCHDB => 'ไม่มีข้อมูลนี้',
- DB_ERROR_ACCESS_VIOLATION => 'permissions ไม่พอ'
-);
diff --git a/vendor/adodb/adodb-php/lang/adodb-uk.inc.php b/vendor/adodb/adodb-php/lang/adodb-uk.inc.php
deleted file mode 100644
index 2ace5bc4..00000000
--- a/vendor/adodb/adodb-php/lang/adodb-uk.inc.php
+++ /dev/null
@@ -1,34 +0,0 @@
- 'uk',
- 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/vendor/adodb/adodb-php/pear/Auth/Container/ADOdb.php b/vendor/adodb/adodb-php/pear/Auth/Container/ADOdb.php
deleted file mode 100644
index 26c3a23e..00000000
--- a/vendor/adodb/adodb-php/pear/Auth/Container/ADOdb.php
+++ /dev/null
@@ -1,406 +0,0 @@
-
- Richard Tango-Lowy
"; - ( !$vardump ) ? ( print_r( $var )) : ( var_dump( $var )); - print ""; -} diff --git a/vendor/adodb/adodb-php/pear/auth_adodb_example.php b/vendor/adodb/adodb-php/pear/auth_adodb_example.php deleted file mode 100644 index 3b7cf5e8..00000000 --- a/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/vendor/adodb/adodb-php/pear/readme.Auth.txt b/vendor/adodb/adodb-php/pear/readme.Auth.txt deleted file mode 100644 index f5b162cc..00000000 --- a/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/vendor/adodb/adodb-php/perf/perf-db2.inc.php b/vendor/adodb/adodb-php/perf/perf-db2.inc.php deleted file mode 100644 index 143fc3d5..00000000 --- a/vendor/adodb/adodb-php/perf/perf-db2.inc.php +++ /dev/null @@ -1,108 +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 __construct(&$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/vendor/adodb/adodb-php/perf/perf-informix.inc.php b/vendor/adodb/adodb-php/perf/perf-informix.inc.php deleted file mode 100644 index e5cfb25d..00000000 --- a/vendor/adodb/adodb-php/perf/perf-informix.inc.php +++ /dev/null @@ -1,71 +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 __construct(&$conn) - { - $this->conn = $conn; - } - -} diff --git a/vendor/adodb/adodb-php/perf/perf-mssql.inc.php b/vendor/adodb/adodb-php/perf/perf-mssql.inc.php deleted file mode 100644 index cd8a6641..00000000 --- a/vendor/adodb/adodb-php/perf/perf-mssql.inc.php +++ /dev/null @@ -1,164 +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 __construct(&$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 |
| '.round($rs->fields[8],1).' | '.round($rs->fields[9],3).' | '.round($rs->fields[10],3).' | '.htmlspecialchars($rs->fields[0])." |
| tablename | size_in_k | index size | reserved size |
| '.$tab.' | '.$rs2->fields[3].' | '.$rs2->fields[4].' | '.$rs2->fields[2].' |
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 |
| '.round($rs->fields[8],1).' | '.round($rs->fields[9],3).' | '.round($rs->fields[10],3).' | '.htmlspecialchars($rs->fields[0])." |
| tablename | size_in_k | index size | reserved size |
| '.$tab.' | '.$rs2->fields[3].' | '.$rs2->fields[4].' | '.$rs2->fields[2].' |
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/vendor/adodb/adodb-php/perf/perf-oci8.inc.php b/vendor/adodb/adodb-php/perf/perf-oci8.inc.php deleted file mode 100644 index 69df104f..00000000 --- a/vendor/adodb/adodb-php/perf/perf-oci8.inc.php +++ /dev/null @@ -1,703 +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 __construct(&$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 = "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 = "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.' |
| ".$carr[0].' | '.$carr[1].' | '.$prefix.$sql.$suffix.' |
| ".$carr[0].' | '.$carr[1].' | '.$prefix.$sql.$suffix.' |
'; - - $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
'; - $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
%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/vendor/adodb/adodb-php/pivottable.inc.php b/vendor/adodb/adodb-php/pivottable.inc.php
deleted file mode 100644
index dd7d5d88..00000000
--- a/vendor/adodb/adodb-php/pivottable.inc.php
+++ /dev/null
@@ -1,188 +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/vendor/adodb/adodb-php/replicate/adodb-replicate.inc.php b/vendor/adodb/adodb-php/replicate/adodb-replicate.inc.php
deleted file mode 100644
index 9aaf3c42..00000000
--- a/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 __construct($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/vendor/adodb/adodb-php/replicate/replicate-steps.php b/vendor/adodb/adodb-php/replicate/replicate-steps.php
deleted file mode 100644
index 5b696568..00000000
--- a/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/vendor/adodb/adodb-php/replicate/test-tnb.php b/vendor/adodb/adodb-php/replicate/test-tnb.php
deleted file mode 100644
index f163ff4f..00000000
--- a/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/vendor/adodb/adodb-php/rsfilter.inc.php b/vendor/adodb/adodb-php/rsfilter.inc.php
deleted file mode 100644
index 4b609b98..00000000
--- a/vendor/adodb/adodb-php/rsfilter.inc.php
+++ /dev/null
@@ -1,62 +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/vendor/adodb/adodb-php/scripts/.gitignore b/vendor/adodb/adodb-php/scripts/.gitignore
deleted file mode 100644
index 3e0e62b2..00000000
--- a/vendor/adodb/adodb-php/scripts/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-# Python byte code
-*.pyc
diff --git a/vendor/adodb/adodb-php/scripts/TARADO5.BAT b/vendor/adodb/adodb-php/scripts/TARADO5.BAT
deleted file mode 100644
index bf25ef99..00000000
--- a/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/vendor/adodb/adodb-php/scripts/buildrelease.py b/vendor/adodb/adodb-php/scripts/buildrelease.py
deleted file mode 100644
index 0b37b97b..00000000
--- a/vendor/adodb/adodb-php/scripts/buildrelease.py
+++ /dev/null
@@ -1,270 +0,0 @@
-#!/usr/bin/python -u
-'''
- ADOdb release build script
-
- - Create release tag if it does not exist
- - Copy release files to target directory
- - Generate zip/tar balls
- -
-'''
-
-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 = "https://github.com/ADOdb/ADOdb.git"
-release_branch = "master"
-release_prefix = "adodb"
-
-# Directories and files to exclude from release tarballs
-exclude_list = (".git*",
- "replicate",
- "scripts",
- "tests",
- # 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 = "hb:dfk"
-long_options = ["help", "branch", "debug", "fresh", "keep"]
-
-# Global flags
-debug_mode = False
-fresh_clone = False
-cleanup = True
-
-
-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
-
- -b | --branch Use specified branch (defaults to '%s' for '.0'
- releases, or 'hotfix/' for patches)
- -d | --debug Debug mode (ignores upstream: no fetch, allows
- build even if local branch is not in sync)
- -f | --fresh Create a fresh clone of the repository
- -k | --keep Keep build directories after completion
- (useful for debugging)
-''' % (
- path.basename(__file__),
- release_branch
- )
-#end usage()
-
-
-def set_version_and_tag(version):
- '''
- '''
- global release_branch, debug_mode, fresh_clone, cleanup
-
- # Delete existing tag to force creation in debug mode
- if debug_mode:
- try:
- updateversion.tag_delete(version)
- except:
- pass
-
- # Checkout release branch
- subprocess.call("git checkout %s" % release_branch, shell=True)
-
- if not debug_mode:
- # Make sure we're up-to-date, ignore untracked files
- ret = subprocess.check_output(
- "git status --branch --porcelain --untracked-files=no",
- 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
-
-
-def main():
- global release_branch, debug_mode, fresh_clone, cleanup
-
- # 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)
-
- for opt, val in opts:
- if opt in ("-h", "--help"):
- usage()
- sys.exit(0)
-
- elif opt in ("-b", "--branch"):
- release_branch = val
-
- elif opt in ("-d", "--debug"):
- debug_mode = True
-
- 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]
-
- # Default release branch
- if updateversion.version_is_patch(version):
- release_branch = 'hotfix/' + version
-
- # -------------------------------------------------------------------------
- # Start the build
- #
- global release_prefix
-
- print "Building ADOdb release %s into '%s'\n" % (
- version,
- release_path
- )
-
- if debug_mode:
- print "DEBUG MODE: ignoring upstream repository status"
-
- 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 = subprocess.check_output('git root', shell=True).rstrip()
- os.chdir(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
- if not debug_mode:
- 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)
- if debug_mode:
- set_version_and_tag(version)
- except:
- set_version_and_tag(version)
-
- # Copy files to release dir
- release_files = release_prefix + version.split(".")[0]
- release_tmp_dir = path.join(release_path, release_files)
- print "Copying release files to '%s'" % release_tmp_dir
- 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
- print release_prefix, version, release_name
-
- os.chdir(release_path)
- print "- tar"
- subprocess.call(
- "tar -czf %s.tar.gz %s" % (release_name, release_files),
- shell=True
- )
- print "- zip"
- subprocess.call(
- "zip -rq %s.zip %s" % (release_name, release_files),
- 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, files saved in '%s'." % (
- version,
- release_path
- )
- print "Don't forget to generate a README file with the changelog"
-
-#end main()
-
-if __name__ == "__main__":
- main()
diff --git a/vendor/adodb/adodb-php/scripts/updateversion.py b/vendor/adodb/adodb-php/scripts/updateversion.py
deleted file mode 100644
index 0c39fd53..00000000
--- a/vendor/adodb/adodb-php/scripts/updateversion.py
+++ /dev/null
@@ -1,399 +0,0 @@
-#!/usr/bin/python -u
-'''
- ADOdb version update script
-
- Updates the version number, and release date in all php and html files
-'''
-
-from datetime import date
-import getopt
-import os
-from os import path
-import re
-import subprocess
-import sys
-
-
-# ADOdb version validation regex
-# These are used by sed - they are not PCRE !
-_version_dev = "dev"
-_version_regex = "[Vv]?([0-9]\.[0-9]+)(\.([0-9]+))?(-?%s)?" % _version_dev
-_release_date_regex = "[0-9?]+-.*-[0-9]+"
-_changelog_file = "docs/changelog.md"
-
-_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_is_dev(version):
- ''' Returns true if version is a development release
- '''
- return version.endswith(_version_dev)
-
-
-def version_is_patch(version):
- ''' Returns true if version is a patch release (i.e. X.Y.Z with Z > 0)
- '''
- return not version.endswith('.0')
-
-
-def version_parse(version):
- ''' Breakdown the version into groups (Z and -dev are optional)
- 1:(X.Y), 2:(.Z), 3:(Z), 4:(-dev)
- '''
- return re.match(r'^%s$' % _version_regex, version)
-
-
-def version_check(version):
- ''' Checks that the given version is valid, exits with error if not.
- Returns the SemVer-normalized version without the "v" prefix
- - add '.0' if missing patch bit
- - add '-' before dev release suffix if needed
- '''
- vparse = version_parse(version)
- if not vparse:
- usage()
- print "ERROR: invalid version ! \n"
- sys.exit(1)
-
- vnorm = vparse.group(1)
-
- # Add .patch version component
- if vparse.group(2):
- vnorm += vparse.group(2)
- else:
- # None was specified, assume a .0 release
- vnorm += '.0'
-
- # Normalize version number
- if version_is_dev(version):
- vnorm += '-' + _version_dev
-
- return vnorm
-
-
-def get_release_date(version):
- ''' Returns the release date in DD-MMM-YYYY format
- For development releases, DD-MMM will be ??-???
- '''
- # Development release
- if version_is_dev(version):
- 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
- '''
-
- # Version number and release date
- script = r"s/{}\s+(-?)\s+{}/v{} \5 {}/".format(
- _version_regex,
- _release_date_regex,
- version,
- get_release_date(version)
- )
-
- return script
-
-
-def sed_filelist():
- ''' Build list of files to update
- '''
- dirlist = []
- for root, dirs, files in os.walk(".", topdown=True):
- # Filter files by extensions
- files = [
- f for f in files
- if re.search(r'\.(php|html?)$', f, re.IGNORECASE)
- ]
- for fname in files:
- dirlist.append(path.join(root, fname))
-
- 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_delete(version):
- ''' Deletes the specified tag
- '''
- subprocess.check_call(
- "git tag --delete " + tag_name(version),
- stderr=subprocess.PIPE,
- shell=True)
-
-
-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,
- get_release_date(version)
- ),
- tag_name(version)
- ),
- shell=True
- )
- return result == 0
-
-
-def section_exists(filename, version, print_message=True):
- ''' Checks given file for existing section with specified version
- '''
- script = True
- for i, line in enumerate(open(filename)):
- if re.search(r'^## ' + version, line):
- if print_message:
- print " Existing section for v%s found," % version,
- return True
- return False
-
-
-def version_get_previous(version):
- ''' Returns the previous version number
- Don't decrease major versions (raises exception)
- '''
- vprev = version.split('.')
- item = len(vprev) - 1
-
- while item > 0:
- val = int(vprev[item])
- if val > 0:
- vprev[item] = str(val - 1)
- break
- else:
- item -= 1
-
- if item == 0:
- raise ValueError('Refusing to decrease major version number')
-
- return '.'.join(vprev)
-
-
-def update_changelog(version):
- ''' Updates the release date in the Change Log
- '''
- print "Updating Changelog"
-
- vparse = version_parse(version)
-
- # Version number without '-dev' suffix
- version_release = vparse.group(1) + vparse.group(2)
- version_previous = version_get_previous(version_release)
-
- if not section_exists(_changelog_file, version_previous, False):
- raise ValueError(
- "ERROR: previous version %s does not exist in changelog" %
- version_previous
- )
-
- # Check if version already exists in changelog
- version_exists = section_exists(_changelog_file, version_release)
- if (not version_exists
- and not version_is_patch(version)
- and not version_is_dev(version)):
- version += '-' + _version_dev
-
- release_date = get_release_date(version)
-
- # Development release
- # Insert a new section for next release before the most recent one
- if version_is_dev(version):
- # Check changelog file for existing section
- if version_exists:
- print "nothing to do"
- return
-
- # No existing section found, insert new one
- if version_is_patch(version_release):
- print " Inserting new section for hotfix release v%s" % version
- else:
- print " Inserting new section for v%s" % version_release
- # Adjust previous version number (remove patch component)
- version_previous = version_parse(version_previous).group(1)
- script = "1,/^## {0}/s/^## {0}.*$/## {1} - {2}\\n\\n\\0/".format(
- version_previous,
- version_release,
- release_date
- )
-
- # Stable release (X.Y.0)
- # Replace the 1st occurence of markdown level 2 header matching version
- # and release date patterns
- elif not version_is_patch(version):
- print " Updating release date for v%s" % version
- script = r"s/^(## ){0}(\.0)? - {1}.*$/\1{2} - {3}/".format(
- vparse.group(1),
- _release_date_regex,
- version,
- release_date
- )
-
- # Hotfix release (X.Y.[0-9])
- # Insert a new section for the hotfix release before the most recent
- # section for version X.Y and display a warning message
- else:
- if version_exists:
- print 'updating release date'
- script = "s/^## {0}.*$/## {1} - {2}/".format(
- version.replace('.', '\.'),
- version,
- release_date
- )
- else:
- print " Inserting new section for hotfix release v%s" % version
- script = "1,/^## {0}/s/^## {0}.*$/## {1} - {2}\\n\\n\\0/".format(
- version_previous,
- version,
- release_date
- )
-
- print " WARNING: review '%s' to ensure added section is correct" % (
- _changelog_file
- )
-
- subprocess.call(
- "sed -r -i '%s' %s " % (
- script,
- _changelog_file
- ),
- 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
- os.chdir(subprocess.check_output('git root', shell=True).rstrip())
- version_set(version, do_commit, do_tag)
-#end main()
-
-
-if __name__ == "__main__":
- main()
diff --git a/vendor/adodb/adodb-php/scripts/uploadrelease.py b/vendor/adodb/adodb-php/scripts/uploadrelease.py
deleted file mode 100644
index 5b295cbb..00000000
--- a/vendor/adodb/adodb-php/scripts/uploadrelease.py
+++ /dev/null
@@ -1,172 +0,0 @@
-#!/usr/bin/python -u
-'''
- ADOdb release upload script
-'''
-
-from distutils.version import LooseVersion
-import getopt
-import glob
-import os
-from os import path
-import re
-import subprocess
-import sys
-
-
-# Directories and files to exclude from release tarballs
-sf_files = "frs.sourceforge.net:/home/frs/project/adodb/"
-rsync_cmd = "rsync -vP --rsh ssh {opt} {src} {usr}@{dst}"
-
-# Command-line options
-options = "hn"
-long_options = ["help", "dry-run"]
-
-
-def usage():
- print '''Usage: %s [options] username [release_path]
-
- This script will upload the files in the given directory (or the
- current one if unspecified) to Sourceforge.
-
- Parameters:
- username Sourceforge user account
- release_path Location of the release files to upload
- (see buildrelease.py)
-
- Options:
- -h | --help Show this usage message
- -n | --dry-run Do not upload the files
-''' % (
- path.basename(__file__)
- )
-#end usage()
-
-
-def call_rsync(usr, opt, src, dst):
- ''' Calls rsync to upload files with given parameters
- usr = ssh username
- opt = options
- src = source directory
- dst = target directory
- '''
- global dry_run
-
- command = rsync_cmd.format(usr=usr, opt=opt, src=src, dst=dst)
-
- if dry_run:
- print command
- else:
- subprocess.call(command, shell=True)
-
-
-def get_release_version():
- ''' Get the version number from the zip file to upload
- '''
- try:
- zipfile = glob.glob('adodb-*.zip')[0]
- except IndexError:
- print "ERROR: release zip file not found in '%s'" % release_path
- sys.exit(1)
-
- try:
- version = re.search(
- "^adodb-([\d]+\.[\d]+\.[\d]+)\.zip$",
- zipfile
- ).group(1)
- except AttributeError:
- print "ERROR: unable to extract version number from '%s'" % zipfile
- print " Only 3 groups of digits separated by periods are allowed"
- sys.exit(1)
-
- return version
-
-
-def sourceforge_target_dir(version):
- ''' Returns the sourceforge target directory
- Base directory as defined in sf_files global variable, plus
- - if version >= 5.21: adodb-X.Y
- - for older versions: adodb-XYZ-for-php5
- '''
- # Keep only X.Y (discard patch number)
- short_version = version.rsplit('.', 1)[0]
-
- directory = 'adodb-php5-only/'
- if LooseVersion(version) >= LooseVersion('5.21'):
- directory += "adodb-" + short_version
- else:
- directory += "adodb-{}-for-php5".format(short_version.replace('.', ''))
-
- return directory
-
-
-def process_command_line():
- ''' Retrieve command-line options and set global variables accordingly
- '''
- global upload_files, upload_doc, dry_run, username, release_path
-
- # 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 Sourceforge user and release_path"
- sys.exit(1)
-
- # Default values for flags
- dry_run = False
-
- for opt, val in opts:
- if opt in ("-h", "--help"):
- usage()
- sys.exit(0)
-
- elif opt in ("-n", "--dry-run"):
- dry_run = True
-
- # Mandatory parameters
- username = args[0]
-
- # Change to release directory, current if not specified
- try:
- release_path = args[1]
- os.chdir(release_path)
- except IndexError:
- release_path = os.getcwd()
-
-
-def upload_release_files():
- ''' Upload release files from source directory to SourceForge
- '''
- version = get_release_version()
- target = sf_files + sourceforge_target_dir(version)
-
- print
- print "Uploading release files..."
- print " Source:", release_path
- print " Target: " + target
- print
- call_rsync(
- username,
- "",
- path.join(release_path, "*"),
- target
- )
-
-
-def main():
- process_command_line()
-
- # Start upload process
- print "ADOdb release upload script"
-
- upload_release_files()
-
-#end main()
-
-if __name__ == "__main__":
- main()
diff --git a/vendor/adodb/adodb-php/server.php b/vendor/adodb/adodb-php/server.php
deleted file mode 100644
index c61287e7..00000000
--- a/vendor/adodb/adodb-php/server.php
+++ /dev/null
@@ -1,100 +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/vendor/adodb/adodb-php/session/adodb-compress-bzip2.php b/vendor/adodb/adodb-php/session/adodb-compress-bzip2.php
deleted file mode 100644
index 4e6ab501..00000000
--- a/vendor/adodb/adodb-php/session/adodb-compress-bzip2.php
+++ /dev/null
@@ -1,118 +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 __construct($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/vendor/adodb/adodb-php/session/adodb-compress-gzip.php b/vendor/adodb/adodb-php/session/adodb-compress-gzip.php
deleted file mode 100644
index 53bb0530..00000000
--- a/vendor/adodb/adodb-php/session/adodb-compress-gzip.php
+++ /dev/null
@@ -1,93 +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 __construct($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/vendor/adodb/adodb-php/session/adodb-cryptsession.php b/vendor/adodb/adodb-php/session/adodb-cryptsession.php
deleted file mode 100644
index 763cb50e..00000000
--- a/vendor/adodb/adodb-php/session/adodb-cryptsession.php
+++ /dev/null
@@ -1,27 +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 __construct($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/vendor/adodb/adodb-php/session/adodb-encrypt-md5.php b/vendor/adodb/adodb-php/session/adodb-encrypt-md5.php
deleted file mode 100644
index f5b2da61..00000000
--- a/vendor/adodb/adodb-php/session/adodb-encrypt-md5.php
+++ /dev/null
@@ -1,39 +0,0 @@
-encrypt($data, $key);
- }
-
- /**
- */
- function read($data, $key) {
- $md5crypt = new MD5Crypt();
- return $md5crypt->decrypt($data, $key);
- }
-
-}
-
-return 1;
diff --git a/vendor/adodb/adodb-php/session/adodb-encrypt-secret.php b/vendor/adodb/adodb-php/session/adodb-encrypt-secret.php
deleted file mode 100644
index 96ae8549..00000000
--- a/vendor/adodb/adodb-php/session/adodb-encrypt-secret.php
+++ /dev/null
@@ -1,48 +0,0 @@
-encrypt($data, $key);
-
- }
-
-
- function read($data, $key)
- {
- $sha1crypt = new SHA1Crypt();
- return $sha1crypt->decrypt($data, $key);
-
- }
-}
-
-
-
-return 1;
diff --git a/vendor/adodb/adodb-php/session/adodb-sess.txt b/vendor/adodb/adodb-php/session/adodb-sess.txt
deleted file mode 100644
index c6c76858..00000000
--- a/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/vendor/adodb/adodb-php/session/adodb-session-clob.php b/vendor/adodb/adodb-php/session/adodb-session-clob.php
deleted file mode 100644
index a6906f60..00000000
--- a/vendor/adodb/adodb-php/session/adodb-session-clob.php
+++ /dev/null
@@ -1,24 +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_maxlifetimenot 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/vendor/adodb/adodb-php/session/adodb-session2.php b/vendor/adodb/adodb-php/session/adodb-session2.php
deleted file mode 100644
index adeefc62..00000000
--- a/vendor/adodb/adodb-php/session/adodb-session2.php
+++ /dev/null
@@ -1,939 +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_maxlifetimenot 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);
- }
- } else {
- $ok = true; // $conn->_connectionID is set after call to ADONewConnection
- }
-
- 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/vendor/adodb/adodb-php/session/adodb-sessions.mysql.sql b/vendor/adodb/adodb-php/session/adodb-sessions.mysql.sql
deleted file mode 100644
index f90de449..00000000
--- a/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/vendor/adodb/adodb-php/session/adodb-sessions.oracle.clob.sql b/vendor/adodb/adodb-php/session/adodb-sessions.oracle.clob.sql
deleted file mode 100644
index c5c4f2d0..00000000
--- a/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/vendor/adodb/adodb-php/session/adodb-sessions.oracle.sql b/vendor/adodb/adodb-php/session/adodb-sessions.oracle.sql
deleted file mode 100644
index 8fd5a342..00000000
--- a/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/vendor/adodb/adodb-php/session/crypt.inc.php b/vendor/adodb/adodb-php/session/crypt.inc.php
deleted file mode 100644
index 1468cb1a..00000000
--- a/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/vendor/adodb/adodb-php/session/old/adodb-cryptsession.php b/vendor/adodb/adodb-php/session/old/adodb-cryptsession.php
deleted file mode 100644
index ca0d7930..00000000
--- a/vendor/adodb/adodb-php/session/old/adodb-cryptsession.php
+++ /dev/null
@@ -1,325 +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_maxlifetimenot 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/vendor/adodb/adodb-php/session/old/adodb-session-clob.php b/vendor/adodb/adodb-php/session/old/adodb-session-clob.php
deleted file mode 100644
index 3361ea59..00000000
--- a/vendor/adodb/adodb-php/session/old/adodb-session-clob.php
+++ /dev/null
@@ -1,448 +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_maxlifetimenot 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/vendor/adodb/adodb-php/session/old/adodb-session.php b/vendor/adodb/adodb-php/session/old/adodb-session.php
deleted file mode 100644
index 5764339e..00000000
--- a/vendor/adodb/adodb-php/session/old/adodb-session.php
+++ /dev/null
@@ -1,439 +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_maxlifetimenot 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/vendor/adodb/adodb-php/session/old/crypt.inc.php b/vendor/adodb/adodb-php/session/old/crypt.inc.php
deleted file mode 100644
index 9c347db0..00000000
--- a/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/vendor/adodb/adodb-php/session/session_schema.xml b/vendor/adodb/adodb-php/session/session_schema.xml
deleted file mode 100644
index 27e47bfe..00000000
--- a/vendor/adodb/adodb-php/session/session_schema.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
- table for ADOdb session-management
-
-
- session key
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/vendor/adodb/adodb-php/session/session_schema2.xml b/vendor/adodb/adodb-php/session/session_schema2.xml
deleted file mode 100644
index f0d3ec94..00000000
--- a/vendor/adodb/adodb-php/session/session_schema2.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
- table for ADOdb session-management
-
-
- session key
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/vendor/adodb/adodb-php/tests/benchmark.php b/vendor/adodb/adodb-php/tests/benchmark.php
deleted file mode 100644
index 5ba5e8bc..00000000
--- a/vendor/adodb/adodb-php/tests/benchmark.php
+++ /dev/null
@@ -1,86 +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/vendor/adodb/adodb-php/tests/client.php b/vendor/adodb/adodb-php/tests/client.php
deleted file mode 100644
index 5b30065a..00000000
--- a/vendor/adodb/adodb-php/tests/client.php
+++ /dev/null
@@ -1,199 +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/vendor/adodb/adodb-php/tests/pdo.php b/vendor/adodb/adodb-php/tests/pdo.php
deleted file mode 100644
index 31ca5969..00000000
--- a/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/vendor/adodb/adodb-php/tests/test-active-record.php b/vendor/adodb/adodb-php/tests/test-active-record.php
deleted file mode 100644
index 59471620..00000000
--- a/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/vendor/adodb/adodb-php/tests/test-active-recs2.php b/vendor/adodb/adodb-php/tests/test-active-recs2.php
deleted file mode 100644
index f5898fcd..00000000
--- a/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/vendor/adodb/adodb-php/tests/test-active-relations.php b/vendor/adodb/adodb-php/tests/test-active-relations.php
deleted file mode 100644
index 7a98d479..00000000
--- a/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/vendor/adodb/adodb-php/tests/test-active-relationsx.php b/vendor/adodb/adodb-php/tests/test-active-relationsx.php
deleted file mode 100644
index 0f28f728..00000000
--- a/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/vendor/adodb/adodb-php/tests/test-datadict.php b/vendor/adodb/adodb-php/tests/test-datadict.php
deleted file mode 100644
index 9c7422aa..00000000
--- a/vendor/adodb/adodb-php/tests/test-datadict.php
+++ /dev/null
@@ -1,251 +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/vendor/adodb/adodb-php/tests/test-perf.php b/vendor/adodb/adodb-php/tests/test-perf.php
deleted file mode 100644
index 62465bef..00000000
--- a/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/vendor/adodb/adodb-php/tests/test-pgblob.php b/vendor/adodb/adodb-php/tests/test-pgblob.php
deleted file mode 100644
index 3add99e6..00000000
--- a/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/vendor/adodb/adodb-php/tests/test-php5.php b/vendor/adodb/adodb-php/tests/test-php5.php
deleted file mode 100644
index a8f1ffe5..00000000
--- a/vendor/adodb/adodb-php/tests/test-php5.php
+++ /dev/null
@@ -1,116 +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/vendor/adodb/adodb-php/tests/test-xmlschema.php b/vendor/adodb/adodb-php/tests/test-xmlschema.php
deleted file mode 100644
index c56cfec8..00000000
--- a/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/vendor/adodb/adodb-php/tests/test.php b/vendor/adodb/adodb-php/tests/test.php
deleted file mode 100644
index 50e74ad4..00000000
--- a/vendor/adodb/adodb-php/tests/test.php
+++ /dev/null
@@ -1,1781 +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) {
- // XSS protection (see Github issue #274) - only set variables for
- // expected get parameters used in testdatabases.inc.php
- if(preg_match('/^(test|no)\w+$/', $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/vendor/adodb/adodb-php/tests/test2.php b/vendor/adodb/adodb-php/tests/test2.php
deleted file mode 100644
index eb3b0258..00000000
--- a/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/vendor/adodb/adodb-php/tests/test3.php b/vendor/adodb/adodb-php/tests/test3.php
deleted file mode 100644
index 78c7c775..00000000
--- a/vendor/adodb/adodb-php/tests/test3.php
+++ /dev/null
@@ -1,44 +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/vendor/adodb/adodb-php/tests/test4.php b/vendor/adodb/adodb-php/tests/test4.php
deleted file mode 100644
index 7a5d821c..00000000
--- a/vendor/adodb/adodb-php/tests/test4.php
+++ /dev/null
@@ -1,144 +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/vendor/adodb/adodb-php/tests/test5.php b/vendor/adodb/adodb-php/tests/test5.php
deleted file mode 100644
index e46bbc1d..00000000
--- a/vendor/adodb/adodb-php/tests/test5.php
+++ /dev/null
@@ -1,48 +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/vendor/adodb/adodb-php/tests/test_rs_array.php b/vendor/adodb/adodb-php/tests/test_rs_array.php
deleted file mode 100644
index 547b20ad..00000000
--- a/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/vendor/adodb/adodb-php/tests/testcache.php b/vendor/adodb/adodb-php/tests/testcache.php
deleted file mode 100644
index 87f6d51a..00000000
--- a/vendor/adodb/adodb-php/tests/testcache.php
+++ /dev/null
@@ -1,30 +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/vendor/adodb/adodb-php/tests/testdatabases.inc.php b/vendor/adodb/adodb-php/tests/testdatabases.inc.php
deleted file mode 100644
index f9f000a6..00000000
--- a/vendor/adodb/adodb-php/tests/testdatabases.inc.php
+++ /dev/null
@@ -1,478 +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/vendor/adodb/adodb-php/tests/testgenid.php b/vendor/adodb/adodb-php/tests/testgenid.php
deleted file mode 100644
index 3310734a..00000000
--- a/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/vendor/adodb/adodb-php/tests/testmssql.php b/vendor/adodb/adodb-php/tests/testmssql.php
deleted file mode 100644
index 733f0d45..00000000
--- a/vendor/adodb/adodb-php/tests/testmssql.php
+++ /dev/null
@@ -1,77 +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/vendor/adodb/adodb-php/tests/testoci8.php b/vendor/adodb/adodb-php/tests/testoci8.php
deleted file mode 100644
index 5eadc22e..00000000
--- a/vendor/adodb/adodb-php/tests/testoci8.php
+++ /dev/null
@@ -1,84 +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/vendor/adodb/adodb-php/tests/testoci8cursor.php b/vendor/adodb/adodb-php/tests/testoci8cursor.php
deleted file mode 100644
index 1f7b381e..00000000
--- a/vendor/adodb/adodb-php/tests/testoci8cursor.php
+++ /dev/null
@@ -1,110 +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/vendor/adodb/adodb-php/tests/testpaging.php b/vendor/adodb/adodb-php/tests/testpaging.php
deleted file mode 100644
index 947641be..00000000
--- a/vendor/adodb/adodb-php/tests/testpaging.php
+++ /dev/null
@@ -1,87 +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/vendor/adodb/adodb-php/tests/testpear.php b/vendor/adodb/adodb-php/tests/testpear.php
deleted file mode 100644
index a59f5f2c..00000000
--- a/vendor/adodb/adodb-php/tests/testpear.php
+++ /dev/null
@@ -1,35 +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/vendor/adodb/adodb-php/tests/testsessions.php b/vendor/adodb/adodb-php/tests/testsessions.php
deleted file mode 100644
index 79a66191..00000000
--- a/vendor/adodb/adodb-php/tests/testsessions.php
+++ /dev/null
@@ -1,100 +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/vendor/adodb/adodb-php/tests/time.php b/vendor/adodb/adodb-php/tests/time.php
deleted file mode 100644
index 8261e1e9..00000000
--- a/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/vendor/adodb/adodb-php/tests/tmssql.php b/vendor/adodb/adodb-php/tests/tmssql.php
deleted file mode 100644
index 0f81311a..00000000
--- a/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/vendor/adodb/adodb-php/tests/xmlschema.xml b/vendor/adodb/adodb-php/tests/xmlschema.xml
deleted file mode 100644
index ea48ae2b..00000000
--- a/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/vendor/adodb/adodb-php/toexport.inc.php b/vendor/adodb/adodb-php/toexport.inc.php
deleted file mode 100644
index 94c394b8..00000000
--- a/vendor/adodb/adodb-php/toexport.inc.php
+++ /dev/null
@@ -1,136 +0,0 @@
-FieldTypesArray();
- reset($fieldTypes);
- $i = 0;
- $elements = array();
- 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/vendor/adodb/adodb-php/tohtml.inc.php b/vendor/adodb/adodb-php/tohtml.inc.php
deleted file mode 100644
index d39ed291..00000000
--- a/vendor/adodb/adodb-php/tohtml.inc.php
+++ /dev/null
@@ -1,201 +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 ."\n\n";
- $s = $hdr;
- }
- } // while
-
- if ($echo) print $s."\n\n";
- else $html .= $s."\n\n";
-
- if ($docnt) if ($echo) print "".$rows." Rows
";
-
- return ($echo) ? $rows : $html;
- }
-
-// pass in 2 dimensional array
-function arr2html(&$arr,$ztabhtml='',$zheaderarray='')
-{
- if (!$ztabhtml) $ztabhtml = 'BORDER=1';
-
- $s = "";//';print_r($arr);
-
- if ($zheaderarray) {
- $s .= '';
- for ($i=0; $i\n";
- } else $s .= " \n";
- $s .= "\n \n";
- }
- $s .= '
';
- print $s;
-}
diff --git a/vendor/adodb/adodb-php/xmlschema.dtd b/vendor/adodb/adodb-php/xmlschema.dtd
deleted file mode 100644
index 2d0b579d..00000000
--- a/vendor/adodb/adodb-php/xmlschema.dtd
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-] >
\ No newline at end of file
diff --git a/vendor/adodb/adodb-php/xmlschema03.dtd b/vendor/adodb/adodb-php/xmlschema03.dtd
deleted file mode 100644
index 97850bc7..00000000
--- a/vendor/adodb/adodb-php/xmlschema03.dtd
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-]>
\ No newline at end of file
diff --git a/vendor/adodb/adodb-php/xsl/convert-0.1-0.2.xsl b/vendor/adodb/adodb-php/xsl/convert-0.1-0.2.xsl
deleted file mode 100644
index 5b2e3cec..00000000
--- a/vendor/adodb/adodb-php/xsl/convert-0.1-0.2.xsl
+++ /dev/null
@@ -1,205 +0,0 @@
-
-
-
-
-
-
-
-ADODB XMLSchema
-http://adodb-xmlschema.sourceforge.net
-
-
-
- 0.2
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/vendor/adodb/adodb-php/xsl/convert-0.1-0.3.xsl b/vendor/adodb/adodb-php/xsl/convert-0.1-0.3.xsl
deleted file mode 100644
index 3202dce4..00000000
--- a/vendor/adodb/adodb-php/xsl/convert-0.1-0.3.xsl
+++ /dev/null
@@ -1,221 +0,0 @@
-
-
-
-
-
-
-
-ADODB XMLSchema
-http://adodb-xmlschema.sourceforge.net
-
-
-
- 0.3
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/vendor/adodb/adodb-php/xsl/convert-0.2-0.1.xsl b/vendor/adodb/adodb-php/xsl/convert-0.2-0.1.xsl
deleted file mode 100644
index 6398e3e5..00000000
--- a/vendor/adodb/adodb-php/xsl/convert-0.2-0.1.xsl
+++ /dev/null
@@ -1,207 +0,0 @@
-
-
-
-
-
-
-
-ADODB XMLSchema
-http://adodb-xmlschema.sourceforge.net
-
-
-
- 0.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/vendor/adodb/adodb-php/xsl/convert-0.2-0.3.xsl b/vendor/adodb/adodb-php/xsl/convert-0.2-0.3.xsl
deleted file mode 100644
index 9e1f2ae3..00000000
--- a/vendor/adodb/adodb-php/xsl/convert-0.2-0.3.xsl
+++ /dev/null
@@ -1,281 +0,0 @@
-
-
-
-
-
-
-
-ADODB XMLSchema
-http://adodb-xmlschema.sourceforge.net
-
-
-
- 0.3
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/vendor/adodb/adodb-php/xsl/remove-0.2.xsl b/vendor/adodb/adodb-php/xsl/remove-0.2.xsl
deleted file mode 100644
index c82c3ad8..00000000
--- a/vendor/adodb/adodb-php/xsl/remove-0.2.xsl
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-ADODB XMLSchema
-http://adodb-xmlschema.sourceforge.net
-
-
-
-Uninstallation Schema
-
-
-
- 0.2
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/vendor/adodb/adodb-php/xsl/remove-0.3.xsl b/vendor/adodb/adodb-php/xsl/remove-0.3.xsl
deleted file mode 100644
index 4b1cd02e..00000000
--- a/vendor/adodb/adodb-php/xsl/remove-0.3.xsl
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-ADODB XMLSchema
-http://adodb-xmlschema.sourceforge.net
-
-
-
-Uninstallation Schema
-
-
-
- 0.3
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php
index 9fcb4a5f..dd37d858 100644
--- a/vendor/composer/autoload_files.php
+++ b/vendor/composer/autoload_files.php
@@ -8,6 +8,5 @@ $baseDir = dirname($vendorDir);
return array(
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
- 'bf9f5270ae66ac6fa0290b4bf47867b7' => $vendorDir . '/adodb/adodb-php/adodb.inc.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
);
diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php
index 36f7cc27..87bea681 100644
--- a/vendor/composer/autoload_static.php
+++ b/vendor/composer/autoload_static.php
@@ -9,7 +9,6 @@ class ComposerStaticInit67b09c83b85c3bc0027caefe5bba171a
public static $files = array (
'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php',
- 'bf9f5270ae66ac6fa0290b4bf47867b7' => __DIR__ . '/..' . '/adodb/adodb-php/adodb.inc.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
);
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 358122c1..27488910 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -1,60 +1,4 @@
[
- {
- "name": "adodb/adodb-php",
- "version": "v5.20.9",
- "version_normalized": "5.20.9.0",
- "source": {
- "type": "git",
- "url": "https://github.com/ADOdb/ADOdb.git",
- "reference": "f601748cca1ccb86dfd427620a1692a70e681075"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/ADOdb/ADOdb/zipball/f601748cca1ccb86dfd427620a1692a70e681075",
- "reference": "f601748cca1ccb86dfd427620a1692a70e681075",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.2"
- },
- "time": "2016-12-21T17:19:42+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "files": [
- "adodb.inc.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause",
- "LGPL-2.1"
- ],
- "authors": [
- {
- "name": "John Lim",
- "email": "jlim@natsoft.com",
- "role": "Author"
- },
- {
- "name": "Damien Regad",
- "role": "Current maintainer"
- },
- {
- "name": "Mark Newnham",
- "role": "Developer"
- }
- ],
- "description": "ADOdb is a PHP database abstraction layer library",
- "homepage": "http://adodb.org/",
- "keywords": [
- "abstraction",
- "database",
- "layer",
- "library",
- "php"
- ]
- },
{
"name": "brandonwamboldt/utilphp",
"version": "1.1.0",