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.
精彩评论