Skip to content

Commit

Permalink
cache lizmap version from xml to globalconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
nworr committed Feb 15, 2023
1 parent 33a1ca2 commit 145ab73
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lizmap/modules/lizmap/classes/lizmapServices.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,7 @@ public function __construct($readConfigPath, $globalConfig, $ldapEnabled, $varPa
// may be set to false if already set in the php.ini
$userAgent = $readConfigPath['services']['userAgent'];
} else {
$appInfos = \Jelix\Core\Infos\AppInfos::load();
$userAgent = 'Lizmap '.$appInfos->version;
$userAgent = $globalConfig->lizmap['version'];
}
if ($userAgent && !ini_get('user_agent')) {
ini_set('user_agent', $userAgent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public function atStart($config)

public function onModule($config, $moduleName, $modulePath, $xml)
{
if ($moduleName == 'lizmap') {
// we store the version into the configuration file, it avoids
// to read it from the project.xml file, as it is an heavy process.
$config->lizmap['version'] = (string) $xml->info->version;
}
}

public function atEnd($config)
Expand Down

0 comments on commit 145ab73

Please sign in to comment.