本文整理汇总了PHP中Piwik\Config::unsetInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::unsetInstance方法的具体用法?PHP Config::unsetInstance怎么用?PHP Config::unsetInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Config
的用法示例。
在下文中一共展示了Config::unsetInstance方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->recreateContainerWithWebEnvironment();
$this->initHostAndQueryString($input);
if ($this->isTestModeEnabled()) {
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/TestingEnvironment.php';
Config::unsetInstance();
StaticContainer::clearContainer();
\Piwik_TestingEnvironment::addHooks();
$indexFile = '/tests/PHPUnit/proxy/';
$this->resetDatabase();
} else {
$indexFile = '/';
}
$indexFile .= 'index.php';
if (!empty($_GET['pid'])) {
$process = new Process($_GET['pid']);
if ($process->hasFinished()) {
return;
}
$process->startProcess();
}
require_once PIWIK_INCLUDE_PATH . $indexFile;
if (!empty($process)) {
$process->finishProcess();
}
}
示例2: setUp
public function setUp()
{
parent::setUp();
$application = new Console();
$application->setAutoExit(false);
$this->applicationTester = new ApplicationTester($application);
Config::unsetInstance();
}
示例3: setUp
public function setUp()
{
parent::setUp();
Config::unsetInstance();
Config::getInstance()->setTestEnvironment();
Config::getInstance()->LoginLdap = array();
$this->setSitesManagerApiMock();
$this->userAccessAttributeParser = new UserAccessAttributeParser();
}
示例4: test_saveServersInfo_SavesConfigToINIFile_AndIgnoresInvalidServerInfo
public function test_saveServersInfo_SavesConfigToINIFile_AndIgnoresInvalidServerInfo()
{
Config::unsetInstance();
Config::getInstance()->setTestEnvironment();
$_SERVER['REQUEST_METHOD'] = 'POST';
$serverInfos = array(array('name' => 'server1', 'hostname' => 'ahost.com', 'port' => 389, 'base_dn' => 'somedn'), array('invaliddata' => 'sdfjklsdj', 'name' => 'server2', 'hostname' => 'thehost.com', 'port' => 456, 'base_dn' => 'thedn', 'admin_user' => 'admin', 'admin_pass' => 'pass'));
$this->api->saveServersInfo(json_encode($serverInfos));
$this->assertEquals(array('hostname' => 'ahost.com', 'port' => 389, 'base_dn' => 'somedn', 'admin_user' => null, 'admin_pass' => null), Config::getInstance()->LoginLdap_server1);
$this->assertEquals(array('hostname' => 'thehost.com', 'port' => 456, 'base_dn' => 'thedn', 'admin_user' => 'admin', 'admin_pass' => 'pass'), Config::getInstance()->LoginLdap_server2);
}
示例5: performTearDown
public function performTearDown()
{
// Note: avoid run SQL in the *tearDown() metohds because it randomly fails on Travis CI
// with error Error while sending QUERY packet. PID=XX
$this->tearDown();
self::unloadAllPlugins();
if ($this->dropDatabaseInTearDown) {
$this->dropDatabase();
}
DataTableManager::getInstance()->deleteAll();
Option::clearCache();
Site::clearCache();
Cache::deleteTrackerCache();
Config::getInstance()->clear();
ArchiveTableCreator::clear();
\Piwik\Plugins\ScheduledReports\API::$cache = array();
\Piwik\Registry::unsetInstance();
\Piwik\EventDispatcher::getInstance()->clearAllObservers();
$_GET = $_REQUEST = array();
Translate::unloadEnglishTranslation();
Config::unsetInstance();
\Piwik\Config::getInstance()->Plugins;
// make sure Plugins exists in a config object for next tests that use Plugin\Manager
// since Plugin\Manager uses getFromGlobalConfig which doesn't init the config object
}
示例6: tearDown
public function tearDown()
{
Config::unsetInstance();
Manager::unsetInstance();
parent::tearDown();
}
示例7: clearInMemoryCaches
public function clearInMemoryCaches()
{
DataTableManager::getInstance()->deleteAll();
Option::clearCache();
Site::clearCache();
Cache::deleteTrackerCache();
Config::getInstance()->clear();
ArchiveTableCreator::clear();
\Piwik\Plugins\ScheduledReports\API::$cache = array();
\Piwik\Registry::unsetInstance();
\Piwik\EventDispatcher::getInstance()->clearAllObservers();
$_GET = $_REQUEST = array();
Translate::unloadEnglishTranslation();
Config::unsetInstance();
\Piwik\Config::getInstance()->Plugins;
// make sure Plugins exists in a config object for next tests that use Plugin\Manager
// since Plugin\Manager uses getFromGlobalConfig which doesn't init the config object
}
示例8: tearDown
public function tearDown()
{
parent::tearDown();
Config::unsetInstance();
}