Forum Moderators: coopster
Anyhow, I was either going to just bite the bullet and code the JS or try to write a small PHP wrapper as a plugin.
Well, I happened to be browsing MozDev earlier and I came across a project called MozPHP -- a set of libraries (two, to be exact) which doesn't just wrap the PHP binary but actually calls it through the SAPI just like a real server would!
I downloaded the Mozilla 1.4 binary package for windows provided by the author (there is also a Linux binary package) and grabbed a copy of Mozilla 1.4, followed the install instructions, and viola! Works great! Extreemly fast too! :D
Also, since it is opensource, it could also be compiled for, e.g., Firebird, or Mozilla 1.5 and (in theory) it would work just as well.
Too cool!
Jordan
Monkee, are you thinking of an app that you would distribute as a package (say Mozilla, MozPHP, your app itself all in a zip file), compiled for various platforms? Then the end user would have to install it, but would not need to have a PHP server installed on her machine?
Is that all there is to it? In other words, does the user need to run some installer (other than installing Mozilla obviously), or does she need to install Mozilla, MozPHP, and then your app?
You have the right idea. You just unzip MozPHP package to the Mozilla directory, set up a mime type for text/php and then you can use a special pseudo-protocol (cfh://) to execute any local PHP script in Mozilla without needing a local PHP server.
MozPHP consists of two components:
PHPToHTMLConv
A stream converter for the conversion of PHP files to HTML. The stream converter integrates a PHP SAPI module.
CFH_Protocol
A protocol handler that partly implements the file protocol and the http protocol.
The only limitation the author is aware of is:
You cannot (yet) set cookies using PHPsfunction.setcookie
As for my app...thing, I was just giving a bit of background as to why I was looking for a PHP wrapper. I'm not sure how I will handle deployment yet, but I'm thinking it will probably be a custom build of Firebird / MozPHP with my app as a standard chrome package. A person will just download the package and then unzip it to some directory and then run a .bat file or .sh script that calls 'MozillaFirbird -chrome' with my app's chrome path.
Jordan
I don't know whether this is the kind of thing your looking for, but this thread was extremely enlightening ;)
Putting a new dynamic PHP/MySQL site on a cd-rom [webmasterworld.com]
Cheers,
wruk999