PHP Internals - PHP 深度探索


Entries Tagged as 'PHP Extension'

Secrets of PHP Extension [TBD]

06月 18th, 2008 · No Comments

在写PHP扩展时,你可能对那些无处不在的宏感到困惑不已,本文将为你揭开这个秘密:
/* __header_here__ */
#ifdef HAVE_CONFIG_H
#include “config.h”
#endif
#include “php.h”
#include “php_globals.h”
#include “php_ini.h”
#include “ext/standard/info.h”
#include “php_myext.h”
#ifdef ZTS
#include “TSRM.h”
#endif
/* If you declare any globals in php_myext.h uncomment this:
ZEND_DECLARE_MODULE_GLOBALS(myext)
*/
/* True global resources - no need for thread safety here */
static int le_myext;
/* {{{ myext_functions[]
*
* Every user visible function must have an entry in myext_functions[].
*/
zend_function_entry myext_functions[] = {
PHP_FE(confirm_myext_compiled,    NULL)        /* For testing, remove [...]

[Read more →]

Tags: PHP Extension