Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/lib/zend/Zend/Service/Amazon/Ec2/Region.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_Region extends Zend_Service_Amazon_Ec2_Abstract
00038 {
00039 
00047     public function describe($region = null)
00048     {
00049         $params = array();
00050         $params['Action'] = 'DescribeRegions';
00051 
00052         if(is_array($region) && !empty($region)) {
00053             foreach($region as $k=>$name) {
00054                 $params['Region.' . ($k+1)] = $name;
00055             }
00056         } elseif($region) {
00057             $params['Region.1'] = $region;
00058         }
00059 
00060         $response = $this->sendRequest($params);
00061 
00062         $xpath  = $response->getXPath();
00063         $nodes  = $xpath->query('//ec2:item');
00064 
00065         $return = array();
00066         foreach ($nodes as $k => $node) {
00067             $item = array();
00068             $item['regionName']   = $xpath->evaluate('string(ec2:regionName/text())', $node);
00069             $item['regionUrl']  = $xpath->evaluate('string(ec2:regionUrl/text())', $node);
00070 
00071             $return[] = $item;
00072             unset($item);
00073         }
00074 
00075         return $return;
00076     }
00077 }
 All Data Structures Namespaces Files Functions Variables Enumerations