Exemplo n.º 1
0
<?php

require_once '../StormAPI.class.php';
$apiUser = "******";
$apiPass = "******";
$apiMethod = "storm/server/list";
$paramsArray = FALSE;
$apiVersion = "v1";
$storm = new \LiquidWeb\StormAPI($apiUser, $apiPass, $apiMethod, $paramsArray, $apiVersion);
$storm->addParam("page_size", 999);
$results = $storm->request();
foreach ($results['items'] as $item) {
    echo $item['domain'] . " || " . $item['uniq_id'] . "\n";
}
     if ($storm->listParams()) {
         cleanArrayDisp($storm->listParams());
     } else {
         echo "No parameters are currently set\n";
     }
     break;
 case 4:
     $storm->clearParams();
     break;
 case 5:
     if (isset($logging)) {
         fwrite($logging['handle'], $storm->debugInfo());
         // Head up the output with the debug information
         fwrite($logging['handle'], "\n");
         // Whitespace makes people happy
         cleanArrayDisp($storm->request(), $logging);
         // Done this way so the file handler gets passed into the function
         fwrite($logging['handle'], "\n\n");
         // More whitespace happiness
     } else {
         cleanArrayDisp($storm->request());
     }
     break;
 case 6:
     if (!isset($logging)) {
         $logging['filename'] = date('His - dMy') . ".log";
         $logging['handle'] = fopen($logging['filename'], 'w+');
     } else {
         // Clean up
         fclose($logging['handle']);
         unset($logging);