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


PHP MDB2_Driver_Common::disconnect方法代碼示例

本文整理匯總了PHP中MDB2_Driver_Common::disconnect方法的典型用法代碼示例。如果您正苦於以下問題:PHP MDB2_Driver_Common::disconnect方法的具體用法?PHP MDB2_Driver_Common::disconnect怎麽用?PHP MDB2_Driver_Common::disconnect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在MDB2_Driver_Common的用法示例。


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

示例1: tearDown

 public function tearDown()
 {
     if (!$this->db || MDB2::isError($this->db)) {
         return;
     }
     $this->clearTables();
     $this->db->disconnect();
     $this->db->popExpect();
     unset($this->db);
 }
開發者ID:gauthierm,項目名稱:MDB2,代碼行數:10,代碼來源:Abstract.php

示例2: disconnect

 /**
  * @brief Disconnect
  * @return bool
  *
  * This is good bye, good bye, yeah!
  */
 public static function disconnect()
 {
     // Cut connection if required
     if (self::$connection) {
         if (self::$backend == self::BACKEND_MDB2) {
             self::$connection->disconnect();
         }
         self::$connection = false;
         self::$MDB2 = false;
         self::$PDO = false;
     }
     return true;
 }
開發者ID:ryanshoover,項目名稱:core,代碼行數:19,代碼來源:db.php

示例3: disconnect

 /**
  * Log out and disconnect from the database.
  *
  * @param  boolean $force if the disconnect should be forced even if the
  *                        connection is opened persistently
  * @return mixed true on success, false if not connected and error
  *                object on error
  * @access public
  */
 function disconnect($force = true)
 {
     if (is_resource($this->connection)) {
         if ($this->in_transaction) {
             $dsn = $this->dsn;
             $database_name = $this->database_name;
             $persistent = $this->options['persistent'];
             $this->dsn = $this->connected_dsn;
             $this->database_name = $this->connected_database_name;
             $this->options['persistent'] = $this->opened_persistent;
             $this->rollback();
             $this->dsn = $dsn;
             $this->database_name = $database_name;
             $this->options['persistent'] = $persistent;
         }
         if (!$this->opened_persistent || $force) {
             @sqlite_close($this->connection);
         }
     }
     return parent::disconnect($force);
 }
開發者ID:ookwudili,項目名稱:chisimba,代碼行數:30,代碼來源:sqlite.php

示例4: disconnect

 /**
  * Log out and disconnect from the database.
  *
  * @param  boolean $force if the disconnect should be forced even if the
  *                        connection is opened persistently
  * @return mixed true on success, false if not connected and error
  *                object on error
  * @access public
  */
 function disconnect($force = true)
 {
     if ($this->connection instanceof SQLite3) {
         if ($this->in_transaction) {
             $dsn = $this->dsn;
             $database_name = $this->database_name;
             $persistent = $this->options['persistent'];
             $this->dsn = $this->connected_dsn;
             $this->database_name = $this->connected_database_name;
             $this->options['persistent'] = $this->opened_persistent;
             $this->rollback();
             $this->dsn = $dsn;
             $this->database_name = $database_name;
             $this->options['persistent'] = $persistent;
         }
         if (!$this->opened_persistent || $force) {
             $this->connection->close();
         }
     } else {
         return false;
     }
     return parent::disconnect($force);
 }
開發者ID:jaeindia,項目名稱:ownCloud-Enhancements,代碼行數:32,代碼來源:sqlite3.php

示例5: disconnect

 /**
  * Log out and disconnect from the database.
  *
  * @param  boolean $force if the disconnect should be forced even if the
  *                        connection is opened persistently
  * @return mixed true on success, false if not connected and error
  *                object on error
  * @access public
  */
 function disconnect($force = true)
 {
     if (is_resource($this->connection)) {
         if ($this->in_transaction) {
             $dsn = $this->dsn;
             $database_name = $this->database_name;
             $persistent = $this->options['persistent'];
             $this->dsn = $this->connected_dsn;
             $this->database_name = $this->connected_database_name;
             $this->options['persistent'] = $this->opened_persistent;
             $this->rollback();
             $this->dsn = $dsn;
             $this->database_name = $database_name;
             $this->options['persistent'] = $persistent;
         }
         if (!$this->opened_persistent || $force) {
             $ok = @pg_close($this->connection);
             if (!$ok) {
                 return $this->raiseError(MDB2_ERROR_DISCONNECT_FAILED, null, null, null, __FUNCTION__);
             }
         }
     } else {
         return false;
     }
     return parent::disconnect($force);
 }
開發者ID:phpontrax,項目名稱:trax,代碼行數:35,代碼來源:pgsql.php

示例6: disconnect

 /**
  * Log out and disconnect from the database.
  *
  * @param  boolean $force if the disconnect should be forced even if the
  *                        connection is opened persistently
  * @return mixed true on success, false if not connected and error
  *                object on error
  * @access public
  */
 function disconnect($force = true)
 {
     if (is_resource($this->connection)) {
         if ($this->in_transaction) {
             $dsn = $this->dsn;
             $database_name = $this->database_name;
             $persistent = $this->options['persistent'];
             $this->dsn = $this->connected_dsn;
             $this->database_name = $this->connected_database_name;
             $this->options['persistent'] = $this->opened_persistent;
             $this->rollback();
             $this->dsn = $dsn;
             $this->database_name = $database_name;
             $this->options['persistent'] = $persistent;
         }
         if (!$this->opened_persistent || $force) {
             if (function_exists('oci_close')) {
                 @oci_close($this->connection);
             } else {
                 @OCILogOff($this->connection);
             }
         }
         $this->uncommitedqueries = 0;
     }
     return parent::disconnect($force);
 }
開發者ID:Rudi9719,項目名稱:lucid,代碼行數:35,代碼來源:oci8.php

示例7: disconnect

 /**
  * Log out and disconnect from the database.
  *
  * @param  boolean $force if the disconnect should be forced even if the
  *                        connection is opened persistently
  * @return mixed true on success, false if not connected and error
  *                object on error
  * @access public
  */
 function disconnect($force = true)
 {
     if (is_resource($this->connection)) {
         if ($this->in_transaction) {
             $this->rollback();
         }
         if (!$this->opened_persistent || $force) {
             @mssql_close($this->connection);
         }
     }
     return parent::disconnect($force);
 }
開發者ID:laiello,項目名稱:punchcms,代碼行數:21,代碼來源:mssql.php


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