[Catalyst] setup_home bug (with fix): wrong detection of home
directory
Oleg Pronin
syber.rus at gmail.com
Fri Sep 28 20:16:13 GMT 2007
Hello.
I put the service script into
APP_HOME/script/service/online_users.plx
In the script:
use FindBin;
use lib "$FindBin::Bin/../../lib";
use MyApp;
print MyApp->path_to('/'); # prints APP_HOME/script/service/
Fix for Catalyst::Utils (sub Catalyst::Utils::home):
174,176c174,177
< my ($lastdir) =3D $home->dir_list( -1, 1 );
< if ( $lastdir eq '..' ) {
< $home =3D dir($home)->parent->parent;
---
> my $i =3D 0;
> $i++ while $home->dir_list( -$i, 1 ) eq '..';
> if ($i) {
> $home =3D dir($home)->parent for 1..($i*2);
in my case at line 174 $home =3D 'APP_HOME/script/service/../../'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070928/a4478=
e7b/attachment.htm
More information about the Catalyst
mailing list