views:

202

answers:

4

If you wanted to re-create the DOM server-side and manipulate it in PHP, how would you choose to go about it?

I'm looking for a fast, multi-user complete server-side web browser that can interface with PHP and run complete Javascript.

Like Jaxer but something I can use with PHP... an extension would be fine, or even an Apache mod.

Ideas?

+1  A: 

If you wanted to re-create the DOM server-side and manipulate it in PHP, how would you choose to go about it?

I'd use the DOM extension

I'm looking for a fast, multi-user complete server-side web browser that can interface with PHP and run complete Javascript.

Try any of these:

and have a look at

Gordon
A: 

I don't know of any browser emulators for PHP that can execute javascript, but if you can do without that requirement, SimpleTest has a browser component that's pretty nifty. It's part of the SimpleTest suite, but it can easily be used on its own.

Otherwise, your best bet is probably to remote-control Firefox or a Webkit-based browser. You can use Xvfb (X virtual frame buffer) on Linux systems to run graphical programs under a scripting environment.

troelskn
+1  A: 

I'd run Firefox on an instance of Xvfb and make sure the MozRepl plugin was installed.

I'd then connect to the MozRepl server from PHP (using the Perl module's source code to guide me in writing an API if I couldn't find a PHP one).

David Dorward
A: 

Node.js is cause a bit of a stir at the moment. Could be worth looking into more.

Ross