/** * Set it up * @param \mithra62\Language $lang * @param \mithra62\Files $file * @param \mithra62\Settings $setting * @param \mithra62\Encrypt $encrypt * @param \mithra62\AbstractPlatform $platform */ public function __construct(\mithra62\Language $lang, \mithra62\Files $file, \mithra62\Settings $setting, \mithra62\Encrypt $encrypt, \mithra62\Platforms\AbstractPlatform $platform) { $this->lang = $lang; $this->file = $file; $this->settings = $setting->get(); $this->encrypt = $encrypt; $this->platform = $platform; $this->setTz($this->platform->getTimezone()); }
/** * (non-PHPdoc) * @see \mithra62\Settings::get() */ public function get($force = false) { $this->settings = parent::get($force); if ($this->settings['backup_file_location'] == '') { $this->settings['backup_file_location'] = $this->_defaults['backup_file_location']; } if ($this->settings['working_directory'] == '') { $this->settings['working_directory'] = $this->_defaults['working_directory']; } //little sanity check to ensure we can use the `system()` function for SQL backups and set to PHP accordingly if (!function_exists('system')) { $this->settings['db_backup_method'] = $this->settings['db_restore_method'] = 'php'; } $this->settings['max_file_backups'] = (int) $this->settings['max_file_backups']; $this->settings['max_db_backups'] = (int) $this->settings['max_db_backups']; //we have to ensure storage_details is always an array since if the encryption key is changed we'll get a bad return. Rare, but it happens. $this->settings['storage_details'] = is_array($this->settings['storage_details']) ? $this->settings['storage_details'] : array(); return $this->settings; }