Stas Bekman
Tue, 29 Jul 2003 04:22:29 -0700
I'm steadily making progress with getting a collection of mod_perl 1 compatibale scripts working with mod_perl 2 using the backward compatibility mode.
However, I find that the working directory of all scripts is "/". This occurs for both ModPerl::Registry and Apache::Registry. This causes many scripts to fail because they call open() using a relative pathname.
Surely the working directory of a script should be the directory in which it resides?
It does not seem to matter what directory I am in when I invoke httpd; the script's current directory is always "/".
Index: lib/Apache/compat.pm =================================================================== RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v retrieving revision 1.86 diff -u -r1.86 compat.pm --- lib/Apache/compat.pm 28 Jul 2003 10:33:58 -0000 1.86 +++ lib/Apache/compat.pm 29 Jul 2003 11:19:46 -0000 @@ -335,6 +335,8 @@
sub chdir_file {
#XXX resolve '.' in @INC to basename $r->filename
+ my $dir = @_ == 2 ? $_[1] : $_[0]->filename;
+ chdir $dir;
}require Apache::compat;
sub Apache::RequestRec::chdir_file {
my $dir = @_ == 2 ? $_[1] : $_[0]->filename;
chdir $dir;
}
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com