function sqliteGetInstance($dbPath, $forceVersion = null) { if (!$forceVersion) { if ($dbPath == ':memory:') { $dbVersion = min($GLOBALS['sqliteVersionAvailable']); } else { $dbVersion = sqlite::getDbVersion($dbPath); } } else { $dbVersion = $forceVersion; } if ($dbVersion && ($dbVersion == 2 || $dbVersion == 3)) { include_once INCLUDE_LIB . 'sqlite' . $dbVersion . '.class.php'; $classObj = 'sqlite' . $dbVersion; return new $classObj($dbPath); } else { return false; } }
function getTabDb() { $this->tabDb = array(); $tempTabDb = $GLOBALS["db"]->array_query("SELECT id, name, location FROM database", SQLITE_ASSOC); foreach ($tempTabDb as $tabDbInfo) { if (sqlite::getDbVersion($tabDbInfo['location']) == $this->connId->connId->getVersion()) { $this->tabDb[] = $tabDbInfo; } } return $this->tabDb; }
</div> <div class="base" align="center" style="margin-top: 5px;"> <a href="index.php" class="base" target="_parent"><?php echo $traduct->get(1); ?> </a> </div> <table class="main" width="100%" border="0" cellspacing="0" cellpadding="0"> <?php include_once INCLUDE_LIB . 'sqlite.class.php'; $query = "SELECT * FROM database ORDER BY name"; $tabDb = $db->array_query($query, SQLITE_ASSOC); if (is_array($tabDb)) { foreach ($tabDb as $ligne) { // get Database version $versionNum = sqlite::getDbVersion($ligne["location"]); $dbPics = 'database'; if (in_array($ligne['id'], $attachDbList)) { $dbPics .= '_link'; } else { $dbPics .= $versionNum; } $dbPics .= '.png'; if (isset($tempDb) && is_object($tempDb)) { if ($tempDb->dbVersion == 2) { $tempDb->close(); } else { $tempDb = null; } } echo "\n\t" . '<tr class="database" style="vertical-align: middle">' . "\n\t\t" . '<td class="img_db" width="18">' . displayPics($dbPics, '', 0, 20) . '</td>' . "\n\t\t" . '<td class="name_db"><a href="index.php?dbsel=' . $ligne['id'] . '" target="_parent" class="dbsel">' . $ligne['name'] . '</a></td>' . "\n\t" . '</tr>';