- 提取字符串字面量处理逻辑到独立方法 getLiteralString - 将 C++ 接口参数类型从 const char* 改为 const php::String& - 修改字面量字符串数组类型从 php::Var 为 php::Str - 添加 function_exists 函数调用的优化处理 - 更新头文件中的函数声明和内联函数参数类型 - 调整示例代码中的性能测试部分注释状态pull/1/head
parent
5b44e4d390
commit
6dd8d2d6bc
6 changed files with 95 additions and 89 deletions
@ -1,20 +1,20 @@ |
|||||||
#include <phpx.h> |
#include <phpx.h> |
||||||
|
|
||||||
extern zend_class_entry *php_get_class(int class_id, const char *class_name); |
extern zend_class_entry *php_get_class(int class_id, const php::String &class_name); |
||||||
extern zend_function *php_get_func(int func_id, const char *func_name); |
extern zend_function *php_get_func(int func_id, const php::String &func_name); |
||||||
|
|
||||||
static inline php::Variant CALL(int func_id, const char *func_name, const std::initializer_list<php::Variant> &args) { |
static inline php::Variant CALL(int func_id, const php::String &func_name, const std::initializer_list<php::Variant> &args) { |
||||||
return php::call(php_get_func(func_id, func_name), args); |
return php::call(php_get_func(func_id, func_name), args); |
||||||
} |
} |
||||||
|
|
||||||
static inline php::Variant CALL(int func_id, const char *func_name) { |
static inline php::Variant CALL(int func_id, const php::String &func_name) { |
||||||
return php::call(php_get_func(func_id, func_name)); |
return php::call(php_get_func(func_id, func_name)); |
||||||
} |
} |
||||||
|
|
||||||
static inline php::Variant CALL_SILENT(int func_id, const char *func_name, const std::initializer_list<php::Variant> &args) { |
static inline php::Variant CALL_SILENT(int func_id, const php::String &func_name, const std::initializer_list<php::Variant> &args) { |
||||||
return php::silentCall(php_get_func(func_id, func_name), args); |
return php::silentCall(php_get_func(func_id, func_name), args); |
||||||
} |
} |
||||||
|
|
||||||
static inline php::Variant CALL_SILENT(int func_id, const char *func_name) { |
static inline php::Variant CALL_SILENT(int func_id, const php::String &func_name) { |
||||||
return php::silentCall(php_get_func(func_id, func_name)); |
return php::silentCall(php_get_func(func_id, func_name)); |
||||||
} |
} |
||||||
|
|||||||
Loading…
Reference in new issue