Upload
quang-anh-le
View
1.230
Download
2
Embed Size (px)
Citation preview
Quercus – PHP in JAVAJava implementation of the PHP language
Author: Bui Dinh NgocAiti-aptech
What's QuercusQuercus 100% Java implementation of
PHP PHP run on JVM (not Zend Engine)Opensource GPL license
Why?● Performance
– Up to 4x faster on some applications● Security
– Avoids buffer overflow problems in C-basedimplementation● Java/PHP integration
– PHP can now access any Java library or objects– Java can use PHP as a view technology
Why? (continue)
● PHP on Google App Engine– Google cloud computing
● Long Live Process (worker)– Php process ~ 82 live hours - Java process ∞ live hours
● Delicate Cache vs Cache on process
Existing PHP applications on QuercusMediawiki
Wordpress
DokuWiki
Drupal
Gallery2
Php-Nuke
PhpMyAdmin
Openads
PHP+JAVA
Working with Java classes in PHP<?php $a = new Java("java.util.Date", 123); echo $a->time; ?>OR<?php import java.util.Date; $a = new Date(123); echo $a->time;?>
PHP Module Standard modules
Quercus implements the standard PHP libraries (arrays, strings, date, regexp, zip ,zlib mcrypt, bcmath.
PHP Ext ModuleAPC (object caching)Image support ('gd')PDF generation (PDFlib api)AJAX (JSON)GetText (localization)
Using Databases (PHP API)MySQLPostgreSQLOracle
Java Module
All, of course !!!
Benefits of QuercusPerformance - simply fasterDevelopment - fast, safe, and easyCapability - powerful Java technologies Security - no more pesky C memory bugsScalability - Massive clusters of PHPInternationalization - 16-bit unicode
Demo<?php $a=time(); $arr = array(); for($i=0;$i<10000000;$i++) { $arr[i] = $i; } sort($arr); $b=time(); echo $b-$a; ?>
====> Time Processinghttp://quercusdemo.appspot.com/ ====> 8shttp://222.255.28.33:8888/index.php ====> 5shttp://o2tv.vn/quercus.php ===> 15s
Drupal performance stats
Thank you