Sends a controll command to server and returns servers response.

@throws ClientException
@param string $command
@return string
12748
public function sendCommand(string $command) : string
    {
        try {
            $this->socket->send(json_encode([
                'action' => 'command',
                'command' => [
                    'name' => $command,
                ]
            ]));
            $result = $this->socket->recv();
            return $result;
        } catch (\ZMQException $e) {
            throw new ClientException($e->getMessage());
        }
    }
885180
public function sendCommand(Command $command): Generator
    {
        yield from $this->encoder->writeCommand($this->stream, $command);
        $response = yield from $this->encoder->readResponse($this->stream);

        // If the command was unsuccessful, throw an exception with the server's error reason.
        if (!$response->isOk()) {
            throw new RemoteException($response->message(), $response->code());
        }

        return $response;
    }
1159864
public function post($command, $params = null, $postcontenttype = 'application/json')
    {
        $url = $command;

        $headers = array('Content-Type' => $postcontenttype);

        $content = $params;
        if ($postcontenttype == 'application/json') {
            $content = json_encode($params);
        }

        try {
            $response = $this->client->post($url, ['headers' => $headers, 'body' => $content]);
        } catch (\Exception $e) {
            return null;
        }
        $this->checkError($response, $url);

        return $response->getBody();
    }
200881
protected function action($command) {
		if ($command === self::ACTION_DELETE_A_B
		    && $this->b === ' '
		    && ($this->a === '+' || $this->a === '-')
		) {
			// Note: we're at an addition/substraction operator; the inputIndex
			// will certainly be a valid index
			if ($this->input[$this->inputIndex] === $this->a) {
				// This is "+ +" or "- -". Don't delete the space.
				$command = self::ACTION_KEEP_A;
			}
		}
		switch ($command) {
			case self::ACTION_KEEP_A:
				$this->output .= $this->a;
				$this->lastByteOut = $this->a;

			// fallthrough
			case self::ACTION_DELETE_A:
				$this->a = $this->b;
				if ($this->a === "'" || $this->a === '"') { // string literal
					$str = $this->a; // in case needed for exception
					while (true) {
						$this->output .= $this->a;
						$this->lastByteOut = $this->a;

						$this->a = $this->get();
						if ($this->a === $this->b) { // end quote
							break;
						}
						if (ord($this->a) <= self::ORD_LF) {
							throw new JSMinUnterminatedStringException(
								"JSMin: Unterminated String at byte "
								. $this->inputIndex . ": {$str}");
						}
						$str .= $this->a;
						if ($this->a === '\\') {
							$this->output .= $this->a;
							$this->lastByteOut = $this->a;

							$this->a = $this->get();
							$str .= $this->a;
						}
					}
				}
			// fallthrough
			case self::ACTION_DELETE_A_B:
				$this->b = $this->next();
				if ($this->b === '/' && $this->isRegexpLiteral()) { // RegExp literal
					$this->output .= $this->a . $this->b;
					$pattern = '/'; // in case needed for exception
					while (true) {
						$this->a = $this->get();
						$pattern .= $this->a;
						if ($this->a === '/') { // end pattern
							break; // while (true)
						} elseif ($this->a === '\\') {
							$this->output .= $this->a;
							$this->a = $this->get();
							$pattern .= $this->a;
						} elseif (ord($this->a) <= self::ORD_LF) {
							throw new JSMinUnterminatedRegExpException(
								"JSMin: Unterminated RegExp at byte "
								. $this->inputIndex . ": {$pattern}");
						}
						$this->output .= $this->a;
						$this->lastByteOut = $this->a;
					}
					$this->b = $this->next();
				}
			// end case ACTION_DELETE_A_B
		}
	}
437824
protected function sendCommandToServer(string $command): void
	{
		$this->lastCommand = $command;

		$this->connection->write($command);
	}
1356319
public function exec($command)
    {
        // Check for prohibited commands
        foreach ($this->prohibitedCommands as $prohibitedCommand) {
            if (strpos(trim($command), $prohibitedCommand) !== false) {
                throw new \Exception('The shell command ' . $command . ' is prohibited');
            }
        }
        return exec($command);
    }
20736
public function call( $command, array $parameters = [] )
	{
		$parameters = collect( $parameters )->prepend( $command );

		$this->lastOutput = new BufferedOutput;

		$this->setCatchExceptions( false );

		$result = $this->run( new ArrayInput( $parameters->toArray() ), $this->lastOutput );

		$this->setCatchExceptions( true );

		return $result;
	}
854635
public function sendCommand($command, $port = null, &$error = null)
    {
        $port or $port = $this->choosePort();
        $sockFile = $this->runDir . "command-{$port}.sock";
        if (!$socket = @stream_socket_client('unix://' . $sockFile, $errNo, $errStr, 5)) {
            $error = ['err' => $errNo, 'message' => $errStr];
            return "$errStr ($errNo)";
        }
        $error = false;
        fwrite($socket, $command, strlen($command));
        $response = fread($socket, 8192);
        fclose($socket);
        return $response;
    }
129371
protected function execute($command)
    {
        $status = null;
        $result = array();
        exec($command, $result, $status);
        return !$status ? $result : null;
    }
1156799
public function handle($command)
    {
        $user = new User();
        $user
            ->setEmail($command->getEmail())
            ->setPassword($command->getPassword())
            ->setRoles($this->registeredUserRoles)
            ->setEnabled(true);

        // validate user
        $errors = $this->validator->validate($user);
        if (count($errors) > 0) {
            $exception = new InvalidCommandException("User is invalid");
            $exception->setConstraintViolationList($errors);
            throw $exception;
        }

        // persist user
        $this->entityManager->persist($user);
        $this->entityManager->flush();

        return $user;
    }
267303
public function execute(Command $command)
    {
        if (!$this->innerCommandBus) {
            throw new Exception('No inner bus defined for this decorator. Set an inner bus with setInnerBus()');
        }

        $response = $this->innerCommandBus->execute($command);

        $eventName = $this->getEventName($command);

        $this->dispatcher->dispatch($eventName, [$command]);

        return $response;
    }
592368
public function client_send($data, $command = '')
    {
        //If SMTP transcripts are left enabled, or debug output is posted online
        //it can leak credentials, so hide credentials in all but lowest level
        if (self::DEBUG_LOWLEVEL > $this->do_debug and
            in_array($command, ['User & Password', 'Username', 'Password'], true)) {
            $this->edebug('CLIENT -> SERVER: <credentials hidden>', self::DEBUG_CLIENT);
        } else {
            $this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT);
        }
        set_error_handler([$this, 'errorHandler']);
        $result = fwrite($this->smtp_conn, $data);
        restore_error_handler();

        return $result;
    }
1261311
public function send(ClientCommand $command)
	{
		$request = $this->client->createRequest(
			$command->method(),
			$this->client->getBaseUrl() . $command->uri($this->cryptographyEngine),
			$this->headers($command->apiVersion(), $command->format(), $command->headers()),
			$command->body($this->cryptographyEngine),
			$this->config->getHttpClientConfig()
		);

		try {
			$response = $request->send();
		} catch (ClientErrorResponseException $exception) {
			$response = $exception->getResponse();
		} catch (ServerErrorResponseException $exception) {
			$response = $exception->getResponse();
		}

		return $command->response($response, $this->cryptographyEngine);
	}
346414
public function handle(GetUrlCommand $command): string
    {
        return $this->s3Client->getObjectUrl($command->getBucket(), $command->getFilename());
    }
927457
public function client_send($data)
    {
        $this->edebug("CLIENT -> SERVER: $data", self::DEBUG_CLIENT);
        set_error_handler(array($this, 'errorHandler'));
        $result = fwrite($this->smtp_conn, $data);
        restore_error_handler();
        return $result;
    }
737704
function send_command(command, cb) {
        var cmd = commands[command.toUpperCase()];
        if(parseInt(cmd)) {
            post('/roap/api/command', `<?xml version='1.0' encoding='utf-8'?><command><name>HandleKeyInput</name><value>${cmd}</value></command>`, (body) => {
                try {
                    var doc = new dom().parseFromString(body);
                    if(cb) cb(xpath.select('//ROAPErrorDetail/text()', doc).toString() == 'OK')
                } catch(error) {
                    log(`error send_command:  ${error.message}`)
                    if(cb) cb(false)
                }
            });
        }
    }
527172
protected function prepareCommand($command)
    {
        if (is_string($command)) {
            return trim($command);
        }
        if (is_array($command)) {
            return implode(' && ', $command);
        }
        throw new TaskExecutionException('Command must be string or array, ' . gettype($command) . ' given.', 1312454906);
    }