pssht  latest
SSH server library written in PHP
EchoService.php
1 <?php
2 /*
3 * This file is part of pssht.
4 *
5 * (c) François Poirotte <clicky@erebot.net>
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
10 
12 
18 {
19  public function __construct(
20  \fpoirotte\Pssht\Transport $transport,
21  \fpoirotte\Pssht\Connection $connection,
22  \fpoirotte\Pssht\Messages\MessageInterface $message
23  ) {
24  $transport->setHandler(\fpoirotte\Pssht\Messages\CHANNEL\DATA::getMessageId(), $this);
25  }
26 
27  // SSH_MSG_CHANNEL_DATA = 94
28  public function handle(
29  $msgType,
30  \fpoirotte\Pssht\Wire\Decoder $decoder,
31  \fpoirotte\Pssht\Transport $transport,
32  array &$context
33  ) {
35  $channel = $message->getChannel();
36  $response = new \fpoirotte\Pssht\Messages\CHANNEL\DATA($channel, $message->getData());
37  $transport->writeMessage($response);
38  return true;
39  }
40 }
handle($msgType,\fpoirotte\Pssht\Wire\Decoder $decoder,\fpoirotte\Pssht\Transport $transport, array &$context)
Definition: EchoService.php:28
static unserialize(\fpoirotte\Pssht\Wire\Decoder $decoder)
Definition: DATA.php:49