模块种类(两种) 类型一:zend的模块:(类似zend_extension=test.so) 识别方法: php.ini中以zend_extension开头的配置,如zend_extension=test.so,存放到数据结构zend_extensions中 模块的数据结构: struct _zend_extension { // zend扩展模块结构体(php.ini中以zend_extension开头的配置,如zend_extension=test.so) char *name; // z…
// opcode处理器 --- ZEND_DO_FCALL_SPEC_CONST_HANDLER实现在 php-5.6.26\Zend\zend_vm_execute.h static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zval *fname = opline->op1.zv; call_slot *call = EX(call_slots) + o…
// main实现在文件 php-5.6.26\sapi\cgi\cgi_main.c int main(int argc, char *argv[]) { .... cgi_sapi_module->startup(){ // php_cgi_startup实现在文件 php-5.6.26\sapi\cgi\cgi_main.c static int php_cgi_startup(sapi_module_struct *sapi_module) { // php_module_startup…
添加 , (void *)module, sizeof(zend_module_entry), (void**)&module_ptr){ // zend_hash_add 定义在文件“php-5.6.26\Zend\zend_hash.h” #define zend_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ _zend_hash_add_or_update(ht, arKey, nKeyLength, pData, n…
初始化 有指定析构函数,在销毁hash的时候会调用,如:“类似extension=test.so扩展”也是存放在HashTable中的,“类似extension=test.so扩展”的module_shutdown_func函数就是靠hash的析构函数来调用的 zend_hash_init_ex(GLOBAL_FUNCTION_TABLE, , NULL, ZEND_FUNCTION_DTOR, , ); { // zend_hash_init_ex 定义在文件“php-5.6.26\Zend\…
// zend_inline_hash_func 实现在文件“php-5.6.26\Zend\zend_hash.h” h = zend_inline_hash_func(arKey, nKeyLength); { // zend_hash_add 定义在文件“php-5.6.26\Zend\zend_hash.h” /* * DJBX33A (Daniel J. Bernstein, Times 33 with Addition) * * This is Daniel J. Bernstein…
php-7.2.3 在“汇编php文件”和“执行opcode代码”上做了大量改变php-5.6.26 没见到支持抽象语法树的相关代码,php-7.2.3 见到支持抽象语法树的相关代码php-5.6.26 存在“保存active_op_array现场”的代码,php-7.2.3 去除了“保存active_op_array现场”的代码 php-5.6.26 php-7.2.3 .初始化 opcode处理器列表// main实现在文件“php-5.6.26\sapi\cgi\cgi_main.c” i…
.初始化 opcode处理器列表 // main实现在文件“php-5.6.26\sapi\cgi\cgi_main.c” int main(int argc, char *argv[]) { if (cgi_sapi_module.startup(&cgi_sapi_module){ // php_cgi_startup实现在文件“php-5.6.26\sapi\cgi\cgi_main.c” static int php_cgi_startup(sapi_module_struct *sap…
文件 php-5.6.26/Zend/zend_vm_opcodes.h #ifndef ZEND_VM_OPCODES_H #define ZEND_VM_OPCODES_H BEGIN_EXTERN_C() ZEND_API const char *zend_get_opcode_name(zend_uchar opcode); END_EXTERN_C() #define ZEND_NOP 0 #define ZEND_ADD 1 #define ZEND_SUB 2 #define ZE…
文件 php-5.6.26/Zend/zend_vm_execute.h ZEND_API void execute_ex(zend_execute_data *execute_data TSRMLS_DC) { DCL_OPLINE zend_bool original_in_execution; original_in_execution = EG(in_execution); // 保存现场 EG(in_execution) = ; // 正在执行中 ) { zend_vm_enter:…