| <?php |
|
|
| |
| |
| |
| |
| |
| |
|
|
| namespace Piwik\Application\Kernel; |
|
|
| use Piwik\Config; |
| use Piwik\Config\IniFileChain; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| class GlobalSettingsProvider |
| { |
| |
| |
| |
| protected $iniFileChain; |
|
|
| |
| |
| |
| protected $pathGlobal = null; |
|
|
| |
| |
| |
| protected $pathCommon = null; |
|
|
| |
| |
| |
| protected $pathLocal = null; |
|
|
| |
| |
| |
| |
| |
| public function __construct($pathGlobal = null, $pathLocal = null, $pathCommon = null) |
| { |
| $this->pathGlobal = $pathGlobal ?: Config::getGlobalConfigPath(); |
| $this->pathCommon = $pathCommon ?: Config::getCommonConfigPath(); |
| $this->pathLocal = $pathLocal ?: Config::getLocalConfigPath(); |
|
|
| $this->iniFileChain = new IniFileChain(); |
| $this->reload(); |
| } |
|
|
| public function reload($pathGlobal = null, $pathLocal = null, $pathCommon = null) |
| { |
| $this->pathGlobal = $pathGlobal ?: $this->pathGlobal; |
| $this->pathCommon = $pathCommon ?: $this->pathCommon; |
| $this->pathLocal = $pathLocal ?: $this->pathLocal; |
|
|
| $this->iniFileChain->reload(array($this->pathGlobal, $this->pathCommon), $this->pathLocal); |
| } |
|
|
| |
| |
| |
| |
| |
| |
| public function &getSection($name) |
| { |
| $section =& $this->iniFileChain->get($name); |
| return $section; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| public function setSection($name, $value) |
| { |
| $this->iniFileChain->set($name, $value); |
| } |
|
|
| public function getIniFileChain() |
| { |
| return $this->iniFileChain; |
| } |
|
|
| public function getPathGlobal() |
| { |
| return $this->pathGlobal; |
| } |
|
|
| public function getPathLocal() |
| { |
| return $this->pathLocal; |
| } |
|
|
| public function getPathCommon() |
| { |
| return $this->pathCommon; |
| } |
| } |
|
|