Execute the job.

@return bool
189425
public function handle()
    {
        return $this->dbTransaction(function () {
            $descendantsIds = $this->content->findDescendantsWithTrashed()->pluck('id');

            // First we need to delete all routes because it's polymorphic relation
            Route::where('routes.routable_type', '=', Content::class)
                ->whereIn('routable_id', $descendantsIds)
                ->delete();
            $lastAction = Content::withTrashed()->find($this->content->id)->forceDelete();

            event('content.force_deleted', [$this->content]);

            return $lastAction;
        });
    }
467834
public function execute()
    {
        $curdir = getcwd();
        chdir($this->phpci->buildPath);

        $behat = $this->executable;

        if (!$behat) {
            $this->phpci->logFailure(Lang::get('could_not_find', 'behat'));

            return false;
        }

        $success = $this->phpci->executeCommand($behat . ' %s', $this->features);
        chdir($curdir);

        list($errorCount, $data) = $this->parseBehatOutput();

        $this->build->storeMeta('behat-warnings', $errorCount);
        $this->build->storeMeta('behat-data', $data);

        return $success;
    }
211839
public function handle()
	{
		$days = (int)$this->option( 'days' );

		if ( $days < 0 )
		{
			$this->writeError( "days option cannot be negative" );

			return self::ERROR;
		}

		$success = $this->manager->deleteBackupFiles( $this->lang_folder_path , $days , $this->option( 'dry-run' ) );

		return ( $success === true ) ? self::SUCCESS : self::ERROR;
	}
6839
public function handle()
    {
        $this->tables = $this->getTablesFromMWBFile();
        if ($this->tables === false) {
            return false;
        }
        $this->getAppJson();

        $this->databaseService = new DatabaseService($this->config, $this->files);
        $this->databaseService->resetDatabase();

        $this->generateMigration();

        $this->databaseService->dropDatabase();

        return true;
    }
274449
public function handle()
    {
        if (! $this->confirmToProceed()) {
            return;
        }

        $driver = $this->getDriver();
        $database = $this->option('database');
        $id = $this->option('id');
        $pretend = $this->option('pretend', false);

        $this->prepareDatabase($driver, $database, $id);

        $migrator = $this->tenant->driver($driver);

        $this->setupMigrationOutput($migrator);

        $migrator->run($database, $id, $pretend);
    }
670218
public function handle()
    {
        $path = $this->argument('path');
        $lines = (int) $this->option('lines');

        if (empty($path) === false) {
            $root = function_exists('base_path') === true ? base_path() : getcwd();
            $file = rtrim($root, '/').'/'.$path;
        } else {
            $path = function_exists('storage_path') === true ? storage_path() : getcwd();
            $path = rtrim($path, '/').'/';

            $file = (new Collection($this->files->glob($path.'logs/*.log')))
                ->map(function ($file) {
                    return is_file($file) === true ? $file : false;
                })->sortByDesc(function ($file) {
                    return filectime($file);
                })->first();
        }

        $this->readLine($file, $lines);
    }
1287391
public function execute()
    {
        // if npm does not work, we cannot use gulp, so we return false
        $cmd = 'cd %s && npm install';
        if (IS_WIN) {
            $cmd = 'cd /d %s && npm install';
        }
        if (!$this->phpci->executeCommand($cmd, $this->directory)) {
            return false;
        }

        // build the gulp command
        $cmd = 'cd %s && ' . $this->gulp;
        if (IS_WIN) {
            $cmd = 'cd /d %s && ' . $this->gulp;
        }
        $cmd .= ' --no-color';
        $cmd .= ' --gulpfile %s';
        $cmd .= ' %s'; // the task that will be executed

        // and execute it
        return $this->phpci->executeCommand($cmd, $this->directory, $this->gulpfile, $this->task);
    }
1085448
public function handle()
	{
		$counter = JobsFacade::run();

		if ($counter === false) {
			$this->error('Job executor needs to cool down for '.(JobsFacade::remainingCoolDown() * 60)
                .' seconds! No jobs executed.');
		} else {
			$this->info('Done. Jobs executed: '.$counter.'/'.JobsFacade::count());
		}			
	}
202499
public function handle()
    {
        $contents = $this->blueprint->generate($this->getControllers(), $this->getDocName(), $this->getVersion(), $this->getIncludePath());

        if ($file = $this->option('output-file')) {
            $this->writer->write($contents, $file);

            return $this->info('Documentation was generated successfully.');
        }

        return $this->line($contents);
    }
564875
public function run()
	{
		$this->say("Copying CLI files " . $this->source);

		if (!file_exists($this->source))
		{
			$this->say("Folder " . $this->source . " does not exist!");

			return true;
		}

		$this->prepareDirectory();

		$map = $this->copyTarget($this->source, $this->target);

		$this->setResultFiles($map);

		return true;
	}
1074655
public function perform()
    {
        Stats::decr('queued', 1);
        Stats::decr('queued', 1, Queue::redisKey($this->queue, 'stats'));

        if (Event::fire(Event::JOB_PERFORM, $this) === false) {
            $this->cancel();
            return false;
        }

        $this->run();

        $retval = true;

        try {
            $instance = $this->getInstance();

            ob_start();

            if (method_exists($instance, 'setUp')) {
                $instance->setUp();
            }

            call_user_func_array(array($instance, $this->method), array($this->data, $this));

            if (method_exists($instance, 'tearDown')) {
                $instance->tearDown();
            }

            $this->complete();
        } catch (Exception\Cancel $e) {
            // setUp said don't perform this job
            $this->cancel();
            $retval = false;
        } catch (\Exception $e) {
            $this->fail($e);
            $retval = false;
        }

        $output = ob_get_contents();

        while (ob_get_length()) {
            ob_end_clean();
        }

        $this->redis->hset(self::redisKey($this), 'output', $output);

        Event::fire(Event::JOB_DONE, $this);

        return $retval;
    }
463214
public function handle()
    {
        $rows = array();

        foreach ($this->container['queue.failer']->all() as $failed)
        {
            $rows[] = $this->parseFailedJob((array) $failed);
        }

        if (count($rows) == 0)
        {
            return $this->info('No failed jobs!');
        }

        $this->table(array('ID', 'Connection', 'Queue', 'Class', 'Failed At'), $rows);
    }
157824
public function handle()
    {
        $this->tables = $this->getTablesFromMWBFile();
        if ($this->tables === false) {
            return false;
        }
        $this->getAppJson();

        $success = $this->validateTableSchema();
        if (!$success) {
            return false;
        }

        return true;
    }
50475
public function execute()
    {
        // if npm does not work, we cannot use grunt, so we return false
        $cmd = 'cd %s && npm install';
        if (IS_WIN) {
            $cmd = 'cd /d %s && npm install';
        }
        if (!$this->phpci->executeCommand($cmd, $this->directory)) {
            return false;
        }

        // build the grunt command
        $cmd = 'cd %s && ' . $this->grunt;
        if (IS_WIN) {
            $cmd = 'cd /d %s && ' . $this->grunt;
        }
        $cmd .= ' --no-color';
        $cmd .= ' --gruntfile %s';
        $cmd .= ' %s'; // the task that will be executed

        // and execute it
        return $this->phpci->executeCommand($cmd, $this->directory, $this->gruntfile, $this->task);
    }
163052
public function handle()
    {
        @ob_start();
        $ret = call_user_func_array([$this->di->get($this->module), $this->fun], $this->args);
        $out = ob_get_clean();
        ob_end_clean();

        return $this->packResult(['return' => $ret, 'output' => $out ?: '']);
    }
497254
public function execute()
    {
        $command = $this->getExecCommand();

        if (!$command) {
            return false;
        }

        if ($this->useExec) {
            $execCommand = $this->captureStdErr ? "$command 2>&1" : $command;
            exec($execCommand, $output, $this->_exitCode);
            $this->_stdOut = implode("\n", $output);
            if ($this->_exitCode!==0) {
                $this->_stdErr = $this->_stdOut;
                $this->_error = empty($this->_stdErr) ? 'Command failed' : $this->_stdErr;
                return false;
            }
        } else {
            $descriptors = array(
                1   => array('pipe','w'),
                2   => array('pipe', $this->getIsWindows() ? 'a' : 'w'),
            );
            if ($this->_stdIn!==null) {
                $descriptors[0] = array('pipe', 'r');
            }

            $process = proc_open($command, $descriptors, $pipes, $this->procCwd, $this->procEnv, $this->procOptions);

            if (is_resource($process)) {

                if ($this->_stdIn!==null) {
                    if (is_resource($this->_stdIn) &&
                        in_array(get_resource_type($this->_stdIn), array('file', 'stream'), true)) {
                        stream_copy_to_stream($this->_stdIn, $pipes[0]);
                    } else {
                        fwrite($pipes[0], $this->_stdIn);
                    }
                    fclose($pipes[0]);
                }
                $this->_stdOut = stream_get_contents($pipes[1]);
                $this->_stdErr = stream_get_contents($pipes[2]);
                fclose($pipes[1]);
                fclose($pipes[2]);

                $this->_exitCode = proc_close($process);

                if ($this->_exitCode!==0) {
                    $this->_error = $this->_stdErr ? $this->_stdErr : "Failed without error message: $command";
                    return false;
                }
            } else {
                $this->_error = "Could not run command $command";
                return false;
            }
        }

        $this->_executed = true;

        return true;
    }
14974
public function handle()
    {
        $input = $this->getCommandInput();
        $file = $this->getFilename($input->file);

        if (Config::autoManageResourceMapper()) {
            $mapper = new ResourceMapper($this);
            $mapper->reduce($input->modelName, $input->file);
        }

        if (!$this->isFileExists($file)) {
            $this->error('The resource-file does not exists.');

            return false;
        }

        $this->deleteFile($file);
        $this->info('The "' . basename($file) . '" file was successfully deleted!');
    }