Merge remote-tracking branch 'origin/support/2.7' into support/2.7

This commit is contained in:
BenGrenoble
2020-10-02 10:51:59 +02:00
3 changed files with 30 additions and 6 deletions

View File

@@ -178,7 +178,7 @@ abstract class Expression {
abstract public function CollectUsedParents(&$aTable);
/**
* @return boolean evaluation of the expression value, false if no conversion possible
* @return boolean true if the expression's value is constant and evaluates to true, false otherwise
*/
abstract public function IsTrue();

View File

@@ -34,23 +34,30 @@ $oModuleDesign = new ModuleDesign($_ENV['PORTAL_ID']);
// Load portal conf. such as properties, themes, templates, ...
// Append into %combodo.portal.instance.conf%
$oKPI = new ExecutionKPI();
$oBasicCompat = new Basic($oModuleDesign);
$oBasicCompat->Process($container);
$oKPI->ComputeAndReport('Load portal conf. such as properties, themes, templates, ...');
// Load portal forms definition
// Append into %combodo.portal.instance.conf%
$oKPI = new ExecutionKPI();
$oFormsCompat = new Forms($oModuleDesign);
$oFormsCompat->Process($container);
$oKPI->ComputeAndReport('Load portal forms definition');
// Load portal lists definition
// Append into %combodo.portal.instance.conf%
$oKPI = new ExecutionKPI();
$oListsCompat = new Lists($oModuleDesign);
$oListsCompat->Process($container);
$oKPI->ComputeAndReport('Load portal lists definition');
// Generating CSS files
// Note: We do this here as it is not user dependent and therefore can be cached for everyone.
// A dedicated listener 'CssFromSassCompiler' exists to compile files again when by-passing HTTP cache.
// This is to keep developers comfort when tuning the SCSS files.
$oKPI = new ExecutionKPI();
$aImportPaths = array($_ENV['COMBODO_PORTAL_BASE_ABSOLUTE_PATH'].'css/');
$aPortalConf = $container->getParameter('combodo.portal.instance.conf');
foreach ($aPortalConf['properties']['themes'] as $sKey => $value)
@@ -71,4 +78,6 @@ foreach ($aPortalConf['properties']['themes'] as $sKey => $value)
$aPortalConf['properties']['themes'][$sKey] = $aValues;
}
}
$oKPI->ComputeAndReport('Generating CSS files');
$container->setParameter('combodo.portal.instance.conf', $aPortalConf);

View File

@@ -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();