Sends command to server.

@param string $command Command
437824
protected function sendCommandToServer(string $command): void
	{
		$this->lastCommand = $command;

		$this->connection->write($command);
	}
350215
protected function setCommand($command)
    {
        $this->command = $command;

        if (!is_null($this->loader)) {
            $this->loader->setCommand($this->command);
        }
    }
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
		}
	}
17176
public function publish(Command $command)
    {
        $value = $this->serializer->serialize($command);

        return (bool) $this->client->rpush($this->queue_name, [$value]);
    }
170880
protected function _commandDelete($command)
    {
        $entity = $this->getController()->getItem();

        $command->append(array('label' => AnTranslator::_('LIB-AN-ACTION-DELETE')))
        ->href(route($entity->getURL()))
        ->setAttribute('data-action', 'delete')
        ->setAttribute('data-redirect', route('index.php?option=com_locations&view=locations'))
        ->class('action-delete');
    }
742833
public function publish(Command $command)
    {
        $index = array_search($command, $this->commands);

        // remove exists command and publish it again
        if ($index !== false) {
            unset($this->commands[$index]);
        }

        $this->commands[] = $command;

        return true;
    }
339054
public function command($command, $method) {

        self::$commands[] = $command;
        self::$callbacks[$command] = $method;
    }
1243816
public function dispatch($command): void
    {
        $this->commandStack[] = $command;

        if ($this->executing) {
            return;
        }

        $this->transactionManager->begin();
        try {
            while ($command = array_shift($this->commandStack)) {
                $this->invokeHandler($command);
            }
            $this->eventPublisher->publishEvents();
            $this->transactionManager->commit();
        } catch (Exception $e) {
            $this->transactionManager->rollback();
            throw $e;
        }
    }
958712
final public function handle(Command $command): void
    {
        $supportedCommandType = $this->getSupportedCommandType();
        if (!\is_a($command, $supportedCommandType)) {
            throw new InvalidCommandException(\sprintf(
                'Command must be a %s, %s given',
                $supportedCommandType,
                \get_class($command)
            ));
        }

        $this->handleCommand($command);
    }
896789
protected function _commandEdit($command)
    {
        $entity = $this->getController()->getItem();
        $view = $this->getController()->getView()->getName();

        $layout = pick($command->layout, 'edit');

        $command->append(array('label' => AnTranslator::_('LIB-AN-ACTION-EDIT')))
        ->href($entity->getURL().'&layout='.$layout)
        ->setAttribute('data-action', 'edit');
    }
618732
public function execute(interfaces\commands\Command $command)
    {
        $handler = $this->resolver->resolve($command);
        
        return call_user_func([$handler, 'handle'], $command);
    }
469485
public function fire(Command $command)
    {
        $gitignorePath = base_path('.gitignore');

        if (! $this->gitignoreContainsComposerLock($gitignorePath)) {
            return;
        }

        $removeComposerLock = $command->confirm('Do you want to remove composer.lock from .gitignore ?', true);
        if ($removeComposerLock) {
            $out = $this->getGitignoreLinesButComposerLock($gitignorePath);
            $this->writeNewGitignore($gitignorePath, $out);
        }
    }
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;
    }
1114894
public function run(Command $command)
    {
        if($this->script) {
            $process = new Process($command);
            $process->setCommandLine($this->script);
            $process->setTimeout(null);
            $process->run();

            if (!$process->isSuccessful()) {
                $command->error($process->getErrorOutput());
            } else {
                $command->info($process->getOutput());
                return true;
            }
        }

        return false;
    }
209732
public function setCommand($command)
    {
        if (!is_string($command)) {
            throw new InvalidArgumentException('string', 0);
        }
        // escape command
        $this->command = ($this->flags & ESCAPE) ? escapeshellcmd($command) : $command;

        return $this;
    }
1295064
public function command($command)
    {
        if (! $command instanceof Command) {
            $command = $this[$command];
        }

        $this['console']->add($command);
    }
1122396
public function dispatch($command): void
    {
        $this->commandQueue[] = $command;

        if (! $this->isDispatching) {
            $this->isDispatching = true;

            $actionEventEmitter = $this->events;

            try {
                while ($command = \array_shift($this->commandQueue)) {
                    $actionEvent = $actionEventEmitter->getNewActionEvent(
                        self::EVENT_DISPATCH,
                        $this,
                        [
                            self::EVENT_PARAM_MESSAGE => $command,
                        ]
                    );

                    try {
                        $actionEventEmitter->dispatch($actionEvent);

                        if (! $actionEvent->getParam(self::EVENT_PARAM_MESSAGE_HANDLED)) {
                            throw new RuntimeException(\sprintf('Command %s was not handled', $this->getMessageName($command)));
                        }
                    } catch (\Throwable $exception) {
                        $actionEvent->setParam(self::EVENT_PARAM_EXCEPTION, $exception);
                    } finally {
                        $actionEvent->stopPropagation(false);
                        $this->triggerFinalize($actionEvent);
                    }
                }
                $this->isDispatching = false;
            } catch (\Throwable $e) {
                $this->isDispatching = false;
                throw CommandDispatchException::wrap($e, $this->commandQueue);
            }
        }
    }