pssht  latest
SSH server library written in PHP
PtyReq.php
1 <?php
2 
3 /*
4 * This file is part of pssht.
5 *
6 * (c) François Poirotte <clicky@erebot.net>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11 
13 
19 {
21  protected $term;
22 
24  protected $widthInCols;
25 
27  protected $heightInRows;
28 
30  protected $widthInPixels;
31 
33  protected $heightInPixels;
34 
36  protected $modes;
37 
38 
62  public function __construct(
63  $channel,
64  $type,
65  $wantReply,
66  $term,
71  $modes
72  ) {
73  parent::__construct($channel, $type, $wantReply);
74  $this->term = $term;
75  $this->widthInCols = $widthInCols;
76  $this->heightInRows = $heightInRows;
77  $this->widthInPixels = $widthInPixels;
78  $this->heightInPixels = $heightInPixels;
79  $this->modes = $modes;
80  }
81 
82  public function serialize(\fpoirotte\Pssht\Wire\Encoder $encoder)
83  {
84  parent::serialize($encoder);
85  $encoder->encodeString($this->term);
86  $encoder->encodeUint32($this->widthInCols);
87  $encoder->encodeUint32($this->heightInRows);
88  $encoder->encodeUint32($this->widthInPixels);
89  $encoder->encodeUint32($this->heightInPixels);
90  $encoder->encodeString($this->modes);
91  return $this;
92  }
93 
94  protected static function unserializeSub(\fpoirotte\Pssht\Wire\Decoder $decoder)
95  {
96  return array(
97  $decoder->decodeString(),
98  $decoder->decodeUint32(),
99  $decoder->decodeUint32(),
100  $decoder->decodeUint32(),
101  $decoder->decodeUint32(),
102  $decoder->decodeString(),
103  );
104  }
105 }
$widthInPixels
Terminal width in pixels.
Definition: PtyReq.php:30
$widthInCols
Terminal width in characters.
Definition: PtyReq.php:24
$heightInPixels
Terminal height in pixels.
Definition: PtyReq.php:33
$channel
Local channel identifier.
Definition: Base.php:20
$wantReply
Whether the sender of the message wants a reply or not.
Definition: Base.php:23
serialize(\fpoirotte\Pssht\Wire\Encoder $encoder)
Definition: PtyReq.php:82
$heightInRows
Terminal height in rows.
Definition: PtyReq.php:27
__construct($channel, $type, $wantReply, $term, $widthInCols, $heightInRows, $widthInPixels, $heightInPixels, $modes)
Definition: PtyReq.php:62