@@ -3,7 +3,6 @@ |
||
| 3 | 3 | require __DIR__ . '/../vendor/autoload.php'; |
| 4 | 4 | |
| 5 | 5 | use mpyw\Co\Co; |
| 6 | -use mpyw\Co\CURLException; |
|
| 7 | 6 | |
| 8 | 7 | function curl_init_with($url, array $options = [CURLOPT_RETURNTRANSFER => true]) { |
| 9 | 8 | $ch = curl_init($url); |
@@ -12,6 +12,10 @@ discard block |
||
| 12 | 12 | throw new \RuntimeException($error['message']); |
| 13 | 13 | } |
| 14 | 14 | } |
| 15 | +/** |
|
| 16 | + * @param integer $status |
|
| 17 | + * @param string $message |
|
| 18 | + */ |
|
| 15 | 19 | function respond_rest($con, $status, $message, $content) { |
| 16 | 20 | try { |
| 17 | 21 | $length = strlen($content); |
@@ -24,6 +28,11 @@ discard block |
||
| 24 | 28 | } |
| 25 | 29 | fclose($con); |
| 26 | 30 | } |
| 31 | +/** |
|
| 32 | + * @param Closure $tick_function |
|
| 33 | + * @param integer $tick |
|
| 34 | + * @param integer $times |
|
| 35 | + */ |
|
| 27 | 36 | function respond_streaming($con, $tick_function, $tick, $times) { |
| 28 | 37 | try { |
| 29 | 38 | fsend($con, "HTTP/1.1 200 OK\r\n"); |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | require __DIR__ . '/../vendor/autoload.php'; |
| 4 | 4 | |
| 5 | 5 | use mpyw\Co\Co; |
| 6 | -use mpyw\Co\CURLException; |
|
| 7 | 6 | |
| 8 | 7 | function curl_init_with($url, array $options = [CURLOPT_RETURNTRANSFER => true]) { |
| 9 | 8 | $ch = curl_init($url); |