Пример #1
0
 }
 if ($runSiteTests && $runSiteAliasTests) {
     /*
      * 16. Create site alias (CreateSiteAlias)
      */
     $data['site_alias'] = random_string() . '.' . $data['domain'];
     $params = array('site_id' => $data['site_id'], 'alias' => $data['site_alias']);
     $request = new \pmill\Plesk\CreateSiteAlias($config, $params);
     $info = $request->process();
     $data['site_alias_id'] = $request->id;
     echo "Site alias created: " . $data['site_alias'] . "<BR>";
     /*
      * 17. List site aliases (ListSiteAliases)
      */
     $request = new \pmill\Plesk\ListSiteAliases($config, array('site_id' => $data['site_id']));
     $aliases = $request->process();
     $alias_found = FALSE;
     foreach ($aliases as $alias_id => $alias_name) {
         if ($alias_id == $data['site_alias_id']) {
             $alias_found = TRUE;
         }
     }
     if (!$alias_found) {
         throw new Exception("Couldn't find created site alias");
     }
     echo "Site alias found: " . $data['site_alias'] . "<BR>";
     /*
      * 18. Delete site alias (DeleteEmailAddress)
      */
     $request = new \pmill\Plesk\DeleteSiteAlias($config, array('id' => $data['site_alias_id']));
     $info = $request->process();
Пример #2
0
<?php

require_once "../config.php";
$params = array('domain' => 'example.com');
$request = new \pmill\Plesk\ListSiteAliases($config, $params);
$info = $request->process();
var_dump($info);