如何导出PHP扩展中的所有函数?

发布于 2024-08-12 17:12:07 字数 178 浏览 7 评论 0原文

我打开 php_sqlite.dll &使用 Depends.exe 的 php_sockets.dll。我在两者中都只看到了 1 个函数: get_module

在编译 .dll 时,如何将扩展名中的所有函数导出到 dll 文件? AFAIK,ZEND_FUNCTION 用于声明模块中的函数。请各位指教。非常感谢!

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_FUNCTION is used to declare functions in the modules. Please kindly advise. Thank you very much!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人事已非 2024-08-19 17:12:07

我不会简单地公开所有功能。如果这不是您的扩展,只需执行 zend 的操作 - 调用 get_module(),获取函数描述和信息。函数指针。

但是,如果这是您的扩展,请考虑您是否主要针对 PHP、C++,还是想要支持您遇到的任何问题。
如果您主要针对 PHP 并且 C++ 访问是例外,那么只需执行 zend 的操作即可。在其他两种情况下,您应该选择仅具有 PHP 接口的 C++ 核心 - 像 SWIG 可以简化您的工作并为您生成 PHP 界面。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文