cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@us.ibm.com
Subject *preliminary* PHP generator committed
Date Wed, 28 Jun 2000 15:20:09 GMT


OK, I've committed to the cocoon-2 branch the beginnings of a PHP
generator.  A suitably configured system will invoke the PHP binaries
through JNI and the output of the page will be processed through the
configured XML parser and placed into the pipeline for processing by such
filters as XSLT.

This enables PHP developers to access the powers of Cocoon to separate
their content, style, and logic without requiring them to write a single
line of Java code.

To build, one needs to first build PHP as a servlet.  Then copy the
resulting phpsrvlt.jar into xml-cocoon-lib and build cocoon.  Then copy
both phpsrvlt.jar and cocoon.jar into Tomcat's lib directory, and add the
php servlet DLL or shared library to your path/LD_LIBRARY_PATH.

To configure, simply add the following to your configuration

   <generator name="php"
   class="org.apache.cocoon.generators.PhpGenerator"/>

...and then use this generator in a process.

This has been developed using JDK 1.2.2 on Win2K with Tomcat, but should
run on pretty much any OS supported by PHP and Java, any JDK 1.1 or better,
and any servlet 2.0 or better engine.  You do need cocoon2 and PHP 4.0.1
however, neither of which has been released.

Warning: what I have committed has only been tested to the point where it
processes a simple "hello world" style page.  An example of known problems
include error recovery - the default behavior of PHP is to insert an error
message into the output stream.  While this default error message is valid
HTML, it is not well formed XML; the result being that instead of seeing
what you did wrong, you see a message about an unmatched <br> tag.

I expect to evolve this quickly and have the code ready for prime time by
the O'Reilly Open Source conference in Monterey.

- Sam Ruby



Mime
View raw message