1docs::api::Apache2::porUtsienrg(C3o)ntributed Perl Documdeonctsa:t:iaopni::Apache2::porting(3)
2
3
4

NAME

6       Apache2::porting -- a helper module for mod_perl 1.0 to mod_perl 2.0
7       porting
8

Synopsis

10         # either add at the very beginning of startup.pl
11         use Apache2::porting;
12
13         # or httpd.conf
14         PerlModule Apache2::porting
15
16         # now issue requests and look at the error_log file for hints
17

Description

19       "Apache2::porting" helps to port mod_perl 1.0 code to run under
20       mod_perl 2.0. It doesn't provide any back-compatibility functionality,
21       however it knows to trap methods calls that are no longer in the
22       mod_perl 2.0 API and tell what should be used instead if at all. If you
23       attempts to use mod_perl 2.0 methods without first loading the modules
24       that contain them, it will tell you which modules you need to load.
25       Finally if your code tries to load modules that no longer exist in
26       mod_perl 2.0 it'll also tell you what are the modules that should be
27       used instead.
28
29       "Apache2::porting" communicates with users via the error_log file.
30       Everytime it traps a problem, it logs the solution (if it finds one) to
31       the error log file. If you use this module coupled with
32       "Apache2::Reload" you will be able to port your applications quickly
33       without needing to restart the server on every modification.
34
35       It starts to work only when child process start and doesn't work for
36       the code that gets loaded at the server startup. This limitation is
37       explained in the Culprits section.
38
39       It relies heavily on "ModPerl::MethodLookup".  which can also be used
40       manually to lookup things.
41

Culprits

43       "Apache2::porting" uses the "UNIVERSAL::AUTOLOAD" function to provide
44       its functionality. However it seems to be impossible to create "UNIVER‐
45       SAL::AUTOLOAD" at the server startup, Apache segfaults on restart.
46       Therefore it performs the setting of "UNIVERSAL::AUTOLOAD" only during
47       the child_init phase, when child processes start. As a result it can't
48       help you with things that get preloaded at the server startup.
49
50       If you know how to resolve this problem, please let us know. To repro‐
51       duce the problem try to use an earlier phase, e.g. "PerlPostConfigHan‐
52       dler":
53
54         Apache2::ServerUtil->server->push_handlers(PerlPostConfigHandler => \&porting_autoload);
55
56       META: Though there is a better solution at work, which assigns AUTOLOAD
57       for each class separately, instead of using UNIVERSAL. See the discus‐
58       sion on the dev list (hint: search the archive for EazyLife)
59

See Also

61       mod_perl 2.0 documentation.
62
64       mod_perl 2.0 and its core modules are copyrighted under The Apache
65       Software License, Version 2.0.
66

Authors

68       The mod_perl development team and numerous contributors.
69
70
71
72perl v5.8.8                       2006-11-19    docs::api::Apache2::porting(3)
Impressum