The property value is part of the word, and a new method call means a new word. So:
$API->write('=servers=8.8.4.4');
Then how about switching to a PHP API client that doesn’t require you to know the API protocol’s syntax, like the one from my signature maybe?
With it, you can do all you want with
<?php
use PEAR2\Net\RouterOS;
require_once 'PEAR2_Net_RouterOS-1.0.0b5.phar';
$client = new RouterOS\Client('192.168.88.1', 'api', 'pass');
$client->sendSync(new RouterOS\Request('/ip dns set servers=8.8.4.4'));
$client->sendSync(new RouterOS\Request('/interface sstp-client set numbers=sstp-out1 disabled=yes'));
$monitorRequest = new RouterOS\Request('/interface sstp-client monitor numbers=sstp-out1 once');
$monitorResults = $client->sendSync($monitorRequest);
if ($monitorResults->getProperty('status') === 'disabled') {
$client->sendSync(new RouterOS\Request('/interface sstp-client set numbers=sstp-out1 disabled=no'));
$monitorResults = $client->sendSync($monitorRequest);
if ($monitorResults->getProperty('status') !== 'disabled') {
//Enabled, possibly disconnected; So what do we do now?
}
}
Just replace “sstp-out1” with the actual name of your SSTP client interface.
(The API protocol in general doesn’t support numbers; It can only take IDs or names, which are confusingly specified via the “numbers” argument)