<?php require_once "../config.php"; $params = array('domain' => 'example.com'); $request = new \pmill\Plesk\ListSubdomains($config, $params); $info = $request->process(); var_dump($info);
$info = $request->process(); echo "Site alias deleted: " . $data['site_alias'] . "<BR>"; } if ($runSiteTests && $runSubdomainTests) { /* * 19. Create subdomain (CreateSubdomain) */ $data['subdomain'] = random_string(); $request = new \pmill\Plesk\CreateSubdomain($config, array('domain' => $data['domain'], 'subdomain' => $data['subdomain'], 'www_root' => '/subdomains/' . strtolower($data['subdomain']), 'fpt_username' => random_string(), 'fpt_password' => random_string())); $info = $request->process(); $data['subdomain_id'] = $request->id; echo "Subdomain created: " . $data['subdomain'] . "<BR>"; /* * 20. List subdomains (ListSubdomains) */ $request = new \pmill\Plesk\ListSubdomains($config, array('site_id' => $data['site_id'])); $subdomains = $request->process(); $subdomain_found = FALSE; foreach ($subdomains as $subdomain) { if ($subdomain['id'] == $data['subdomain_id']) { $subdomain_found = TRUE; } } if (!$subdomain_found) { throw new Exception("Couldn't find created subdomain"); } echo "Subdomain found: " . $data['subdomain'] . "<BR>"; /* * 21. Update subdomain(UpdateSubdomain) */ $request = new \pmill\Plesk\UpdateSubdomain($config, array('id' => $data['subdomain_id'], 'fpt_username' => random_string(), 'fpt_password' => random_string()));