本文整理匯總了PHP中Doctrine_Manager::resetInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP Doctrine_Manager::resetInstance方法的具體用法?PHP Doctrine_Manager::resetInstance怎麽用?PHP Doctrine_Manager::resetInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doctrine_Manager
的用法示例。
在下文中一共展示了Doctrine_Manager::resetInstance方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setUp
public function setUp()
{
// singleton-mania! ;)
Zend_Controller_Front::getInstance()->resetInstance();
Doctrine_Manager::resetInstance();
ZFDoctrine_Core::resetModelDirectories();
}
示例2: setUp
public function setUp()
{
if (method_exists('Doctrine_Manager', 'resetInstance')) {
// as of 1.2ALPHA3
Doctrine_Manager::resetInstance();
}
$this->application = new Zend_Application('testing');
$this->bootstrap = new Zend_Application_Bootstrap_Bootstrap($this->application);
Zend_Controller_Front::getInstance()->resetInstance();
}
示例3: tearDown
public function tearDown()
{
if (method_exists('Doctrine_Manager', 'resetInstance')) {
// as of 1.2ALPHA3
Doctrine_Manager::resetInstance();
}
// Restore original autoloaders
$loaders = spl_autoload_functions();
foreach ($loaders as $loader) {
spl_autoload_unregister($loader);
}
foreach ($this->loaders as $loader) {
spl_autoload_register($loader);
}
// Reset autoloader instance so it doesn't affect other tests
Zend_Loader_Autoloader::resetInstance();
}
示例4: reset
/**
* Reset connection
*
* @param string $profile_name (optional) Passed to init(), if given here.
* @param string $app_path (optional) Passed to init(), if given here.
* @return string|null
*/
public static function reset($profile_name = null, $app_path = null)
{
foreach (self::$db_handles as $name => $conn) {
$conn->close();
}
self::$master = null;
self::$slave = null;
self::$db_handles = array();
self::$registry = null;
self::$master_profile = null;
self::$slave_profile = null;
Doctrine_Manager::resetInstance();
// not just reset()
// If we were handed args, call init() on behalf of the user, and return the result.
if (!empty($profile_name) || !empty($app_path)) {
return self::init($profile_name, $app_path);
}
}