Elgg  Version master
ResponseTransport.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Cli;
4 
6 
11 
17  public function __construct(protected Command $command) {
18  }
19 
23  public function send(Response $response) {
24  $content = $response->getContent();
25  $json = @json_decode($content);
26  $this->command->write(elgg_echo('cli:response:output') . PHP_EOL);
27  $this->command->dump($json ?: $content);
28 
29  return true;
30  }
31 }
$response
Definition: content.php:10
send(Response $response)
{}
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
HTTP response transport interface.
Cli ResponseTransport.
Abstract command with some utility methods.
Definition: Command.php:12
__construct(protected Command $command)
ResponseTransport constructor.
$content
Set robots.txt action.
Definition: set_robots.php:6