适用于 Windows 的 PHP 驱动的 GUI 应用程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6870289/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PHP-powered GUI Applications for Windows
提问by Jimmie Lin
I know that PHP is an interpreted language and for web-based things, isn't designed for running GUI applications on actual OSs, but is there a way?
我知道 PHP 是一种解释性语言,对于基于 Web 的事物,它不是为在实际操作系统上运行 GUI 应用程序而设计的,但有没有办法?
Basically, is there a framework / system that allows me to create "native" (basically, binary, .exe, looks like a Win32 app with the native controls and all) windows, GUI-based applications?
基本上,是否有一个框架/系统允许我创建“本机”(基本上,二进制,.exe,看起来像带有本机控件和所有的 Win32 应用程序)窗口,基于 GUI 的应用程序?
So I could code a PHP app with such framework, and (somehow) compile it into an .exe, and distribute it as a normal windows application. Possible?
所以我可以用这样的框架编写一个 PHP 应用程序,并且(以某种方式)将它编译成一个 .exe,然后将它作为一个普通的 Windows 应用程序分发。可能的?
I could use VS/.NET , C# and all, but using PHP would allow me to reuse an internal framework for many extra functions, shortening the development cycle a lot.
我可以使用 VS/.NET、C# 和所有,但使用 PHP 将允许我为许多额外功能重用内部框架,从而大大缩短开发周期。
So, is there such a way to do it?
那么,有没有这样的方法呢?
采纳答案by Julien Roncaglia
The best solution if you have knowledge of .Net would be to use Phalanger(Blog) which basically compile php code to the .Net intermediate language and allow you to access all standard .Net libraries (including WPF and WinForms so you could create GUIs)
如果您了解 .Net,最好的解决方案是使用Phalanger(博客),它基本上将 php 代码编译为 .Net 中间语言,并允许您访问所有标准的 .Net 库(包括 WPF 和 WinForms,因此您可以创建 GUI)
回答by Delan Azabani
You can use any number of GUI toolkits that have PHP bindings, such as GTK+ through PHP-GTK.
您可以使用任意数量的具有 PHP 绑定的 GUI 工具包,例如 GTK+ 到 PHP-GTK。
Then you can 'compile' it with something like HipHop, which transforms your PHP into optimised C++ that you can then proceed to compile. Of course, compilation is not necessary at all, but if you want to, it's possible.
然后你可以用 HipHop 之类的东西“编译”它,它将你的 PHP 转换成优化的 C++,然后你可以继续编译。当然,编译根本没有必要,但如果你愿意,也是可以的。
回答by DevelRoot
Yes, there is a IDE called DevelStudio. It has a Visual-Studio like interface and you can write all your code in PHP and by pressing a button it compiles into .exe that runs standalone.
是的,有一个名为DevelStudio的 IDE 。它有一个类似 Visual-Studio 的界面,你可以用 PHP 编写所有代码,只需按下一个按钮,它就会编译成独立运行的 .exe。
回答by Igor Teterin
There is DevelNext, but there are JPHP. JPHP - is PHP. It compile to Java byte code. simple code comatible, but no chance that any existing real PHP class will work. No chance. But IDE DevelNext is cool.
有DevelNext,但有 JPHP。JPHP - 是 PHP。它编译为Java字节码。简单的代码兼容,但任何现有的真正 PHP 类都无法工作。没有机会。但是 IDE DevelNext 很酷。