@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function execute() { |
72 | 72 | $sleepTime = 1000;//microsecond, prevent CPU 100% |
73 | - //prepare conf |
|
73 | + //prepare conf |
|
74 | 74 | // while (($multiFlg = curl_multi_exec(self::$multiHandler, $active)) == CURLM_CALL_MULTI_PERFORM); |
75 | - //fetch data |
|
75 | + //fetch data |
|
76 | 76 | // while ($active && $multiFlg == CURLM_OK) { |
77 | 77 | // if (curl_multi_select(self::$multiHandler) != -1) { |
78 | 78 | // while (curl_multi_exec(self::$multiHandler, $active) === CURLM_CALL_MULTI_PERFORM); |
@@ -84,27 +84,27 @@ discard block |
||
84 | 84 | // } |
85 | 85 | |
86 | 86 | |
87 | - do{ |
|
88 | - curl_multi_exec(self::$multiHandler, $active); |
|
89 | - // bug in PHP 5.3.18+ where curl_multi_select can return -1 |
|
87 | + do{ |
|
88 | + curl_multi_exec(self::$multiHandler, $active); |
|
89 | + // bug in PHP 5.3.18+ where curl_multi_select can return -1 |
|
90 | 90 | // https://bugs.php.net/bug.php?id=63411 |
91 | - if (curl_multi_select(self::$multiHandler) == -1) { |
|
91 | + if (curl_multi_select(self::$multiHandler) == -1) { |
|
92 | 92 | // usleep($sleepTime); |
93 | - } |
|
93 | + } |
|
94 | 94 | // usleep($sleepTime); |
95 | - }while($active); |
|
95 | + }while($active); |
|
96 | 96 | |
97 | 97 | |
98 | - $return = array(); |
|
98 | + $return = array(); |
|
99 | 99 | foreach (self::$requestPool as $request) { |
100 | 100 | $response = $request->makeResponse(true); |
101 | - $func = $response->request->endCallback(); |
|
101 | + $func = $response->request->endCallback(); |
|
102 | 102 | if (isset($func)) { |
103 | 103 | $func($response); |
104 | 104 | } |
105 | 105 | $return[] = $response; |
106 | - curl_multi_remove_handle(self::$multiHandler, $request->curlHandle); |
|
107 | - curl_close($request->curlHandle); |
|
106 | + curl_multi_remove_handle(self::$multiHandler, $request->curlHandle); |
|
107 | + curl_close($request->curlHandle); |
|
108 | 108 | } |
109 | 109 | curl_multi_close(self::$multiHandler); |
110 | 110 | return $return; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @return array(Response) |
70 | 70 | */ |
71 | 71 | public function execute() { |
72 | - $sleepTime = 1000;//microsecond, prevent CPU 100% |
|
72 | + $sleepTime = 1000; //microsecond, prevent CPU 100% |
|
73 | 73 | //prepare conf |
74 | 74 | // while (($multiFlg = curl_multi_exec(self::$multiHandler, $active)) == CURLM_CALL_MULTI_PERFORM); |
75 | 75 | //fetch data |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | // } |
85 | 85 | |
86 | 86 | |
87 | - do{ |
|
87 | + do { |
|
88 | 88 | curl_multi_exec(self::$multiHandler, $active); |
89 | 89 | // bug in PHP 5.3.18+ where curl_multi_select can return -1 |
90 | 90 | // https://bugs.php.net/bug.php?id=63411 |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | // usleep($sleepTime); |
93 | 93 | } |
94 | 94 | // usleep($sleepTime); |
95 | - }while($active); |
|
95 | + }while ($active); |
|
96 | 96 | |
97 | 97 | |
98 | 98 | $return = array(); |