Files which make up an extension
Whether created by hand, using ext_skel, or by an alternate extension generator, such as » CodeGen, all extensions will have at least four files:
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 the counter extension might look like this:
Exemplo #1 Files in the counter extension, in no particular order
ext/ counter/ .svnignore config.m4 config.w32 counter_util.h counter_util.c php_counter.h counter.c package.xml CREDITS tests/ critical_function_001.phpt critical_function_002.phpt optional_function_001.phpt optional_function_002.phpt
The .svnignore file is used for extensions which are checked into the PHP Subversion repository (usually » PECL); the one generated by ext_skel contains:
.deps *.lo *.la
These lines tell Subversion to ignore interim files generated by the PHP buildsystem. This is only a convenience, and can be omitted completely without ill effect.
The CREDITS file lists the contributors and/or maintainers of the extension in plain text format. The main purpose of this file is generating the credits information for bundled extensions as used by phpcredits(). By convention the first line of the file should hold the name of the extension, the second a comma separated list of contributors. The contributors are usually ordered by the chronological order of their contributions. In a » PECL package, this information is already maintained in package.xml, for example. This is another file which can be omitted without ill effect.
The package.xml file is specific to » PECL-based extensions; it is a metainformation file which gives details about an extension's dependencies, authors, installation requirements, and other tidbits. In an extension not being hosted in » PECL, this file is extraneous.