tcl-websh-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ronnie Brunner <ron...@netcetera.ch>
Subject Re: web site
Date Thu, 11 Apr 2002 10:48:19 GMT
> We will do this on tcl.apache.org, but the reason I didn't do
> something similar immediately is this:
> 
> How to set up a testing environment that does not affect other websh
> pages being run on my system.  I got bit by this when setting up the
> tcl.apache.org test site on my computer.

The clean way to setup a server with different applications / setups
for templates etc by just using multiple interpreter classes:

   proc web::interpmap {file} {
      if {[string match "*/myExamples/*" $file]} {
          # this is my own code for the examples
	  return /path/to/script/for/examples/myScript
      }
      if {[string match "/path/to/special/app" $file]} {
          # an app with its own script code
	  return /real/path/to/app/code
      }
      # default : the websh.com stuff
      return [file join [file dirname [web::request SCRIPT_FILENAME]] websh.com.gen]
   }

Doesn't that help?

> What I ended up doing is having a 'common.tcl' file that is loaded at
> child init time on the live site, and loaded before each request on my
> box.

The "and loaded before each request" seems strange. I understand that
in a page you explicitly want to test with new code it's easier to
include the code in the file, because it's loaded (=eval'd) every time
you request the page. But in all the other pages it shouldn't be there
(where's all the fun of being faster with preloaded code ;-)

> This way, it is also easier to change code there without having to
> restart things all the time.

Sure, as I said.

> I'm not sure what the easiest/cleanest way to do this in Websh is,
> though.

Regarding what: testing or production?

------------------------------------------------------------------------
Ronnie Brunner                               ronnie.brunner@netcetera.ch
Netcetera AG, 8040 Zuerich    phone +41 1 247 79 79 Fax: +41 1 247 70 75

---------------------------------------------------------------------
To unsubscribe, e-mail: websh-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-dev-help@tcl.apache.org


Mime
View raw message