本文整理汇总了PHP中Zend_Loader_Autoloader::resetInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Loader_Autoloader::resetInstance方法的具体用法?PHP Zend_Loader_Autoloader::resetInstance怎么用?PHP Zend_Loader_Autoloader::resetInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Loader_Autoloader
的用法示例。
在下文中一共展示了Zend_Loader_Autoloader::resetInstance方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: teardown
public function teardown()
{
$loaders = spl_autoload_functions();
foreach ($loaders as $loader) {
spl_autoload_unregister($loader);
}
foreach ($this->loaders as $loader) {
spl_autoload_register($loader);
}
Zend_Loader_Autoloader::resetInstance();
}
示例2: tearDown
public function tearDown()
{
// 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();
}
示例3: tearDown
public function tearDown()
{
// 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();
ZendX_JQuery_View_Helper_JQuery::disableNoConflictMode();
}
示例4: tearDown
public function tearDown()
{
Zend_Db_Table::setDefaultAdapter(null);
Zend_Db_Table::setDefaultMetadataCache();
// 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();
}
示例5: 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();
}
示例6: setUpWithEnv
/**
* Method to initialize Zend_Application for each test.
*/
public function setUpWithEnv($applicationEnv)
{
// Reducing memory footprint by forcing garbage collection runs
// WARNING: Did not work on CI-System (PHP 5.3.14, PHPnit 3.5.13)
// gc_collect_cycles();
$this->closeLogfile();
$this->closeDatabaseConnection();
// Resetting singletons or other kinds of persistent objects.
Opus_Db_TableGateway::clearInstances();
// FIXME Does it help with the mystery bug?
Zend_Registry::_unsetInstance();
// Reset autoloader to fix huge memory/cpu-time leak
Zend_Loader_Autoloader::resetInstance();
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->suppressNotFoundWarnings(false);
$autoloader->setFallbackAutoloader(true);
// Clean-up possible artifacts in $_SERVER of previous test.
unset($_SERVER['REMOTE_ADDR']);
$this->bootstrap = new Zend_Application($applicationEnv, array("config" => array(APPLICATION_PATH . '/application/configs/application.ini', APPLICATION_PATH . '/tests/tests.ini', APPLICATION_PATH . '/tests/config.ini')));
// added to ensure that application log messages are written to opus.log when running unit tests
// if not set messages are written to opus-console.log
$_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.0';
parent::setUp();
}
示例7: tearDown
public function tearDown()
{
if ($this->errorHandler !== null) {
restore_error_handler();
}
// Restore original autoloaders
$loaders = spl_autoload_functions();
if (is_array($loaders)) {
foreach ($loaders as $loader) {
spl_autoload_unregister($loader);
}
}
if (is_array($this->loaders)) {
foreach ($this->loaders as $loader) {
spl_autoload_register($loader);
}
}
// Retore original include_path
set_include_path($this->includePath);
// Reset autoloader instance so it doesn't affect other tests
Zend_Loader_Autoloader::resetInstance();
}
示例8: testSingletonInstanceShouldAllowReset
public function testSingletonInstanceShouldAllowReset()
{
Zend_Loader_Autoloader::resetInstance();
$autoloader = Zend_Loader_Autoloader::getInstance();
$this->assertNotSame($this->autoloader, $autoloader);
}
示例9: set_include_path
<?php
set_include_path(implode(PATH_SEPARATOR, array(
realpath(dirname(__FILE__) . '/../library'),
get_include_path(),
)));
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', 'testing');
defined('APPLICATION_LOAD_TESTDATA')
|| define('APPLICATION_LOAD_TESTDATA', true);
require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
spl_autoload_unregister(array($autoloader, 'autoload'));
Zend_Loader_Autoloader::resetInstance();
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('PHPUnit_');
示例10: tearDown
public function tearDown()
{
Zend_Loader_Autoloader::resetInstance();
}
示例11: _SF_Autloader_TearDown
function _SF_Autloader_TearDown()
{
Zend_Loader_Autoloader::resetInstance();
$loader = Zend_Loader_Autoloader::getInstance();
$loader->registerNamespace('SF_');
}
示例12: unregisterZend
public static function unregisterZend()
{
if (!self::$zendLoaded) {
return true;
}
Zend_Loader_Autoloader::resetInstance();
spl_autoload_unregister(array('Zend_Loader_Autoloader', 'autoload'));
self::$zendLoaded = false;
}
示例13: tearDown
public function tearDown()
{
Zend_Loader_Autoloader::resetInstance();
Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true);
}