2003-06-30 00:07:18 +08:00
|
|
|
WHAT IT IS
|
|
|
|
|
2017-11-10 11:57:27 +08:00
|
|
|
It's a tool for automatically creating the basic framework for a PHP extension.
|
2003-06-30 00:07:18 +08:00
|
|
|
|
|
|
|
HOW TO USE IT
|
|
|
|
|
2017-11-10 11:57:27 +08:00
|
|
|
Very simple. First, change to the ext/ directory of the PHP sources. Then
|
|
|
|
run the following
|
2003-06-30 00:07:18 +08:00
|
|
|
|
2017-11-10 11:57:27 +08:00
|
|
|
php ext_skel.php --ext extension_name
|
2003-06-30 00:07:18 +08:00
|
|
|
|
2017-11-10 11:57:27 +08:00
|
|
|
and everything you need will be placed in directory ext/extension_name.
|
2003-06-30 00:07:18 +08:00
|
|
|
|
|
|
|
If you don't need to test the existence of any external header files,
|
2017-11-10 11:57:27 +08:00
|
|
|
libraries or functions in them, the extension is ready to be compiled in
|
|
|
|
PHP. To compile the extension, run the following:
|
2003-06-30 00:07:18 +08:00
|
|
|
|
2017-11-10 11:57:27 +08:00
|
|
|
./buildconf; ./configure --enable-extension_name; make
|
2003-06-30 00:07:18 +08:00
|
|
|
|
2017-11-10 11:57:27 +08:00
|
|
|
The definition of PHP_extension_NAME_VERSION will be present in the
|
|
|
|
php_extension_name.h and injected into the zend_extension_entry definition. This
|
2013-10-14 22:07:26 +08:00
|
|
|
is required by the PECL website for the version string conformity checks
|
|
|
|
against package.xml
|
|
|
|
|
2014-01-26 17:31:27 +08:00
|
|
|
SOURCE AND HEADER FILE NAME
|
|
|
|
|
2017-11-10 11:57:27 +08:00
|
|
|
The ext_skel.php script generates 'extension_name.c' and 'php_extension_name.h'
|
|
|
|
as the main source and header files. Keep these names.
|
2014-01-26 17:31:27 +08:00
|
|
|
|
2017-11-10 11:57:27 +08:00
|
|
|
extension functions (User functions) must be named
|
2014-01-26 17:31:27 +08:00
|
|
|
|
2017-11-10 11:57:27 +08:00
|
|
|
extension_name_function()
|
2014-01-26 17:31:27 +08:00
|
|
|
|
2017-11-10 11:57:27 +08:00
|
|
|
When you need to expose extension functions to other extensions, expose functions
|
2014-01-26 17:31:27 +08:00
|
|
|
strictly needed by others. Exposed internal function must be named
|
|
|
|
|
2017-11-10 11:57:27 +08:00
|
|
|
php_extension_name_function()
|
2014-01-26 17:31:27 +08:00
|
|
|
|
|
|
|
See also CODING_STANDARDS.
|
|
|
|
|
2003-06-30 00:07:18 +08:00
|
|
|
OTHER OPTIONS
|
|
|
|
|
2017-11-10 11:57:27 +08:00
|
|
|
Run php ext_skel.php --help to see the available options.
|
2003-06-30 00:07:18 +08:00
|
|
|
|