Beispiel #1
0
 protected function submitConfig($key, $data)
 {
     if (is_string($data)) {
         $data = json_decode($data, true);
         if (json_last_error() != JSON_ERROR_NONE) {
             throw new ValidationException(json_last_error_msg(), json_last_error());
         }
     }
     $value = $this->filterConfig($key, $data);
     ConfigModel::saveConfig($key, $value);
     Config::clearCache();
     return $value;
 }
Beispiel #2
0
 protected static function loadDb(PhalconConfig $config)
 {
     $dbConfig = new PhalconConfig(Model\Config::all());
     $config->merge($dbConfig);
     static::$config = $config->toArray();
 }