downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/internals2.buildsys.skeleton.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/internals2.buildsys.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'internals2.buildsys.skeleton.php',
   
1 => 'The ext_skel script',
  ),
 
'up' =>
  array (
   
0 => 'internals2.buildsys.php',
   
1 => 'The PHP 5 build system',
  ),
 
'prev' =>
  array (
   
0 => 'internals2.buildsys.environment.php',
   
1 => 'Building PHP for extension development',
  ),
 
'next' =>
  array (
   
0 => 'internals2.buildsys.configunix.php',
   
1 => 'Talking to the UNIX build system: config.m4',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="internals2.buildsys.skeleton" class="sect1">
  <h2 class="title">The ext_skel script</h2>
  <p class="para">
   A PHP 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 laborious to duplicate the content for each one. Fortunately, there
   is a script which can do all of the initial setup for you. It&#039;s called
   <strong class="command">ext_skel</strong>, and it&#039;s been distributed with PHP since 4.0.
  </p>
 
  <p class="para">
   Running <strong class="command">ext_skel</strong> with no parameters produces this
   output in PHP 5.2.2:
   <div class="example-contents screen">
<div class="cdata"><pre>
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&#039;t try to be nice and create comments in the code
                     and helper functions to test if the module compiled
</pre></div></div>
   Generally, when developing a new extension the only parameters you will be
   interested in are <i>--extname</i> and
   <i>--no-help</i>. Unless you are already experienced with the
   structure of an extension, you will <em class="emphasis">not</em> want to use
   <i>--no-help</i>; specifying it causes
   <strong class="command">ext_skel</strong> to leave out many helpful comments in the
   files it generates.
  </p>
 
  <p class="para">
   This leaves you with <i>--extname</i>, which tells
   <strong class="command">ext_skel</strong> what the name of your extension is. This
   &quot;name&quot; is an all-lowercase identifier containing only letters and
   underscores which is unique among everything in the
   <var class="filename">ext/</var> folder of your PHP distribution.
  </p>
 
  <p class="para">
   The <i>--proto</i> 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 <var class="filename">zlib.h</var> header resulted in a very large number of
   empty and nonsense prototypes in the <strong class="command">ext_skel</strong> output
   files. The <i>--xml</i> and <i>--full-xml</i>
   options are entirely nonfunctional thus far. The <i>--skel</i>
   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.
  </p>
 </div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites