Execute this command.

@return  mixed  Executed result or exit code.

@since  1.0
514842
public function execute()
	{
		if (count($this->children) && count($this->input->args))
		{
			$name = $this->input->args[0];

			try
			{
				return $this->executeSubCommand($name);
			}
			catch (CommandNotFoundException $e)
			{
				$e->getCommand()->renderAlternatives($e->getChild(), $e);

				return $e->getCode();
			}
			catch (\Exception $e)
			{
				$this->renderException($e);

				return $e->getCode();
			}
		}

		if ($this->handler)
		{
			if ($this->handler instanceof \Closure)
			{
				$code = $this->handler;

				return $code($this);
			}
			elseif (is_callable($this->handler))
			{
				return call_user_func($this->handler, $this);
			}
		}

		return $this->doExecute();
	}
981923
protected function executeCommand()
    {
        $process = new SymfonyProcess(
            $this->makeCommand(),
            $this->target->workingDir
        );

        $process->run();

        $output = $this->outputToCollection($process->getOutput());

        if ($output->count() == 0) {
            return $output;
        }

        if ($rootItem = $this->target->resource->rootItem) {
            return collect($output[$rootItem]);
        }

        return $output;
    }
817872
public function execute()
    {
        $cmd = $this->executable;

        if ($this->args !== null) {
            $cmd .= " {$this->args}";
        }
        if ($this->config !== null) {
            $cmd .= " -c '{$this->config}'";
        }
        if ($this->directory !== null) {
            $dirPath = $this->phpci->buildPath . DIRECTORY_SEPARATOR . $this->directory;
            $cmd .= " -d '{$dirPath}'";
        }
        chdir($this->phpci->buildPath);
        $output = '';
        $status = true;
        exec($cmd, $output);

        if (count(preg_grep("/Success \(/", $output)) == 0) {
            $status = false;
            $this->phpci->log($output);
        }
        if (count($output) == 0) {
            $status = false;
            $this->phpci->log(Lang::get('no_tests_performed'));
        }
        
        return $status;
    }
1061128
public function execute()
	{
		if (count($this->input->args) && $this->input->args[0] != 'help'
			&& $this->getOption('h') && !$this->getParent())
		{
			array_unshift($this->input->args, 'help');
		}

		if ($this->getOption('no-ansi'))
		{
			$this->output->getProcessor()->noColors = true;
		}

		return parent::execute();
	}
276414
public function execute()
    {
        $build = $this->phpci->buildPath;

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

        $this->wipeExistingDirectory();

        $cmd = 'mkdir -p "%s" && cp -R "%s" "%s"';
        if (IS_WIN) {
            $cmd = 'mkdir -p "%s" && xcopy /E "%s" "%s"';
        }

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

        $this->deleteIgnoredFiles();

        return $success;
    }
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;
    }
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;
    }
651919
public function execute()
    {
        $returnValues = array();
        
        while ($execute = array_shift($this->executeParameters)) {
            $returnValues[] = $this->run($execute);
        }
        
        return $returnValues;
    }
1304382
public function execute()
    {
        $pipeline = array_reduce(
            array_reverse($this->pipes), $this->carry(), function ($passable) {
            return $passable;
        }
        );

        return $pipeline($this->passable);
    }
693963
public function handle()
    {
        // generate command class
        $commandName  = $this->input->getArgument('name');

        $commandNamespace = $this->getNamespace('Commands', $commandName);

        $commandStubs = $this->filesystem->get(__DIR__.'/../stubs/MakeCommand.txt');
        $commandStubs = str_replace([ 'dummyCommandName', 'dummyNamespace', '\\\\' ], [ basename($commandName), $commandNamespace, '\\' ], $commandStubs);

        if(!file_exists($filename = app_path() ."/Commands/{$commandName}Command.php")) {
            $this->filesystem->create($filename, $commandStubs);
            $this->info("{$commandName} command has been created successfully.");
        } else {
            $this->info("{$commandName} command already exists.");
        }

        // generate command handler class
        $commandHandlerNamespace = $this->getNamespace('Handlers', $commandName);
        $commandClassName = basename($commandName);
        $commandHandlerUse = "{$commandNamespace}\\{$commandClassName}";

        $commandHandlerStubs = $this->filesystem->get(__DIR__.'/../stubs/MakeCommand-handler.txt');
        $commandHandlerStubs = str_replace(
            [ 'dummyCommandName', 'dummyNamespace', 'dummyUse', '\\\\' ],
            [ basename($commandName), $commandHandlerNamespace, $commandHandlerUse, '\\' ], $commandHandlerStubs
        );

        if(!file_exists($filename = app_path() ."/Handlers/{$commandName}CommandHandler.php")) {
            $this->filesystem->create($filename, $commandHandlerStubs);
            $this->info("{$commandName} handler has been created successfully.");
        } else {
            $this->info("{$commandName} handler already exists.");
        }
    }
954607
public function handle()
    {
        $env = new Env(base_path('.env'));
        $key = strtoupper($this->argument('key'));
        $result = str_replace('"', '', $env->get($key));

        if ($result == '' || is_null($result)) {
            return $this->error("Could not find a value for [$key] in your .env file.");
        }

        return $this->comment("The value for [$key] is \"$result\".");
    }
110264
public function execute()
    {
        foreach ($this->getJobs() as $key => $job) {
            try {
                $this->console($job, $key + 1);
                $task = $this->createTask($job);
                $return = $task->run();
                $this->getAdapter()->history(HistoryInterface::STATUS_OK, $job, is_string($return) ? $return : null);
            } catch (\Exception $exc) {
                $this->log($job, $exc);
            }
        }

        $this->getAdapter()->finishProcessing($this->getJobs());
    }
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);
    }
486692
public function execute()
    {
        $command = new \ReflectionClass($this);
        $options = input()->get();

        if (empty($options)) {
            $this->optionHelp();
        } else {

            foreach ($options as $method => $arguments) {

                if (array_key_exists('-' . $method, $this->commandOptionsShortcuts)) {
                    $method = $this->commandOptionsShortcuts[ '-' . $method ];
                }

                $optionMethod = camelcase('option-' . $method);

                if ($command->hasMethod($optionMethod)) {

                    $commandMethod = $command->getMethod($optionMethod);

                    if ($commandMethod->getNumberOfRequiredParameters() == 0) {
                        call_user_func([&$this, $optionMethod]);
                    } elseif ($commandMethod->getNumberOfRequiredParameters() > 0 and empty($arguments)) {
                        if (isset($this->commandOptions[ $method ][ 'help' ])) {
                            output()->write(
                                (new Format())
                                    ->setContextualClass(Format::INFO)
                                    ->setString(language()->getLine('CLI_USAGE') . ':')
                                    ->setNewLinesBefore(1)
                                    ->setNewLinesAfter(1)
                            );

                            output()->write(
                                (new Format())
                                    ->setContextualClass(Format::INFO)
                                    ->setString(language()->getLine($this->commandOptions[ $method ][ 'help' ]))
                                    ->setNewLinesAfter(2)
                            );
                        }
                    } else {
                        $optionArguments = is_array($arguments)
                            ? $arguments
                            : [$arguments];

                        call_user_func_array([&$this, $optionMethod], $optionArguments);
                    }
                }
            }
        }
    }
682218
public function execute()
    {
        $groups = array();
        $results = array();
        $currentOperation = null;
        $currentGroup = array();

        foreach ($this->commands as $command) {
            if ($currentOperation !== $command[0]) {
                $groups[] = array($currentOperation, $currentGroup);
                $currentOperation = $command[0];
                $currentGroup = array();
            }
            if ($currentOperation === 'get') {
                $currentGroup[] = $command[1];
            } else {
                $currentGroup[$command[1]] = $command[2];
            }
        }
        $groups[] = array($currentOperation, $currentGroup);
        array_shift($groups);

        foreach ($groups as $group) {
            list($op, $args) = $group;
            if ($op === 'set') {
                $result = $this->backend->setMulti($args, $this->ttl);
                $results = array_merge($results, array_fill(0, count($args), $result));
            } else {
                $results = array_merge($results, $this->backend->getMulti($args));
            }
        }

        $this->commands = array();
        return $results;
    }
973513
public function execute() {
		// if source is not specified
		if(!$this->Source) {
			// add an error
			$this->Error = 'No source image provided';	
			// return false already
			return(false);
		}
		// check if the source file exists
		if(!file_exists($this->Source)) {
			// add an error
			$this->Error = 'Source image does not exist';	
			// return false already
			return(false);
		}
		// if no destination
		if(!$this->Destination) {
			// add an error
			$this->Error = 'No destination provided';	
			// return false already
			return(false);
		}
		// if the destination is not a folder and already exists
		if(!is_dir($this->Destination) && file_exists($this->Destination)) {
			// throw an exception
			$this->Error = 'Destination image already exists';	
			// return false
			return(false);
		}
		// if the destination is not a directory
		elseif(!is_dir($this->Destination)) {
			// try to explode by slash to find the file name
			$exploded = explode('/',$this->Destination);
			// get the last element wich is the file name
			$this->Name = $exploded[count($exploded)-1];
			// set the directory as being the path minus the name
			$this->Destination = str_replace($this->Name,'',$this->Destination);
		}
		// the destination if a folder without name
		elseif(is_dir($this->Destination)) {
			// if the trailing slash is ommited
			if(substr($this->Destination,-1) != '/') {
				// add it to the path
				$this->Destination .= '/';	
			}
			// generate a name being sha1(file) +sha1(microtime)
			$this->Name = sha1_file($this->Source);
		}
		// destination unknown !
		else {
			// add an error
			$this->Error = 'Destination is unkown or incorrect';
			// return an error
			return(false);
		}
		// check if the destination is writable
		if(!is_writable($this->Destination)) {
			// add an error
			$this->Error = 'Destination is not writable';
			// return an error
			return(false);
		}
		// compute filesize
		$this->Size = filesize($this->Source);
		// get the type of the source image
		$this->Type = Filesystem::type($this->Source, true);
		// if failed to get a type
		if(!$this->Type) {
			// add an error
			$this->Error = 'Failed to get mimetype';
			// return an error
			return(false);		
		}
		// if the source type is not allowed
		if(!in_array($this->Type, $this->Allowed)) {
			// add an error
			$this->Error = 'This image is not in the list of allowed formats : ' . implode(',',$this->Allowed);
			// return an error
			return(false);
		}
		// if we have a png
		if($this->Type == 'image/png') {
			// create image
			$this->Image = imagecreatefrompng($this->Source);
		}
		// if we have a jpg
		elseif($this->Type == 'image/jpeg') {
			// create image
			$this->Image = imagecreatefromjpeg($this->Source);
		}		// get the width
		$this->OriginalWidth = imageSX($this->Image);
		// get the height
		$this->OriginalHeight = imageSY($this->Image);
		// if the picture is horizontal
		if($this->OriginalHeight < $this->OriginalWidth) {
			// set the height
			$this->Height 	= round($this->Maximum * $this->OriginalHeight / $this->OriginalWidth , 0);
			// set the width
			$this->Width 	= $this->Maximum;
		}
		// else the picture is vertical or cubic
		else {
			// set the width
			$this->Width = round($this->Maximum * $this->OriginalWidth / $this->OriginalHeight , 0);
			// set the height
			$this->Height = $this->Maximum;
		}
		// create a canvas for the resized image
		$this->Sized = ImageCreateTrueColor($this->Width,$this->Height);
		// resize and inject into the canvas
		imagecopyresampled(
			$this->Sized, $this->Image,
			0, 0, 0, 0,
			$this->Width, $this->Height,
			$this->OriginalWidth, $this->OriginalHeight
		);
		// destroy the source handler
		imagedestroy($this->Image);
		// if output is png
		if($this->Output == 'image/png') {
			// roof
			$this->Quality = $this->Quality > 90 ? '90' : $this->Quality;
			// convert the jpeg quality index to a png quality index
			$this->Quality = round(abs(-0.1 * $this->Quality + 10));
			// create png image
			$status = imagepng($this->Sized,$this->Destination.$this->Name,$this->Quality);
		}
		elseif($this->Output == 'image/jpeg') {
			// create jpeg image
			$status = imagejpeg($this->Sized,$this->Destination.$this->Name,$this->Quality);
		}
		// destroy the sized handler
		imagedestroy($this->Sized);
		
		// if everything went well
		if($status) {
			// get the size of the generated thumbnail
			$this->Size = filesize($this->Destination . $this->Name);
			// creation succeeded
			return(true);
		}
		// failed somewhere
		else {
			// add an error
			$this->Error = 'Failed to write thumbnail to the disk';
			// and return false
			return(false);	
		}
	}
1038029
public function execute()
    {
        $output = [];
        $code = 0;

        exec(sprintf($this->command, $this->hgPath, $this) . " 2>&1", $output, $code);

        if ($code != 0) {
            throw new \RuntimeException(
                'An error occurred while using VersionControl_HG; hg returned: '
                . implode(PHP_EOL, $output),
                $code
            );
        }

        return implode(PHP_EOL, $output);
    }