Пример #1
0
 public function getConfigValuesFromFiles()
 {
     $ini = $this->settings->getIniFileChain();
     $descriptions = $this->iniReader->readComments($this->settings->getPathGlobal());
     $copy = array();
     foreach ($ini->getAll() as $category => $values) {
         if ($this->shouldSkipCategory($category)) {
             continue;
         }
         $local = $this->getFromLocalConfig($category);
         if (empty($local)) {
             $local = array();
         }
         $global = $this->getFromGlobalConfig($category);
         if (empty($global)) {
             $global = array();
         }
         $copy[$category] = array();
         foreach ($values as $key => $value) {
             $newValue = $value;
             if ($this->isKeyAPassword($key)) {
                 $newValue = $this->getMaskedPassword();
             }
             $defaultValue = null;
             if (array_key_exists($key, $global)) {
                 $defaultValue = $global[$key];
             }
             $description = '';
             if (!empty($descriptions[$category][$key])) {
                 $description = trim($descriptions[$category][$key]);
             }
             $copy[$category][$key] = array('value' => $newValue, 'description' => $description, 'isCustomValue' => array_key_exists($key, $local), 'defaultValue' => $defaultValue);
         }
     }
     return $copy;
 }