Example #1
0
 /**
  * @param $xml
  * @return array
  */
 protected function processResponse($xml)
 {
     $result = [];
     foreach ($xml->subdomain->get->result as $node) {
         $result[] = ['id' => (int) $node->id, 'status' => (string) $node->status, 'parent' => (string) $node->data->parent, 'name' => (string) $node->data->name, 'php' => (string) Xml::findProperty($node->data, 'php'), 'php_handler_type' => (string) Xml::findProperty($node->data, 'php_handler_type'), 'www_root' => (string) Xml::findProperty($node->data, 'www_root')];
     }
     return $result;
 }
Example #2
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;
 }