public static function getInstance() { if (self::$instance == null) { self::$instance = new SqliteDb(); } return self::$instance; }
<?php date_default_timezone_set('UTC'); set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT']); require "_/inc/functions.php"; require "_/inc/db/dbinit.php"; require "_/inc/vendor/logboost/logboost-api-php/LogboostAPI.php"; //Config dbpath for unit test SqliteDb::$dbpath = isset($test_dbpath) ? $test_dbpath : ""; //Constants define("FROM_EMAIL", "localhost <webform@localhost>"); $cdao = new ConfigDao(); //ANTI CSRF if (!isset($_COOKIE['cv'])) { setcookie("cv", generateRandomString(30), time() + 3600); } //OpenID client configuration $Logboost_clientID = $cdao->getValueByKey("openid_clientid"); $Logboost_clientSecret = $cdao->getValueByKey("openid_clientsecret"); //Hoster configuration $Hoster_name = $cdao->getValueByKey("hoster_name"); $Hoster_maxfilesize = $cdao->getValueByKey("maxfilesize"); //Setup Variable for tracking VirtualPageViews in analytics. $VirtualPageView = ""; //Variables to store Site/URL information $ServerName = $_SERVER['SERVER_NAME']; $SiteSection = ""; $SubSection = ""; $RequestMethod = $_SERVER['REQUEST_METHOD']; $FormErrors = array(); setSectionInfo();
public function __construct() { $this->db = SqliteDb::getInstance(); }
function showArchivalProjectsTable() { $db = new SqliteDb('archives.sqlite'); createHtmlPage("Archival Projects", getTableStyle()); switch (rq('table')) { case 'archives': echo '<h1>Archival Projects Reference</h1>'; echo '<table id="archivalprojectsTable">'; echo '<tr><th>ID</th><th>Source URL</th><th>Scope of project</th><th>URL of archived data</th><th class="highlightedCell">Status of project</th></tr>'; if (rq('editTable', true) == 'true') { echo $db->editTable("archives", "archives"); } else { echo $db->displayTable("archives", "archives", array("status" => "Done")); } echo '</table>'; break; case 'encodings': echo '<h1>Data for known encodings</h1>'; break; } endHtmlPage(); $db->close(); }