Example #1
0
 /**
  * Process XML Response
  *
  * Process the XML response from Twitter.com
  *
  * @param string $response
  */
 function __process_xml($response)
 {
     $xml = new XML($response);
     $result = $xml->toArray();
     $xml->__killParent();
     $xml->__destruct();
     $xml = null;
     unset($xml);
     return $result;
 }
Example #2
0
 public function setBody(\SimpleXMLElement $body)
 {
     $this->data = null;
     $parser = new XML();
     $data = $parser->toArray($body);
     if (!isset($data['@attributes']['type']) || !isset($data['@attributes']['msg'])) {
         return;
     }
     $this->data = $data;
 }
Example #3
0
 /**
  * undocumented function
  *
  * @param string $options 
  * @return void
  * @access public
  */
 function process($options = array())
 {
     $defaults = array('type' => 'redirect', 'tId' => false);
     $options = am($defaults, $options);
     if ($options['type'] == 'redirect') {
         $myXml = $this->inquiry($options['tId']);
         App::import('Core', 'Xml');
         $xml = new XML($myXml);
         $data = $xml->toArray();
         return array('order_id' => $data['PaymentService']['Reply']['OrderStatus']['orderCode'], 'url' => $data['PaymentService']['Reply']['OrderStatus']['reference']['value']);
     }
     return false;
 }
Example #4
0
 /**
  * Format the API response into an array, given the expected response type
  * 
  * @param array Response to format
  * @param string Response type
  * @return array Array formatted API response
  */
 private function __formatResponse($response, $format)
 {
     if (in_array($format, array('xml', 'rss', 'atom'))) {
         $xml = new XML($response);
         $array = $xml->toArray(false);
         unset($xml);
         $response = $this->__fixXml($array);
         if (isset($response['bitly'])) {
             $response = array('results' => $this->__fixBitlyXml($response['bitly']['results']));
         }
     } elseif ($format === 'json') {
         $response = json_decode($response, true);
     }
     return $response;
 }
Example #5
0
 public static function XMLToArray($xml, $recursionDepth = 0)
 {
     XML::toArray($xml, $recursionDepth);
 }
Example #6
0
 function __process($response)
 {
     $xml = new XML($response);
     return $xml->toArray();
 }
 function __to_array($response = '')
 {
     $xml = new XML($response);
     $array = $xml->toArray();
     $xml->__killParent();
     $xml->__destruct();
     $xml = null;
     unset($xml);
     return $array;
 }
Example #8
0
 /**
  *
  * @param string data to process
  * @return array Twitter API response
  */
 function __process($response)
 {
     $xml = new XML($response);
     $array = $xml->toArray();
     $xml->__destruct();
     $xml = null;
     unset($xml);
     return $array;
 }
Example #9
0
 function __process($response)
 {
     /* Note: this will fail to properly distinguish among link tags -- see
        __parse_atom above for a better alternative */
     $xml = new XML($response);
     $array = $xml->toArray();
     $xml->__killParent();
     $xml->__destruct();
     $xml = null;
     unset($xml);
     return $array;
 }