private function getSection($sectionName) { $section = $this->config->getSection($sectionName); if (!is_array($section)) { throw new DefinitionException(sprintf('IniFileChain did not return an array for the config section %s', $section)); } return $section; }
/** * Dump config * * @return string|null * @throws \Exception */ public function dumpConfig() { $chain = $this->settings->getIniFileChain(); $header = "; <?php exit; ?> DO NOT REMOVE THIS LINE\n"; $header .= "; file automatically generated or modified by Piwik; you can manually override the default values in global.ini.php by redefining them in this file.\n"; return $chain->dumpChanges($header); }
public function getFromLocalConfig($name) { return $this->settings->getIniFileChain()->getFrom($this->settings->getPathLocal(), $name); }
public function __construct($configLocal, $configGlobal, $configCommon, $configCache) { parent::__construct(); $this->iniFileChain = new DumpConfigTestMockIniFileChain(array($this->pathGlobal => $configGlobal, $this->pathCommon => $configCommon, $this->pathLocal => $configLocal), $configCache); }
private function isDevelopmentModeEnabled() { $section = $this->settings->getSection('Development'); return (bool) @$section['enabled']; // TODO: code redundancy w/ Development. hopefully ok for now. }