本文整理汇总了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);
}
}