Ignore:
Timestamp:
Mar 9, 2015, 4:46:24 PM (9 years ago)
Author:
knut
Message:

Altered the path of stored response files from [tmpPath]/[serviceProvider]_[cpid].xml to [tmpPath]/[serviceName]_[cpid].xml. Added support for a new parameter, libPath, in the [main] block of main.cfg. The libPath parameter is interpreted as the absolute path of the directory containing library files. If the libPath parameter is set, it will override the metapath parameter such that library files are loaded from [libPath]/[serviceProvider] instead of [CWD]/[metapath]/[serviceProvider]. Added the option to disable the metapath parameter (for security reasons) at compile time: If the Zoo kernel is compiled with the preprocessor directive IGNORE_METAPATH, the metapath will be set to the empty string. Note however, that the libPath and IGNORE_METAPATH options so far only work for C and PHP; the functions for loading libraries written in other languages should be modified correspondingly before the documentation is updated. See also ticket no. 112 (http://www.zoo-project.org/trac/ticket/112). Fixed some spelling errors and modified the language in some of the messages returned by the Zoo kernel.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service_internal_php.c

    r587 r605  
    186186  char ntmp[1024];
    187187  getcwd(ntmp,1024);
    188   map* tmp=getMap(request,"metapath");
    189 
     188   
     189  map* libp = getMapFromMaps(m, "main", "libPath"); // KLa 
    190190  int res=SERVICE_FAILED;
    191191
    192   tmp=getMap(s->content,"serviceProvider");
     192  map* tmp=getMap(s->content,"serviceProvider");
     193  if (tmp == NULL || tmp->value == NULL) {
     194          return errorException(m, "Missing serviceProvider (library file)", "NoApplicableCode", NULL);
     195  }
     196 
    193197  map* cwd=getMapFromMaps(m,"lenv","cwd");
    194   map* mp=getMap(request,"metapath");
     198#ifdef IGNORE_METAPATH
     199  map* mp = createMap("metapath", "");
     200#else 
     201  map* mp = getMap(request, "metapath");
     202#endif
    195203  char *scriptName;
    196   if(mp!=NULL && strlen(mp->value)>0){
    197     scriptName=(char*)malloc((strlen(cwd->value)+strlen(mp->value)+strlen(tmp->value)+3)*sizeof(char));
    198     sprintf(scriptName,"%s/%s/%s",cwd->value,mp->value,tmp->value);
    199   }else{
    200     scriptName=(char*)malloc((strlen(cwd->value)+strlen(tmp->value)+2)*sizeof(char));
    201     sprintf(scriptName,"%s/%s",cwd->value,tmp->value);
    202   }
     204 
     205  if (libp != NULL && libp->value != NULL) {
     206        scriptName = (char*) malloc((strlen(libp->value) + strlen(tmp->value) + 2)*sizeof(char));
     207    sprintf (scriptName, "%s/%s", libp->value, tmp->value);     
     208  }
     209  else {       
     210    if(mp!=NULL && strlen(mp->value)>0){
     211      scriptName=(char*)malloc((strlen(cwd->value)+strlen(mp->value)+strlen(tmp->value)+3)*sizeof(char));
     212      sprintf(scriptName,"%s/%s/%s",cwd->value,mp->value,tmp->value);
     213    }else{
     214      scriptName=(char*)malloc((strlen(cwd->value)+strlen(tmp->value)+2)*sizeof(char));
     215      sprintf(scriptName,"%s/%s",cwd->value,tmp->value);
     216    }
     217  }
    203218  zend_file_handle iscript;
    204219  iscript.type=ZEND_HANDLE_FD;
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png