Computer: Programming Language
Limited PHP compiler   (0)  [vote for, against]
Creates a desktop-executable from your web app.

I have become so used to scripting with PHP that C and C++ (even with an IDE) seems way too picky.

I propose a complier that can turn a single php file into a desktop executable.

I really don't think it would be that hard for a good programmer, if the following rules are followed:

1. The PHP file must be fully self-contained (ie form actions must pass back to $PHP_SELF), with switch/cases being passed to functions in the one file.

2. No mysql storage/interactions.

So all that's needed is to change any HTML elements into (eg) C++ widgets, PHP functions converted to C, JavaScript either brought into advanced widget control or further C fuctions, then compile for your fave platform.

You'd need to probably convert all variables into strings and later EVAL them to make sure the type is not 'implied double', but that'd reasonable, too, right?

Does this already exist?
-- not_only_but_also, Jan 26 2006

Although I'm not convinced by the usefulness of this, if you really must do it, get some micro web server code (there are a lot around), the php code, and add it to XUL. (Google for Xul if you're not aware of it) Shouldn't be too hard to produce a standalone web app that way. You may also need something that presents a filing-system-like interface from an embedded zip file inside your exe, so that you don't need to release a pile of files as well as your app. Probably can base that on zlib. I would expect a competant programmer to be able to put this all together in about a week.
-- gtoal, Apr 25 2008

random, halfbakery