PHP In Browser Update

Jul
19
2004

Well, with the release of PHP5 (and yes, Sokkit 4.0 will be based on
PHP5), it appears that Wes Furlong (spelling?) has fixed the issues with
the ActivePHP extension/container. The ActivePHP5 container now can access
the document, window, history, etc. objects for the browser, including
$window->alert() and $document->write(). The first few attempts at
manipulating the DOM tree didn't seem to want to work and those browser
objects don't dump their structure with print_r() like the other $GLOBALS
variables do. I found that strange. If you do a print_r($GLOBALS,true) in
the ActivePHP5 container, you get exactly what you'd expect for the
environment variables, etc. However, when it gets down to the $document,
$window, etc. objects, all you get is the top level for 95% of them and a
single property for the rest. However, clearly, there is more inside of
those objects than that. Obviously, I don't expect to see methods, but I
did expect to be able to see properties. Unfortunately, this means that
much of the work to do development with this will require hunt-and-peck
debugging to see how to get things like inserting content into a given id
will work.

Also disappointing is that building WSC's doesn't seem to work. I used the
Microsoft wizard and "ActivePHP5" as my engine to build a basic WSC. I
then called it from a test PHP script using the COM interface. I was able
to load the object without PHP calling my die() routine, but when I try to
access a property or method of my WSC, PHP crashes. This may be to some
residual PHP4 files on my test machine. Incidentally, if you want to use
ActivePHP5 on your machine, you need to pretty much commit to PHP5 as it
will use your php.ini file from your Windows/System directory and will try
to load any extensions you have in there, which will mismatch API's with
PHP5. Just an FYI for anyone wondering what's going on when they try this.

At any rate, if anyone has a working WSC, I'd love to see it. Why? Because
writing WSC's with PHP means you can build COM objects *out of* PHP and
use them in *other* COM enabled languages like ASP. Given the fact that so
many COM components for ASP use are really expensive, a cheap PHP COM
object could be a real alternative way to infiltrate ASP development with
the built-in wizardry of PHP.

 

Comments on this post

Feedback is always welcome. Read some from other folks or leave your own below. Just keep things civil and remember that what you post lives on in public. Forever.

Thanks,
J

Leave Your Own Comment

By submitting a comment, you agree to license it under the terms of the Creative Commons Attribution license.

© 2003-2008 J Wynia. All original content is licensed under the terms of the Creative Commons Attribution license unless otherwise noted. Content from other sources is licensed under its original terms.