FOSSology  4.4.0
Open Source License Compliance by Open Source Software
FossologyInitMiddleware.php
Go to the documentation of this file.
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2019 Siemens AG
4  Author: Gaurav Mishra <mishra.gaurav@siemens.com>
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
13 namespace Fossology\UI\Api\Middlewares;
14 
15 require_once dirname(__FILE__, 5) . "/lib/php/bootstrap.php";
16 
17 use Psr\Http\Message\ResponseInterface;
18 use Psr\Http\Message\ServerRequestInterface as Request;
19 use Psr\Http\Server\RequestHandlerInterface as RequestHandler;
20 
26 {
35  public function __invoke(Request $request, RequestHandler $handler) : ResponseInterface
36  {
37  global $container;
38  $timingLogger = $container->get("log.timing");
39  plugin_preinstall();
40  plugin_postinstall();
41  $timingLogger->toc("setup plugins");
42 
43  $response = $handler->handle($request);
44 
45  plugin_unload();
46  return $response;
47  }
48 }
Middleware to initialize FOSSology for Slim framework.
__invoke(Request $request, RequestHandler $handler)