本文整理汇总了PHP中Piwik\Config::getCommonConfigPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::getCommonConfigPath方法的具体用法?PHP Config::getCommonConfigPath怎么用?PHP Config::getCommonConfigPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Config
的用法示例。
在下文中一共展示了Config::getCommonConfigPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setTestEnvironment
/**
* Enable test environment
*
* @param string $pathLocal
* @param string $pathGlobal
* @param string $pathCommon
*/
public function setTestEnvironment($pathLocal = null, $pathGlobal = null, $pathCommon = null, $allowSaving = false)
{
if (!$allowSaving) {
$this->isTest = true;
}
$this->clear();
$this->pathLocal = $pathLocal ?: Config::getLocalConfigPath();
$this->pathGlobal = $pathGlobal ?: Config::getGlobalConfigPath();
$this->pathCommon = $pathCommon ?: Config::getCommonConfigPath();
$this->init();
// this proxy will not record any data in the production database.
// this provides security for Piwik installs and tests were setup.
if (isset($this->configGlobal['database_tests']) || isset($this->configLocal['database_tests'])) {
$this->__get('database_tests');
$this->configCache['database'] = $this->configCache['database_tests'];
}
// Ensure local mods do not affect tests
if (empty($pathGlobal)) {
$this->configCache['log'] = $this->configGlobal['log'];
$this->configCache['Debug'] = $this->configGlobal['Debug'];
$this->configCache['mail'] = $this->configGlobal['mail'];
$this->configCache['General'] = $this->configGlobal['General'];
$this->configCache['Segments'] = $this->configGlobal['Segments'];
$this->configCache['Tracker'] = $this->configGlobal['Tracker'];
$this->configCache['Deletelogs'] = $this->configGlobal['Deletelogs'];
$this->configCache['Deletereports'] = $this->configGlobal['Deletereports'];
$this->configCache['Development'] = $this->configGlobal['Development'];
}
// for unit tests, we set that no plugin is installed. This will force
// the test initialization to create the plugins tables, execute ALTER queries, etc.
$this->configCache['PluginsInstalled'] = array('PluginsInstalled' => array());
}
示例2: setTestEnvironment
/**
* Enable test environment
*
* @param string $pathLocal
* @param string $pathGlobal
* @param string $pathCommon
*/
public function setTestEnvironment($pathLocal = null, $pathGlobal = null, $pathCommon = null, $allowSaving = false)
{
if (!$allowSaving) {
$this->doNotWriteConfigInTests = true;
}
$this->pathLocal = $pathLocal ?: Config::getLocalConfigPath();
$this->pathGlobal = $pathGlobal ?: Config::getGlobalConfigPath();
$this->pathCommon = $pathCommon ?: Config::getCommonConfigPath();
$this->reload();
$databaseTestsSettings = $this->database_tests;
if (!empty($databaseTestsSettings)) {
$this->database = $databaseTestsSettings;
}
// Ensure local mods do not affect tests
if (empty($pathGlobal)) {
$this->Debug = $this->settings->getFrom($this->pathGlobal, 'Debug');
$this->mail = $this->settings->getFrom($this->pathGlobal, 'mail');
$this->General = $this->settings->getFrom($this->pathGlobal, 'General');
$this->Segments = $this->settings->getFrom($this->pathGlobal, 'Segments');
$this->Tracker = $this->settings->getFrom($this->pathGlobal, 'Tracker');
$this->Deletelogs = $this->settings->getFrom($this->pathGlobal, 'Deletelogs');
$this->Deletereports = $this->settings->getFrom($this->pathGlobal, 'Deletereports');
$this->Development = $this->settings->getFrom($this->pathGlobal, 'Development');
}
// for unit tests, we set that no plugin is installed. This will force
// the test initialization to create the plugins tables, execute ALTER queries, etc.
$this->PluginsInstalled = array('PluginsInstalled' => array());
}