@@ -108,12 +108,12 @@ |
||
| 108 | 108 | * List of allowed parameters of config |
| 109 | 109 | */ |
| 110 | 110 | public const ALLOWED = [ |
| 111 | - 'host' => 'string', // Address of Mikrotik RouterOS |
|
| 112 | - 'user' => 'string', // Username |
|
| 113 | - 'pass' => 'string', // Password |
|
| 111 | + 'host' => 'string', // Address of Mikrotik RouterOS |
|
| 112 | + 'user' => 'string', // Username |
|
| 113 | + 'pass' => 'string', // Password |
|
| 114 | 114 | 'port' => 'integer', // RouterOS API port number for access (if not set use default or default with SSL if SSL enabled) |
| 115 | 115 | 'ssl' => 'boolean', // Enable ssl support (if port is not set this parameter must change default port to ssl port) |
| 116 | - 'ssl_options' => 'array', // List of SSL options, eg. |
|
| 116 | + 'ssl_options' => 'array', // List of SSL options, eg. |
|
| 117 | 117 | 'legacy' => 'boolean', // Support of legacy login scheme (true - pre 6.43, false - post 6.43) |
| 118 | 118 | 'timeout' => 'integer', // Max timeout for instantiating connection with RouterOS |
| 119 | 119 | 'socket_timeout' => 'integer', // Max timeout for read from RouterOS |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | // Set blocking mode on a stream |
| 64 | - if ($this->config('socket_blocking') === true){ |
|
| 64 | + if ($this->config('socket_blocking') === true) { |
|
| 65 | 65 | stream_set_blocking($socket, true); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | $result = fread($this->stream, $length); |
| 52 | 52 | |
| 53 | 53 | // Stream in blocking mode timed out |
| 54 | - if(socket_get_status($this->stream)['timed_out']){ |
|
| 54 | + if (socket_get_status($this->stream)['timed_out']) { |
|
| 55 | 55 | throw new StreamException('Stream timed out'); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -15,10 +15,10 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | 17 | 'host' => '192.168.88.1', // Address of Mikrotik RouterOS |
| 18 | - 'user' => 'admin', // Username |
|
| 19 | - 'pass' => null, // Password |
|
| 20 | - 'port' => 8728, // RouterOS API port number for access (if not set use default or default with SSL if SSL enabled) |
|
| 21 | - 'ssh_port' => 22, // Number of SSH port |
|
| 18 | + 'user' => 'admin', // Username |
|
| 19 | + 'pass' => null, // Password |
|
| 20 | + 'port' => 8728, // RouterOS API port number for access (if not set use default or default with SSL if SSL enabled) |
|
| 21 | + 'ssh_port' => 22, // Number of SSH port |
|
| 22 | 22 | |
| 23 | 23 | /* |
| 24 | 24 | |-------------------------------------------------------------------------- |
@@ -33,14 +33,14 @@ discard block |
||
| 33 | 33 | | |
| 34 | 34 | */ |
| 35 | 35 | |
| 36 | - 'ssl' => false, // Enable ssl support (if port is not set this parameter must change default port to ssl port) |
|
| 36 | + 'ssl' => false, // Enable ssl support (if port is not set this parameter must change default port to ssl port) |
|
| 37 | 37 | |
| 38 | 38 | // @see https://www.php.net/manual/en/context.ssl.php |
| 39 | 39 | 'ssl_options' => [ |
| 40 | 40 | 'ciphers' => 'ADH:ALL', // ADH:ALL, ADH:ALL@SECLEVEL=0, ADH:ALL@SECLEVEL=1 ... ADH:ALL@SECLEVEL=5 |
| 41 | - 'verify_peer' => false, // Require verification of SSL certificate used. |
|
| 42 | - 'verify_peer_name' => false, // Require verification of peer name. |
|
| 43 | - 'allow_self_signed' => false, // Allow self-signed certificates. Requires verify_peer=true. |
|
| 41 | + 'verify_peer' => false, // Require verification of SSL certificate used. |
|
| 42 | + 'verify_peer_name' => false, // Require verification of peer name. |
|
| 43 | + 'allow_self_signed' => false, // Allow self-signed certificates. Requires verify_peer=true. |
|
| 44 | 44 | ], |
| 45 | 45 | |
| 46 | 46 | /* |
@@ -54,11 +54,11 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | |
| 56 | 56 | 'legacy' => false, // Support of legacy login scheme (true - pre 6.43, false - post 6.43) |
| 57 | - 'timeout' => 10, // Max timeout for instantiating connection with RouterOS |
|
| 58 | - 'socket_timeout' => 30, // Max timeout for read from RouterOS |
|
| 59 | - 'socket_blocking' => true, // Set blocking mode on a socket stream |
|
| 60 | - 'ssh_timeout' => 30, // Max timeout for read from RouterOS via SSH proto (for "/export" command) |
|
| 61 | - 'attempts' => 10, // Count of attempts to establish TCP session |
|
| 62 | - 'delay' => 1, // Delay between attempts in seconds |
|
| 57 | + 'timeout' => 10, // Max timeout for instantiating connection with RouterOS |
|
| 58 | + 'socket_timeout' => 30, // Max timeout for read from RouterOS |
|
| 59 | + 'socket_blocking' => true, // Set blocking mode on a socket stream |
|
| 60 | + 'ssh_timeout' => 30, // Max timeout for read from RouterOS via SSH proto (for "/export" command) |
|
| 61 | + 'attempts' => 10, // Count of attempts to establish TCP session |
|
| 62 | + 'delay' => 1, // Delay between attempts in seconds |
|
| 63 | 63 | |
| 64 | 64 | ]; |