diff --git a/core/config.class.inc.php b/core/config.class.inc.php index 70a176623b..4806e5800d 100644 --- a/core/config.class.inc.php +++ b/core/config.class.inc.php @@ -1399,7 +1399,7 @@ class Config 'source_of_value' => '', 'show_in_conf_sample' => true, ], - 'theme_precompilation_enabled' => [ + 'theme.enable_precompilation' => [ 'type' => 'bool', 'description' => 'If false, theme compilation will not use any precompiled file setup optimization.)', 'default' => true, diff --git a/setup/compiler.class.inc.php b/setup/compiler.class.inc.php index 58a5d4ce21..04c22011c0 100644 --- a/setup/compiler.class.inc.php +++ b/setup/compiler.class.inc.php @@ -2911,13 +2911,13 @@ EOF; $bHasCompiled = static::$oThemeHandlerService->CompileTheme($sThemeId, true, $this->sCompilationTimeStamp, $aThemeParameters, $aImportsPaths, $sTempTargetDir); if ($bHasCompiled) { - if (utils::GetConfig()->Get('theme_precompilation_enabled')){ + if (utils::GetConfig()->Get('theme.enable_precompilation')){ if (utils::IsDevelopmentEnvironment() && ! empty(trim($sPrecompiledStylesheet))) { //help developers to detect & push theme precompilation changes $sInitialPrecompiledFilePath = null; - $aRootDirs = $this->oFactory->getRootDirs(); + $aRootDirs = $this->oFactory->GetRootDirs(); if (is_array($aRootDirs) && count($aRootDirs) !== 0) { - foreach ($this->oFactory->getRootDirs() as $sRootDir) { + foreach ($this->oFactory->GetRootDirs() as $sRootDir) { $sCurrentFile = $sRootDir. DIRECTORY_SEPARATOR . $sPrecompiledStylesheet; if (is_file($sCurrentFile) && is_writable($sCurrentFile)) { $sInitialPrecompiledFilePath = $sCurrentFile; @@ -2942,7 +2942,7 @@ EOF; $this->Log(sprintf('Themes compilation took: %.3f ms for %d themes.', (microtime(true) - $fStart)*1000.0, count($aThemes))); } - public static function setThemeHandlerService(ThemeHandlerService $oThemeHandlerService): void { + public static function SetThemeHandlerService(ThemeHandlerService $oThemeHandlerService): void { self::$oThemeHandlerService = $oThemeHandlerService; } @@ -2957,7 +2957,7 @@ EOF; * @return string : file path of latest precompiled file to use for setup */ public function UseLatestPrecompiledFile(string $sTempTargetDir, string $sPrecompiledFileUri, $sPostCompilationLatestPrecompiledFile, $sThemeId) : ?string { - if (! utils::GetConfig()->Get('theme_precompilation_enabled')) { + if (! utils::GetConfig()->Get('theme.enable_precompilation')) { return null; } diff --git a/setup/modelfactory.class.inc.php b/setup/modelfactory.class.inc.php index 32a9da298c..ef2f40b024 100644 --- a/setup/modelfactory.class.inc.php +++ b/setup/modelfactory.class.inc.php @@ -1838,7 +1838,7 @@ EOF; /** * @return mixed */ - public function getRootDirs() { + public function GetRootDirs() { return $this->aRootDirs; } } diff --git a/test/setup/MFCompilerTest.php b/test/setup/MFCompilerTest.php index 49127ffcb6..04107d79f2 100644 --- a/test/setup/MFCompilerTest.php +++ b/test/setup/MFCompilerTest.php @@ -115,7 +115,7 @@ class MFCompilerTest extends ItopTestCase { */ public function testUseLatestPrecompiledFile(string $sTempTargetDir, string $sPrecompiledFileUri, string $sPostCompilationLatestPrecompiledFile, string $sThemeDir, ?string $sExpectedReturn, bool $bDisableThemePrecompilationViaConf = false){ if ($bDisableThemePrecompilationViaConf){ - utils::GetConfig()->Set('theme_precompilation_enabled', false); + utils::GetConfig()->Set('theme.enable_precompilation', false); } $sRes = $this->oMFCompiler->UseLatestPrecompiledFile($sTempTargetDir, $sPrecompiledFileUri, $sPostCompilationLatestPrecompiledFile, $sThemeDir); $this->assertEquals($sExpectedReturn, $sRes); @@ -186,7 +186,7 @@ class MFCompilerTest extends ItopTestCase { //CompileTheme($sThemeId, $bSetup = false, $sSetupCompilationTimestamp="", $aThemeParameters = null, $aImportsPaths = null, $sWorkingPath = null) - MFCompiler::setThemeHandlerService($oThemeHandlerService); + MFCompiler::SetThemeHandlerService($oThemeHandlerService); $this->oMFCompiler->CompileThemes($oBrandingNode, $this->sTmpDir); } }