FOSSology  4.4.0
Open Source License Compliance by Open Source Software
index.php
Go to the documentation of this file.
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2008-2011 Hewlett-Packard Development Company, L.P.
4  SPDX-FileCopyrightText: © 2014 Siemens AG
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
8 
11 
17 /* initialize session variable to run test in cli mode */
18 if (! isset($_SESSION)) {
19  $_SESSION = array();
20 }
21 
22 $startTime = microtime(true);
23 require_once(__DIR__ . "/../../lib/php/bootstrap.php");
24 
25 $PG_CONN = 0; // Database connection
26 
27 /* Set SYSCONFDIR and set global (for backward compatibility) */
28 $SysConf = bootstrap();
29 
30 global $container;
32 $timingLogger = $container->get("log.timing");
33 $timingLogger->logWithStartTime("bootstrap", $startTime);
34 
35 /* Load UI templates */
36 $loader = $container->get('twig.loader');
37 $loader->addPath(dirname(__FILE__).'/template');
38 
39 /* Initialize global system configuration variables $SysConfig[] */
40 $timingLogger->tic();
41 ConfigInit($SYSCONFDIR, $SysConf);
42 $timingLogger->toc("setup init");
43 
44 $timingLogger->tic();
45 plugin_load();
46 plugin_preinstall();
47 plugin_postinstall();
48 $timingLogger->toc("setup plugins");
49 
50 $plugin = plugin_find(GetParm("mod", PARM_STRING) ?: HomePage::NAME);
51 if ($plugin) {
52  $timingLogger->tic();
53  $plugin->execute();
54  $timingLogger->toc("plugin execution");
55 } else {
56  $linkUri = Traceback_uri() . "?mod=auth";
57  $errorText = _("Module unavailable or your login session timed out.");
58  print "$errorText <P />";
59  $linkText = _("Click here to continue.");
60  print "<a href=\"$linkUri\">$linkText</a>";
61 }
62 plugin_unload();
63 
64 $container->get("db.manager")->flushStats();
65 return 0;
about page on UI
Definition: HomePage.php:24
Traceback_uri()
Get the URI without query to this location.
Definition: common-parm.php:97
const PARM_STRING
Definition: common-parm.php:18
GetParm($parameterName, $parameterType)
This function will retrieve the variables and check data types.
Definition: common-parm.php:46
plugin_load()
Load every module ui found in mods-enabled.
plugin_find($pluginName)
Given the official name of a plugin, return the $Plugins object.
ConfigInit($sysconfdir, &$SysConf, $exitOnDbFail=true)
Initialize the fossology system after bootstrap().
foreach($Options as $Option=> $OptVal) if(0==$reference_flag &&0==$nomos_flag) $PG_CONN
bootstrap($sysconfdir="")
Bootstrap the fossology php library.
Definition: migratetest.php:82