Changeset 887 for trunk/Modules/NetworkConfigRouterOS/Routerboard2.php
- Timestamp:
- Nov 20, 2020, 12:08:12 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigRouterOS/Routerboard2.php
r874 r887 11 11 ); 12 12 13 function Execute($Commands) 13 function Execute($Commands): array 14 14 { 15 15 if (is_array($Commands)) $Commands = implode(';', $Commands); … … 17 17 } 18 18 19 function GetItem($Command) 19 function GetItem($Command): array 20 20 { 21 21 $Result = $this->Execute($Command); … … 25 25 { 26 26 $ResultLineParts = explode(' ', trim($ResultLine)); 27 if ($ResultLineParts[1] {0}== '"') $ResultLineParts[1] = substr($ResultLineParts[1], 1, -1); // Remove quotes27 if ($ResultLineParts[1][0] == '"') $ResultLineParts[1] = substr($ResultLineParts[1], 1, -1); // Remove quotes 28 28 $List[substr($ResultLineParts[0], 0, -1)] = $ResultLineParts[1]; 29 29 } … … 31 31 } 32 32 33 function GetList($Command, $Properties) 33 function GetList($Command, $Properties): array 34 34 { 35 35 $PropertyList = '"'; … … 55 55 } 56 56 57 function GetSystemResource() 57 function GetSystemResource(): array 58 58 { 59 59 return $this->GetItem('/system resource print'); 60 60 } 61 61 62 function GetFirewallFilterList() 62 function GetFirewallFilterList(): array 63 63 { 64 64 return $this->GetList('/ip firewall nat', array('src-address', 'dst-address', 'bytes')); 65 65 } 66 66 67 function GetDHCPServerLeasesList() 67 function GetDHCPServerLeasesList(): array 68 68 { 69 69 return $this->GetList('/ip dhcp-server lease', array('address', 'active-address', 'comment', 'lease-time', 'status', 'host-name'));
Note:
See TracChangeset
for help on using the changeset viewer.