1 | <HTML
|
---|
2 | ><HEAD
|
---|
3 | ><TITLE
|
---|
4 | >Creation of get_module</TITLE
|
---|
5 | ><META
|
---|
6 | NAME="GENERATOR"
|
---|
7 | CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
---|
8 | REL="HOME"
|
---|
9 | TITLE="Manuál PHP"
|
---|
10 | HREF="index.html"><LINK
|
---|
11 | REL="UP"
|
---|
12 | TITLE="Source Discussion"
|
---|
13 | HREF="zend.structure.html"><LINK
|
---|
14 | REL="PREVIOUS"
|
---|
15 | TITLE="Declaration of the Zend Module Block"
|
---|
16 | HREF="zend.structure.module-block.html"><LINK
|
---|
17 | REL="NEXT"
|
---|
18 | TITLE="Implementation of All Exported Functions"
|
---|
19 | HREF="zend.structure.implementation.html"><META
|
---|
20 | HTTP-EQUIV="Content-type"
|
---|
21 | CONTENT="text/html; charset=ISO-8859-2"></HEAD
|
---|
22 | ><BODY
|
---|
23 | CLASS="section"
|
---|
24 | BGCOLOR="#FFFFFF"
|
---|
25 | TEXT="#000000"
|
---|
26 | LINK="#0000FF"
|
---|
27 | VLINK="#840084"
|
---|
28 | ALINK="#0000FF"
|
---|
29 | ><DIV
|
---|
30 | CLASS="NAVHEADER"
|
---|
31 | ><TABLE
|
---|
32 | SUMMARY="Header navigation table"
|
---|
33 | WIDTH="100%"
|
---|
34 | BORDER="0"
|
---|
35 | CELLPADDING="0"
|
---|
36 | CELLSPACING="0"
|
---|
37 | ><TR
|
---|
38 | ><TH
|
---|
39 | COLSPAN="3"
|
---|
40 | ALIGN="center"
|
---|
41 | >Manuál PHP</TH
|
---|
42 | ></TR
|
---|
43 | ><TR
|
---|
44 | ><TD
|
---|
45 | WIDTH="10%"
|
---|
46 | ALIGN="left"
|
---|
47 | VALIGN="bottom"
|
---|
48 | ><A
|
---|
49 | HREF="zend.structure.module-block.html"
|
---|
50 | ACCESSKEY="P"
|
---|
51 | >Pøedcházející</A
|
---|
52 | ></TD
|
---|
53 | ><TD
|
---|
54 | WIDTH="80%"
|
---|
55 | ALIGN="center"
|
---|
56 | VALIGN="bottom"
|
---|
57 | >Kapitola 31. Source Discussion</TD
|
---|
58 | ><TD
|
---|
59 | WIDTH="10%"
|
---|
60 | ALIGN="right"
|
---|
61 | VALIGN="bottom"
|
---|
62 | ><A
|
---|
63 | HREF="zend.structure.implementation.html"
|
---|
64 | ACCESSKEY="N"
|
---|
65 | >Dal¹í</A
|
---|
66 | ></TD
|
---|
67 | ></TR
|
---|
68 | ></TABLE
|
---|
69 | ><HR
|
---|
70 | ALIGN="LEFT"
|
---|
71 | WIDTH="100%"></DIV
|
---|
72 | ><DIV
|
---|
73 | CLASS="section"
|
---|
74 | ><H1
|
---|
75 | CLASS="section"
|
---|
76 | ><A
|
---|
77 | NAME="zend.structure.get-module"
|
---|
78 | ></A
|
---|
79 | >Creation of <B
|
---|
80 | CLASS="function"
|
---|
81 | >get_module()</B
|
---|
82 | ></H1
|
---|
83 | ><P
|
---|
84 | > This function is special to all dynamic loadable modules. Take a
|
---|
85 | look at the creation via the <TT
|
---|
86 | CLASS="literal"
|
---|
87 | >ZEND_GET_MODULE</TT
|
---|
88 | >
|
---|
89 | macro first:
|
---|
90 | </P
|
---|
91 | ><TABLE
|
---|
92 | BORDER="0"
|
---|
93 | BGCOLOR="#E0E0E0"
|
---|
94 | CELLPADDING="5"
|
---|
95 | ><TR
|
---|
96 | ><TD
|
---|
97 | ><PRE
|
---|
98 | CLASS="programlisting"
|
---|
99 | >#if COMPILE_DL_FIRSTMOD
|
---|
100 | ZEND_GET_MODULE(firstmod)
|
---|
101 | #endif</PRE
|
---|
102 | ></TD
|
---|
103 | ></TR
|
---|
104 | ></TABLE
|
---|
105 | ><P
|
---|
106 | > The function implementation is surrounded by a conditional
|
---|
107 | compilation statement. This is needed since the function
|
---|
108 | <B
|
---|
109 | CLASS="function"
|
---|
110 | >get_module()</B
|
---|
111 | > is only required if your module is
|
---|
112 | built as a dynamic extension. By specifying a definition of
|
---|
113 | <TT
|
---|
114 | CLASS="literal"
|
---|
115 | >COMPILE_DL_FIRSTMOD</TT
|
---|
116 | > in the compiler command
|
---|
117 | (see above for a discussion of the compilation instructions
|
---|
118 | required to build a dynamic extension), you can instruct your
|
---|
119 | module whether you intend to build it as a dynamic extension or as
|
---|
120 | a built-in module. If you want a built-in module, the
|
---|
121 | implementation of <B
|
---|
122 | CLASS="function"
|
---|
123 | >get_module()</B
|
---|
124 | > is simply left
|
---|
125 | out.
|
---|
126 | </P
|
---|
127 | ><P
|
---|
128 | > <B
|
---|
129 | CLASS="function"
|
---|
130 | >get_module()</B
|
---|
131 | > is called by Zend at load time
|
---|
132 | of the module. You can think of it as being invoked by the
|
---|
133 | <A
|
---|
134 | HREF="function.dl.html"
|
---|
135 | ><B
|
---|
136 | CLASS="function"
|
---|
137 | >dl()</B
|
---|
138 | ></A
|
---|
139 | > call in your script. Its purpose is to pass the
|
---|
140 | module information block back to Zend in order to inform the engine about the
|
---|
141 | module contents.
|
---|
142 | </P
|
---|
143 | ><P
|
---|
144 | > If you don't implement a <B
|
---|
145 | CLASS="function"
|
---|
146 | >get_module()</B
|
---|
147 | > function in
|
---|
148 | your dynamic loadable module, Zend will compliment you with an error message
|
---|
149 | when trying to access it.
|
---|
150 | </P
|
---|
151 | ></DIV
|
---|
152 | ><DIV
|
---|
153 | CLASS="NAVFOOTER"
|
---|
154 | ><HR
|
---|
155 | ALIGN="LEFT"
|
---|
156 | WIDTH="100%"><TABLE
|
---|
157 | SUMMARY="Footer navigation table"
|
---|
158 | WIDTH="100%"
|
---|
159 | BORDER="0"
|
---|
160 | CELLPADDING="0"
|
---|
161 | CELLSPACING="0"
|
---|
162 | ><TR
|
---|
163 | ><TD
|
---|
164 | WIDTH="33%"
|
---|
165 | ALIGN="left"
|
---|
166 | VALIGN="top"
|
---|
167 | ><A
|
---|
168 | HREF="zend.structure.module-block.html"
|
---|
169 | ACCESSKEY="P"
|
---|
170 | >Pøedcházející</A
|
---|
171 | ></TD
|
---|
172 | ><TD
|
---|
173 | WIDTH="34%"
|
---|
174 | ALIGN="center"
|
---|
175 | VALIGN="top"
|
---|
176 | ><A
|
---|
177 | HREF="index.html"
|
---|
178 | ACCESSKEY="H"
|
---|
179 | >Domù</A
|
---|
180 | ></TD
|
---|
181 | ><TD
|
---|
182 | WIDTH="33%"
|
---|
183 | ALIGN="right"
|
---|
184 | VALIGN="top"
|
---|
185 | ><A
|
---|
186 | HREF="zend.structure.implementation.html"
|
---|
187 | ACCESSKEY="N"
|
---|
188 | >Dal¹í</A
|
---|
189 | ></TD
|
---|
190 | ></TR
|
---|
191 | ><TR
|
---|
192 | ><TD
|
---|
193 | WIDTH="33%"
|
---|
194 | ALIGN="left"
|
---|
195 | VALIGN="top"
|
---|
196 | >Declaration of the Zend Module Block</TD
|
---|
197 | ><TD
|
---|
198 | WIDTH="34%"
|
---|
199 | ALIGN="center"
|
---|
200 | VALIGN="top"
|
---|
201 | ><A
|
---|
202 | HREF="zend.structure.html"
|
---|
203 | ACCESSKEY="U"
|
---|
204 | >Nahoru</A
|
---|
205 | ></TD
|
---|
206 | ><TD
|
---|
207 | WIDTH="33%"
|
---|
208 | ALIGN="right"
|
---|
209 | VALIGN="top"
|
---|
210 | >Implementation of All Exported Functions</TD
|
---|
211 | ></TR
|
---|
212 | ></TABLE
|
---|
213 | ></DIV
|
---|
214 | ></BODY
|
---|
215 | ></HTML
|
---|
216 | >
|
---|