@param \frostealth\yii2\aws\s3\commands\GetUrlCommand $command

@return string
346414
public function handle(GetUrlCommand $command): string
    {
        return $this->s3Client->getObjectUrl($command->getBucket(), $command->getFilename());
    }
1328461
private function _getUsageExample( Command $command )
    {
        $name = strtolower( str_replace( 'Command', '', get_class( $command ) ) );

        if ( FALSE !== strstr( $name, "\\" ) )
        {
            $pts = explode( "\\", $name );

            $name = $pts[ count( $pts ) - 1 ];
        }

        $usage = './' . $name . ' --' . $command->options[ 0 ]->longCode;

        return $usage . PHP_EOL . PHP_EOL;
    }
1232318
private function apiCall($command, $data=array()) {
			if (!isset($this->rest_commands[$command])) {
				return false;
			}

			$cmd = $this->rest_commands[$command];

			$url = $cmd['url'];
			$url = str_replace(array('{k}', '{s}') ,array($this->nx_key, $this->nx_secret), $url);

			$parsed_data = array();
			foreach ($data as $k => $v) $parsed_data['{'.$k.'}'] = $v;
			$url = str_replace(array_keys($parsed_data) ,array_values($parsed_data), $url);

			$url = trim($this->rest_base_url, '/') . $url;
			$post_data = '';

			// If available, use CURL
			if (function_exists('curl_version')) {

				$to_nexmo = curl_init( $url );
				curl_setopt( $to_nexmo, CURLOPT_RETURNTRANSFER, true );
				curl_setopt( $to_nexmo, CURLOPT_SSL_VERIFYPEER, false);
				curl_setopt($to_nexmo, CURLOPT_HTTPHEADER, array('Accept: application/json'));

				if ($cmd['method'] == 'POST') {
					curl_setopt( $to_nexmo, CURLOPT_POST, true );
					curl_setopt( $to_nexmo, CURLOPT_POSTFIELDS, $post_data );
				}

				$from_nexmo = curl_exec( $to_nexmo );
				$curl_info = curl_getinfo($to_nexmo);
				$http_response_code = $curl_info['http_code'];
				curl_close ( $to_nexmo );

			} elseif (ini_get('allow_url_fopen')) {
				// No CURL available so try the awesome file_get_contents

				$opts = array('http' =>
					array(
						'method'  => 'GET',
						'header'  => 'Accept: application/json'
					)
				);

				if ($cmd['method'] == 'POST') {
					$opts['http']['method'] = 'POST';
					$opts['http']['header'] .= "\r\nContent-type: application/x-www-form-urlencoded";
					$opts['http']['content'] = $post_data;
				}

				$context = stream_context_create($opts);
				$from_nexmo = file_get_contents($url, false, $context);

				// et the response code
				preg_match('/HTTP\/[^ ]+ ([0-9]+)/i', $http_response_header[0], $m);
				$http_response_code = $m[1];

			} else {
				// No way of sending a HTTP post :(
				return false;
			}

			$data = json_decode($from_nexmo, true);
			return array(
				'data' => $data,
				'http_code' => (int)$http_response_code
			);

		}
541520
public function getCommand($command = null, $arguments = [], $flags = [], $environmentVariables = [])
    {
        // Format arguments
        $arguments = $this->buildArguments($arguments);
        $options = $this->buildOptions($flags);
        $environmentVariables = $this->buildEnvironmentVariables($environmentVariables);

        // Build command
        $binary = $this->getBinary();
        $components = [$command, $arguments, $options];
        foreach ($components as $component) {
            if ($component) {
                $binary .= ' '.$component;
            }
        }

        // If the binary has a parent, wrap the call with it
        $parent = $this->parent instanceof self ? $this->parent->getBinary() : $this->parent;
        $command = $environmentVariables.$parent.' '.$binary;

        return trim($command);
    }
27544
public function execute(string $command): string
    {
        exec($command, $output);

        return implode(PHP_EOL, $output);
    }
266051
private function formatCommand($command, $parameters)
    {
        $parameters = collect($parameters)->map(function ($parameter) {
            if (is_array($parameter)) {
                return collect($parameter)->map(function ($value, $key) {
                    return is_int($key) ? $value : "{$key} {$value}";
                })->implode(' ');
            }

            return $parameter;
        })->implode(' ');

        return "{$command} {$parameters}";
    }
712411
public function handle(PlainCommand $command)
    {
        $awsCommand = $this->transformToAwsCommand($command);

        /** @var \GuzzleHttp\Promise\PromiseInterface $promise */
        $promise = $this->s3Client->executeAsync($awsCommand);

        return $this->commandIsAsync($command) ? $promise : $promise->wait();
    }
683884
public function drush($command) {
    // @todo Set to silent if verbosity is less than very verbose.
    $bin = $this->getConfigValue('composer.bin');
    /** @var \Robo\Common\ProcessExecutor $process_executor */
    $drush_alias = $this->getConfigValue('drush.alias');
    $command_string = "'$bin/drush' @$drush_alias $command";

    // URIs do not work on remote drush aliases in Drush 9. Instead, it is
    // expected that the alias define the uri in its configuration.
    if ($drush_alias != 'self') {
      $command_string .= ' --uri=' . $this->getConfigValue('site');
    }

    $process_executor = Robo::process(new Process($command_string));

    return $process_executor->dir($this->getConfigValue('docroot'))
      ->interactive(FALSE)
      ->printOutput(TRUE)
      ->printMetadata(TRUE)
      ->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERY_VERBOSE);
  }
1317219
protected function getVerboseCommandEndMessage(CommandInterface $command, $exitCode)
    {
        return sprintf(
            '<fg=green>//</> Command <fg=green>%s</> finished in <fg=green>%ss</>, exit code <fg=%s>%s</>',
            $command->getName(),
            $this->timer->end($command),
            ($exitCode !== 0) ? 'red' : 'green',
            $exitCode
        );
    }
1163118
public function getCommand($command)
  {
    return new CommandShortcut($command, $this->commands[$command]['options'], $this->commands[$command]['file']);
  }
27836
public function getCommandConfiguration($command)
    {
        $url = "selendroid/configure/command/{$command}";
        $result = $this->driver->curl($this->driver->factoryCommand($url, WebDriver_Command::METHOD_GET));
        return isset($result['value']) ? $result['value'] : [];
    }
25023
protected function forceCommand($command): string
    {
        return (
            starts_with($command, 'migrate') === true && starts_with($command, 'migrate:status') === false ||
            starts_with($command, 'db:seed') === true
        ) && mb_strpos('command', '--force') === false ?
            $command .= ' --force' : $command;
    }
608840
public function executeAdbShellCommand($command)
    {
        return $this->getDriver()->curl(
            $this->getDriver()->factoryCommand(
                'selendroid/adb/executeShellCommand',
                \WebDriver_Command::METHOD_POST,
                ['command' => $command]
            )
        );
    }
902500
public static function escapeArguments(array $arguments, $command = null)
    {
        $processedArguments = array();
        foreach ($arguments as $key => $value) {
            if (is_string($key) && substr($key, 0, 1) === '-') {
                if (is_array($value) === false) {
                    $value = array($value);
                }

                foreach ($value as $optionValue) {
                    if ($optionValue === null) {
                        $processedArguments[] = $key;
                    } elseif (is_string($optionValue)) {
                        $processedArguments[] = trim(sprintf('%s=%s', $key, $optionValue));
                    }
                }
            } elseif (is_scalar($value)) {
                $processedArguments[] = $value;
            }
        }

        if ($command !== null) {
            array_unshift($processedArguments, $command);
        }

        return implode(' ', array_map(array(__CLASS__, 'escapeArgument'), $processedArguments));
    }
699309
function sendCommand($command) {
      $this->responseHeaders = array();
      $this->responseBody = '';

// connect if necessary
      if ( ($this->socket == false) || (feof($this->socket)) ) {
        if ($this->useProxy) {
          $host = $this->proxyHost;
          $port = $this->proxyPort;
        } else {
          $host = $this->url['host'];
          $port = $this->url['port'];
        }

        if (!zen_not_null($port)) $port = 80;

        if (!$this->socket = @fsockopen($host, $port, $this->reply, $this->replyString, $this->timeout)) {
          return false;
        }

        if (zen_not_null($this->requestBody)) {
          $this->addHeader('Content-Length', strlen($this->requestBody));
        }

        $this->request = $command;
        $cmd = $command . "\r\n";
        if (is_array($this->requestHeaders)) {
          reset($this->requestHeaders);
          while (list($k, $v) = each($this->requestHeaders)) {
            $cmd .= $k . ': ' . $v . "\r\n";
          }
        }

        if (zen_not_null($this->requestBody)) {
          $cmd .= "\r\n" . $this->requestBody;
        }

// unset body (in case of successive requests)
        $this->requestBody = '';

        fputs($this->socket, $cmd . "\r\n");

        return true;
      }
    }
610025
private function renderButton(CommandInterface $command)
    {
        $extra = $command->getExtra();
        $label = $this->translate($command->getLabel());

        if (isset($extra['href'])) {
            $href = $extra['href'];
        } else {
            $href = '';
            foreach ($command->getParameters() as $key => $value) {
                $href .= '&' . $key . '=' . $value;
            }

            /** @var AddToUrlEvent $event */
            $event = $this->dispatcher->dispatch(
                ContaoEvents::BACKEND_ADD_TO_URL,
                new AddToUrlEvent(
                    $href
                )
            );

            $href = $event->getUrl();
        }

        if (null === $label) {
            $label = $command->getName();
        }

        $buttonEvent = new GetGlobalButtonEvent($this->environment);
        $buttonEvent
            ->setAccessKey(isset($extra['accesskey']) ? \trim($extra['accesskey']) : null)
            ->setAttributes(' ' . \ltrim($extra['attributes']))
            ->setClass($extra['class'])
            ->setKey($command->getName())
            ->setHref($href)
            ->setLabel($label)
            ->setTitle($this->translate((string) $command->getDescription()));
        $this->dispatcher->dispatch(GetGlobalButtonEvent::NAME, $buttonEvent);

        // Allow to override the button entirely - if someone sets empty string, we keep it.
        if (null !== ($html = $buttonEvent->getHtml())) {
            return $html;
        }

        // Use the view native button building.
        return \sprintf(
            '<a href="%s" class="%s" title="%s"%s>%s</a> ',
            $buttonEvent->getHref(),
            $buttonEvent->getClass(),
            StringUtil::specialchars($buttonEvent->getTitle()),
            $buttonEvent->getAttributes(),
            $buttonEvent->getLabel()
        );
    }
843056
public function command( $command, array $parameters = [] )
	{
		$binary = ProcessUtils::escapeArgument( ( new PhpExecutableFinder )->find( false ) );

		$artisan = defined( 'ARTISAN_BINARY' ) ? ProcessUtils::escapeArgument( ARTISAN_BINARY ) : 'artisan';

		return $this->exec( "{$binary} {$artisan} {$command}", $parameters );
	}