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