tmp work: save timestamp + few fixes

This commit is contained in:
odain
2020-07-21 23:22:50 +02:00
parent 307713d326
commit 08414296b6
4 changed files with 84 additions and 17 deletions

View File

@@ -60,6 +60,7 @@ class MFCompiler
protected $aSnippets;
protected $aRelations;
protected $sEnvironment;
protected $sCompilationTimeStamp;
public function __construct($oModelFactory, $sEnvironment)
{
@@ -74,7 +75,8 @@ class MFCompiler
$this->sMainPHPCode .= " * This file was automatically generated by the compiler on ".date('Y-m-d H:i:s')." -- DO NOT EDIT\n";
$this->sMainPHPCode .= " */\n";
$this->sMainPHPCode .= "\n";
$this->sMainPHPCode .= "define('COMPILATION_TIMESTAMP', '".microtime(true)."');\n";
$this->sCompilationTimeStamp = microtime(true);
$this->sMainPHPCode .= "define('COMPILATION_TIMESTAMP', '".$this->sCompilationTimeStamp."');\n";
$this->aSnippets = array();
$this->aRelations = array();
}
@@ -96,6 +98,14 @@ class MFCompiler
{
return $this->aLog;
}
/**
* @return mixed
*/
public function GetCompilationTimeStamp()
{
return $this->sCompilationTimeStamp;
}
/**
@@ -2759,7 +2769,7 @@ EOF;
{
$this->Log("Precompiled file not found: '$sPrecompiledFile'");
}
ThemeHandler::CompileTheme($sThemeId, true, $aThemeParameters, $aImportsPaths, $sTempTargetDir);
ThemeHandler::CompileTheme($sThemeId, $this->GetCompilationTimeStamp(), $aThemeParameters, $aImportsPaths, $sTempTargetDir);
}
$this->Log(sprintf('Themes compilation took: %.3f ms for %d themes.', (microtime(true) - $fStart)*1000.0, count($aThemes)));
}