@@ -43,14 +43,14 @@ |
||
| 43 | 43 | if (($value & $mask) || $buffer !== '') { |
| 44 | 44 | // Get the current byte by shifting it to least significant position and add it to the string |
| 45 | 45 | // 0xFF12345678 => 0xFF |
| 46 | - $byte = $value >> (8 * $i); |
|
| 46 | + $byte = $value >> (8 * $i); |
|
| 47 | 47 | $buffer .= chr($byte); |
| 48 | 48 | |
| 49 | 49 | // Set the most significant byte to 0 so we can restart the process being shure |
| 50 | 50 | // that the value is left padded with 0 |
| 51 | 51 | // 0xFF12345678 => 0x12345678 |
| 52 | 52 | // -1 = 0xFFFFF.... (number of F depend of PHP_INT_SIZE ) |
| 53 | - $mask = -1 >> ((PHP_INT_SIZE - $i) * 8); |
|
| 53 | + $mask = -1 >> ((PHP_INT_SIZE - $i) * 8); |
|
| 54 | 54 | $value &= $mask; |
| 55 | 55 | } |
| 56 | 56 | } |
@@ -46,9 +46,9 @@ |
||
| 46 | 46 | * List of available operators for "->where()" method |
| 47 | 47 | */ |
| 48 | 48 | public const AVAILABLE_OPERATORS = [ |
| 49 | - '-', // Does not have |
|
| 50 | - '=', // Equal |
|
| 51 | - '>', // More than |
|
| 49 | + '-', // Does not have |
|
| 50 | + '=', // Equal |
|
| 51 | + '>', // More than |
|
| 52 | 52 | '<' // Less than |
| 53 | 53 | ]; |
| 54 | 54 | |
@@ -93,9 +93,9 @@ |
||
| 93 | 93 | * List of allowed parameters of config |
| 94 | 94 | */ |
| 95 | 95 | public const ALLOWED = [ |
| 96 | - 'host' => 'string', // Address of Mikrotik RouterOS |
|
| 97 | - 'user' => 'string', // Username |
|
| 98 | - 'pass' => 'string', // Password |
|
| 96 | + 'host' => 'string', // Address of Mikrotik RouterOS |
|
| 97 | + 'user' => 'string', // Username |
|
| 98 | + 'pass' => 'string', // Password |
|
| 99 | 99 | 'port' => 'integer', // RouterOS API port number for access (if not set use default or default with SSL if SSL enabled) |
| 100 | 100 | 'ssl' => 'boolean', // Enable ssl support (if port is not set this parameter must change default port to ssl port) |
| 101 | 101 | 'ssl_options' => 'array', // Enable ssl support (if port is not set this parameter must change default port to ssl port) |
@@ -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,12 +33,12 @@ 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 | 'ssl_options' => [ |
| 38 | 38 | 'ciphers' => 'ADH:ALL', // ADH:ALL, ADH:ALL@SECLEVEL=0, ADH:ALL@SECLEVEL=1 ... ADH:ALL@SECLEVEL=5 |
| 39 | - 'verify_peer' => false, // Require verification of SSL certificate used. |
|
| 40 | - 'verify_peer_name' => false, // Require verification of peer name. |
|
| 41 | - 'allow_self_signed' => false, // Allow self-signed certificates. Requires verify_peer. |
|
| 39 | + 'verify_peer' => false, // Require verification of SSL certificate used. |
|
| 40 | + 'verify_peer_name' => false, // Require verification of peer name. |
|
| 41 | + 'allow_self_signed' => false, // Allow self-signed certificates. Requires verify_peer. |
|
| 42 | 42 | ], |
| 43 | 43 | |
| 44 | 44 | /* |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | |
| 54 | 54 | 'legacy' => false, // Support of legacy login scheme (true - pre 6.43, false - post 6.43) |
| 55 | - 'timeout' => 10, // Max timeout for answer from RouterOS |
|
| 56 | - 'attempts' => 10, // Count of attempts to establish TCP session |
|
| 57 | - 'delay' => 1, // Delay between attempts in seconds |
|
| 55 | + 'timeout' => 10, // Max timeout for answer from RouterOS |
|
| 56 | + 'attempts' => 10, // Count of attempts to establish TCP session |
|
| 57 | + 'delay' => 1, // Delay between attempts in seconds |
|
| 58 | 58 | |
| 59 | 59 | ]; |
@@ -249,7 +249,7 @@ |
||
| 249 | 249 | $word = $this->connector->readWord(); |
| 250 | 250 | |
| 251 | 251 | //Limit response number to finish the read |
| 252 | - if (isset($options['count']) && $countResponse >= (int)$options['count']) { |
|
| 252 | + if (isset($options['count']) && $countResponse >= (int) $options['count']) { |
|
| 253 | 253 | $lastReply = true; |
| 254 | 254 | } |
| 255 | 255 | |