Hi,
I want to write an independent extension for PHP. This extension should not be compiled into PHP. It should be dynamically loaded in PHP script.
The platform is to be Linux. Can someone tell me the broad steps to do so ?
Thanks in advance,
iceberg.
How to create PHP extension ?
Moderator: General Moderators
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact:
here is a good Table of Contents to get you going: http://www.php.net/manual/en/zend.php
there are several modules within the source-distribution of php.
Take a look at those that can be configured via with-xyz-shared.
i.e. the tokenizer module. note:in tokenizer.c
Take a look at those that can be configured via with-xyz-shared.
i.e. the tokenizer module. note:
Code: Select all
/* {{{ tokenizer_functionsї]
*
* Every user visible function must have an entry in tokenizer_functionsї].
*/
function_entry tokenizer_functionsї] = {
PHP_FE(token_get_all, NULL)
PHP_FE(token_name, NULL)
{NULL, NULL, NULL} /* Must be the last line in tokenizer_functionsї] */
};
/* }}} */
/* {{{ tokenizer_module_entry
*/
zend_module_entry tokenizer_module_entry = {
#if ZEND_MODULE_API_NO >= 20010901
STANDARD_MODULE_HEADER,
#endif
"tokenizer",
tokenizer_functions,
PHP_MINIT(tokenizer),
PHP_MSHUTDOWN(tokenizer),
PHP_RINIT(tokenizer), /* Replace with NULL if there's nothing to do at request start */
PHP_RSHUTDOWN(tokenizer), /* Replace with NULL if there's nothing to do at request end */
PHP_MINFO(tokenizer),
#if ZEND_MODULE_API_NO >= 20010901
"0.1", /* Replace with version number for your extension */
#endif
STANDARD_MODULE_PROPERTIES
};
/* }}} */
#ifdef COMPILE_DL_TOKENIZER
ZEND_GET_MODULE(tokenizer)
#endifif