php-src/README.EXT_SKEL

44 lines
1.3 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,
libraries or functions in them, the extension is ready to be compiled in
2017-11-10 11:57:27 +08:00
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
The ext_skel.php script generates 'extension_name.c' and 'php_extension_name.h'
2017-11-10 11:57:27 +08:00
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.