当前位置: 首页>>代码示例>>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;未经允许,请勿转载。