本文整理汇总了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);
}
}
示例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();
示例3: destroy
public static function destroy()
{
PersistenceContext::close_db_connection();
@ob_end_flush();
}
示例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'];
}
}