Skip to content

Commit

Permalink
Merge pull request #6333 from geographika/web-rfc-133
Browse files Browse the repository at this point in the history
Remove LOG, EXTENT, MAXSCALE, and MINSCALE keywords from WEB object
  • Loading branch information
geographika committed May 24, 2021
2 parents 8828344 + 6fed096 commit ca05c15
Show file tree
Hide file tree
Showing 22 changed files with 1,921 additions and 2,025 deletions.
1 change: 0 additions & 1 deletion apache/mod_mapserver.c
Expand Up @@ -333,7 +333,6 @@ mapserver_handler (request_rec *r)

end_request:
if(mapserv) {
msCGIWriteLog(mapserv,MS_FALSE);
mapserv->request->ParamNames = NULL;
mapserv->request->ParamValues = NULL;
mapserv->request->postrequest = NULL;
Expand Down
3 changes: 0 additions & 3 deletions mapcopy.c
Expand Up @@ -430,7 +430,6 @@ int msCopyLabel(labelObj *dst, const labelObj *src)
int msCopyWeb(webObj *dst, const webObj *src, mapObj *map)
{

MS_COPYSTRING(dst->log, src->log);
MS_COPYSTRING(dst->imagepath, src->imagepath);
MS_COPYSTRING(dst->imageurl, src->imageurl);
dst->map = map;
Expand All @@ -444,8 +443,6 @@ int msCopyWeb(webObj *dst, const webObj *src, mapObj *map)
MS_COPYSTRING(dst->empty, src->empty);
MS_COPYSTRING(dst->error, src->error);

MS_COPYRECT(&(dst->extent), &(src->extent));

MS_COPYSTELEM(minscaledenom);
MS_COPYSTELEM(maxscaledenom);
MS_COPYSTRING(dst->mintemplate, src->mintemplate);
Expand Down
20 changes: 0 additions & 20 deletions mapfile.c
Expand Up @@ -5567,13 +5567,11 @@ char* msWriteQueryMapToString(queryMapObj *querymap)
*/
void initWeb(webObj *web)
{
web->extent.minx = web->extent.miny = web->extent.maxx = web->extent.maxy = -1.0;
web->template = NULL;
web->header = web->footer = NULL;
web->error = web->empty = NULL;
web->mintemplate = web->maxtemplate = NULL;
web->minscaledenom = web->maxscaledenom = -1;
web->log = NULL;
web->imagepath = msStrdup("");
web->temppath = NULL;
web->imageurl = msStrdup("");
Expand All @@ -5596,7 +5594,6 @@ void freeWeb(webObj *web)
msFree(web->empty);
msFree(web->maxtemplate);
msFree(web->mintemplate);
msFree(web->log);
msFree(web->imagepath);
msFree(web->temppath);
msFree(web->imageurl);
Expand All @@ -5614,14 +5611,12 @@ static void writeWeb(FILE *stream, int indent, webObj *web)
writeString(stream, indent, "BROWSEFORMAT", "text/html", web->browseformat);
writeString(stream, indent, "EMPTY", NULL, web->empty);
writeString(stream, indent, "ERROR", NULL, web->error);
writeExtent(stream, indent, "EXTENT", web->extent);
writeString(stream, indent, "FOOTER", NULL, web->footer);
writeString(stream, indent, "HEADER", NULL, web->header);
writeString(stream, indent, "IMAGEPATH", "", web->imagepath);
writeString(stream, indent, "TEMPPATH", NULL, web->temppath);
writeString(stream, indent, "IMAGEURL", "", web->imageurl);
writeString(stream, indent, "LEGENDFORMAT", "text/html", web->legendformat);
writeString(stream, indent, "LOG", NULL, web->log);
writeNumber(stream, indent, "MAXSCALEDENOM", -1, web->maxscaledenom);
writeString(stream, indent, "MAXTEMPLATE", NULL, web->maxtemplate);
writeHashTable(stream, indent, "METADATA", &(web->metadata));
Expand Down Expand Up @@ -5682,16 +5677,6 @@ int loadWeb(webObj *web, mapObj *map)
case(ERROR):
if(getString(&web->error) == MS_FAILURE) return(-1);
break;
case(EXTENT):
if(getDouble(&(web->extent.minx)) == -1) return(-1);
if(getDouble(&(web->extent.miny)) == -1) return(-1);
if(getDouble(&(web->extent.maxx)) == -1) return(-1);
if(getDouble(&(web->extent.maxy)) == -1) return(-1);
if (!MS_VALID_EXTENT(web->extent)) {
msSetError(MS_MISCERR, "Given web extent is invalid. Check that it is in the form: minx, miny, maxx, maxy", "loadWeb()");
return(-1);
}
break;
case(FOOTER):
if(getString(&web->footer) == MS_FAILURE) return(-1); /* getString() cleans up previously allocated string */
if(msyysource == MS_URL_TOKENS) {
Expand Down Expand Up @@ -5728,10 +5713,6 @@ int loadWeb(webObj *web, mapObj *map)
web->legendformat = NULL; /* there is a default */
if(getString(&web->legendformat) == MS_FAILURE) return(-1);
break;
case(LOG):
if(getString(&web->log) == MS_FAILURE) return(-1);
break;
case(MAXSCALE):
case(MAXSCALEDENOM):
if(getDouble(&web->maxscaledenom) == -1) return(-1);
break;
Expand All @@ -5741,7 +5722,6 @@ int loadWeb(webObj *web, mapObj *map)
case(METADATA):
if(loadHashTable(&(web->metadata)) != MS_SUCCESS) return(-1);
break;
case(MINSCALE):
case(MINSCALEDENOM):
if(getDouble(&web->minscaledenom) == -1) return(-1);
break;
Expand Down
3,791 changes: 1,892 additions & 1,899 deletions maplexer.c

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion maplexer.l
Expand Up @@ -316,7 +316,6 @@ char path[MS_MAXPATHLEN];
<INITIAL>linecap { MS_LEXER_RETURN_TOKEN(LINECAP); }
<INITIAL>linejoin { MS_LEXER_RETURN_TOKEN(LINEJOIN); }
<INITIAL>linejoinmaxsize { MS_LEXER_RETURN_TOKEN(LINEJOINMAXSIZE); }
<INITIAL>log { MS_LEXER_RETURN_TOKEN(LOG); }
<INITIAL,URL_VARIABLE>map { MS_LEXER_RETURN_TOKEN(MAP); }
<INITIAL>marker { MS_LEXER_RETURN_TOKEN(MARKER); }
<INITIAL>markersize { MS_LEXER_RETURN_TOKEN(MARKERSIZE); }
Expand Down
22 changes: 7 additions & 15 deletions mapscript/php/web.c
Expand Up @@ -74,8 +74,7 @@ PHP_METHOD(webObj, __get)

php_web = MAPSCRIPT_OBJ_P(php_web_object, zobj);

IF_GET_STRING("log", php_web->web->log)
else IF_GET_STRING("imagepath", php_web->web->imagepath)
IF_GET_STRING("imagepath", php_web->web->imagepath)
else IF_GET_STRING("template", php_web->web->template)
else IF_GET_STRING("imageurl", php_web->web->imageurl)
else IF_GET_STRING("temppath", php_web->web->temppath)
Expand All @@ -90,12 +89,11 @@ PHP_METHOD(webObj, __get)
else IF_GET_STRING("queryformat", php_web->web->queryformat)
else IF_GET_STRING("legendformat", php_web->web->legendformat)
else IF_GET_STRING("browseformat", php_web->web->browseformat)
else IF_GET_OBJECT("extent", mapscript_ce_rect, php_web->extent, &php_web->web->extent)
else IF_GET_OBJECT("metadata", mapscript_ce_hashtable, php_web->metadata, &php_web->web->metadata)
else IF_GET_OBJECT("validation", mapscript_ce_hashtable, php_web->validation, &php_web->web->validation)
else {
mapscript_throw_exception("Property '%s' does not exist in this object." TSRMLS_CC, property);
}
else IF_GET_OBJECT("metadata", mapscript_ce_hashtable, php_web->metadata, &php_web->web->metadata)
else IF_GET_OBJECT("validation", mapscript_ce_hashtable, php_web->validation, &php_web->web->validation)
else {
mapscript_throw_exception("Property '%s' does not exist in this object." TSRMLS_CC, property);
}
}

PHP_METHOD(webObj, __set)
Expand All @@ -116,8 +114,7 @@ PHP_METHOD(webObj, __set)

php_web = MAPSCRIPT_OBJ_P(php_web_object, zobj);

IF_SET_STRING("log", php_web->web->log, value)
else IF_SET_STRING("imagepath", php_web->web->imagepath, value)
IF_SET_STRING("imagepath", php_web->web->imagepath, value)
else IF_SET_STRING("template", php_web->web->template, value)
else IF_SET_STRING("imageurl", php_web->web->imageurl, value)
else IF_SET_STRING("temppath", php_web->web->temppath, value)
Expand Down Expand Up @@ -216,7 +213,6 @@ PHP_METHOD(webObj, free)

php_web = MAPSCRIPT_OBJ_P(php_web_object, zobj);

MAPSCRIPT_DELREF(php_web->extent);
MAPSCRIPT_DELREF(php_web->metadata);
MAPSCRIPT_DELREF(php_web->validation);
}
Expand Down Expand Up @@ -259,7 +255,6 @@ static zend_object *mapscript_web_create_object(zend_class_entry *ce TSRMLS_DC)
php_web->zobj.handlers = &mapscript_web_object_handlers;

MAPSCRIPT_INIT_PARENT(php_web->parent);
ZVAL_UNDEF(&php_web->extent);
ZVAL_UNDEF(&php_web->metadata);
ZVAL_UNDEF(&php_web->validation);

Expand All @@ -273,7 +268,6 @@ static void mapscript_web_free_object(zend_object *object)
php_web = (php_web_object *)((char *)object - XtOffsetOf(php_web_object, zobj));

MAPSCRIPT_FREE_PARENT(php_web->parent);
MAPSCRIPT_DELREF(php_web->extent);
MAPSCRIPT_DELREF(php_web->metadata);
MAPSCRIPT_DELREF(php_web->validation);

Expand Down Expand Up @@ -307,7 +301,6 @@ static void mapscript_web_object_destroy(void *object TSRMLS_DC)
MAPSCRIPT_FREE_OBJECT(php_web);

MAPSCRIPT_FREE_PARENT(php_web->parent);
MAPSCRIPT_DELREF(php_web->extent);
MAPSCRIPT_DELREF(php_web->metadata);
MAPSCRIPT_DELREF(php_web->validation);

Expand All @@ -327,7 +320,6 @@ static zend_object_value mapscript_web_object_new(zend_class_entry *ce TSRMLS_DC
&mapscript_web_object_destroy TSRMLS_CC);

MAPSCRIPT_INIT_PARENT(php_web->parent);
php_web->extent = NULL;
php_web->metadata = NULL;
php_web->validation = NULL;

Expand Down
1 change: 0 additions & 1 deletion mapserv.c
Expand Up @@ -306,7 +306,6 @@ int main(int argc, char *argv[])
(requestendtime.tv_sec+requestendtime.tv_usec/1.0e6)-
(requeststarttime.tv_sec+requeststarttime.tv_usec/1.0e6) );
}
msCGIWriteLog(mapserv,MS_FALSE);
msFreeMapServObj(mapserv);
#ifdef USE_FASTCGI
/* FCGI_ --- return to top of loop */
Expand Down
1 change: 0 additions & 1 deletion mapserv.h
Expand Up @@ -53,7 +53,6 @@
*/
#define TEMPLATE_TYPE(s) (((strncmp("http://", s, 7) == 0) || (strncmp("https://", s, 8) == 0) || (strncmp("ftp://", s, 6)) == 0) ? MS_URL : MS_FILE)

MS_DLL_EXPORT int msCGIWriteLog(mapservObj *mapserv, int show_error);
MS_DLL_EXPORT void msCGIWriteError(mapservObj *mapserv);
MS_DLL_EXPORT mapObj *msCGILoadMap(mapservObj *mapserv);
int msCGISetMode(mapservObj *mapserv);
Expand Down
3 changes: 0 additions & 3 deletions mapserver.h
Expand Up @@ -959,9 +959,6 @@ Serves as a container for various run-time web application definitions like temp
%mutable;
#endif /* SWIG */

rectObj extent; ///< The clipping extent - see :ref:`EXTENT <mapfile-web-extent>`

char *log; ///< TODO - deprecated - see :ref:`LOG <mapfile-web-log>`
char *imagepath; ///< Filesystem path to temporary image location - see :ref:`IMAGEPATH <mapfile-web-imagepath>`
char *imageurl; ///< URL to temporary image location - see :ref:`IMAGEURL <mapfile-web-imageurl>`
char *temppath; ///< See :ref:`TEMPPATH <mapfile-web-temppath>`
Expand Down
51 changes: 0 additions & 51 deletions mapservutil.c
Expand Up @@ -45,54 +45,6 @@ static char *modeStrings[23] = {"BROWSE","ZOOMIN","ZOOMOUT","MAP","LEGEND","LEGE
"INDEXQUERY","TILE","OWS", "WFS", "MAPLEGEND", "MAPLEGENDICON"
};

int msCGIWriteLog(mapservObj *mapserv, int show_error)
{
FILE *stream;
int i;
time_t t;
char szPath[MS_MAXPATHLEN];

if(!mapserv) return(MS_SUCCESS);
if(!mapserv->map) return(MS_SUCCESS);
if(!mapserv->map->web.log) return(MS_SUCCESS);

if((stream = fopen(msBuildPath(szPath, mapserv->map->mappath,
mapserv->map->web.log),"a")) == NULL) {
msSetError(MS_IOERR, "%s", "msCGIWriteLog()", mapserv->map->web.log);
return(MS_FAILURE);
}

t = time(NULL);
fprintf(stream,"%s,",msStringChop(ctime(&t)));
fprintf(stream,"%d,",(int)getpid());

if(getenv("REMOTE_ADDR") != NULL)
fprintf(stream,"%s,",getenv("REMOTE_ADDR"));
else
fprintf(stream,"NULL,");

fprintf(stream,"%s,",mapserv->map->name);
fprintf(stream,"%d,",mapserv->Mode);

fprintf(stream,"%f %f %f %f,", mapserv->map->extent.minx, mapserv->map->extent.miny, mapserv->map->extent.maxx, mapserv->map->extent.maxy);

fprintf(stream,"%f %f,", mapserv->mappnt.x, mapserv->mappnt.y);

for(i=0; i<mapserv->NumLayers; i++)
fprintf(stream, "%s ", mapserv->Layers[i]);
fprintf(stream,",");

if(show_error == MS_TRUE)
msWriteError(stream);
else
fprintf(stream, "normal execution");

fprintf(stream,"\n");

fclose(stream);
return(MS_SUCCESS);
}

void msCGIWriteError(mapservObj *mapserv)
{
errorObj *ms_error = msGetErrorObj();
Expand All @@ -102,8 +54,6 @@ void msCGIWriteError(mapservObj *mapserv)
return;
}

msCGIWriteLog(mapserv,MS_TRUE);

if(!mapserv || !mapserv->map) {
msIO_setHeader("Content-Type","text/html");
msIO_sendHeaders();
Expand Down Expand Up @@ -1915,7 +1865,6 @@ int msCGIHandler(const char *query_string, void **out_buffer, size_t *buffer_len
(requestendtime.tv_sec+requestendtime.tv_usec/1.0e6)-
(requeststarttime.tv_sec+requeststarttime.tv_usec/1.0e6) );
}
msCGIWriteLog(mapserv,MS_FALSE);
msFreeMapServObj(mapserv);
}

Expand Down
6 changes: 0 additions & 6 deletions maptemplate.c
Expand Up @@ -182,12 +182,6 @@ int setExtent(mapservObj *mapserv)
return MS_SUCCESS;
}

int checkWebExtent(mapservObj *mapserv)
{
(void)mapserv;
return MS_SUCCESS;
}

int checkWebScale(mapservObj *mapserv)
{
int status;
Expand Down
5 changes: 2 additions & 3 deletions msautotest/renderers/chartlayer_bar.map
Expand Up @@ -22,15 +22,14 @@ IMAGECOLOR 255 255 255
# Start of web interface definition
#
WEB
MINSCALE 2000000
MAXSCALE 50000000
MINSCALEDENOM 2000000
MAXSCALEDENOM 50000000
#
# On Windows systems, /tmp and /tmp/ms_tmp/ should be created at the root
# of the drive where the .MAP file resides.
#
IMAGEPATH "/tmp/ms_tmp/"
IMAGEURL "/ms_tmp/"
# LOG "/tmp/gmap.log"
END


Expand Down
5 changes: 2 additions & 3 deletions msautotest/renderers/chartlayer_vbar.map
Expand Up @@ -22,15 +22,14 @@ IMAGECOLOR 255 255 255
# Start of web interface definition
#
WEB
MINSCALE 2000000
MAXSCALE 50000000
MINSCALEDENOM 2000000
MAXSCALEDENOM 50000000
#
# On Windows systems, /tmp and /tmp/ms_tmp/ should be created at the root
# of the drive where the .MAP file resides.
#
IMAGEPATH "/tmp/ms_tmp/"
IMAGEURL "/ms_tmp/"
# LOG "/tmp/gmap.log"
END


Expand Down
4 changes: 2 additions & 2 deletions msautotest/wxs/wms_time1.map
Expand Up @@ -65,8 +65,8 @@ FONTSET ./etc/fonts.txt
# Start of web interface definition
#
WEB
MINSCALE 2000000
MAXSCALE 50000000
MINSCALEDENOM 2000000
MAXSCALEDENOM 50000000

IMAGEPATH "/tmp/ms_tmp/"
IMAGEURL "/ms_tmp/"
Expand Down
4 changes: 2 additions & 2 deletions msautotest/wxs/wms_time1_postgis.map
Expand Up @@ -65,8 +65,8 @@ FONTSET ./etc/fonts.txt
# Start of web interface definition
#
WEB
MINSCALE 2000000
MAXSCALE 50000000
MINSCALEDENOM 2000000
MAXSCALEDENOM 50000000

IMAGEPATH "/tmp/ms_tmp/"
IMAGEURL "/ms_tmp/"
Expand Down
4 changes: 2 additions & 2 deletions msautotest/wxs/wms_time2.map
Expand Up @@ -25,8 +25,8 @@ FONTSET ./etc/fonts.txt
# Start of web interface definition
#
WEB
MINSCALE 2000000
MAXSCALE 50000000
MINSCALEDENOM 2000000
MAXSCALEDENOM 50000000

IMAGEPATH "/tmp/ms_tmp/"
IMAGEURL "/ms_tmp/"
Expand Down
4 changes: 2 additions & 2 deletions msautotest/wxs/wms_time2_postgis.map
Expand Up @@ -25,8 +25,8 @@ FONTSET ./etc/fonts.txt
# Start of web interface definition
#
WEB
MINSCALE 2000000
MAXSCALE 50000000
MINSCALEDENOM 2000000
MAXSCALEDENOM 50000000

IMAGEPATH "/tmp/ms_tmp/"
IMAGEURL "/ms_tmp/"
Expand Down
4 changes: 2 additions & 2 deletions msautotest/wxs/wms_time_pattern.map
Expand Up @@ -258,8 +258,8 @@ FONTSET ./etc/fonts.txt
# Start of web interface definition
#
WEB
MINSCALE 2000000
MAXSCALE 50000000
MINSCALEDENOM 2000000
MAXSCALEDENOM 50000000

IMAGEPATH "/tmp/ms_tmp/"
IMAGEURL "/ms_tmp/"
Expand Down
4 changes: 2 additions & 2 deletions msautotest/wxs/wms_time_pattern_12_13_test.map
Expand Up @@ -55,8 +55,8 @@ FONTSET ./etc/fonts.txt
# Start of web interface definition
#
WEB
MINSCALE 2000000
MAXSCALE 50000000
MINSCALEDENOM 2000000
MAXSCALEDENOM 50000000

IMAGEPATH "/tmp/ms_tmp/"
IMAGEURL "/ms_tmp/"
Expand Down

0 comments on commit ca05c15

Please sign in to comment.