You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Andre Landwehr <an...@gmx.net> on 2000/08/21 16:06:21 UTC

EMBPERL_OBJECT_ADDPATH modifiable at runtime?

hi,
is there a way to modify EMBPERL_OBJECT_ADDPATH from within my
pages or another way (apart from absolute pathes) to Execute
modules not in the same hierarchie as the called page?

Andre


Re: EMBPERL_OBJECT_ADDPATH modifiable at runtime?

Posted by Andre Landwehr <an...@gmx.net>.
On Tue, Aug 22, 2000 at 10:35:57AM +0200, Gerald Richter wrote:
> This behaveiour was intended, but from my experience with using
> EmbperlObject, it seems better to me to change it in the following way:
> 
> - If EMBPERL_OBJECT_STOPDIR is set, this directory is taken as the last
> directory in the normal search path, instead of the directory where the base
> template (base.epo in your case) is found.
> - EMBPERL_OBJECT_ADDPATH is _always_ added to the search path
> 
> What do you think? Any other ideas?

This is how I expected it to work from start, so it would be
great, at least for me, if you changed it to work that way

Andre


Re: EMBPERL_OBJECT_ADDPATH modifiable at runtime?

Posted by Gerald Richter <ri...@ecos.de>.
> As I understand it in EmbperlObject.pm, line 206ff $searchpath is
> extended by paths from $ENV{EMBPERL_OBJECT_ADDPATH} _only_ when
> $basename is _not_ found earlier, while processing the directory
> hierarchie from dirname($req -> {inputfile}) down to
> $stopdir and the likes.
> I verified this behaviour by creating a <mydocroot>/temp/base.epo
> which tries to Execute header.epo, * and footer.epo and
> a corresponding <mydocroot>/temp/index.epo which I tryed to
> request. As I expected header.epo and footer.epo could not be
> found despite they exist in <mydocroot>/
>
> If this behaviour is intended I would be happy to know why...
>

This behaveiour was intended, but from my experience with using
EmbperlObject, it seems better to me to change it in the following way:

- If EMBPERL_OBJECT_STOPDIR is set, this directory is taken as the last
directory in the normal search path, instead of the directory where the base
template (base.epo in your case) is found.
- EMBPERL_OBJECT_ADDPATH is _always_ added to the search path

What do you think? Any other ideas?

Gerald




Re: EMBPERL_OBJECT_ADDPATH modifiable at runtime?

Posted by Andre Landwehr <an...@gmx.net>.
On Mon, Aug 21, 2000 at 05:44:15PM +0200, Andre Landwehr wrote:
> "PerlSetEnv EMBPERL_OBJECT_ADDPATH :/home/httpd/145.228.6.167/components:"
> in my httpd.conf, but this is what is logged in embperl.log:
> (...)

Forget my previous postings, I had a really dumb mistake in the
ADDPATH I specified in my httpd.conf (missed a directory..) 
Sorry for the inconvenience!
But nevertheless there seems to be sth. wrong with the addpath
feature:

as I said earlier I want to Execute files in
<mydocroot>/components by just specifying their name, without
directory. This works perfectly well as long as my base document
(base.epo) cannot be found in the normal hierarchie of
directories but only in that components directory. Example:
In <mydocroot>/home/index.epo I want to Execute
<mydocroot>/components/logo.epo by just typing 
Execute ('logo.epo');
If either <mydocroot>/base.epo or <mydocroot>/home/base.epo exist
this does not work. If I move <mydocroot>/base.epo to
<mydocroot>/components/base.epo everything is ok.

As I understand it in EmbperlObject.pm, line 206ff $searchpath is
extended by paths from $ENV{EMBPERL_OBJECT_ADDPATH} _only_ when
$basename is _not_ found earlier, while processing the directory
hierarchie from dirname($req -> {inputfile}) down to
$stopdir and the likes. 
I verified this behaviour by creating a <mydocroot>/temp/base.epo
which tries to Execute header.epo, * and footer.epo and 
a corresponding <mydocroot>/temp/index.epo which I tryed to
request. As I expected header.epo and footer.epo could not be
found despite they exist in <mydocroot>/

If this behaviour is intended I would be happy to know why...

Andre


Re: EMBPERL_OBJECT_ADDPATH modifiable at runtime?

Posted by Andre Landwehr <an...@gmx.net>.
On Mon, Aug 21, 2000 at 04:06:21PM +0200, Andre Landwehr wrote:
> is there a way to modify EMBPERL_OBJECT_ADDPATH from within my
> pages or another way (apart from absolute pathes) to Execute
> modules not in the same hierarchie as the called page?

ok, I realize that my problem is bigger than I first thought: 
now I have a line 
"PerlSetEnv EMBPERL_OBJECT_ADDPATH :/home/httpd/145.228.6.167/components:"
in my httpd.conf, but this is what is logged in embperl.log:
----------
[5203]EmbperlObject Check for base:
/home/httpd/145.228.6.167/docs/home/base.epo
[5203]EmbperlObject Check for base:
/home/httpd/145.228.6.167/docs/base.epo
[5203]EmbperlObject Check for base:
/home/httpd/145.228.6.167/base.epo
[5203]EmbperlObject Check for base:
/home/httpd/145.228.6.167/components/base.epo
                         ^^^^^^^^^^^ so here it is in the searchpath!
[5203]EmbperlObject Request Filename:
/home/httpd/145.228.6.167/docs/home/index.epo
[5203]EmbperlObject basename: base.epo
[5203]EmbperlObject Check for base:
/home/httpd/145.228.6.167/docs/home/base.epo
[5203]EmbperlObject Check for base:
/home/httpd/145.228.6.167/docs/base.epo
[5203]EmbperlObject Found Base:
/home/httpd/145.228.6.167/docs/base.epo
[5203]EmbperlObject path:
;/home/httpd/145.228.6.167/docs/home;/home/httpd/145.228.6.167/docs
-----------
"EmbperlObject path" obviously does not contain the path to my
components directory; where is my mistake? btw: I use Embperl
1.3b5, modperl 1.24

Andre