Gets the command line to be executed.

@return string The command to execute
171587
public function getCommandLine()
    {
        return is_array($this->commandline) ? implode(' ', array_map(array($this, 'escapeArgument'), $this->commandline)) : $this->commandline;
    }
560960
public function getCommand()
    {
        return sprintf(
            "put %d %d %d %d",
            $this->_priority,
            $this->_delay,
            $this->_ttr,
            strlen($this->_message)
        );
    }
761750
public function getCommand()
    {
        $options = $this->defaultOptions;

        if ($this->options !== null) {
            $options = $this->options;
        }

        if ($this->verbose === true) {
            $options .= ' --verbose';
        }

        if ($this->checksum === true) {
            $options .= ' --checksum';
        }

        if ($this->identityFile !== null) {
            $options .= ' -e "ssh -i ' . $this->identityFile . ' -p' . $this->remotePort . '"';
        } else {
            if ($this->remoteShell !== null) {
                $options .= ' -e "' . $this->remoteShell . '"';
            }
        }

        if ($this->dryRun === true) {
            $options .= ' --dry-run';
        }

        if ($this->delete === true) {
            $options .= ' --delete-after --ignore-errors --force';
        }

        if ($this->itemizeChanges === true) {
            $options .= ' --itemize-changes';
        }
        if ($this->backupDir !== null) {
            $options .= ' -b --backup-dir="' . $this->backupDir . '"';
        }

        if ($this->exclude !== null) {
            //remove trailing comma if any
            $this->exclude = trim($this->exclude, ',');
            $options .= ' --exclude="' . str_replace(',', '" --exclude="', $this->exclude) . '"';
        }

        if ($this->excludeFile !== null) {
            $options .= ' --exclude-from="' . $this->excludeFile . '"';
        }

        $this->setOptions($options);

        $options .= ' "' . $this->sourceDir . '" "' . $this->destinationDir . '"';

        escapeshellcmd($options);
        $options .= ' 2>&1';

        return $this->rsyncPath . ' ' . $options;
    }
594176
protected function getServerCommandLine()
    {
        $this->checkJar(self::$ngJarFile);
        $this->checkJar(self::$jarFile);

        $classPath = array(
            self::$ngJarFile,
            self::$jarFile,
        );

        // The command for the server that should show up in the process list
        $server = array(
            self::$javaExecutable,
            '-server',
            '-cp', implode(':', $classPath),
            self::NG_SERVER,
        );

        return $server;
    }
387142
public function getCommandName()
    {
        preg_match("/\\\\([\w]+)Command$/", get_class($this->command), $matches);
        return isset($matches[1]) ? lcfirst($matches[1]).'()' : 'Method';
    }
1049991
public function getIsCli()
    {
        if ($this->_isCli === null) {
            $this->_isCli = $this->getSapiName() === 'cli';
        }

        return $this->_isCli;
    }
880579
private function getProcessCommand()
    {
        $options   = $this->transformOptions();
        $options[] = escapeshellarg($this->input);

        $command = $this->binary . ' ' . implode(' ', $options);

        return $command;
    }
996698
public function getCommand()
    {
        $payload = $this->getContent();
        
        $command = new Command(
            $payload['service'], 
            $payload['operation'], 
            $payload['params'], 
            $payload['context']);
        
        $payloadIdentity = $payload['identity'];
        $identity = null;
        
        if (isset($payloadIdentity['username'])) {
            $identity = $this->resolveIdentity(
                $payloadIdentity['username'], 
                $payloadIdentity['account']);
        } else if($payloadIdentity) {
            $identity = $this->prepareIdentity($payloadIdentity);
        }
        
        if ($identity) {
            $command->setIdentity($identity);
        }
        
        $command->setJob($this);
        
        return $command;
    }
774116
public function execute() {
        $this->log
            ->printAsMessage()
            ->info($this->getDescription())
            ->printEmptyLine()
            ->printAsOutput();

        ksort($this->config['commands']);

        $maxCommandLength = 0;

        foreach (array_keys($this->config['commands']) as $command) {
            if (is_string($command) && strlen($command) > $maxCommandLength) {
                $maxCommandLength = strlen($command);
            }
        }

        $tab = 4;
        $minLength = $tab * (int) ($maxCommandLength / $tab) + $tab;

        foreach ($this->config['commands'] as $command => $details) {
            $this->log->info(
                str_pad($command, $minLength) . '<dim>' . $details['description'] . '</dim>'
            );
        }

        return $this;
    }
293742
protected function getArtisanLine()
    {
        $command = $this->app['request']->server('argv', []);

        if (is_array($command)) {
            $command = implode(' ', $command);
        }

        return $command;
    }
393253
public function execute(): string
    {
        $calls  = $this->requestParser->parse($this->requestProvider->getPayload());
        $result = $this->processor->process($calls);

        return $this->responseBuilder->build($result);
    }
923243
public function buildCommand()
	{
		$output = ProcessUtils::escapeArgument( $this->output );
		$redirect = $this->shouldAppendOutput ? ' >> ' : ' > ';
		if ( $this->withoutOverlapping )
		{
			if ( windows_os() )
			{
				$command = '(echo \'\' > "' . $this->mutexPath() . '" & ' . $this->command . ' & del "' . $this->mutexPath() . '")' . $redirect . $output . ' 2>&1 &';
			}
			else
			{
				$command = '(touch ' . $this->mutexPath() . '; ' . $this->command . '; rm ' . $this->mutexPath() . ')' . $redirect . $output . ' 2>&1 &';
			}
		}
		else
		{
			$command = $this->command . $redirect . $output . ' 2>&1 &';
		}

		return $this->user && !windows_os() ? 'sudo -u ' . $this->user . ' -- sh -c \'' . $command . '\'' : $command;
	}
662530
public function getProcessedHelp()
    {
        $name = $this->name;
        $isSingleCommand = $this->application && $this->application->isSingleCommand();

        $placeholders = [
            '%command.name%',
            '%command.full_name%',
        ];
        $replacements = [
            $name,
            $isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'].' '.$name,
        ];

        return str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription());
    }
1328145
protected function _command() {
        $class = '\Gcs\Framework\Core\Terminal\Terminal' . ucfirst($this->_argv[0]);

        if (isset($this->_argv[1])) {
            $method = $this->_argv[1];
        }
        else if ($this->_argv[0] == 'help') {
            $method = 'help';
        }
        else {
            $method = '';
        }

        if (method_exists($class, $method)) {
            $instance = new $class($this->_argv);
            $instance->$method($this->_argv);
        }
        else {
            if (isset($this->_argv[1])) {
                echo '[ERROR] unrecognized command "' . $this->_argv[0] . ' ' . $this->_argv[1] . '"';
            }
            else {
                echo '[ERROR] unrecognized command "' . $this->_argv[0] . '"\n';
            }
        }
    }
457128
protected function getExecutedCommand()
    {
        $commandBinary = $_SERVER['PHP_SELF'];
        $commandBinaryDir = dirname($commandBinary);
        $pathDirs = explode(PATH_SEPARATOR, $_SERVER['PATH']);
        if (in_array($commandBinaryDir, $pathDirs)) {
            $commandBinary = basename($commandBinary);
        }

        $commandName = $this->getName();

        if ('new' === $commandName) {
            $commandArguments = sprintf('%s %s', $this->projectName, ('latest' !== $this->version) ? $this->version : '');
        } elseif ('demo' === $commandName) {
            $commandArguments = '';
        }

        return sprintf('%s %s %s', $commandBinary, $commandName, $commandArguments);
    }
139642
public function getProcessedHelp()
    {
        $help = $this->getHelp();
        if ($help === '') {
            return $help;
        }
        $name = $this->getName();

        $placeholders = ['%command.name%', '%command.full_name%'];
        $replacements = [$name, $this->config()->get('application.executable') . ' ' . $name];

        return str_replace($placeholders, $replacements, $help);
    }
1015676
public function buildCommand()
    {
        $output = ProcessUtils::escapeArgument($this->output);

        $redirect = $this->shouldAppendOutput ? ' >> ' : ' > ';

        if ($this->withoutOverlapping) {
            $command = '(touch ' . $this->mutexPath() . '; ' . $this->command . '; rm ' . $this->mutexPath() . ')' . $redirect . $output . ' 2>&1 &';
        } else {
            $command = $this->command;
        }

        return $this->user ? 'sudo -u ' . $this->user . ' ' . $command : $command;
    }