mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
updated previously written docs to know about the counter example. Also fix the $ keyword. Depends on a pending PhD bug fix and will look odd until then
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@258746 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
456e4db2f9
commit
cf075af43d
4 changed files with 82 additions and 28 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<sect1 xml:id="internals2.buildsys.configunix" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Talking to the UNIX build system: config.m4</title>
|
||||
<para>
|
||||
|
@ -27,7 +27,7 @@
|
|||
<title>An example config.m4 file</title>
|
||||
<programlisting role="autoconf">
|
||||
<![CDATA[
|
||||
dnl $Id: configunix.xml,v 1.3 2007-06-28 04:45:10 gwynne Exp $
|
||||
dnl ]]>$<![CDATA[Id$
|
||||
dnl config.m4 for extension example
|
||||
|
||||
PHP_ARG_WITH(example, for example support,
|
||||
|
@ -323,6 +323,36 @@ checking for extra libraries for example... /another/library/path
|
|||
mode.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="internals2.buildsys.configunix.counter">
|
||||
<title>The counter extension's config.m4 file</title>
|
||||
<para>
|
||||
The counter extension previously documented has a much simpler
|
||||
<filename>config.m4</filename> file than that described above, as it doesn't
|
||||
make use of many buildsystem features. This is a preferred method of
|
||||
operation for any extension that doesn't use an external or bundled library.
|
||||
</para>
|
||||
<example xml:id="internals2.buildsys.configunix.counter.configunix">
|
||||
<title>counter's config.m4 file</title>
|
||||
<programlisting role="autoconf">
|
||||
<![CDATA[
|
||||
dnl ]]>$<![CDATA[Id$
|
||||
dnl config.m4 for extension counter
|
||||
|
||||
PHP_ARG_ENABLE(counter, for counter support,
|
||||
[ --enable-counter Include counter support])
|
||||
|
||||
dnl Check whether the extension is enabled at all
|
||||
if test "$PHP_COUNTER" != "no"; then
|
||||
dnl Finally, tell the build system about the extension and what files are needed
|
||||
PHP_NEW_EXTENSION(counter, counter.c counter_util.c, $ext_shared)
|
||||
PHP_SUBST(COUNTER_SHARED_LIBADD)
|
||||
fi
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<sect1 xml:id="internals2.buildsys.configwin" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Talking to the Windows build system: config.w32</title>
|
||||
<para>
|
||||
|
@ -16,7 +16,7 @@
|
|||
<title>An example config.w32 file</title>
|
||||
<programlisting role="javascript">
|
||||
<![CDATA[
|
||||
// $Id: configwin.xml,v 1.3 2007-06-28 04:45:10 gwynne Exp $
|
||||
// ]]>$<![CDATA[Id$
|
||||
// vim:ft=javascript
|
||||
|
||||
ARG_WITH("example", "for example support", "no");
|
||||
|
@ -51,6 +51,30 @@ if (PHP_EXAMPLE != "no") {
|
|||
</programlisting>
|
||||
</example>
|
||||
|
||||
<sect2 xml:id="internals2.buildsys.configwin.counter">
|
||||
<title>The counter extension's config.w32 file</title>
|
||||
<para>
|
||||
The counter extension previously documented has a much simpler
|
||||
<filename>config.w32</filename> file than that described above, as it
|
||||
doesn't make use of many buildsystem features.
|
||||
</para>
|
||||
<example xml:id="internals2.buildsys.configwin.counter.configwin">
|
||||
<title>counter's config.w32 file</title>
|
||||
<programlisting role="autoconf">
|
||||
<![CDATA[
|
||||
// ]]>$<![CDATA[Id$
|
||||
// vim:ft=javascript
|
||||
|
||||
ARG_ENABLE("counter", "for counter support", "no");
|
||||
if (PHP_COUNTER != "no") {
|
||||
EXTENSION("counter", "counter.c");
|
||||
ADD_SOURCE("counter-util.c");
|
||||
}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<sect1 xml:id="internals2.structure.files" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Files which make up an extension</title>
|
||||
<para>
|
||||
|
@ -31,7 +31,7 @@
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><filename>php_example.h</filename></term>
|
||||
<term><filename>php_counter.h</filename></term>
|
||||
<listitem>
|
||||
<para>
|
||||
When building an extension as static module into the PHP binary the
|
||||
|
@ -44,7 +44,7 @@
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><filename>example.c</filename></term>
|
||||
<term><filename>counter.c</filename></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Main extension source file. By convention, the name of this file
|
||||
|
@ -60,23 +60,23 @@
|
|||
The buildsystem files are discussed elsewhere; this section concentrates on
|
||||
the rest. These four files make up the bare minimum for an extension, which
|
||||
may also contain any number of headers, source files, unit tests, and other
|
||||
support files. The list of files in a realistic extension might look like
|
||||
support files. The list of files in the counter extension might look like
|
||||
this:
|
||||
</para>
|
||||
|
||||
<example xml:id="internals2.structure.files.ex1">
|
||||
<title>Files in an example "real" extension, in no particular order</title>
|
||||
<title>Files in the counter extension, in no particular order</title>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
ext/
|
||||
example/
|
||||
counter/
|
||||
.cvsignore
|
||||
config.m4
|
||||
config.w32
|
||||
example_util.h
|
||||
example_util.c
|
||||
php_example.h
|
||||
example.c
|
||||
counter_util.h
|
||||
counter_util.c
|
||||
php_counter.h
|
||||
counter.c
|
||||
package.xml
|
||||
CREDITS
|
||||
tests/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<sect1 xml:id="internals2.structure.modstruct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>The zend_module structure</title>
|
||||
<para>
|
||||
|
@ -15,27 +15,27 @@
|
|||
|
||||
<para>
|
||||
The <literal>zend_module</literal> declaration from
|
||||
<filename>example.c</filename> looks like this before any code has been
|
||||
<filename>counter.c</filename> looks like this before any code has been
|
||||
written. The example file was generated by
|
||||
<command>ext_skel --extname=example</command>, with some obsolete constructs
|
||||
<command>ext_skel --extname=counter</command>, with some obsolete constructs
|
||||
removed:
|
||||
</para>
|
||||
|
||||
<example xml:id="internals2.structure.modstruct.example-decl">
|
||||
<title>zend_module declaration in an example extension</title>
|
||||
<title>zend_module declaration in the counter extension</title>
|
||||
<programlisting role="c">
|
||||
<![CDATA[
|
||||
/* {{{ example_module_entry
|
||||
/* {{{ counter_module_entry
|
||||
*/
|
||||
zend_module_entry example_module_entry = {
|
||||
zend_module_entry counter_module_entry = {
|
||||
STANDARD_MODULE_HEADER,
|
||||
"example",
|
||||
example_functions,
|
||||
PHP_MINIT(example),
|
||||
PHP_MSHUTDOWN(example),
|
||||
PHP_RINIT(example), /* Replace with NULL if there's nothing to do at request start */
|
||||
PHP_RSHUTDOWN(example), /* Replace with NULL if there's nothing to do at request end */
|
||||
PHP_MINFO(example),
|
||||
"counter",
|
||||
counter_functions,
|
||||
PHP_MINIT(counter),
|
||||
PHP_MSHUTDOWN(counter),
|
||||
PHP_RINIT(counter), /* Replace with NULL if there's nothing to do at request start */
|
||||
PHP_RSHUTDOWN(counter), /* Replace with NULL if there's nothing to do at request end */
|
||||
PHP_MINFO(counter),
|
||||
"0.1", /* Replace with version number for your extension */
|
||||
STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
@ -463,7 +463,7 @@ struct _zend_module_entry {
|
|||
<para>
|
||||
With all these fields to play with, it can be confusing to know which to use
|
||||
for what purpose. Here is the <literal>zend_module</literal> definition from
|
||||
the "counter" example extension.
|
||||
the "counter" example extension after updating it to its final form.
|
||||
</para>
|
||||
|
||||
<example xml:id="internals2.structure.modstruct.filling-it-in.counter-mod-ex">
|
||||
|
|
Loading…
Reference in a new issue