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;
 }
示例#2
0
文件: Config.php 项目: piwik/piwik
 /**
  * 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);
 }
示例#3
0
 public function getFromLocalConfig($name)
 {
     return $this->settings->getIniFileChain()->getFrom($this->settings->getPathLocal(), $name);
 }
示例#4
0
 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.
 }