Ignore:
Timestamp:
Apr 6, 2020, 11:17:40 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved code format.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/NetworkConfigRouterOS/Routerboard2.php

    r738 r873  
    1313  function Execute($Commands)
    1414  {
    15     if(is_array($Commands)) $Commands = implode(';', $Commands);
    16     return(parent::Execute($Commands));
     15    if (is_array($Commands)) $Commands = implode(';', $Commands);
     16    return (parent::Execute($Commands));
    1717  }
    1818
     
    2222    array_pop($Result);
    2323    $List = array();
    24     foreach($Result as $ResultLine)
     24    foreach ($Result as $ResultLine)
    2525    {
    2626      $ResultLineParts = explode(' ', trim($ResultLine));
    27       if($ResultLineParts[1]{0} == '"') $ResultLineParts[1] = substr($ResultLineParts[1], 1, -1); // Remove quotes
     27      if ($ResultLineParts[1]{0} == '"') $ResultLineParts[1] = substr($ResultLineParts[1], 1, -1); // Remove quotes
    2828      $List[substr($ResultLineParts[0], 0, -1)] = $ResultLineParts[1];
    2929    }
    30     return($List);
     30    return ($List);
    3131  }
    3232
     
    3434  {
    3535    $PropertyList = '"';
    36     foreach($Properties as $Property)
     36    foreach ($Properties as $Property)
    3737    {
    3838      $PropertyList .= $Property.'=".[get $i '.$Property.']." ';
     
    4141    $Result = $this->Execute($Command.' {:foreach i in=[find] do={:put ('.$PropertyList.')}}');
    4242    $List = array();
    43     foreach($Result as $ResultLine)
     43    foreach ($Result as $ResultLine)
    4444    {
    4545      $ResultLineParts = explode(' ', $ResultLine);
    4646      $ListItem = array();
    47       foreach($ResultLineParts as $ResultLinePart)
     47      foreach ($ResultLineParts as $ResultLinePart)
    4848      {
    4949        $Value = explode('=', $ResultLinePart);
     
    5252      $List[] = $ListItem;
    5353    }
    54     return($List);
     54    return ($List);
    5555  }
    5656
    5757  function GetSystemResource()
    5858  {
    59     return($this->GetItem('/system resource print'));
     59    return ($this->GetItem('/system resource print'));
    6060  }
    6161
    6262  function GetFirewallFilterList()
    6363  {
    64     return($this->GetList('/ip firewall nat', array('src-address', 'dst-address', 'bytes')));
     64    return ($this->GetList('/ip firewall nat', array('src-address', 'dst-address', 'bytes')));
    6565  }
    6666
    6767  function GetDHCPServerLeasesList()
    6868  {
    69     return($this->GetList('/ip dhcp-server lease', array('address', 'active-address', 'comment', 'lease-time', 'status', 'host-name')));
     69    return ($this->GetList('/ip dhcp-server lease', array('address', 'active-address', 'comment', 'lease-time', 'status', 'host-name')));
    7070  }
    7171}
Note: See TracChangeset for help on using the changeset viewer.