php-src/README.EXT_SKEL

45 lines
1.4 KiB
Plaintext
Raw Normal View History

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.
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
2017-11-10 11:57:27 +08:00
php ext_skel.php --ext extension_name
2017-11-10 11:57:27 +08:00
and everything you need will be placed in directory ext/extension_name.
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:
2017-11-10 11:57:27 +08:00
./buildconf; ./configure --enable-extension_name; make
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
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.
OTHER OPTIONS
2017-11-10 11:57:27 +08:00
Run php ext_skel.php --help to see the available options.