Ignore:
Timestamp:
Dec 7, 2021, 9:56:09 PM (3 years ago)
Author:
chronos
Message:
  • Fixed: Various PHP 8.0 related fixes.
Location:
trunk/Modules/NetworkConfigRouterOS
Files:
3 edited

Legend:

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

    r888 r915  
    4444  }
    4545
    46   function ExecuteBatch(string $Commands): string
     46  function ExecuteBatch(string $Commands): array
    4747  {
    4848    $Commands = trim($Commands);
     
    6060      $Output = array();
    6161      exec($Command, $Output);
    62     } else $Output = '';
     62    } else $Output = array();
    6363    if ($this->Debug) print_r($Output);
    6464    return $Output;
     
    140140          if (count($Value) > 1)
    141141          {
    142             if ($Value[1]{0} == '"') $Value[1] = substr($Value[1], 1, -1);
     142            if ($Value[1][0] == '"') $Value[1] = substr($Value[1], 1, -1);
    143143            //if (strlen($Value[1]) > 0)
    144144            $ListItem[$Value[0]] = $Value[1];
  • trunk/Modules/NetworkConfigRouterOS/RouterboardAPI.php

    r888 r915  
    1010  public int $Port;        // Port to connect to
    1111  public int $Timeout;        // Connection attempt timeout and data read timeout
    12   public int $Socket;             // Variable for storing socket resource
     12  public $Socket;             // Variable for storing socket resource
    1313  public bool $Debug;
    1414  public bool $SSL; // If SSL API connection is used. You need also change port to 8729
     
    2323    $this->Debug = false;
    2424    $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
    2830  {
    2931    if ($Length < 0x80)
  • trunk/Modules/NetworkConfigRouterOS/SSH.php

    r888 r915  
    3737          }
    3838            /*
    39             //echo(') '.strlen($Buffer).' '.ord($Buffer{0}).'(');
     39            //echo(') '.strlen($Buffer).' '.ord($Buffer[0]).'(');
    4040            for ($I = 0; $I < strlen($Buffer); $I++)
    4141            {
    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] == '>')
    4444              {
    4545                fwrite($Stream, $Commands."\n\r");
Note: See TracChangeset for help on using the changeset viewer.