public function init($params) { if (Installer::getStatus() !== Installer::CREATE_CONFIG) { InstallationPage::redirectToCorrectStep(); exit; } }
public function init($params) { if (Installer::getStatus() !== Installer::CREATE_CONFIG) { InstallationPage::redirectToCorrectStep(); exit; } $postData = \tniessen\tinyIt\HttpParams::_POST(); if ($postData && !$postData->isEmpty()) { $this->currentParams = $postData; $this->tryProcessPostData($postData); } }
public static function redirectToCorrectStep() { $status = Installer::getStatus(); if ($status === Installer::INSTALLED) { self::redirectTo('home'); } else { if ($status === Installer::CREATE_CONFIG) { self::redirectTo('installation/config'); } else { if ($status === Installer::INIT_DATABASE) { self::redirectTo('installation/database'); } else { die("Invalid installer status: {$status}"); } } } }
/** * Requires the installation to be complete. * * If the installation has not been completed, this function will redirect * the client to the `installation` page. * * @see \tniessen\tinyIt\Installer::getStatus */ public static final function requireInstallationComplete() { if (Installer::getStatus() !== Installer::INSTALLED) { self::redirectTo('installation'); exit; } }