mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-21 08:12:26 +02:00
N°3351 restore LogKPI calls in portal index
This commit is contained in:
@@ -24,23 +24,38 @@ require_once MODULESROOT.'itop-portal-base/portal/config/bootstrap.php';
|
||||
|
||||
// Stacking context tag so it knows we are in the portal
|
||||
$oContext = new ContextTag(ContextTag::TAG_PORTAL);
|
||||
$oContext2 = new ContextTag('Portal:' . $_ENV['PORTAL_ID']);
|
||||
$oContext2 = new ContextTag('Portal:'.$_ENV['PORTAL_ID']);
|
||||
|
||||
|
||||
$oKPI = new ExecutionKPI();
|
||||
|
||||
// Note: Manually refactored ternary condition to be PHP 5.x compatible
|
||||
if ($trustedProxies = isset($_SERVER['TRUSTED_PROXIES']) ? $_SERVER['TRUSTED_PROXIES'] : (isset($_ENV['TRUSTED_PROXIES']) ? $_ENV['TRUSTED_PROXIES'] : false))
|
||||
{
|
||||
if ($trustedProxies = isset($_SERVER['TRUSTED_PROXIES']) ? $_SERVER['TRUSTED_PROXIES'] : (isset($_ENV['TRUSTED_PROXIES']) ? $_ENV['TRUSTED_PROXIES'] : false)) {
|
||||
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
|
||||
}
|
||||
|
||||
// Note: Manually refactored ternary condition to be PHP 5.x compatible
|
||||
if ($trustedHosts = isset($_SERVER['TRUSTED_HOSTS']) ? $_SERVER['TRUSTED_HOSTS'] : (isset($_ENV['TRUSTED_HOSTS']) ? $_ENV['TRUSTED_HOSTS'] : false))
|
||||
{
|
||||
if ($trustedHosts = isset($_SERVER['TRUSTED_HOSTS']) ? $_SERVER['TRUSTED_HOSTS'] : (isset($_ENV['TRUSTED_HOSTS']) ? $_ENV['TRUSTED_HOSTS'] : false)) {
|
||||
Request::setTrustedHosts([$trustedHosts]);
|
||||
}
|
||||
|
||||
$oKernel = new Kernel($_SERVER['APP_ENV'], (bool)$_SERVER['APP_DEBUG']);
|
||||
$oKPI->ComputeAndReport('Symfony kernel init');
|
||||
|
||||
$oKPI = new ExecutionKPI();
|
||||
$oRequest = Request::createFromGlobals();
|
||||
$oKPI->ComputeAndReport('Symfony request parsing/creation');
|
||||
|
||||
$oKPI = new ExecutionKPI();
|
||||
/** @noinspection PhpUnhandledExceptionInspection */
|
||||
$oResponse = $oKernel->handle($oRequest);
|
||||
$oResponse->send();
|
||||
$oKPI->ComputeAndReport('Page execution and rendering');
|
||||
|
||||
|
||||
$oKPI = new ExecutionKPI();
|
||||
$oKernel->terminate($oRequest, $oResponse);
|
||||
$oKPI->ComputeAndReport('Symfony kernel termination');
|
||||
|
||||
|
||||
ExecutionKPI::ReportStats();
|
||||
Reference in New Issue
Block a user