diff options
author | mkanat%bugzilla.org <> | 2007-11-05 01:30:58 +0000 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2007-11-05 01:30:58 +0000 |
commit | 7d90e43e9879be068e563567995ffe2b5066bd61 (patch) | |
tree | ccb68696bad4eb22bfe4b4f608718d1a6a328030 | |
parent | 9f774e4a6de07003873bb20a68989d8e7f6fd544 (diff) | |
download | bugs-7d90e43e9879be068e563567995ffe2b5066bd61.tar bugs-7d90e43e9879be068e563567995ffe2b5066bd61.tar.gz bugs-7d90e43e9879be068e563567995ffe2b5066bd61.tar.bz2 bugs-7d90e43e9879be068e563567995ffe2b5066bd61.tar.xz bugs-7d90e43e9879be068e563567995ffe2b5066bd61.zip |
Bug 383522: mod_perl creates a separate template directory
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=mkanat
-rw-r--r-- | Bugzilla/Template.pm | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 62334999d..9be1180bc 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -790,17 +790,20 @@ sub precompile_templates { # *compiled* versions using the full absolute path under the data/template # directory. (Like data/template/var/www/html/mod_perl/.) To avoid # re-compiling templates under mod_perl, we symlink to the - # already-compiled templates. - my $abs_root = dirname(abs_path($templatedir)); - mkpath("$datadir/template$abs_root"); - my $todir = "$datadir/template$abs_root"; - # We use abs2rel so that the symlink will look like "../../../../template" - # which works, while just "data/template/template/" doesn't work. - my $fromdir = File::Spec->abs2rel("$datadir/template/template", $todir); - # We eval for systems (like Windows) that can't symlink, where "symlink" - # throws a fatal error. - eval { symlink($fromdir, "$todir/template") - or warn "Failed to symlink from $fromdir to $todir: $!" }; + # already-compiled templates. This doesn't work on Windows. + if (!ON_WINDOWS) { + my $abs_root = dirname(abs_path($templatedir)); + my $todir = "$datadir/template$abs_root"; + mkpath($todir); + # We use abs2rel so that the symlink will look like + # "../../../../template" which works, while just + # "data/template/template/" doesn't work. + my $fromdir = File::Spec->abs2rel("$datadir/template/template", $todir); + # We eval for systems that can't symlink at all, where "symlink" + # throws a fatal error. + eval { symlink($fromdir, "$todir/template") + or warn "Failed to symlink from $fromdir to $todir: $!" }; + } # If anything created a Template object before now, clear it out. delete Bugzilla->request_cache->{template}; |