Execute the maintenance mode command

@return bool
540213
public function handle()
    {
        if(!$this->verifyViewExists($this->option('view')))
        {
            $message  = "Aborting due to missing view. Your application will remain ";
            $message .= (file_exists($this->laravel->storagePath().'/framework/down')) ? "down from a previous down command." : "up.";
            $this->info($message);
            return false;
        }

        // Call the original method, writing to the down file & console output
        parent::handle();

        // Fire an event
        $payload = $this->getDownFilePayload();
        Event::dispatch(new MaintenanceModeEnabled($payload['time'], $payload['message'], $payload['view'], $payload['retry'], $payload['allowed']));
        return true;
    }
885198
def enter_maintenance_mode(self):
    
    cmd = self._cmd('enterMaintenanceMode')
    if cmd.success:
      self._update(_get_service(self._get_resource_root(), self._path()))
    return cmd
1019657
public function handle()
    {
        if (!file_exists(base_path('.env'))) {
            $this->error('File .env not found');
            return false;
        }
        if (config('app.key') == '') {
            $this->info('Key Generate...');
            $this->call('key:generate');
        }
        if (!is_link(public_path('storage'))) {
            $this->info('Storage Link...');
            $this->call('storage:link');
        }
        if (!file_exists(app_path('Http/Controllers/HomeController.php')) && $this->confirm('Do you want to run make:auth?')) {
            $this->info('Make Auth...');
            $this->call('make:auth');
        }
        $this->info('Migrate and Seeding...');
        if ($this->option('migrate-fresh')) {
            $this->call('migrate:fresh', [ '--seed' => true ]);
        } elseif ($this->option('migrate-refresh')) {
            $this->call('migrate:refresh', [ '--seed' => true ]);
        } else {
            $this->call('migrate', [ '--seed' => true ]);
        }
        if (!file_exists(storage_path('oauth-private.key')) || !file_exists(storage_path('oauth-public.key'))) {
            $this->info('Passport Key Generate...');
            $this->call('passport:install');
        }

        return true;
    }
121409
protected function perform()
    {
        if ($this->isQuietModeDisabled()) {
            $this->fixer->disableQuietMode();
        }

        $spl = new SplFileInfo($this->file->path());

        return (bool) $this->fixer->fixFile($spl);
    }
436421
public function execute() {

		foreach($this -> stmt as $stmt) {
			$this -> executeStatement($stmt);
		}

		$this -> shadow = $this -> stmt;
		$this -> reset();

		//Write time for debugging
		$this -> trace = microtime(true) - $this -> trace;

		return true;
	}
1037430
public function execute(){
    
        if($this->last_updated->add(new \DateInterval('PT'.self::TASK_TIME_OUT.'S')) < new \DateTime())
            $this->is_running = false;
    
        if(!$this->is_running){
            $this->last_result = false;
            $this->is_running = true;
            $this->save();
    
            Log::addDebugLog('Start execution of Admin task: '.$this->getTitle());
            $this->last_result = $this->executeSteps();
            if($this->last_result){
                $this->last_updated = new \DateTime();
                if($this->nb_occurrences > 0){
                    $this->nb_occurrences--;
                    if($this->nb_occurrences == 0) $this->is_enabled = false;
                }
            }
            $this->is_running = false;
            $this->save();
            Log::addDebugLog('Execution completed for Admin task: '.$this->getTitle().' - '.($this->last_result ? 'Success' : 'Failure'));
        }
    }
865026
public function execute()
    {
        $buildPath = $this->phpci->buildPath;

        // Check if there are any actions to be run for the branch we're running on:
        if (!array_key_exists($this->build->getBranch(), $this->actions)) {
            return true;
        }

        // If there are, run them:
        $curdir = getcwd();
        chdir($buildPath);

        $success = true;
        foreach ($this->actions[$this->build->getBranch()] as $action => $options) {
            if (!$this->runAction($action, $options)) {
                $success = false;
                break;
            }
        }

        chdir($curdir);

        return $success;
    }
1173487
protected function runCommands()
    {
        // Load Remote directory
        $remote    = $this->argument('remote');
        $directory = Config::get('remote.connections.'.$remote.'.root');

        // Define commands
        $commands = array_merge(['cd '.$directory], Config::get('vdeploy::config.commands'));
        $commands = array_filter($commands);

        // Parse tags in command
        if (!$this->parseTags($commands)) {
            return false;
        }

        // Run Commands
        SSH::into($remote)->run($commands);

        return true;
    }
777462
public static function exec()
    {
        if (self::$state > 0) {
            return null;
        }

        self::$state = 1;

        self::trigger('init');

        if (self::env('maintenance')) {
            self::$state = 4;
            self::stop(503);
        }

        self::trigger('changestatus', array(\UtilsStatusCode(), null));

        $resp = Route::get();

        if (is_integer($resp)) {
            self::$state = 5;
            self::stop($resp, 'Invalid route');
        }

        $callback = $resp['callback'];

        if (!$callback instanceof \Closure) {
            $parsed = explode(':', $callback, 2);

            $callback = '\\Controller\\' . strtr($parsed[0], '.', '\\');
            $callback = array(new $callback, $parsed[1]);
        }

        $output = call_user_func_array($callback, $resp['args']);

        if (class_exists('\\Inphinit\\Http\\Response', false)) {
            Response::dispatch();
        }

        if (class_exists('\\Inphinit\\Viewing\\View', false)) {
            View::dispatch();
        }

        if (self::$state < 2) {
            self::$state = 2;
        }

        self::trigger('ready');

        if ($output || is_numeric($output)) {
            echo $output;
        }

        if (self::$state < 3) {
            self::$state = 3;
        }

        self::trigger('finish');

        if (self::$state < 4) {
            self::$state = 4;
        }
    }
677708
public function handle(MaintenanceModeEnabled $maintenanceMode)
    {
        $logMessage = "Maintenance Mode Enabled";
        if(!is_null($maintenanceMode->message) && $maintenanceMode->message !== "")
        {
            $logMessage .= " with a custom message: \"" . $maintenanceMode->message . "\"";
        }
        Log::alert($logMessage);
    }
234506
public function execute()
    {
        if (!$this->tryAndProcessRules()) {
            return false;
        }

        $phpmdBinaryPath = $this->phpci->findBinary('phpmd');

        $this->executePhpMd($phpmdBinaryPath);

        $errorCount = $this->processReport(trim($this->phpci->getLastOutput()));
        $this->build->storeMeta('phpmd-warnings', $errorCount);

        return $this->wasLastExecSuccessful($errorCount);
    }
1156058
public function run()
	{
		$this->say('Building ' . $this->getJConfig()->extension . " " . $this->getJConfig()->version);

		if (!$this->checkFolders())
		{
			return false;
		}

		// Create directory
		$this->prepareDistDirectory();

		// Build extension
		$this->buildExtension($this->params)->run();

		// Create symlink to current folder
		if ($this->isWindows())
		{
			$this->_exec('mklink /J ' . JPATH_BASE . '\dist\current ' . $this->getWindowsPath($this->getBuildFolder()));
		}
		else
		{
			$this->_symlink($this->getBuildFolder(), JPATH_BASE . "/dist/current");
		}

		// Support multiple deployment methods, separated by spaces
		$deploy = explode(" ", $this->getJConfig()->target);

		if (count($deploy))
		{
			foreach ($deploy as $d)
			{
				$task = 'deploy' . ucfirst($d);

				$this->{$task}()->run();
			}
		}

		return true;
	}
875420
public function activate() {
		$duration = (int)$this->params['duration'];
		$this->Maintenance->setMaintenanceMode($duration);
		$this->out('Maintenance mode activated ...');
	}
453946
protected function controlMaintenanceMode()
    {
        $allowed_path = $this->is_install
            || $this->is_backend
            || in_array($this->path, array('login', 'logout', 'forgot'));

        if ($this->is_maintenance && !$allowed_path) {

            if (!$this->isFront()) {
                $this->redirect('/');
            }

            $this->outputMaintenance();
        }
    }
648787
public function handle()
    {
        $commands = config('deploy.commands.purge_old_releases.after');
        foreach($commands as $command){
            $output = $this->scriptParser->parseString(
                $command, [
                'base_path' => base_path(),
                'env' => $this->option('env')
                ]
            )->run($this);

            if(!$output) {
                return false;
            }
        }
    }
495780
public function execute()
    {
        $path  = $this->phpci->buildPath;
        $build = $this->build;

        if ($this->directory == $path) {
            return false;
        }

        $filename = str_replace('%build.commit%', $build->getCommitId(), $this->filename);
        $filename = str_replace('%build.id%', $build->getId(), $filename);
        $filename = str_replace('%build.branch%', $build->getBranch(), $filename);
        $filename = str_replace('%project.title%', $build->getProject()->getTitle(), $filename);
        $filename = str_replace('%date%', date('Y-m-d'), $filename);
        $filename = str_replace('%time%', date('Hi'), $filename);
        $filename = preg_replace('/([^a-zA-Z0-9_-]+)/', '', $filename);

        $curdir = getcwd();
        chdir($this->phpci->buildPath);

        if (!is_array($this->format)) {
            $this->format = array($this->format);
        }

        foreach ($this->format as $format) {
            switch ($format) {
                case 'tar':
                    $cmd = 'tar cfz "%s/%s.tar.gz" ./*';
                    break;
                default:
                case 'zip':
                    $cmd = 'zip -rq "%s/%s.zip" ./*';
                    break;
            }

            $success = $this->phpci->executeCommand($cmd, $this->directory, $filename);
        }

        chdir($curdir);

        return $success;
    }
635145
public function handle()
    {
        if(config('deploy.cron')) {
            $this->comment("\nCreating cron jobs");
            foreach(config('deploy.cron') as $cronCommand){
                $output = $this->scriptParser->parseFile(
                    'createCronJobs', [
                    'command' => $cronCommand,
                    'base_path' => base_path(),
                    'env' => $this->option('env')
                    ]
                )->run($this);
                
                if(!$output) {
                    return false;
                }
            }
        }
    }