File: skeleton.xml

package info (click to toggle)
php-doc 20081024-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 57,752 kB
  • ctags: 3,858
  • sloc: xml: 686,554; php: 19,446; perl: 610; cpp: 500; makefile: 336; sh: 114; awk: 28
file content (82 lines) | stat: -rw-r--r-- 3,539 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Revision: 1.5 $ -->
 <sect1 xml:id="internals2.buildsys.skeleton" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
  <title>The ext_skel script</title>
  <para>
   A Zend extension is composed of several files common to all extensions. As
   the details of many of those files are similar from extension to extension,
   it can be laborous to duplicate the content for each one. Fortunately, there
   is a script which can do all of the initial setup for you. It's called
   <command>ext_skel</command>, and it's been distributed with PHP since 4.0.
  </para>
  
  <para>
   Running <command>ext_skel</command> with no parameters produces this
   output in PHP 5.2.2:
   <screen>
<![CDATA[
php-5.2.2/ext$ ./ext_skel 
./ext_skel --extname=module [--proto=file] [--stubs=file] [--xml[=file]]
           [--skel=dir] [--full-xml] [--no-help]

  --extname=module   module is the name of your extension
  --proto=file       file contains prototypes of functions to create
  --stubs=file       generate only function stubs in file
  --xml              generate xml documentation to be added to phpdoc-cvs
  --skel=dir         path to the skeleton directory
  --full-xml         generate xml documentation for a self-contained extension
                     (not yet implemented)
  --no-help          don't try to be nice and create comments in the code
                     and helper functions to test if the module compiled
]]></screen>
   Generally, when developing a new extension the only parameters you will be
   interested in are <literal>--extname</literal> and
   <literal>--no-help</literal>. Unless you are already experienced with the
   structure of an extension, you will <emphasis>not</emphasis> want to use
   <literal>--no-help</literal>; specifying it causes
   <command>ext_skel</command> to leave out many helpful comments in the
   files it generates.
  </para>
  
  <para>
   This leaves you with <literal>--extname</literal>, which tells
   <command>ext_skel</command> what the name of your extension is. This
   "name" is an all-lowercase identifier containing only letters and
   underscores which is unique among everything in the
   <filename>ext/</filename> folder of your PHP distribution. 
  </para>
  
  <para>
   The <literal>--proto</literal> option is intended to allow the developer to
   specify a header file from which a set of PHP functions will be created,
   ostensibly for the purpose of developing an extension based on a library,
   but it often functions poorly with most modern header files. A test run on
   the <filename>zlib.h</filename> header resulted in a very large number of
   empty and nonsense prototypes in the <command>ext_skel</command> output
   files. The <literal>--xml</literal> and <literal>--full-xml</literal>
   options are entirely nonfunctional thus far. The <literal>--skel</literal>
   option can be used to specify a modified set of skeleton files to work from,
   a topic which is beyond the scope of this section.
  </para>
 </sect1>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->