FOSSology  4.4.0
Open Source License Compliance by Open Source Software
index.php File Reference

Provides router for REST api requests. More...

Go to the source code of this file.

Functions

 Fossology\UI\Api::getVersionFromUri ($uri)
 

Variables

 Fossology\UI\Api::$GLOBALS ['apiCall'] = true
 
 Fossology\UI\Api::$requestedVersion = isset($_SERVER['REQUEST_URI']) ? getVersionFromUri($_SERVER['REQUEST_URI']) : null
 
 Fossology\UI\Api::$apiVersion = in_array($requestedVersion, [ApiVersion::V1, ApiVersion::V2]) ? $requestedVersion : ApiVersion::V1
 
 Fossology\UI\Api::$BASE_PATH = "/repo/api/v" .$apiVersion
 
const Fossology\UI\Api::AUTH_METHOD = "JWT_TOKEN"
 
 Fossology\UI\Api::$GLOBALS ['apiBasePath'] = $BASE_PATH
 
 Fossology\UI\Api::$startTime = microtime(true)
 
 Fossology\UI\Api::$SysConf = bootstrap()
 
global Fossology\UI\Api::$container
 
 Fossology\UI\Api::$timingLogger = $container->get("log.timing")
 
 Fossology\UI\Api::$loader = $container->get('twig.loader')
 
 Fossology\UI\Api::$error = ConfigInit($GLOBALS['SYSCONFDIR'], $SysConf, false)
 
 Fossology\UI\Api::$dbConnected = true
 
 Fossology\UI\Api::$app = AppFactory::create()
 
 Fossology\UI\Api::$apiVersionMiddleware
 
if($dbConnected) Fossology\UI\Api::else
 
 Fossology\UI\Api::return
 
 Fossology\UI\Api::$pattern = "[\\w\\d\\-\\.@_]+}"
 
 Fossology\UI\Api::$customErrorHandler
 
 Fossology\UI\Api::$errorMiddleware
 

Detailed Description

Provides router for REST api requests.

Definition in file index.php.

Variable Documentation

◆ $apiVersionMiddleware

Fossology::UI::Api\$apiVersionMiddleware
Initial value:
= function (Request $request, RequestHandler $handler) use ($apiVersion) {
$request = $request->withAttribute(ApiVersion::ATTRIBUTE_NAME, $apiVersion);
return $handler->handle($request);
}

Definition at line 120 of file index.php.

◆ $errorMiddleware

Fossology::UI::Api\$errorMiddleware
Initial value:
= $app->addErrorMiddleware(false, true, true,
$container->get("logger"))

Definition at line 467 of file index.php.

◆ else

if ( $dbConnected) Fossology::UI::Api\else
Initial value:
{
$app->get('/health', function($req, $res) {
$handler = new InfoController($GLOBALS['container']);
return $handler->getHealth($req, $res, -1);
})

Definition at line 148 of file index.php.