tools/page-loader/RegistryPrefork.pm

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tools/page-loader/RegistryPrefork.pm	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,35 @@
     1.4 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.5 +# License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.7 +
     1.8 +package ModPerl::RegistryPrefork;
     1.9 +
    1.10 +# RegistryPrefork.pm originally from
    1.11 +# http://perl.apache.org/docs/2.0/user/porting/compat.html#Code_Porting
    1.12 +# backported for mod_perl <= 1.99_08
    1.13 +
    1.14 +use strict;
    1.15 +use warnings FATAL => 'all';
    1.16 +
    1.17 +our $VERSION = '0.01';
    1.18 +
    1.19 +use base qw(ModPerl::Registry);
    1.20 +
    1.21 +use File::Basename ();
    1.22 +
    1.23 +use constant FILENAME => 1;
    1.24 +
    1.25 +sub handler : method {
    1.26 +    my $class = (@_ >= 2) ? shift : __PACKAGE__;
    1.27 +    my $r = shift;
    1.28 +    return $class->new($r)->default_handler();
    1.29 +}
    1.30 +
    1.31 +sub chdir_file {
    1.32 +    my $file = @_ == 2 ? $_[1] : $_[0]->[FILENAME];
    1.33 +    my $dir = File::Basename::dirname($file);
    1.34 +    chdir $dir or die "Can't chdir to $dir: $!";
    1.35 +}
    1.36 +
    1.37 +1;
    1.38 +__END__

mercurial