1
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
4
<title>4.5.1 Functions</title>
5
<META NAME="description" CONTENT="4.5.1 Functions">
4
<link rel="STYLESHEET" href="modpython.css" type='text/css'>
5
<link rel="first" href="modpython.html" title='Mod_python Manual'>
6
<link rel='contents' href='contents.html' title="Contents">
7
<link rel='index' href='genindex.html' title='Index'>
8
<link rel='last' href='about.html' title='About this document...'>
9
<link rel='help' href='about.html' title='About this document...'>
10
<LINK REL="next" href="pyapi-mptable.html">
11
<LINK REL="prev" href="module-apache.html">
12
<LINK REL="parent" href="module-apache.html">
13
<LINK REL="next" href="pyapi-mptable.html">
14
<meta name='aesop' content='information'>
15
<META NAME="description" CONTENT="Functions">
6
16
<META NAME="keywords" CONTENT="modpython">
7
17
<META NAME="resource-type" CONTENT="document">
8
18
<META NAME="distribution" CONTENT="global">
9
<link rel="STYLESHEET" href="modpython.css">
10
<link rel="first" href="modpython.html">
11
<link rel="contents" href="contents.html" title="Contents">
12
<link rel="index" href="genindex.html" title="Index">
13
<LINK REL="next" href="pyapi-mptable.html">
14
<LINK REL="previous" href="module-apache.html">
15
<LINK REL="up" href="module-apache.html">
16
<LINK REL="next" href="pyapi-mptable.html">
19
<title>4.5.1 Functions</title>
19
22
<DIV CLASS="navigation">
20
23
<table align="center" width="100%" cellpadding="0" cellspacing="2">
22
<td><A href="module-apache.html"><img src="icons/previous.gif"
23
border="0" height="32"
24
alt="Previous Page" width="32"></A></td>
25
<td><A href="module-apache.html"><img src="icons/up.gif"
26
border="0" height="32"
27
alt="Up One Level" width="32"></A></td>
28
<td><A href="pyapi-mptable.html"><img src="icons/next.gif"
29
border="0" height="32"
30
alt="Next Page" width="32"></A></td>
25
<td><a rel="prev" title="4.5 apache - Access"
26
href="module-apache.html"><img src='previous.gif'
27
border='0' height='32' alt='Previous Page' width='32'></A></td>
28
<td><a rel="parent" title="4.5 apache - Access"
29
href="module-apache.html"><img src='up.gif'
30
border='0' height='32' alt='Up One Level' width='32'></A></td>
31
<td><a rel="next" title="4.5.2 Table Object (mp_table) "
32
href="pyapi-mptable.html"><img src='next.gif'
33
border='0' height='32' alt='Next Page' width='32'></A></td>
31
34
<td align="center" width="100%">Mod_python Manual</td>
32
<td><A href="contents.html"><img src="icons/contents.gif"
33
border="0" height="32"
34
alt="Contents" width="32"></A></td>
35
<td><img src="icons/blank.gif"
36
border="0" height="32"
37
alt="" width="32"></td>
38
<td><A href="genindex.html"><img src="icons/index.gif"
39
border="0" height="32"
40
alt="Index" width="32"></A></td>
35
<td><a rel="contents" title="Table of Contents"
36
href="contents.html"><img src='contents.gif'
37
border='0' height='32' alt='Contents' width='32'></A></td>
38
<td><img src='blank.gif'
39
border='0' height='32' alt='' width='32'></td>
40
<td><a rel="index" title="Index"
41
href="genindex.html"><img src='index.gif'
42
border='0' height='32' alt='Index' width='32'></A></td>
42
<b class="navlabel">Previous:</b> <a class="sectref" href="module-apache.html">4.5 apache - Access</A>
43
<b class="navlabel">Up:</b> <a class="sectref" href="module-apache.html">4.5 apache - Access</A>
44
<b class="navlabel">Next:</b> <a class="sectref" href="pyapi-mptable.html">4.5.2 Table Object (mp_table) </A>
44
<b class="navlabel">Previous:</b>
45
<a class="sectref" rel="prev" href="module-apache.html">4.5 apache - Access</A>
46
<b class="navlabel">Up:</b>
47
<a class="sectref" rel="parent" href="module-apache.html">4.5 apache - Access</A>
48
<b class="navlabel">Next:</b>
49
<a class="sectref" rel="next" href="pyapi-mptable.html">4.5.2 Table Object (mp_table) </A>
47
52
<!--End of Navigation Panel-->
55
<dl><dt><b><a name="l2h-19"><tt class="function">log_error</tt></a></b>(<var>message</var><big>[</big><var>, level, server</var><big>]</big>)
60
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
61
<td><nobr><b><a name="l2h-31"><tt class="function">log_error</tt></a></b>(</nobr></td>
62
<td><var>message</var><big>[</big><var>, level, server</var><big>]</big>)</td></tr></table>
57
64
An interface to the Apache <code>ap_log_error()</code>
58
65
function. <var>message</var> is a string with the error message,
59
66
<var>level</var> is one of the following flags constants:
62
<dl><dd><pre class="verbatim">
69
<div class="verbatim"><pre>
107
<dl><dd><pre class="verbatim">
116
<div class="verbatim"><pre>
108
117
from mod_python import apache
109
118
mymodule = apache.import_module('mymodule', log=1)
114
<dl><dt><b><a name="l2h-21"><tt class="function">allow_methods</tt></a></b>(<big>[</big><var>*args</var><big>]</big>)
123
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
124
<td><nobr><b><a name="l2h-33"><tt class="function">allow_methods</tt></a></b>(</nobr></td>
125
<td><big>[</big><var>*args</var><big>]</big>)</td></tr></table>
116
127
A convenience function to set values in <tt class="member">req.allowed</tt>.
117
128
<tt class="member">req.allowed</tt> is a bitmask that is used to construct the
148
159
M_BASELINE_CONTROL
157
<dl><dt><b><a name="l2h-22"><tt class="function">config_tree</tt></a></b>()
168
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
169
<td><nobr><b><a name="l2h-34"><tt class="function">exists_config_define</tt></a></b>(</nobr></td>
170
<td><var>name</var>)</td></tr></table>
172
This function returns True if the Apache server was launched
173
with the definition with the given <var>name</var>. This means
174
that you can test whether Apache was launched with the <code>-DFOOBAR</code>
175
parameter by calling <code>apache.exists_config_define('FOOBAR')</code>.
179
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
180
<td><nobr><b><a name="l2h-35"><tt class="method">register_cleanup</tt></a></b>(</nobr></td>
181
<td><var>handler</var><big>[</big><var>, data</var><big>]</big>)</td></tr></table>
183
Registers a cleanup. Equivalent to <tt class="function">req.register_cleanup()</tt>
184
or <tt class="function">req.server.register_cleanup()</tt>, except that a server or request
185
object is not required.
189
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
190
<td><nobr><b><a name="l2h-36"><tt class="function">config_tree</tt></a></b>(</nobr></td>
191
<td>)</td></tr></table>
159
193
Returns the server-level configuration tree. This tree does not
160
194
include directives from .htaccess files. This is a <i>copy</i> of
165
<dl><dt><b><a name="l2h-23"><tt class="function">server_root</tt></a></b>()
199
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
200
<td><nobr><b><a name="l2h-37"><tt class="function">server_root</tt></a></b>(</nobr></td>
201
<td>)</td></tr></table>
167
203
Returns the value of ServerRoot.
171
<dl><dt><b><a name="l2h-24"><tt class="function">make_table</tt></a></b>()
207
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
208
<td><nobr><b><a name="l2h-38"><tt class="function">make_table</tt></a></b>(</nobr></td>
209
<td>)</td></tr></table>
173
211
This function is obsolete and is an alias to <tt class="class">table</tt> (see below).
177
<dl><dt><b><a name="l2h-25"><tt class="function">mpm_query</tt></a></b>(<var>code</var>)
215
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
216
<td><nobr><b><a name="l2h-39"><tt class="function">mpm_query</tt></a></b>(</nobr></td>
217
<td><var>code</var>)</td></tr></table>
179
219
Allows querying of the MPM for various parameters such as numbers of
180
220
processes and threads. The return value is one of three constants:
181
<dl><dd><pre class="verbatim">
221
<div class="verbatim"><pre>
182
222
AP_MPMQ_NOT_SUPPORTED = 0 # This value specifies whether
183
223
# an MPM is capable of
184
224
# threading or forking.
224
264
<table align="center" width="100%" cellpadding="0" cellspacing="2">
226
<td><A href="module-apache.html"><img src="icons/previous.gif"
227
border="0" height="32"
228
alt="Previous Page" width="32"></A></td>
229
<td><A href="module-apache.html"><img src="icons/up.gif"
230
border="0" height="32"
231
alt="Up One Level" width="32"></A></td>
232
<td><A href="pyapi-mptable.html"><img src="icons/next.gif"
233
border="0" height="32"
234
alt="Next Page" width="32"></A></td>
266
<td><a rel="prev" title="4.5 apache - Access"
267
rel="prev" title="4.5 apache - Access"
268
href="module-apache.html"><img src='previous.gif'
269
border='0' height='32' alt='Previous Page' width='32'></A></td>
270
<td><a rel="parent" title="4.5 apache - Access"
271
rel="parent" title="4.5 apache - Access"
272
href="module-apache.html"><img src='up.gif'
273
border='0' height='32' alt='Up One Level' width='32'></A></td>
274
<td><a rel="next" title="4.5.2 Table Object (mp_table) "
275
rel="next" title="4.5.2 Table Object (mp_table) "
276
href="pyapi-mptable.html"><img src='next.gif'
277
border='0' height='32' alt='Next Page' width='32'></A></td>
235
278
<td align="center" width="100%">Mod_python Manual</td>
236
<td><A href="contents.html"><img src="icons/contents.gif"
237
border="0" height="32"
238
alt="Contents" width="32"></A></td>
239
<td><img src="icons/blank.gif"
240
border="0" height="32"
241
alt="" width="32"></td>
242
<td><A href="genindex.html"><img src="icons/index.gif"
243
border="0" height="32"
244
alt="Index" width="32"></A></td>
279
<td><a rel="contents" title="Table of Contents"
280
rel="contents" title="Table of Contents"
281
href="contents.html"><img src='contents.gif'
282
border='0' height='32' alt='Contents' width='32'></A></td>
283
<td><img src='blank.gif'
284
border='0' height='32' alt='' width='32'></td>
285
<td><a rel="index" title="Index"
286
rel="index" title="Index"
287
href="genindex.html"><img src='index.gif'
288
border='0' height='32' alt='Index' width='32'></A></td>
246
<b class="navlabel">Previous:</b> <a class="sectref" href="module-apache.html">4.5 apache - Access</A>
247
<b class="navlabel">Up:</b> <a class="sectref" href="module-apache.html">4.5 apache - Access</A>
248
<b class="navlabel">Next:</b> <a class="sectref" href="pyapi-mptable.html">4.5.2 Table Object (mp_table) </A>
290
<b class="navlabel">Previous:</b>
291
<a class="sectref" rel="prev" href="module-apache.html">4.5 apache - Access</A>
292
<b class="navlabel">Up:</b>
293
<a class="sectref" rel="parent" href="module-apache.html">4.5 apache - Access</A>
294
<b class="navlabel">Next:</b>
295
<a class="sectref" rel="next" href="pyapi-mptable.html">4.5.2 Table Object (mp_table) </A>
250
<span class="release-info">Release 3.1.3, documentation updated on February 17, 2004.</span>
297
<span class="release-info">Release 3.2.10, documentation updated on July 19, 2006.</span>
252
299
<!--End of Navigation Panel-->