コード例 #1
0
ファイル: example1.php プロジェクト: gonzalo123/netservice
<?php

include __DIR__ . '/../vendor/autoload.php';
use NetService\Service, NetService\Parser;
$host = 'windowshost.com';
$serviceName = 'ServiceName';
$credentials = '{domain}/{user}%{password}';
$service = new Service(new Parser($host, $credentials));
if ($service->isRunning($serviceName)) {
    echo "Service is running. Let's stop";
    $service->stop($serviceName);
} else {
    echo "Service isn't running. Let's start";
    $service->start($serviceName);
}
//dumps status output
echo $service->status($serviceName);
コード例 #2
0
ファイル: example2.php プロジェクト: gonzalo123/netservice
<?php

include __DIR__ . '/../vendor/autoload.php';
use NetService\Service, NetService\Parser;
$host = 'windowshost.com';
$credentials = '{domain}/{user}%{password}';
$service = new Service(new Parser($host, $credentials));
echo $service->listServices();