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