|
Home > Archive > AOL Webserver > April 2006 > init.tcl created commands aren't in ADP interpreters
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
init.tcl created commands aren't in ADP interpreters
|
|
| John Buckman 2006-04-17, 11:56 pm |
| I'm running into a problem where new Tcl commands that BerkeleyDB
makes in init.tcl are not available in adp interpreters.
Specifically, if I do something like this in init.tcl:
> berkdb open -create -btree a.db
a new command "db0" is now in the tcl interpreter, and [info
commands] shows it (but not [info procs])
However, [info commands] when run on and ADP page shows that the ADP
pages don't contain this "db0" command: they don't inherit commands
that were created in init.tcl, just procs.
It seems that only procs from init.tcl are inherited. Is this a bug?
Or is there some way to register commands created in init.tcl so that
they're present in ADP interpreters?
-john
ps: I know about the aolserver/berkeley-db library, but want to use
the native tcl library provided by BerkeleyDB instead.
| |
| patrick o'leary 2006-04-17, 11:56 pm |
| By init.tcl I'm guessing you mean the configuration file passed to
aolserver at start up?
/bin/nsd -t init.tcl ?
If so, then this is more of a feature than a bug, the TCL interpreter
used to load the configuration
file is deallocated after the configuration is loaded.
The only things available to adp pages or tcl procs after configuration
is anything placed in
ns_section, using ns_param, as it'll get stored in a global TCL hash.
In order to make Berkeley available to TCL and ADP pages, it needs to be
done in one of two places
*o *Either in sourcing of public and private server libraries
i.e
a tcl file with package require Db_tcl in either
aolserver/modules/tcl/ the public library
or in aolserver/servers/(servername)/modules/tcl the private tcl library
Code in either of these directories will be available to TCL and ADP
during web server run time.
*o* Or the second place is slightly more obscure, but I'm assured just
as effective,
aolserver/bin/init.tcl
Changing proc ns_init
238 proc ns_init {} {
239 ns_ictl update; # check for proc/namespace update
240 }
to load Berkeley will allow it to occur for all threads created or
reused, this method might be a little overkill for most,
but it's an option.
P
John Buckman wrote:
> I'm running into a problem where new Tcl commands that BerkeleyDB
> makes in init.tcl are not available in adp interpreters.
>
> Specifically, if I do something like this in init.tcl:
>
> a new command "db0" is now in the tcl interpreter, and [info
> commands] shows it (but not [info procs])
>
> However, [info commands] when run on and ADP page shows that the ADP
> pages don't contain this "db0" command: they don't inherit commands
> that were created in init.tcl, just procs.
>
> It seems that only procs from init.tcl are inherited. Is this a bug?
>
> Or is there some way to register commands created in init.tcl so that
> they're present in ADP interpreters?
>
> -john
>
> ps: I know about the aolserver/berkeley-db library, but want to use
> the native tcl library provided by BerkeleyDB instead.
>
>
> --
> AOLserver - http://www.aolserver.com/
>
> To Remove yourself from this list, simply send an email to
> <listserv@listserv.aol.com> with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the
> Subject: field of your email blank.
>
--
Patrick O'Leary
AOL Search
Phone: + 1 703 265 1000 ext 31097
Smash forehead on keyboard to continue...
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <listserv@listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
|
|
|
|
|