Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/lib/zend/Zend/Service/Amazon/Ec2/Availabilityzones.php
Go to the documentation of this file.
00001 <?php
00026 require_once 'Zend/Service/Amazon/Ec2/Abstract.php';
00027 
00037 class Zend_Service_Amazon_Ec2_Availabilityzones extends Zend_Service_Amazon_Ec2_Abstract
00038 {
00046     public function describe($zoneName = null)
00047     {
00048         $params = array();
00049         $params['Action'] = 'DescribeAvailabilityZones';
00050 
00051         if(is_array($zoneName) && !empty($zoneName)) {
00052             foreach($zoneName as $k=>$name) {
00053                 $params['ZoneName.' . ($k+1)] = $name;
00054             }
00055         } elseif($zoneName) {
00056             $params['ZoneName.1'] = $zoneName;
00057         }
00058 
00059         $response = $this->sendRequest($params);
00060 
00061         $xpath  = $response->getXPath();
00062         $nodes  = $xpath->query('//ec2:item');
00063 
00064         $return = array();
00065         foreach ($nodes as $k => $node) {
00066             $item = array();
00067             $item['zoneName']   = $xpath->evaluate('string(ec2:zoneName/text())', $node);
00068             $item['zoneState']  = $xpath->evaluate('string(ec2:zoneState/text())', $node);
00069 
00070             $return[] = $item;
00071             unset($item);
00072         }
00073 
00074         return $return;
00075     }
00076 }
 All Data Structures Namespaces Files Functions Variables Enumerations