public static function get($cacheClusterId)
    {
        if (!$cacheClusterId) throw new Kwf_Exception("cacheClusterId is requried");
        $ec = new Kwf_Util_Aws_ElastiCache();
        $r = $ec->describe_cache_clusters(array(
            'ShowCacheNodeInfo' => true,
            'CacheClusterId' => $cacheClusterId
        ));
        if (!$r->isOk()) {
            if (isset($r->body->Error->Message)) {
                throw new Kwf_Exception($r->body->Error->Message);
            } else {
                throw new Kwf_Exception("Getting CacheClusters failed");
            }
        }
        $servers = array();
        foreach ($r->body->DescribeCacheClustersResult->CacheClusters->CacheCluster->CacheNodes->CacheNode as $node) {
            $servers[] = array(
                'host' => (string)$node->Endpoint->Address,
                'port' => (int)$node->Endpoint->Port,
            );
        }
        return $servers;
    }
public static function get($cacheClusterId)
    {
        if (!$cacheClusterId) throw new Kwf_Exception("cacheClusterId is requried");
        $ec = new Kwf_Util_Aws_ElastiCache();
        $r = $ec->describe_cache_clusters(array(
            'ShowCacheNodeInfo' => true,
            'CacheClusterId' => $cacheClusterId
        ));
        if (!$r->isOk()) {
            if (isset($r->body->Error->Message)) {
                throw new Kwf_Exception($r->body->Error->Message);
            } else {
                throw new Kwf_Exception("Getting CacheClusters failed");
            }
        }
        $servers = array();
        foreach ($r->body->DescribeCacheClustersResult->CacheClusters->CacheCluster->CacheNodes->CacheNode as $node) {
            $servers[] = array(
                'host' => (string)$node->Endpoint->Address,
                'port' => (int)$node->Endpoint->Port,
            );
        }
        return $servers;
    }
public static function get ( $ cacheClusterId ) { if ( ! $ cacheClusterId ) throw new Kwf_Exception ( "cacheClusterId is requried" ) ; $ ec = new Kwf_Util_Aws_ElastiCache ( ) ; $ r = $ ec -> describe_cache_clusters ( array ( 'ShowCacheNodeInfo' => true , 'CacheClusterId' => $ cacheClusterId ) ) ; if ( ! $ r -> isOk ( ) ) { if ( isset ( $ r -> body -> Error -> Message ) ) { throw new Kwf_Exception ( $ r -> body -> Error -> Message ) ; } else { throw new Kwf_Exception ( "Getting CacheClusters failed" ) ; } } $ servers = array ( ) ; foreach ( $ r -> body -> DescribeCacheClustersResult -> CacheClusters -> CacheCluster -> CacheNodes -> CacheNode as $ node ) { $ servers [ ] = array ( 'host' => ( string ) $ node -> Endpoint -> Address , 'port' => ( int ) $ node -> Endpoint -> Port , ) ; } return $ servers ; }
uncached, use getCached to use cache
uncached use getCached to use cache