<?php require_once "../config.php"; $request = new \pmill\Plesk\ListServicePlans($config); $info = $request->process(); var_dump($info);
*/ $request = new \pmill\Plesk\ListIPAddresses($config); $ips = $request->process(); foreach ($ips as $ip) { if ($ip['is_default']) { $data['shared_ip_address'] = $ip['ip_address']; } } if (!isset($data['shared_ip_address'])) { throw new Exception("Couldn't find any shared IP addresses"); } echo "Shared IP Address found: " . $data['shared_ip_address'] . "<BR>"; /* * 3. Find unlimited service plan (ListServicePlans) */ $request = new \pmill\Plesk\ListServicePlans($config); $plans = $request->process(); foreach ($plans as $plan) { if (strtolower($plan['name']) == 'unlimited') { $data['unlimited_plan_id'] = $plan['id']; echo "Unlimited Service Plan found: " . $data['unlimited_plan_id'] . "<BR>"; break; } } if (!isset($data['unlimited_plan_id'])) { throw new Exception("Couldn't find unlimited service plan"); } /* * 4. Creates a new client (CreateClient) */ $data['client_username'] = strtolower(random_string());