Skip to content

Commit

Permalink
test properties
Browse files Browse the repository at this point in the history
  • Loading branch information
nworr committed Feb 16, 2023
1 parent 145ab73 commit 54ffb97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lizmap/modules/lizmap/classes/lizmapServices.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,10 @@ public function __construct($readConfigPath, $globalConfig, $ldapEnabled, $varPa
if (isset($readConfigPath['services']['userAgent'])) {
// may be set to false if already set in the php.ini
$userAgent = $readConfigPath['services']['userAgent'];
} else {
} elseif (property_exists($globalConfig, 'lizmap')) {
$userAgent = $globalConfig->lizmap['version'];
} else {
$userAgent = 'lizmap';
}
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 @@ -30,7 +30,9 @@ 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;
if (property_exists($config, 'lizmap')) {
$config->lizmap['version'] = (string) $xml->info->version;
}
}
}

Expand Down

0 comments on commit 54ffb97

Please sign in to comment.