php 扩展中是否可以有多个类?
我想包装包含多个公共类的 .cc 代码。可以这样做吗?如何?我是否需要使用多个 .cc 文件,每个我想要包装的类都使用一个文件?
谢谢
I would like to wrapp a .cc code that contains multiple public classes. Is it possible to do that ? how? Do I need to use multiple .cc files one for each class that i want to wrapp?
THX
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你想从 php 调用 C++ 类吗?这是非常困难的。通常你必须编写一个 php 模块(工作量很大)。或者,您可以查看 Thrift,它可以让您将 C++ 代码调用为网络服务(听起来很难,但相信我,这比编写 php 模块更容易)。
You want to call a C++ class from php? This is incredibly difficult. Usually you have to write a php module (a lot of work). Alternatively you could take a look at Thrift which would let you call your C++ code as a network service (sounds hard, but trust me it's easier than writing a php module).
我想知道您正在尝试做什么...如果提到动机,我们可能可以提供更好的帮助。无论如何......
要执行编译的应用程序,您可以使用
execute()
;除此之外,您始终可以编写自己的 php 扩展...
查看这些教程
AFAIK,许多开发人员使用 PHP 来执行 C 函数,因为它可以显着提高性能。
I wonder what you are attempting to do... if motives were mentioned may be we can help better. Anyways....
To execute a compiled application you can use
execute()
;Besides that, you can always write your own php extension....
Check out these tutorials
AFAIK, Many developers use PHP to execute C functions, because it boosts performance quite remarkably.