getUserInput(Restore::RESTORE_COMPATIBILITY_CHECK, false, UserInput::BOOL); } /** * @return bool * @throws AjaxException */ private function _getRestoreAllowCrossDomain(): bool { return $this->getUserInput(Restore::RESTORE_ALLOW_CROSS_DOMAIN, false, UserInput::BOOL); } /** * @return bool * @throws AjaxException */ private function _getRestoreAlternatePath(): bool { return $this->getUserInput(Restore::RESTORE_ALTERNATE_PATH, false, UserInput::BOOL); } /** * @return bool * @throws AjaxException */ private function _getRestoreWpContentOnly(): bool { return $this->getUserInput(Restore::RESTORE_WP_CONTENT_ONLY, false, UserInput::BOOL); } /** * @return void * @throws AjaxException * @throws InvalidArgumentException * @throws IOException */ public function execute(): void { $settings = Factory::getSettingsRestore(); if($this->isset(Restore::RESTORE_COMPATIBILITY_CHECK)) $settings->setRestoreCompatibilityCheck($this->_getRestoreCompatibilityCheck()); if($this->isset(Restore::RESTORE_ALLOW_CROSS_DOMAIN)) $settings->setRestoreAllowCrossDomain($this->_getRestoreAllowCrossDomain()); if($this->isset(Restore::RESTORE_ALTERNATE_PATH)) $settings->setRestoreAlternatePath($this->_getRestoreAlternatePath()); if($this->isset(Restore::RESTORE_WP_CONTENT_ONLY)) $settings->setRestoreWpContentOnly($this->_getRestoreWpContentOnly()); $settings->validateFields(); $settings->save(); $this->setResponseMessage('Saved Successfully'); $this->setResponseData($this->isCLI() ? $settings->getDisplayCLI() : $settings->getDisplay()); } }