adodb 최신버전으로 변경

<? 를 <?php 로 변경
This commit is contained in:
2018-01-11 19:28:35 +09:00
parent feff33715f
commit 7b3b674dee
450 changed files with 19425 additions and 32248 deletions
+41 -27
View File
@@ -1,14 +1,16 @@
<?php
/*
V5.09 25 June 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
/*
@version v5.20.9 21-Dec-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Set tabs to 4 for best viewing.
Latest version is available at http://adodb.sourceforge.net
Thanks Diogo Toscano (diogo#scriptcase.net) for the code.
And also Sid Dunayer [sdunayer#interserv.com] for extensive fixes.
*/
@@ -27,12 +29,13 @@ class ADODB_pdo_sqlite extends ADODB_pdo {
var $_dropSeqSQL = 'DROP TABLE %s';
var $concat_operator = '||';
var $pdoDriver = false;
var $random='abs(random())';
function _init($parentDriver)
{
$this->pdoDriver = $parentDriver;
$parentDriver->_bindInputArray = true;
$parentDriver->hasTransactions = true;
$parentDriver->hasTransactions = false; // // should be set to false because of PDO SQLite driver not supporting changing autocommit mode
$parentDriver->hasInsertID = true;
}
@@ -40,7 +43,7 @@ class ADODB_pdo_sqlite extends ADODB_pdo {
{
$parent = $this->pdoDriver;
@($ver = array_pop($parent->GetCol("SELECT sqlite_version()")));
@($end = array_pop($parent->GetCol("PRAGMA encoding")));
@($enc = array_pop($parent->GetCol("PRAGMA encoding")));
$arr['version'] = $ver;
$arr['description'] = 'SQLite ';
@@ -48,8 +51,8 @@ class ADODB_pdo_sqlite extends ADODB_pdo {
return $arr;
}
function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
{
$parent = $this->pdoDriver;
$offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
@@ -110,33 +113,33 @@ class ADODB_pdo_sqlite extends ADODB_pdo {
}
function BeginTrans()
{
{
$parent = $this->pdoDriver;
if ($parent->transOff) return true;
if ($parent->transOff) return true;
$parent->transCnt += 1;
$parent->_autocommit = false;
return $parent->Execute("BEGIN {$parent->_transmode}");
}
function CommitTrans($ok=true)
{
function CommitTrans($ok=true)
{
$parent = $this->pdoDriver;
if ($parent->transOff) return true;
if ($parent->transOff) return true;
if (!$ok) return $parent->RollbackTrans();
if ($parent->transCnt) $parent->transCnt -= 1;
$parent->_autocommit = true;
$ret = $parent->Execute('COMMIT');
return $ret;
}
function RollbackTrans()
{
$parent = $this->pdoDriver;
if ($parent->transOff) return true;
if ($parent->transOff) return true;
if ($parent->transCnt) $parent->transCnt -= 1;
$parent->_autocommit = true;
$ret = $parent->Execute('ROLLBACK');
return $ret;
}
@@ -155,7 +158,7 @@ class ADODB_pdo_sqlite extends ADODB_pdo {
$rs = $parent->Execute("PRAGMA table_info('$tab')");
if (isset($savem)) $parent->SetFetchMode($savem);
if (!$rs) {
$ADODB_FETCH_MODE = $save;
$ADODB_FETCH_MODE = $save;
return $false;
}
$arr = array();
@@ -173,7 +176,7 @@ class ADODB_pdo_sqlite extends ADODB_pdo {
$fld->primary_key = $r['pk'];
$fld->default_value = $r['dflt_value'];
$fld->scale = 0;
if ($save == ADODB_FETCH_NUM) $arr[] = $fld;
if ($save == ADODB_FETCH_NUM) $arr[] = $fld;
else $arr[strtoupper($fld->name)] = $fld;
}
$rs->Close();
@@ -184,7 +187,18 @@ class ADODB_pdo_sqlite extends ADODB_pdo {
function MetaTables($ttype=false,$showSchema=false,$mask=false)
{
$parent = $this->pdoDriver;
return $parent->GetCol($this->metaTablesSQL);
}
if ($mask) {
$save = $this->metaTablesSQL;
$mask = $this->qstr(strtoupper($mask));
$this->metaTablesSQL .= " AND name LIKE $mask";
}
$ret = $parent->GetCol($this->metaTablesSQL);
if ($mask) {
$this->metaTablesSQL = $save;
}
return $ret;
}
}
?>