Exemplo n.º 1
0
 /**
  * Perform the appropriate action based on the current DSP state
  *
  * @param int $state
  *
  * @return bool
  */
 protected function _handleAction($state)
 {
     Platform::setPlatformState('ready', $state);
     switch ($state) {
         case PlatformStates::INIT_REQUIRED:
             $this->actionInitSystem();
             break;
         case PlatformStates::SCHEMA_REQUIRED:
             $this->actionUpgradeSchema();
             break;
         case PlatformStates::UPGRADE_REQUIRED:
             $this->actionUpgrade();
             break;
         case PlatformStates::ADMIN_REQUIRED:
             if (Fabric::fabricHosted()) {
                 $this->actionActivate();
             } else {
                 $this->actionInitAdmin();
             }
             break;
         case PlatformStates::DATA_REQUIRED:
             $this->actionInitData();
             break;
         case PlatformStates::WELCOME_REQUIRED:
             $this->actionWelcome();
             break;
         default:
             return false;
     }
     return true;
 }