# # # # get_web_server_root_path() # # # # Returns the WebServerRoot path # i.e. "c:\_cvs_sawmill_72\LogAnalysisInfo\WebServerRoot" subroutine(get_web_server_root_path, ( # debug_message("\n#### get_web_server_root_path() START \n"); # Set cgi_with_getdirect in case both temporary pathname and URL are empty.\ # This indicates that we are using the "new" CGI mode where files will # be served via getdirect, so we need to write it to WebServerRoot call fileref(). # bool is_cgi_with_getdirect = (preferences.server.temporary_directory_pathname eq "") or (preferences.server.cgi_directory eq ""); # bool is_webserver_mode = !CGI_MODE; # string web_server_root_path; # if (is_webserver_mode or is_cgi_with_getdirect) then ( # web_server_root_path = LOGANALYSISINFO_DIRECTORY; # 2009-01-26 - GMF - Moved this up here, instead of below the if/else. Otherwise, it adds WebServerRoot to # the end of temporary_directory_pathname, which is wrong--temporary_directory_pathname *is* # the web server root directory. # web_server_root_path .= "WebServerRoot" . "/"; # 2009-04-02 - GMF - This code is using temporary_directory_pathname to compute the path. That's a problem if we want this # path so we can write a file to it--we're supposed to write files to LogAnalysisInfo/WebServerRoot/etc # and then fileref() will *copy* those files to temporary_directory_pathname if necessary. So normal usage, # even in CGI mode without getdirect, is to write files to WebServerRoot, which means that the code above # is the right code in all cases, included CGI without getdirect. Therefore, I am commenting out the code below. # ) # else ( # # # cgi-mode without cgi_with_getdirect # # web_server_root_path = @("preferences.server.temporary_directory_pathname"); # # if (!ends_with(web_server_root_path, "/") and !ends_with(web_server_root_path, "\\")) then ( # web_server_root_path .= "/"; # ); # ); # debug_message("#### is_cgi_with_getdirect: " . is_cgi_with_getdirect . "\n"); # debug_message("#### is_webserver_mode: " . is_webserver_mode . "\n"); # debug_message("#### web_server_root_path: " . web_server_root_path . "\n"); # # KHP 04/August/2009 - Cleaned this up my moving all out commented code up # string web_server_root_path = LOGANALYSISINFO_DIRECTORY . "WebServerRoot" . "/"; web_server_root_path; # debug_message("#### get_web_server_root_path() END \n"); ));