Quercus (http://quercus.caucho.com/) implementiert eine PHP 5 Engine in purem Java. Die Software ist unter LGPL und stammt von Caucho, die auch den performanten Resin-Server implementieren. Laut Herstellerangaben laufen bisher
- DokuWiki, Dragonfly CMS, Drupal, Gallery2, Joomla, Mambo, Mantis, MediaWiki, Phorum, phpBB, phpMyAdmin, PHP-Nuke, WordPress, XOOPS (http://quercus.caucho.com/quercus-3.1/doc/quercus-list-of-applications.xtp)
Von den PHP-Funktionen fehlen bisher:
- call_user_method, call_user_method_array, get_declared_interfaces, interface_exists, property_exists
- date_default_timezone_get, date_default_timezone_set, date_sunrise, date_sunset, idate, localtime, strptime
- debug_print_backtrace, restore_exception_handler, set_exception_handler
- exif_read_data, exif_thumbnail, exif_tagname
- disk_free_space (stub), disk_total_space (stub), readlink (stub), umask (stub)
- register_tick_function, unregister_tick_function
- bind_textdomain_codeset (stub)
- headers_list, setrawcookie
- ob_iconv_handler
- imagecolorclosesthwb, imagecolorset, imagecolorstotal, imageftbbox, imagefttext, imagegammacorrect, imageinterlace, imagelayereffect, imageloadfont, imagepalettecopy, imagepsbbox, imagepscopyfont, imagepsencodefont, imagepsextendfont, imagepsfreefont, imagepsloadfont, imagepsslantfont, imagepstext, imagerotate, iptcembed, image2wbmp, jpeg2wbmp, png2wbmp, imagecreatefromgd2, imagecreatefromgd2part, imagecreatefromgd, imagegd2, imagegd
- ezmlm_hash
- mhash_keygen_s2k
- connection_aborted, connection_status, connection_timeout, __halt_compiler, highlight_file, highlight_string, ignore_user_abort, php_check_syntax, php_strip_whitespace, show_source, sys_getloadavg, time_nanosleep, time_sleep_until
- mysqli_debug, mysqli_disable_reads_from_master, mysqli_disable_rpl_parse, mysqli_info, mysqli_kill, mysqli_master_query, mysqli_report, mysqli_rpl_parse_enabled, mysqli_rpl_probe, mysqli_rpl_query_type, mysqli_send_long_data, mysqli_send_query, mysqli_server_end, mysqli_server_init, mysqli_ssl_set, mysqli_stmt_send_long_data, mysqli_thread_id, mysqli_thread_safe
- dns_get_record, inet_ntop, inet_pton, long2ip, pfsockopen, socket_get_status, socket_get_blocking, socket_get_timeout
- assert_options, dl (stub), get_current_user (stub), get_included_files, get_magic_quotes_gpc, get_magic_quotes_runtime, get_required_files, getopt, getrusage, ini_restore, memory_get_usage, php_ini_scanned_files, php_logo_gid, phpcredits, putenv, restore_include_path, set_magic_quotes_runtime, zend_logo_gid, zend_version
- proc_close, proc_get_status, proc_nice, proc_open, proc_terminate
- stream_bucket_append, stream_bucket_make_writeable, stream_bucket_new, stream_bucket_prepend, stream_filter_append, stream_filter_prepend, stream_filter_register, stream_filter_remove, stream_get_filters, stream_get_meta_data, stream_select, stream_set_blocking, stream_set_timeout (stub), stream_set_write_buffer (stub), stream_socket_accept, stream_socket_server, stream_socket_client, stream_socket_enable_crypto, stream_socket_get_name, stream_socket_pair, stream_socket_recvform, stream_socket_sendto, stream_socket_server
- xml_error_string, xml_get_current_byte_index, xml_get_current_column_number, xml_get_current_line_number, xml_get_error_code, xml_set_external_entity_ref_handler
- und noch ein paar
Aus PHP heraus lassen sich Java-Objekte bauen und auf die gesamte API zugreifen:
<?php
$a = new java(„java.util.Date“, 1234567);
echo $a->day();
?>
Neu eingeführt in PHP wurde auch das import Schlüsselwort.
Beiträge, die sich mit Quercus beschäftigen und zeigen, wie das MediaWiki und Forums-Software läuft, sind:
- http://blogs.sun.com/alexismp/entry/php_in_glassfish_first_steps, Video: http://blogs.sun.com/alexismp/resource/phpbbingf.html
- 100% Java Quercus PHP engine running in GlassFish Java EE 5 Application Server… http://weblogs.java.net/blog/ludo/archive/2007/03/100_java_quercu.html
- Java and PHP Intermingling? http://www.javalobby.org/java/forums/t91427.html