data = $data; } public function apply() { $config = array(); foreach ($this->data['generalConfig'] as $sectionAndPropertyName => $value) { list($section, $property) = explode('_', $sectionAndPropertyName); $config[$section][$property] = $value; } $config['preferences']['store'] = $this->data['preferencesStore']; if (isset($this->data['preferencesResource'])) { $config['preferences']['resource'] = $this->data['preferencesResource']; } try { Config::fromArray($config) ->setConfigFile(Config::resolvePath('config.ini')) ->saveIni(); } catch (Exception $e) { $this->error = $e; return false; } $this->error = false; return true; } public function getSummary() { $pageTitle = '
' . mt('setup', 'Logging will be disabled.') . '
'; } else { $level = $this->data['generalConfig']['logging_level']; $loggingHtml = '' . '' . t('Type', 'app.config.logging') . ' | ' . '' . ($type === 'syslog' ? 'Syslog' : t('File', 'app.config.logging.type')) . ' | ' . '||
' . t('Level', 'app.config.logging') . ' | ' . '' . ($level === Logger::$levels[Logger::ERROR] ? t('Error', 'app.config.logging.level') : ( $level === Logger::$levels[Logger::WARNING] ? t('Warning', 'app.config.logging.level') : ( $level === Logger::$levels[Logger::INFO] ? t('Information', 'app.config.logging.level') : ( t('Debug', 'app.config.logging.level') ) ) )) . ' | ' . '||
' . t('Application Prefix') . ' | ' . '' . $this->data['generalConfig']['logging_application'] . ' | ' ) : ( '' . t('Filepath') . ' | ' . '' . $this->data['generalConfig']['logging_file'] . ' | ' )) . '
' . sprintf($message, Config::resolvePath('config.ini')) . '
'; } elseif ($this->error !== null) { $message = mt('setup', 'General configuration could not be written to: %s; An error occured:'); return '' . sprintf($message, Config::resolvePath('config.ini')) . '
' . '' . $this->error->getMessage() . '
'; } } }