當前位置: 首頁>>代碼示例>>PHP>>正文


PHP sqlite_close函數代碼示例

本文整理匯總了PHP中sqlite_close函數的典型用法代碼示例。如果您正苦於以下問題:PHP sqlite_close函數的具體用法?PHP sqlite_close怎麽用?PHP sqlite_close使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了sqlite_close函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: error

/**
 * @file
 * Test sqlite availability.
 */
function error($message)
{
    global $db;
    sqlite_close($db);
    unlink('test.db');
    die($message);
}
開發者ID:bgads,項目名稱:adsbg,代碼行數:11,代碼來源:sqlite.php

示例2: close

 function close()
 {
     if ($this->sqlite) {
         sqlite_close($this->sqlite);
         $this->sqlite = null;
     }
 }
開發者ID:splitice,項目名稱:radical-db,代碼行數:7,代碼來源:SQLiteConnection.php

示例3: CreateDatabase

 function CreateDatabase(&$db, $name)
 {
     if (!function_exists("sqlite_open")) {
         return $db->SetError("Connect", "SQLite support is not available in this PHP configuration");
     }
     $database_file = $db->GetDatabaseFile($name);
     if (@file_exists($database_file)) {
         return $db->SetError("Create database", "database already exists");
     }
     @touch($database_file);
     if (!@file_exists($database_file)) {
         return $db->SetError("Create database", "Unable to create new database. Permission denied");
     }
     $mode = isset($db->options["AccessMode"]) ? strcmp($db->options["AccessMode"][0], "0") ? intval($db->options["AccessMode"]) : octdec($db->options["AccessMode"]) : 0640;
     @chmod($database_file, $mode);
     if (!is_readable($database_file)) {
         @unlink($database_file);
         return $db->SetError("Create database", "Unable to open database for Reading. Permission denied");
     }
     if (!is_writable($database_file)) {
         @unlink($database_file);
         return $db->SetError("Create database", "Unable to open database for Writing. Permission denied");
     }
     $handle = @sqlite_open($database_file, $mode);
     if (!$handle) {
         @unlink($database_file);
         return $db->SetError("Create database", isset($php_errormsg) ? $php_errormsg : "could not create the database file");
     }
     sqlite_close($handle);
     return 1;
 }
開發者ID:wycus,項目名稱:darmedic,代碼行數:31,代碼來源:manager_sqlite.php

示例4: sql_close

 function sql_close()
 {
     if (!$this->db_connect_id) {
         return false;
     }
     return @sqlite_close($this->db_connect_id);
 }
開發者ID:lcorbasson,項目名稱:SemanticScuttle,代碼行數:7,代碼來源:sqlite.php

示例5: disconnect

 function disconnect()
 {
     //DBとの接続を切斷する。
     $flag = 1;
     sqlite_close($this->link) or $flag = false;
     return $flag;
 }
開發者ID:aim-web-projects,項目名稱:ann-cosme,代碼行數:7,代碼來源:DB.class.sqlite2.php

示例6: disconnect

 /**
  * @return SQLite
  **/
 public function disconnect()
 {
     if ($this->isConnected()) {
         sqlite_close($this->link);
     }
     return $this;
 }
開發者ID:onphp-framework,項目名稱:onphp-framework,代碼行數:10,代碼來源:SQLite.class.php

示例7: init

 /**
  * Initializes and opens the database
  *
  * Needs to be called right after loading this helper plugin
  */
 function init($dbname, $updatedir)
 {
     global $conf;
     // check for already open DB
     if ($this->db) {
         if ($this->dbname == $dbname) {
             // db already open
             return true;
         }
         // close other db
         sqlite_close($this->db);
         $this->db = null;
         $this->dbname = '';
     }
     $this->dbname = $dbname;
     $dbfile = $conf['metadir'] . '/' . $dbname . '.sqlite';
     $init = !@file_exists($dbfile) || (int) @filesize($dbfile) < 3;
     $error = '';
     $this->db = sqlite_open($dbfile, 0666, $error);
     if (!$this->db) {
         msg("SQLite: failed to open SQLite " . $this->dbname . " database ({$error})", -1);
         return false;
     }
     // register our custom aggregate function
     sqlite_create_aggregate($this->db, 'group_concat', array($this, '_sqlite_group_concat_step'), array($this, '_sqlite_group_concat_finalize'), 2);
     $this->_updatedb($init, $updatedir);
     return true;
 }
開發者ID:kosenconf,項目名稱:kcweb,代碼行數:33,代碼來源:helper.php

示例8: close

 function close()
 {
     if (!is_null($this->db)) {
         sqlite_close($this->db);
     }
     $this->db = null;
 }
開發者ID:sergrin,項目名稱:crawlers-il,代碼行數:7,代碼來源:CSqliteDB.class.php

示例9: prepareDB

 public function prepareDB($bWithData = true)
 {
     if (file_exists(dirname(__FILE__) . '/unittest.db')) {
         unlink(dirname(__FILE__) . '/unittest.db');
     }
     $db = sqlite_open(dirname(__FILE__) . '/unittest.db');
     $res = sqlite_query($db, 'CREATE TABLE people (id INTEGER PRIMARY KEY, firstName TEXT, lastName TEXT)', $sError);
     if ($res === false) {
         throw new Exception($sError);
     }
     if ($bWithData) {
         $res = sqlite_query($db, 'INSERT INTO people (id,firstName,lastName) VALUES (1, \'Jerome\', \'Piochet\')', $sError);
         if ($res === false) {
             throw new Exception($sError);
         }
         $res = sqlite_query($db, 'INSERT INTO people (id,firstName,lastName) VALUES (2, \'Tadao\', \'Poichet\')', $sError);
         if ($res === false) {
             throw new Exception($sError);
         }
         $res = sqlite_query($db, 'INSERT INTO people (id,firstName,lastName) VALUES (3, \'A\', \'B\')', $sError);
         if ($res === false) {
             throw new Exception($sError);
         }
         $res = sqlite_query($db, 'INSERT INTO people (id,firstName,lastName) VALUES (4, \'C\', \'D\')', $sError);
         if ($res === false) {
             throw new Exception($sError);
         }
     }
     sqlite_close($db);
 }
開發者ID:poitch,項目名稱:dokin,代碼行數:30,代碼來源:SQLiteTest.php

示例10: disconnect

 function disconnect()
 {
     if (is_resource($this->connectionId)) {
         sqlite_close($this->connectionId);
         $this->connectionId = null;
     }
 }
開發者ID:r-kitaev,項目名稱:limb,代碼行數:7,代碼來源:lmbSqliteConnection.class.php

示例11: dbclose

 public function dbclose()
 {
     if ($this->db != -1) {
         sqlite_close($this->db);
         $db = -1;
     }
 }
開發者ID:raccoon4me,項目名稱:sqlite-user-auth,代碼行數:7,代碼來源:userauth.php

示例12: Disconnect

 private function Disconnect()
 {
     if (!is_null($this->link)) {
         return sqlite_close($this->link);
     }
     return false;
 }
開發者ID:mmr,項目名稱:b1n,代碼行數:7,代碼來源:SQLite.php

示例13: close

 function close()
 {
     if ($this->handler) {
         return sqlite_close($this->handler);
     } else {
         die('データベースハンドラが見つかりません。');
     }
 }
開發者ID:miyamoto-shinji,項目名稱:php_01,代碼行數:8,代碼來源:connection.php

示例14: close

 public static function close()
 {
     // garbage collect once in a hundred page requests
     if (rand(1, 100) == 100) {
         Session::cleanup();
     }
     return @sqlite_close(SESSION_DB_LINK);
 }
開發者ID:laiello,項目名稱:php-garden,代碼行數:8,代碼來源:session.php

示例15: Close

 public function Close()
 {
     if ($this->connection === false) {
         throw new DatabaseEx('Not connected to a database server!');
     }
     sqlite_close($this->connection);
     $this->connection = null;
 }
開發者ID:BackupTheBerlios,項目名稱:newscenter,代碼行數:8,代碼來源:Sqlite.php


注:本文中的sqlite_close函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。