Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

PHP Day 2011 Quercus – PHP in JAVA

1,534 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

PHP Day 2011 Quercus – PHP in JAVA

  1. 1. Java implementation of the PHP language Author: Bui Dinh Ngoc Aiti-aptech
  2. 2. Whats Quercus Quercus 100% Java implementation of PHP PHP run on JVM (not Zend Engine) Opensource GPL license
  3. 3. 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
  4. 4. 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
  5. 5. Existing PHP applications onQuercus Mediawiki  Gallery2 Wordpress  Php-Nuke DokuWiki  PhpMyAdmin Drupal  Openads
  6. 6. PHP+JAVA
  7. 7. 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; ?>
  8. 8. PHP Module Standard modules Quercus implements the standard PHP libraries (arrays, strings, date, regexp, zip ,zlib mcrypt, bcmath.
  9. 9. PHP Ext Module APC (object caching) Image support (gd) PDF generation (PDFlib api) AJAX (JSON) GetText (localization)
  10. 10. Using Databases (PHP API) MySQL PostgreSQL Oracle
  11. 11. Java Module All, of course !!!
  12. 12. Benefits of Quercus Performance - simply faster Development - fast, safe, and easy Capability - powerful Java technologies Security - no more pesky C memory bugs Scalability - Massive clusters of PHP Internationalization - 16-bit unicode
  13. 13. Demo<?php $a=time(); $arr = array(); for($i=0;$i<10000000;$i++) { $arr[i] = $i; } sort($arr); $b=time(); echo $b-$a;?> ====> Time Processing http://quercusdemo.appspot.com/ ====> 8s http://222.255.28.33:8888/index.php ====> 5s http://o2tv.vn/quercus.php ===> 15s
  14. 14. Drupal performance stats
  15. 15. Thank you

×