开发者

How to export all functions inside PHP extension?

I opened php_sqlite.dll & php_sockets.dll using Depends.exe. I saw only 1 function in both: get_module

How can I export all functions in extension to dll files when compiling the .dll? AFAIK, ZEND_FUNC开发者_运维百科TION is used to declare functions in the modules. Please kindly advise. Thank you very much!


I wouldn't simply expose all functions. If it isn't your extension, just do what zend does - call get_module(), get the function descriptions & function pointers.

If it is your extension however, consider whether you are mainly targeting PHP, C++ or want to support whatever comes your way.
If you are mainly targeting PHP and the C++ access is an exception, just do what zend does. In both other cases a C++ core with just some interfacing to PHP is what you should go for - interface generators like SWIG can ease your job and generate the PHP interface for you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜