+
+ // Sanitize settings.
+ $this->settings['piwik_enabled'] = $this->settings['piwik_enabled'] ?? false;
+ $this->settings['piwik_site_id'] = intval($this->settings['piwik_site_id'] ?? 0);
+ $this->settings['piwik_url'] = strlen($this->settings['piwik_url'] ?? '') ? $this->settings['piwik_url'] : '/matomo/';
+ $this->settings['piwik_tracker_path'] = strlen($this->settings['piwik_tracker_path'] ?? '') ? $this->settings['piwik_tracker_path'] : '../vendor/matomo/matomo-php-tracker/';
+ $this->settings['skin'] = (($this->settings['skin'] ?? false) && is_dir('skin/'.$this->settings['skin'])) ? $this->settings['skin'] : 'default';
+ $this->settings['operator_name'] = $this->settings['operator_name'] ?? 'Example';
+ $this->settings['operator_contact_url'] = $this->settings['operator_contact_url'] ?? 'https://github.com/KaiRo_at/authserver/';
+ $this->settings['info_from_email'] = $this->settings['info_from_email'] ?? 'noreply@example.com';
+
+ // Initialize database.