home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / perl / PerlRun.pm < prev    next >
Encoding:
Perl POD Document  |  2003-12-31  |  1.9 KB  |  64 lines

  1. package ModPerl::PerlRun;
  2.  
  3. use strict;
  4. use warnings FATAL => 'all';
  5.  
  6. # we try to develop so we reload ourselves without die'ing on the warning
  7. no warnings qw(redefine); # XXX, this should go away in production!
  8.  
  9. our $VERSION = '1.99';
  10.  
  11. use base qw(ModPerl::RegistryCooker);
  12.  
  13. sub handler : method {
  14.     my $class = (@_ >= 2) ? shift : __PACKAGE__;
  15.     my $r = shift;
  16.     return $class->new($r)->default_handler();
  17. }
  18.  
  19. my $parent = 'ModPerl::RegistryCooker';
  20. # the following code:
  21. # - specifies package's behavior different from default of $parent class
  22. # - speeds things up by shortcutting @ISA search, so even if the
  23. #   default is used we still use the alias
  24. my %aliases = (
  25.     new             => 'new',
  26.     init            => 'init',
  27.     default_handler => 'default_handler',
  28.     run             => 'run',
  29.     can_compile     => 'can_compile',
  30.     make_namespace  => 'make_namespace',
  31.     namespace_root  => 'namespace_root',
  32.     namespace_from  => 'namespace_from_filename',
  33.     is_cached       => 'FALSE',
  34.     should_compile  => 'TRUE',
  35.     flush_namespace => 'flush_namespace_normal',
  36.     cache_table     => 'cache_table_common',
  37.     cache_it        => 'NOP',
  38.     read_script     => 'read_script',
  39.     rewrite_shebang => 'rewrite_shebang',
  40.     get_script_name => 'get_script_name',
  41.     chdir_file      => 'chdir_file_normal',
  42.     get_mark_line   => 'get_mark_line',
  43.     compile         => 'compile',
  44.     error_check     => 'error_check',
  45.     should_reset_inc_hash => 'TRUE',
  46.     strip_end_data_segment             => 'strip_end_data_segment',
  47.     convert_script_to_compiled_handler => 'convert_script_to_compiled_handler',
  48. );
  49.  
  50. # in this module, all the methods are inherited from the same parent
  51. # class, so we fixup aliases instead of using the source package in
  52. # first place.
  53. $aliases{$_} = $parent . "::" . $aliases{$_} for keys %aliases;
  54.  
  55. __PACKAGE__->install_aliases(\%aliases);
  56.  
  57.  
  58.  
  59.  
  60.  
  61. 1;
  62. __END__
  63.  
  64.