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


PHP PersistenceContext::close_db_connection方法代碼示例

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


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

示例1: connect_to_database

 private function connect_to_database($dbms, array $db_connection_data, $database)
 {
     DBFactory::init_factory($dbms);
     $connection = DBFactory::new_db_connection();
     DBFactory::set_db_connection($connection);
     try {
         $connection->connect($db_connection_data);
     } catch (UnexistingDatabaseException $exception) {
         PersistenceContext::get_dbms_utils()->create_database($database);
         PersistenceContext::close_db_connection();
         $connection = DBFactory::new_db_connection();
         $connection->connect($db_connection_data);
         DBFactory::set_db_connection($connection);
     }
 }
開發者ID:AroundPBT,項目名稱:PHPBoost,代碼行數:15,代碼來源:InstallationServices.class.php

示例2: HTTPRequestCustom

Environment::load_imports();
Environment::load_static_constants();
AppContext::set_request(new HTTPRequestCustom());
Session::gc();
$session_data = Session::start();
AppContext::set_session($session_data);
AppContext::init_current_user();
require_once PATH_TO_ROOT . '/test/PHPUnit/Framework.php';
if (isset($argv)) {
    array_shift($argv);
    $_REQUEST['params'] = implode(' ', $argv);
    $_REQUEST['is_html'] = false;
}
if (!empty($_REQUEST['params'])) {
    // Fake command line environment
    $argv = $_REQUEST['params'];
    $_SERVER['argv'] = explode(' ', '--configuration ./phpunit.cfg.xml ' . $argv);
} else {
    $_SERVER['argv'] = array();
}
$is_html = isset($_REQUEST['is_html']) && $_REQUEST['is_html'] == true;
if (!$is_html) {
    echo '<pre>';
}
//Debug::dump($_SERVER['argv']);
require_once PATH_TO_ROOT . '/test/phpunit.php';
if (!$is_html) {
    echo '</pre>';
}
PersistenceContext::close_db_connection();
開發者ID:AroundPBT,項目名稱:PHPBoost,代碼行數:30,代碼來源:run.php

示例3: destroy

 public static function destroy()
 {
     PersistenceContext::close_db_connection();
     @ob_end_flush();
 }
開發者ID:AroundPBT,項目名稱:PHPBoost,代碼行數:5,代碼來源:Environment.class.php

示例4: create_tables

 private function create_tables(InstallationServices $service, $host, $port, $login, $password, $schema, $tables_prefix)
 {
     if (!$service->is_already_installed() || !$this->overwrite_field->is_disabled() && $this->overwrite_field->is_checked()) {
         PersistenceContext::close_db_connection();
         $service->create_phpboost_tables(DBFactory::MYSQL, $host, $port, $schema, $login, $password, $tables_prefix);
         AppContext::get_response()->redirect(InstallUrlBuilder::website());
     } else {
         $this->overwrite_fieldset->enable();
         $this->error = $this->lang['phpboost.alreadyInstalled.explanation'];
     }
 }
開發者ID:AroundPBT,項目名稱:PHPBoost,代碼行數:11,代碼來源:InstallDBConfigController.class.php


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