port to Java: mission impossible?
November 24, 2007 12:10AM

Is there any way this could be ported to Java?

PHP is brilliant for certain projects, but the project I work on demands that we live in J2EE world.

Despite not using one of the hot new frameworks for doing Web 2.0 work, we are committed to the same goals -- better web UI for users. And we desperately need a better solution for generating a preview from user-submitted HTML content.

HTML Purifier is feature-for-feature just what we need, except it's not pluggable into a Java setup.

What could be done? Is the implementation of HP such that it could be easily or straightforwardly ported to Java? Any hope of a PHP-Java translator that could automate it? Help me HP-wan, you're my only hope.

Re: port to Java: mission impossible?
November 24, 2007 11:28AM

Previously, users who wanted to use HTML Purifier created a small PHP stub which performed the purification, and then passed that back to Java. The obvious performance hit of having to call an external program was mitigated by the fact that results were cached. Could this setup work for you?

We are looking at porting HTML Purifier, but if anything it would be to C/C++, in order to speed things up.

Re: port to Java: mission impossible?
November 24, 2007 01:24PM

I think the quality of the results would make even the wrapped-PHP solution worth considering. And porting to Java once there was a C/C++ version would be much more straightforward, methinks.

Re: port to Java: mission impossible?
November 24, 2007 02:11PM

Ask your management, then, if installing a PHP interpreter is possible. It doesn't have to be web accessible, it just needs to be invokable by command line.

Sorry, you do not have permission to post/reply in this forum.