@@ -3,21 +3,21 @@ |
||
| 3 | 3 | |
| 4 | 4 | class Worker extends \Workerman\Worker |
| 5 | 5 | { |
| 6 | - public static function runAll() |
|
| 7 | - { |
|
| 8 | - self::checkSapiEnv(); |
|
| 9 | - self::init(); |
|
| 10 | - self::parseCommand(); |
|
| 11 | - self::daemonize(); |
|
| 12 | - self::initWorkers(); |
|
| 13 | - self::installSignal(); |
|
| 14 | - self::saveMasterPid(); |
|
| 15 | - self::forkWorkers(); |
|
| 16 | - // @codeCoverageIgnoreStart |
|
| 17 | - self::resetStd(); |
|
| 18 | - self::monitorWorkers(); |
|
| 19 | - // @codeCoverageIgnoreEnd |
|
| 20 | - } // @codeCoverageIgnore |
|
| 6 | + public static function runAll() |
|
| 7 | + { |
|
| 8 | + self::checkSapiEnv(); |
|
| 9 | + self::init(); |
|
| 10 | + self::parseCommand(); |
|
| 11 | + self::daemonize(); |
|
| 12 | + self::initWorkers(); |
|
| 13 | + self::installSignal(); |
|
| 14 | + self::saveMasterPid(); |
|
| 15 | + self::forkWorkers(); |
|
| 16 | + // @codeCoverageIgnoreStart |
|
| 17 | + self::resetStd(); |
|
| 18 | + self::monitorWorkers(); |
|
| 19 | + // @codeCoverageIgnoreEnd |
|
| 20 | + } // @codeCoverageIgnore |
|
| 21 | 21 | |
| 22 | 22 | protected static function parseCommand() |
| 23 | 23 | { |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | return $illuminateResponse->getFile()->getPathname(); |
| 40 | 40 | }; |
| 41 | 41 | if ($accept_gzip && isset($response->header['Content-Type'])) { |
| 42 | - $size = $illuminateResponse->getFile()->getSize(); |
|
| 42 | + $size = $illuminateResponse->getFile()->getSize(); |
|
| 43 | 43 | } |
| 44 | 44 | } else { |
| 45 | 45 | $content = $illuminateResponse->getContent(); |
@@ -39,14 +39,14 @@ |
||
| 39 | 39 | |
| 40 | 40 | public function endResponse($response, $content) |
| 41 | 41 | { |
| 42 | - $connection = $response->request->getLaravooleInfo()->workermanConnection; |
|
| 42 | + $connection = $response->request->getLaravooleInfo()->workermanConnection; |
|
| 43 | 43 | if (!is_string($content)) { |
| 44 | - $response->content = file_get_contents($content()); |
|
| 44 | + $response->content = file_get_contents($content()); |
|
| 45 | 45 | } else { |
| 46 | - $response->content = $content; |
|
| 46 | + $response->content = $content; |
|
| 47 | 47 | } |
| 48 | 48 | $rawContent = $response->getRawContent(); |
| 49 | - $connection->maxSendBufferSize = strlen($rawContent); |
|
| 49 | + $connection->maxSendBufferSize = strlen($rawContent); |
|
| 50 | 50 | $connection->close($rawContent, true); |
| 51 | 51 | } |
| 52 | 52 | } |