-
-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache - white list of parameters for md5 key #200
Conversation
Use a white list of parameters for the constitution of a unique MD5 key (between WWW and CLI cache generation)
Location search helper
a annuler
This reverts commit 4cb0f8a.
optimisation de requêtes wms pour accélérer les réponses.
This reverts commit cc4e4ca.
This reverts commit 55d6596.
The mask layer name must be 'mask'.
function search() { | ||
$localConfig = jApp::configPath('localconfig.ini.php'); | ||
$ini = new jIniFileModifier($localConfig); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, you shouldn't use jIniFileModifier to only read an ini file : it is very slow compare to parse_ini_file().
Second, all parameters into localconfig.ini.php are merged at run time with other configuration files, so in fact, you can access to your parameters with jApp::config()->localiz_plugin
which is an array (ex: jApp::config()->localiz_plugin['db_host']
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@laurentj we have to check all the lizmap code for this point.
// conf DB | ||
$localConfFile = jApp::configPath('localconfig.ini.php'); | ||
if (file_exists($localConfFile)) { | ||
$ini = new jIniFileModifier($localConfFile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You already have a such instantiated object in $this->entrypoint->localConfigIni
.
$ini->setValue('db_port', '5432', 'localiz_plugin'); | ||
$ini->setValue('db_database', 'refgeo2', 'localiz_plugin'); | ||
$ini->setValue('db_user', 'visu', 'localiz_plugin'); | ||
$ini->setValue('db_password', 'visu', 'localiz_plugin'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to put these parameters into the profiles.ini.php (and so you don't have to create a "virtual" profil into search(), and it is more performant). And you should verify that there isn't already these parameters, to not overwrite values changed by the user.
To create a such profil, use instead the method declareDbProfile
:
$this->declareDbProfile('localiz_plugin', array('driver'=>'pgsql', 'host'=>'...',...), false);
$ini->setValue('db_database', 'refgeo2', 'localiz_plugin'); | ||
$ini->setValue('db_user', 'visu', 'localiz_plugin'); | ||
$ini->setValue('db_password', 'visu', 'localiz_plugin'); | ||
$ini->setValue('db_query', "select oid, geometrytype, value, label, longlabel, xmin, ymin, xmax, ymax from MYTABLE where label like '%s%%'", 'localiz_plugin'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok for this parameter to put it into the localconfig.ini.php
$this->entrypoint->localConfigIni->setValue(...);
{ | ||
// creation du mini dock | ||
// id, titre, contenu html, index, [chemin vers css], [chemin vers js] | ||
$bp = jApp::config()->urlengine["basePath"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also use the shortcut $bp = jApp::urlBasePath()
;-)
needed to comment the "reverse" order
opacityLayers.reverse(); | ||
//printLayers.reverse(); | ||
//styleLayers.reverse(); | ||
//opacityLayers.reverse(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @xcaeag you can't comment this lines, because this correction is available for QGIS 2.18 and not for 2.14.
The fix has to be more complex.
Hi @xcaeag, |
René-Luc, you can close this PR, the latest additions (localiz plugin ...) are quite specific to the water agency ... |
With WMTS support in QGIS Server 3.* we will probably changed the way to cached tiles |
Use a white list of parameters for the constitution of a unique MD5 key
Between WWW and CLI cache generation, sometimes, the list differ ("exception" param)
Seen with René-Luc : The list still needed to be adapted.