Go to main content

man pages section 3: Library Interfaces and Headers

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

Apache2::porting (3)

Name

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

Synopsis

# either add at the very beginning of startup.pl
use Apache2::porting;

# or httpd.conf
PerlModule Apache2::porting

# now issue requests and look at the error_log file for hints

Description

User Contributed Perl Documentation
                                  build::amd64::docs::api::Apache2::porting(3)



NAME
       Apache2::porting -- a helper module for mod_perl 1.0 to mod_perl 2.0
       porting

Synopsis
         # either add at the very beginning of startup.pl
         use Apache2::porting;

         # or httpd.conf
         PerlModule Apache2::porting

         # now issue requests and look at the error_log file for hints

Description
       "Apache2::porting" helps to port mod_perl 1.0 code to run under
       mod_perl 2.0. It doesn't provide any back-compatibility functionality,
       however it knows to trap methods calls that are no longer in the
       mod_perl 2.0 API and tell what should be used instead if at all. If you
       attempts to use mod_perl 2.0 methods without first loading the modules
       that contain them, it will tell you which modules you need to load.
       Finally if your code tries to load modules that no longer exist in
       mod_perl 2.0 it'll also tell you what are the modules that should be
       used instead.

       "Apache2::porting" communicates with users via the error_log file.
       Everytime it traps a problem, it logs the solution (if it finds one) to
       the error log file. If you use this module coupled with
       "Apache2::Reload" you will be able to port your applications quickly
       without needing to restart the server on every modification.

       It starts to work only when child process start and doesn't work for
       the code that gets loaded at the server startup. This limitation is
       explained in the Culprits section.

       It relies heavily on "ModPerl::MethodLookup".  which can also be used
       manually to lookup things.

Culprits
       "Apache2::porting" uses the "UNIVERSAL::AUTOLOAD" function to provide
       its functionality. However it seems to be impossible to create
       "UNIVERSAL::AUTOLOAD" at the server startup, Apache segfaults on
       restart. Therefore it performs the setting of "UNIVERSAL::AUTOLOAD"
       only during the child_init phase, when child processes start. As a
       result it can't help you with things that get preloaded at the server
       startup.

       If you know how to resolve this problem, please let us know. To
       reproduce the problem try to use an earlier phase, e.g.
       "PerlPostConfigHandler":

         Apache2::ServerUtil->server->push_handlers(PerlPostConfigHandler => \&porting_autoload);

       META: Though there is a better solution at work, which assigns AUTOLOAD
       for each class separately, instead of using UNIVERSAL. See the
       discussion on the dev list (hint: search the archive for EazyLife)

See Also
       mod_perl 2.0 documentation.

Copyright
       mod_perl 2.0 and its core modules are copyrighted under The Apache
       Software License, Version 2.0.

Authors
       The mod_perl development team and numerous contributors.



ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       +---------------+-----------------------------------------+
       |ATTRIBUTE TYPE |            ATTRIBUTE VALUE              |
       +---------------+-----------------------------------------+
       |Availability   | web/server/apache-24/module/apache-perl |
       +---------------+-----------------------------------------+
       |Stability      | Uncommitted                             |
       +---------------+-----------------------------------------+

NOTES
       Source code for open source software components in Oracle Solaris can
       be found at https://www.oracle.com/downloads/opensource/solaris-source-
       code-downloads.html.

       This software was built from source available at
       https://github.com/oracle/solaris-userland.  The original community
       source was downloaded from
       https://www.apache.org/dist/perl/mod_perl-2.0.12.tar.gz.

       Further information about this software can be found on the open source
       community website at https://perl.apache.org/.



perl v5.32.0                      2022-01-30
                                  build::amd64::docs::api::Apache2::porting(3)