You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
794 B

4 years ago
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. namespace App\Middleware;
  12. use Psr\Http\Message\ResponseInterface;
  13. use Psr\Http\Message\ServerRequestInterface;
  14. use Psr\Http\Server\MiddlewareInterface;
  15. use Psr\Http\Server\RequestHandlerInterface;
  16. use function trackerHookMalloc;
  17. class HookMallocMiddleware implements MiddlewareInterface
  18. {
  19. public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
  20. {
  21. if (function_exists('trackerHookMalloc')) {
  22. trackerHookMalloc();
  23. }
  24. return $handler->handle($request);
  25. }
  26. }