File tree 2 files changed +28
-3
lines changed
2 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ abstract class AmazonCore{
80
80
protected $ throttleTime ;
81
81
protected $ throttleSafe ;
82
82
protected $ throttleGroup ;
83
+ protected $ throttleStop = false ;
83
84
protected $ storeName ;
84
85
protected $ options ;
85
86
protected $ config ;
@@ -403,6 +404,17 @@ public function setStore($s){
403
404
}
404
405
}
405
406
407
+ /**
408
+ * Enables or disables the throttle stop.
409
+ *
410
+ * When the throttle stop is enabled, throttled requests will not be repeated.
411
+ * This setting is off by default.
412
+ * @param boolean $b <p>Defaults to <b>TRUE</b>.</p>
413
+ */
414
+ public function setThrottleStop ($ b =true ) {
415
+ $ this ->throttleStop =!empty ($ b );
416
+ }
417
+
406
418
/**
407
419
* Writes a message to the log.
408
420
*
@@ -550,7 +562,7 @@ protected function sendRequest($url,$param){
550
562
$ this ->log ("Making request to Amazon: " .$ this ->options ['Action ' ]);
551
563
$ response = $ this ->fetchURL ($ url ,$ param );
552
564
553
- while ($ response ['code ' ] == '503 ' ){
565
+ while ($ response ['code ' ] == '503 ' && $ this -> throttleStop == false ){
554
566
$ this ->sleep ();
555
567
$ response = $ this ->fetchURL ($ url ,$ param );
556
568
}
Original file line number Diff line number Diff line change 4
4
*
5
5
* This Amazon Feeds Core object can retrieve the results of a
6
6
* processed feed from Amazon, which can then be saved to a file
7
- * specified by the user. In order to fetch feed results, the
8
- * feed's ID must be given.
7
+ * specified by the user or retrieved as a single string.
8
+ * In order to fetch feed results, the feed's ID must be given.
9
9
*/
10
10
class AmazonFeedResult extends AmazonFeedsCore{
11
11
private $ rawFeed ;
@@ -114,5 +114,18 @@ public function saveFeed($path){
114
114
}
115
115
}
116
116
117
+ /**
118
+ * Returns the entire raw report data.
119
+ *
120
+ * This is useful for handling the report with an external file management system.
121
+ * @return string|boolean The raw report data as a string, or <b>FALSE</b> if there is no data
122
+ */
123
+ public function getRawFeed () {
124
+ if (!isset ($ this ->rawFeed )){
125
+ return false ;
126
+ }
127
+ return $ this ->rawFeed ;
128
+ }
129
+
117
130
}
118
131
?>
You can’t perform that action at this time.
0 commit comments