Пример #1
0
 /**
  * @param $xml
  * @return array
  */
 protected function processResponse($xml)
 {
     $result = [];
     for ($i = 0; $i < count($xml->{"service-plan"}->get->result); $i++) {
         $plan = $xml->{"service-plan"}->get->result[$i];
         $hosting = [];
         foreach ($plan->hosting as $host) {
             $hosting[$host->getName()] = Xml::getProperties($host);
         }
         $result[] = ['id' => (string) $plan->id, 'guid' => (string) $plan->guid, 'status' => (string) $plan->status, 'name' => (string) $plan->name, 'limits' => ['overuse' => (string) $plan->limits->overuse, 'max_sites' => Xml::findProperty($plan->limits, 'max_site', 'limit'), 'max_subdomains' => Xml::findProperty($plan->limits, 'max_subdom', 'limit'), 'max_domain_aliases' => Xml::findProperty($plan->limits, 'max_dom_aliases', 'limit'), 'disk_space' => Xml::findProperty($plan->limits, 'disk_space', 'limit'), 'max_traffic' => Xml::findProperty($plan->limits, 'max_traffic', 'limit'), 'max_web_users' => Xml::findProperty($plan->limits, 'max_wu', 'limit'), 'max_subftp_users' => Xml::findProperty($plan->limits, 'max_subftp_users', 'limit'), 'max_databases' => Xml::findProperty($plan->limits, 'max_db', 'limit'), 'max_mailboxes' => Xml::findProperty($plan->limits, 'max_box', 'limit'), 'mailbox_quota' => Xml::findProperty($plan->limits, 'mbox_quota', 'limit'), 'max_maillists' => Xml::findProperty($plan->limits, 'max_maillists', 'limit'), 'max_webapps' => Xml::findProperty($plan->limits, 'max_webapps', 'limit'), 'max_site_builder' => Xml::findProperty($plan->limits, 'max_site_builder', 'limit'), 'expiration' => Xml::findProperty($plan->limits, 'expiration', 'limit')], 'log_rotation' => ['on' => (string) $plan->{"log-rotation"}->on->{"log-condition"}->{"log-bytime"}, 'max_num_files' => (int) $plan->{"log-rotation"}->on->{"log-max-num-files"}, 'compressed' => (string) $plan->{"log-rotation"}->on->{"log-compress"}], 'preferences' => ['stat' => (int) $plan->preferences->stat, 'maillists' => (string) $plan->preferences->maillists, 'dns_zone_type' => (string) $plan->preferences->dns_zone_type], 'hosting' => $hosting, 'performance' => ['bandwidth' => (int) $plan->performance->bandwidth, 'max_connections' => (int) $plan->performance->max_connections], 'permissions' => Xml::getProperties($plan->permissions, 'permission')];
     }
     return $result;
 }
Пример #2
0
 /**
  * @param $xml
  * @return array
  */
 protected function processResponse($xml)
 {
     $result = [];
     for ($i = 0; $i < count($xml->webspace->get->result); $i++) {
         $webspace = $xml->webspace->get->result[$i];
         $hosting = [];
         foreach ($webspace->data->hosting->children() as $host) {
             $hosting[$host->getName()] = Xml::getProperties($host);
         }
         $subscriptions = [];
         foreach ($webspace->data->subscriptions->children() as $subscription) {
             $subscriptions[] = ['locked' => (bool) $subscription->locked, 'synchronized' => (bool) $subscription->synchronized, 'plan-guid' => (string) $subscription->plan->{"plan-guid"}];
         }
         $result[] = ['id' => (string) $webspace->id, 'status' => (string) $webspace->status, 'subscription_status' => (int) $webspace->data->gen_info->status, 'created' => (string) $webspace->data->gen_info->cr_date, 'name' => (string) $webspace->data->gen_info->name, 'owner_id' => (string) $webspace->data->gen_info->{"owner-id"}, 'hosting' => $hosting, 'real_size' => (int) $webspace->data->gen_info->real_size, 'dns_ip_address' => (string) $webspace->data->gen_info->dns_ip_address, 'htype' => (string) $webspace->data->gen_info->htype, 'subscriptions' => $subscriptions];
     }
     return $result;
 }