Permalink
Browse files

RFC109: allow substitutions from env vars and in processing entries (#…

  • Loading branch information...
tbonfort committed Feb 11, 2015
1 parent a4375e7 commit 65bce48b645e46911342263531d94dc5bcec2b17
Showing with 14 additions and 1 deletion.
  1. +5 −0 mapfile.c
  2. +7 −0 maplayer.c
  3. +1 −0 mapserver.h
  4. +1 −1 msautotest
View
@@ -6756,6 +6756,7 @@ static void layerSubstituteString(layerObj *layer, const char *from, const char
/* The bindvalues are most useful when able to substitute values from the URL */
hashTableSubstituteString(&layer->bindvals, from, to);
hashTableSubstituteString(&layer->metadata, from, to);
+ msLayerSubstituteProcessing( layer, from, to );
for(c=0; c<layer->numclasses;c++) {
classSubstituteString(layer->class[c], from, to);
}
@@ -6873,6 +6874,10 @@ void msApplyDefaultSubstitutions(mapObj *map)
}
char *_get_param_value(const char *key, char **names, char **values, int npairs) {
+
+ if(getenv(key)) { /* envirronment override */
+ return getenv(key);
+ }
while(npairs) {
npairs--;
if(strcasecmp(key, names[npairs]) == 0) {
View
@@ -1123,6 +1123,13 @@ msLayerSetProcessingKey( layerObj *layer, const char *key, const char *value)
}
}
+void msLayerSubstituteProcessing( layerObj *layer, const char *from, const char *to ) {
+ int i;
+ for( i = 0; i < layer->numprocessing; i++ ) {
+ layer->processing[i] = msCaseReplaceSubstring(layer->processing[i], from, to);
+ }
+}
+
void msLayerAddProcessing( layerObj *layer, const char *directive )
{
View
@@ -2381,6 +2381,7 @@ void msPopulateTextSymbolForLabelAndString(textSymbolObj *ts, labelObj *l, char
MS_DLL_EXPORT char *msLayerGetProcessing( layerObj *layer, int proc_index);
MS_DLL_EXPORT char *msLayerGetProcessingKey( layerObj *layer, const char *);
MS_DLL_EXPORT int msLayerClearProcessing( layerObj *layer );
+ MS_DLL_EXPORT void msLayerSubstituteProcessing( layerObj *layer, const char *from, const char *to );
MS_DLL_EXPORT char *msLayerGetFilterString( layerObj *layer );
MS_DLL_EXPORT int msLayerEncodeShapeAttributes( layerObj *layer, shapeObj *shape);
Submodule msautotest updated from 947c31 to 44fa17

0 comments on commit 65bce48

Please sign in to comment.