pssht  latest
SSH server library written in PHP
Base.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 
18 {
20  protected $service;
21 
29  public function __construct($service)
30  {
31  if (!is_string($service)) {
32  throw new \InvalidArgumentException();
33  }
34 
35  $this->service = $service;
36  }
37 
38  public function serialize(\fpoirotte\Pssht\Wire\Encoder $encoder)
39  {
40  $encoder->encodeString($this->service);
41  return $this;
42  }
43 
44  public static function unserialize(\fpoirotte\Pssht\Wire\Decoder $decoder)
45  {
46  return new static($decoder->decodeString());
47  }
48 
55  public function getServiceName()
56  {
57  return $this->service;
58  }
59 }
static unserialize(\fpoirotte\Pssht\Wire\Decoder $decoder)
Definition: Base.php:44
$service
Name of the service to start after authentication.
Definition: Base.php:20
serialize(\fpoirotte\Pssht\Wire\Encoder $encoder)
Definition: Base.php:38