Exemplo n.º 1
0
  */
 $request = new \pmill\Plesk\UpdateClient($config, array('username' => $data['client_username'], 'phone' => random_string(), 'email' => random_string() . '@example.com'));
 $info = $request->process();
 echo "Client updated: " . $data['client_username'] . "<BR>";
 /*
  * 7.  Create subscription (CreateSubscription)
  */
 $params = array('domain_name' => random_string() . '.com', 'username' => $data['client_username'], 'password' => random_string(16) . '1!', 'ip_address' => $data['shared_ip_address'], 'owner_id' => $data['client_id'], 'service_plan_id' => $data['unlimited_plan_id']);
 $request = new \pmill\Plesk\CreateSubscription($config, $params);
 $request->process();
 $data['subscription_id'] = $request->id;
 echo "Subscription created: " . $data['subscription_id'] . "<BR>";
 /*
  * 8.  List subscriptions (ListSubscriptions)
  */
 $request = new \pmill\Plesk\ListSubscriptions($config);
 $subscriptions = $request->process();
 $subscription_found = FALSE;
 foreach ($subscriptions as $subscription) {
     if ($subscription['id'] == $data['subscription_id']) {
         $subscription_found = TRUE;
     }
 }
 if (!$subscription_found) {
     throw new Exception("Couldn't find created subscription");
 }
 echo "Subscription found: " . $data['subscription_id'] . "<BR>";
 if ($runSiteTests) {
     /*
      * 9.  Create new site (CreateSite)
      */
Exemplo n.º 2
0
<?php

require_once "../config.php";
/*
 * Lists all subscriptions, or if client_id is supplied lists only that clients subscriptions
 */
$params = array();
$request = new \pmill\Plesk\ListSubscriptions($config, $params);
$info = $request->process();
var_dump($info);