summaryrefslogtreecommitdiff
path: root/drivers/adodb-sqlite3.inc.php
diff options
context:
space:
mode:
authorDamien Regad <dregad@mantisbt.org>2021-03-27 11:41:15 +0100
committerDamien Regad <dregad@mantisbt.org>2021-04-11 10:38:20 +0200
commit7e49dfb14cb3ae8a033b277c6c8fc420b1ad5948 (patch)
tree1d22384a5d00a17f214e9d47d812456ae6befd79 /drivers/adodb-sqlite3.inc.php
parent4037fd29fbdb66127714d1211182e3735fb4078f (diff)
downloadadodb-7e49dfb14cb3ae8a033b277c6c8fc420b1ad5948.tar.gz
adodb-7e49dfb14cb3ae8a033b277c6c8fc420b1ad5948.tar.bz2
adodb-7e49dfb14cb3ae8a033b277c6c8fc420b1ad5948.zip
Whitespace
Diffstat (limited to 'drivers/adodb-sqlite3.inc.php')
-rw-r--r--drivers/adodb-sqlite3.inc.php38
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/adodb-sqlite3.inc.php b/drivers/adodb-sqlite3.inc.php
index ec014a47..c4b00142 100644
--- a/drivers/adodb-sqlite3.inc.php
+++ b/drivers/adodb-sqlite3.inc.php
@@ -417,7 +417,7 @@ class ADODB_sqlite3 extends ADOConnection {
{
return $this->_connectionID->close();
}
-
+
function metaIndexes($table, $primary = FALSE, $owner = false)
{
$false = false;
@@ -428,9 +428,9 @@ class ADODB_sqlite3 extends ADOConnection {
if ($this->fetchMode !== FALSE) {
$savem = $this->SetFetchMode(FALSE);
}
-
+
$pragmaData = array();
-
+
/*
* If we want the primary key, we must extract
* it from the table statement, and the pragma
@@ -442,22 +442,22 @@ class ADODB_sqlite3 extends ADOConnection {
);
$pragmaData = $this->getAll($sql);
}
-
+
/*
* Exclude the empty entry for the primary index
*/
$sqlite = "SELECT name,sql
- FROM sqlite_master
- WHERE type='index'
+ FROM sqlite_master
+ WHERE type='index'
AND sql IS NOT NULL
AND LOWER(tbl_name)='%s'";
-
+
$SQL = sprintf($sqlite,
strtolower($table)
);
-
+
$rs = $this->execute($SQL);
-
+
if (!is_object($rs)) {
if (isset($savem)) {
$this->SetFetchMode($savem);
@@ -467,10 +467,10 @@ class ADODB_sqlite3 extends ADOConnection {
}
$indexes = array ();
-
- while ($row = $rs->FetchRow())
+
+ while ($row = $rs->FetchRow())
{
-
+
if (!isset($indexes[$row[0]])) {
$indexes[$row[0]] = array(
'unique' => preg_match("/unique/i",$row[1]),
@@ -485,26 +485,26 @@ class ADODB_sqlite3 extends ADOConnection {
preg_match_all('/\((.*)\)/',$row[1],$indexExpression);
$indexes[$row[0]]['columns'] = array_map('trim',explode(',',$indexExpression[1][0]));
}
-
+
if (isset($savem)) {
$this->SetFetchMode($savem);
$ADODB_FETCH_MODE = $save;
}
-
+
/*
* If we want primary, add it here
*/
if ($primary){
-
+
/*
* Check the previously retrieved pragma to search
* with a closure
*/
$pkIndexData = array('unique'=>1,'columns'=>array());
-
+
$pkCallBack = function ($value, $key) use (&$pkIndexData) {
-
+
/*
* As we iterate the elements check for pk index and sort
*/
@@ -514,7 +514,7 @@ class ADODB_sqlite3 extends ADOConnection {
ksort($pkIndexData['columns']);
}
};
-
+
array_walk($pragmaData,$pkCallBack);
/*
@@ -524,7 +524,7 @@ class ADODB_sqlite3 extends ADOConnection {
if (count($pkIndexData['columns']) > 0)
$indexes['PRIMARY'] = $pkIndexData;
}
-
+
return $indexes;
}