Example #1
0
 public function init($params)
 {
     if (Installer::getStatus() !== Installer::CREATE_CONFIG) {
         InstallationPage::redirectToCorrectStep();
         exit;
     }
 }
Example #2
0
 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);
     }
 }
Example #3
0
 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}");
             }
         }
     }
 }
Example #4
0
 /**
  * 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;
     }
 }