Changeset 915 for trunk/Modules/NetworkConfigRouterOS
- Timestamp:
- Dec 7, 2021, 9:56:09 PM (3 years ago)
- Location:
- trunk/Modules/NetworkConfigRouterOS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigRouterOS/Routerboard.php
r888 r915 44 44 } 45 45 46 function ExecuteBatch(string $Commands): string46 function ExecuteBatch(string $Commands): array 47 47 { 48 48 $Commands = trim($Commands); … … 60 60 $Output = array(); 61 61 exec($Command, $Output); 62 } else $Output = '';62 } else $Output = array(); 63 63 if ($this->Debug) print_r($Output); 64 64 return $Output; … … 140 140 if (count($Value) > 1) 141 141 { 142 if ($Value[1] {0}== '"') $Value[1] = substr($Value[1], 1, -1);142 if ($Value[1][0] == '"') $Value[1] = substr($Value[1], 1, -1); 143 143 //if (strlen($Value[1]) > 0) 144 144 $ListItem[$Value[0]] = $Value[1]; -
trunk/Modules/NetworkConfigRouterOS/RouterboardAPI.php
r888 r915 10 10 public int $Port; // Port to connect to 11 11 public int $Timeout; // Connection attempt timeout and data read timeout 12 public int$Socket; // Variable for storing socket resource12 public $Socket; // Variable for storing socket resource 13 13 public bool $Debug; 14 14 public bool $SSL; // If SSL API connection is used. You need also change port to 8729 … … 23 23 $this->Debug = false; 24 24 $this->SSL = false; 25 } 26 27 function EncodeLength(int $Length): int 25 $this->ErrorNo = 0; 26 $this->ErrorStr = ""; 27 } 28 29 function EncodeLength(int $Length): string 28 30 { 29 31 if ($Length < 0x80) -
trunk/Modules/NetworkConfigRouterOS/SSH.php
r888 r915 37 37 } 38 38 /* 39 //echo(') '.strlen($Buffer).' '.ord($Buffer {0}).'(');39 //echo(') '.strlen($Buffer).' '.ord($Buffer[0]).'('); 40 40 for ($I = 0; $I < strlen($Buffer); $I++) 41 41 { 42 if (((ord($Buffer {$I}) >= 32) and (ord($Buffer{$I}) <= 128)) or ($Buffer{$I} = "\n") or ($Buffer{$I} = "\r")) echo($Buffer{$I});43 if ($Buffer {$I}== '>')42 if (((ord($Buffer[$I]) >= 32) and (ord($Buffer[$I]) <= 128)) or ($Buffer[$I] = "\n") or ($Buffer[$I] = "\r")) echo($Buffer[$I]); 43 if ($Buffer[$I] == '>') 44 44 { 45 45 fwrite($Stream, $Commands."\n\r");
Note:
See TracChangeset
for help on using the changeset viewer.