![]() |
| |||||||||
| Resin 3.1 Documentation Examples Changes Overview Installation Configuration Quercus SOA/IoC JSP Servlets and Filters Admin (JMX) EJB Amber Security Performance Hessian XML and XSLT Third-party Troubleshooting/FAQ Getting Started Overview Security Module Status Resin Module Java Interface List of PHP Applications |
Overview, status, and discussions on Quercus, Caucho's Java implementation of the PHP language. Language StatusQuercus implements the PHP 5 language in Java, including object
and exception support. Quercus is a mixed interpreted/compiled implementation.
Long-running PHP scripts are compiled to Java for performance, while
short scripts, like Because Quercus is a Java implementation, it natively supports 16-bit
unicode strings and functions. Quercus (in 3.1.0) supports the
new PHP 6 internationalization syntax, and the older unicode conversion
functions like Application StatusAt present, a major development focus is getting 100 PHP applications to run on Quercus. Since PHP and its libraries are fairly large with a number of obscure details, we expect this process to take some time. Based on the current development snapshot, the current list of applications is: DokuWiki, Dragonfly CMS, Drupal, Gallery2, Joomla, Mambo, Mantis, MediaWiki, Phorum, phpBB, phpMyAdmin, PHP-Nuke, Wordpress, XOOPS. Module StatusStandard ModulesQuercus implements the standard PHP libraries (arrays, strings, date, regexp, etc). It also supports extension libraries like zip and zlib for compression, mcrypt for encryption, mail (implemented with JavaMail), and bcmath for large numbers. Database ModulesThe database support in Quercus supports robust database connection pooling since Quercus runs in Resin, a fast Java application server. All PHP database access automatically uses JDBC-pooled connections. PHP code does not need changing to take advantage of this capability. The PHP database apis supported include PDO (portable database objects), mysql, mysql improved, postgres and oracle. Any JDBC-compliant database is available to PHP scripts using PDO.
<php
$db = new PDO("java:comp/env/jdbc/my-database");
...
?>
APC (object caching)For PHP object caching, Quercus implements the APC module. PHP applications can use the APC functions to save PHP objects without resorting to serialization and database persistence. Because Quercus runs in Resin, a Java web server, the saved objects are quickly available to any thread running PHP. In other words, unlike Apache which makes sharing across different PHP processes difficult, Quercus can just store a singleton cache of the APC-cached objects. Because Quercus compiles PHP to Java code, PHP scripts get the opcode caching of APC for free. At this time, performance of Quercus is roughtly comparable with performance of mod_php with APC, i.e. it is significantly faster (3-5 times) than mod_php running by itself. Image support ('gd')Quercus provides the image module, so users can use image manipulation functions like watermarking and thumbnail generation in any PHP script on Quercus. .jpg, .png, and .gif files are currently supported. Java users will also find these libraries convenient. PDF generation (PDFlib api)PDF generation in Quercus follows the PDFlib API. Since the Quercus PDF implementation is a new implementation in Java, no special downloads are needed to use PDF. AJAX (JSON)Quercus also includes the new JSON module for encoding and decoding AJAX-style requests. The JSON modules is an excellent example of the benefits of writing modules in Java. Because Java supports garbage collection and protects from pointer overruns, the JSON module implementation is straightforward and reliable, without having to worry about all the possible memory problem in a C library. Gettext (localization)Quercus in Resin 3.1.0 supports the gettext API and .po and .mo files. gettext is a portable API for localization, i.e. translation of program messages. In the future, the Quercus gettext implementation will support Java message bundles so Java applications using PHP can use standard Java localization techniques.
| |||||||||