26 $encoder = new \fpoirotte\Pssht\Wire\Encoder();
27 $channel = $decoder->decodeUint32();
28 $type = $decoder->decodeString();
29 $wantsReply = $decoder->decodeBoolean();
31 $encoder->encodeUint32($channel);
32 $encoder->encodeString($type);
33 $encoder->encodeBoolean($wantsReply);
34 $decoder->getBuffer()->unget($encoder->getBuffer()->get(0));
35 $remoteChannel = $this->connection->getChannel($channel);
43 $cls = str_replace(
' ',
'', ucwords(str_replace(
'-',
' ', $type)));
44 $cls =
'\\fpoirotte\\Pssht\\Messages\\CHANNEL\\REQUEST\\' . $cls;
45 $message = $cls::unserialize($decoder);
50 $response = new \fpoirotte\Pssht\Messages\CHANNEL\FAILURE($remoteChannel);
51 $transport->writeMessage($response);
60 if (in_array($type, array(
'shell',
'exec'),
true)) {
61 $response = new \fpoirotte\Pssht\Messages\CHANNEL\SUCCESS($remoteChannel);
63 $response = new \fpoirotte\Pssht\Messages\CHANNEL\FAILURE($remoteChannel);
65 $transport->writeMessage($response);
67 if (in_array($type, array(
'shell',
'exec'),
true)) {
68 $callable = $transport->getApplicationFactory();
69 if ($callable !== null) {
70 call_user_func($callable, $transport, $this->connection, $message);
handle($msgType,\fpoirotte\Pssht\Wire\Decoder $decoder,\fpoirotte\Pssht\Transport $transport, array &$context)