public function actionEnable()
    {
        $maintenance = Yii::$app->maintenanceMode;

        if (!$maintenance->getIsEnabled(true) && $maintenance->enable()) {
            $this->stdout("Maintenance mode enabled successfully.\n", Console::FG_GREEN);
            return Controller::EXIT_CODE_NORMAL;
        } else {
            $this->stdout("Maintenance mode already enabled.\n", Console::FG_RED);
            return Controller::EXIT_CODE_ERROR;
        }
    }
public function actionEnable()
    {
        $maintenance = Yii::$app->maintenanceMode;

        if (!$maintenance->getIsEnabled(true) && $maintenance->enable()) {
            $this->stdout("Maintenance mode enabled successfully.\n", Console::FG_GREEN);
            return Controller::EXIT_CODE_NORMAL;
        } else {
            $this->stdout("Maintenance mode already enabled.\n", Console::FG_RED);
            return Controller::EXIT_CODE_ERROR;
        }
    }
public function actionEnable ( ) { $ maintenance = Yii :: $ app -> maintenanceMode ; if ( ! $ maintenance -> getIsEnabled ( true ) && $ maintenance -> enable ( ) ) { $ this -> stdout ( "Maintenance mode enabled successfully.\n" , Console :: FG_GREEN ) ; return Controller :: EXIT_CODE_NORMAL ; } else { $ this -> stdout ( "Maintenance mode already enabled.\n" , Console :: FG_RED ) ; return Controller :: EXIT_CODE_ERROR ; } }
Enable maintenance mode.
@since 0.2.2
@return int
Enable maintenance mode .