.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "docs::api::Apache2::MPM 3pm" .TH docs::api::Apache2::MPM 3pm 2024-01-10 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Apache2::MPM \- Perl API for accessing Apache MPM information .SH Synopsis .IX Header "Synopsis" .Vb 1 \& use Apache2::MPM (); \& \& # check whether Apache MPM is threaded \& if (Apache2::MPM\->is_threaded) { do_something() } \& \& # which mpm is used \& my $mpm = lc Apache2::MPM\->show; \& \& # query mpm properties \& use Apache2::Const \-compile => qw(:mpmq); \& if (Apache2::MPM\->query(Apache2::Const::MPMQ_STATIC)) { ... } .Ve .SH Description .IX Header "Description" \&\f(CW\*(C`Apache2::MPM\*(C'\fR provides the Perl API for accessing Apache MPM information. .SH API .IX Header "API" \&\f(CW\*(C`Apache2::MPM\*(C'\fR provides the following functions and/or methods: .ie n .SS """query""" .el .SS \f(CWquery\fP .IX Subsection "query" Query various attributes of the MPM .PP .Vb 1 \& my $query = Apache2::MPM\->query($const); .Ve .ie n .IP "obj: $class ( ""Apache2::MPM class"" )" 4 .el .IP "obj: \f(CW$class\fR ( \f(CWApache2::MPM class\fR )" 4 .IX Item "obj: $class ( Apache2::MPM class )" the class name .ie n .IP "arg1: $const ( ""Apache2::Const :mpmq group constant"" )" 4 .el .IP "arg1: \f(CW$const\fR ( \f(CWApache2::Const :mpmq group constant\fR )" 4 .IX Item "arg1: $const ( Apache2::Const :mpmq group constant )" The MPM attribute to query. .ie n .IP "ret: $query ( boolean )" 4 .el .IP "ret: \f(CW$query\fR ( boolean )" 4 .IX Item "ret: $query ( boolean )" the result of the query .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PP For example to test whether the mpm is static: .PP .Vb 2 \& use Apache2::Const \-compile => qw(MPMQ_STATIC); \& if (Apache2::MPM\->query(Apache2::Const::MPMQ_STATIC)) { ... } .Ve .ie n .SS """is_threaded""" .el .SS \f(CWis_threaded\fP .IX Subsection "is_threaded" Check whether the running Apache MPM is threaded. .PP .Vb 1 \& my $is_threaded = Apache2::MPM\->is_threaded; .Ve .ie n .IP "obj: $class ( ""Apache2::MPM class"" )" 4 .el .IP "obj: \f(CW$class\fR ( \f(CWApache2::MPM class\fR )" 4 .IX Item "obj: $class ( Apache2::MPM class )" the class name .ie n .IP "ret: $is_threaded ( boolean )" 4 .el .IP "ret: \f(CW$is_threaded\fR ( boolean )" 4 .IX Item "ret: $is_threaded ( boolean )" threaded or not .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PP Note that this functionality is just a shortcut for: .PP .Vb 2 \& use Apache2::Const \-compile => qw(MPMQ_IS_THREADED); \& my $is_threaded = Apache2::MPM\->query(Apache2::Const::MPMQ_IS_THREADED); .Ve .ie n .SS """show""" .el .SS \f(CWshow\fP .IX Subsection "show" What mpm is used .PP .Vb 1 \& my $mpm = Apache2::MPM\->show(); .Ve .ie n .IP "obj: $class ( ""Apache2::MPM class"" )" 4 .el .IP "obj: \f(CW$class\fR ( \f(CWApache2::MPM class\fR )" 4 .IX Item "obj: $class ( Apache2::MPM class )" the class name .ie n .IP "ret: $mpm ( string )" 4 .el .IP "ret: \f(CW$mpm\fR ( string )" 4 .IX Item "ret: $mpm ( string )" the name of the MPM. e.g., "Prefork". .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .SH "See Also" .IX Header "See Also" mod_perl 2.0 documentation. .SH Copyright .IX Header "Copyright" mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0. .SH Authors .IX Header "Authors" The mod_perl development team and numerous contributors.