equal
deleted
inserted
replaced
14 * to license@zend.com so we can send you a copy immediately. |
14 * to license@zend.com so we can send you a copy immediately. |
15 * |
15 * |
16 * @category Zend |
16 * @category Zend |
17 * @package Zend_Service |
17 * @package Zend_Service |
18 * @subpackage Amazon |
18 * @subpackage Amazon |
19 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
19 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
20 * @license http://framework.zend.com/license/new-bsd New BSD License |
20 * @license http://framework.zend.com/license/new-bsd New BSD License |
21 * @version $Id: Amazon.php 24782 2012-05-09 12:04:50Z adamlundrigan $ |
21 * @version $Id$ |
22 */ |
22 */ |
23 |
23 |
24 /** |
24 /** |
25 * @see Zend_Rest_Client |
25 * @see Zend_Rest_Client |
26 */ |
26 */ |
27 require_once 'Zend/Rest/Client.php'; |
27 require_once 'Zend/Rest/Client.php'; |
28 |
28 |
|
29 /** @see Zend_Xml_Security */ |
|
30 require_once 'Zend/Xml/Security.php'; |
|
31 |
29 /** |
32 /** |
30 * @category Zend |
33 * @category Zend |
31 * @package Zend_Service |
34 * @package Zend_Service |
32 * @subpackage Amazon |
35 * @subpackage Amazon |
33 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
36 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
34 * @license http://framework.zend.com/license/new-bsd New BSD License |
37 * @license http://framework.zend.com/license/new-bsd New BSD License |
35 */ |
38 */ |
36 class Zend_Service_Amazon |
39 class Zend_Service_Amazon |
37 { |
40 { |
38 /** |
41 /** |
124 throw new Zend_Service_Exception('An error occurred sending request. Status code: ' |
127 throw new Zend_Service_Exception('An error occurred sending request. Status code: ' |
125 . $response->getStatus()); |
128 . $response->getStatus()); |
126 } |
129 } |
127 |
130 |
128 $dom = new DOMDocument(); |
131 $dom = new DOMDocument(); |
129 $dom->loadXML($response->getBody()); |
132 $dom = Zend_Xml_Security::scan($response->getBody(), $dom); |
130 self::_checkErrors($dom); |
133 self::_checkErrors($dom); |
131 |
134 |
132 /** |
135 /** |
133 * @see Zend_Service_Amazon_ResultSet |
136 * @see Zend_Service_Amazon_ResultSet |
134 */ |
137 */ |
166 'An error occurred sending request. Status code: ' . $response->getStatus() |
169 'An error occurred sending request. Status code: ' . $response->getStatus() |
167 ); |
170 ); |
168 } |
171 } |
169 |
172 |
170 $dom = new DOMDocument(); |
173 $dom = new DOMDocument(); |
171 $dom->loadXML($response->getBody()); |
174 $dom = Zend_Xml_Security::scan($response->getBody(), $dom); |
172 self::_checkErrors($dom); |
175 self::_checkErrors($dom); |
173 $xpath = new DOMXPath($dom); |
176 $xpath = new DOMXPath($dom); |
174 $xpath->registerNamespace('az', 'http://webservices.amazon.com/AWSECommerceService/2011-08-01'); |
177 $xpath->registerNamespace('az', 'http://webservices.amazon.com/AWSECommerceService/2011-08-01'); |
175 $items = $xpath->query('//az:Items/az:Item'); |
178 $items = $xpath->query('//az:Items/az:Item'); |
176 |
179 |