Can you turn a website into a program?
July 26, 2009 7:06 PM
Subscribe
Is there a way to embed a rendering engine (like webkit), mysql, and php into a program that talks to itself, not the internet?
I'm almost certainly using the wrong terms. But imagine a php script that reads the text "hello world" from a mysql database.
How do I turn that into an executable that launches an embedded rendering engine, runs the embedded php script, queries the embedded database, and opens a window to display it, all without ever trying to leave its sandbox/communicate with the OS via a port?
Is it possible? If so, is it possible with more complex pieces of work like a CMS or a gallery script (waving away any other dependencies) or an etc.?
posted by Nonce to computers & internet (16 comments total)
2 users marked this as a favorite
The hardest part that I can see would be eliminating the client/server communication model (using ports) altogether. It would be far easier to let the various programs use their default communication mechanisms. How strict do you need your sandbox to be?
It's possible to have a PHP script dump its output to an HTML file, which might help alleviate some of the dependencies (since the rendering engine could just display the HTML file directly instead of requiring a server/CGI access). However, I'm not sure how this would scale with the complexity of the site (it's possible you could write a wrapper and be done, but I don't know for sure). I found this, which might point you in the right direction on that front.
One problem with the PHP --> HTML approach is that it doesn't resolve the PHP/MySQL dependency, since MySQL tends to run as a separate program/daemon. I'm not sure the most direct path to resolve this, so I'll leave it as an open question. If you're not married to MySQL, you might look into PHP/SQLite, which shouldn't require an SQL daemon.
posted by stufflebean at 7:29 PM on July 26