Your SlideShare is downloading. ×
PHP on Java (BarCamp London 7)
PHP on Java (BarCamp London 7)
PHP on Java (BarCamp London 7)
PHP on Java (BarCamp London 7)
PHP on Java (BarCamp London 7)
PHP on Java (BarCamp London 7)
PHP on Java (BarCamp London 7)
PHP on Java (BarCamp London 7)
PHP on Java (BarCamp London 7)
PHP on Java (BarCamp London 7)
PHP on Java (BarCamp London 7)
PHP on Java (BarCamp London 7)
PHP on Java (BarCamp London 7)
PHP on Java (BarCamp London 7)
PHP on Java (BarCamp London 7)
PHP on Java (BarCamp London 7)
PHP on Java (BarCamp London 7)
PHP on Java (BarCamp London 7)
PHP on Java (BarCamp London 7)
PHP on Java (BarCamp London 7)
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

PHP on Java (BarCamp London 7)

11,418

Published on

PHP on Java: why it makes sense to run PHP on the Java Virtual Machine.

PHP on Java: why it makes sense to run PHP on the Java Virtual Machine.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
11,418
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
25
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Transcript

    • 1. PHP on Java
      • Dads
      • ad
      Robin Fernandes (ibm) [email_address] @rewbs
    • 2. PHP ? “ PHP isn't so much a language as a virtual explosion at the keyword and function factory .” - Jeff Atwood from “PHP sucks, but it doesn't matter”
    • 3. PHP ? in_array( $needle , $haystack ); strpos( $haystack , $needle ); ... IteratorIterator RecursiveIterator RecursiveIteratorIterator ... strip _ tags() strip s lashes() SDO _ Model _ Property::get C ontaining T ype() ReflectionClass::isItera tea ble()
    • 4. PHP ! tiobe.com
    • 5. PHP ! Photo from DragonBe
    • 6. PHP !
    • 7. Why integrate PHP and Java?
      • PHP Developers to grow from 3 to 5.5 million by 2013
      • PHP Developers in Corporate IT to grow from 13% to 60% by 2013
      “ Pay special attention to opportunities to use PHP in combination with Java development efforts”
        - Gartner
    • 8. Why run PHP on the JVM ?
      • PHP is an awesome language for web dev
      • The Java Virtual Machine is a cutting edge language runtime
      PHP + JVM = ♥
    • 9. How PHP runs on the JVM <?php echo 'hello' ; System. out .println( &quot;hello&quot; );
    • 10. How PHP runs on the JVM
      • P8: a PHP 5.2 runtime implemented in Java
      • Runs on any Java 5+ JDK
        Extensibility
        • XAPI-C for existing C extensions
        • XAPI-J for new Java extensions
        (extension language choice is opaque to scripts)
      • Debug via DBGp using Eclipse PDT
      P8 Runtime SAPI-J Parser Interpreter P8 Engine Java Extensions C Extensions Stack Resources Classes Objects Variables AST XAPI-J XAPI-C Native code Compiler .class opcodes Cache Persistent class cache Debug API (DBGp) Runtime
    • 11. Some Code ! <?php java_import( &quot;java.util.HashMap&quot; ); $map = new HashMap; $map ->put( &quot;stuff&quot; , array ( 1 , 2 , 3 , 4 , 5 )); var_dump( $map ->get( &quot;stuff&quot; )); // prints: array(5) { ...
    • 12. Some more Code ! <?php java_import( &quot;java.io.File&quot; ); class SubFile extends File { function isThisCool() { return TRUE ; // Way cool } } $file = new SubFile( &quot;/&quot; ); var_dump( $file ->isDirectory()); var_dump( $file ->isThisCool());
    • 13. Last bit of Code ! <?php java_import( &quot;java.util.ArrayList&quot; ); $list = new ArrayList(); $list ->add( &quot;Hello World!&quot; ); $list ->add( FALSE ); $list ->add( 1234567890 ); foreach ( $list as $key => $value ) { echo &quot; $key $value &quot; ; }
    • 14. PHP apps + Java libraries
        For example...
        • SugarCRM + Apache POI
        • Drupal + Eclipse BIRT
        • PhpBB + Apache Lucene
        • Your PHP app + ??? = profit
    • 15. Java apps + PHP scripting
        For example...
    • 16. PHP in WebSphere sMash
        Build Web apps quickly and easily in Java , Groovy and PHP .
      • “ The application is the server”
      • Lightweight runtime, not a Java EE environment
      • Browser-based development tooling
      JVM Web Server Application Code Language Runtimes
    • 17. Sorry, one more bit of Code ! class Dynamic { def storage = [:] def invokeMethod(String name, args) { println &quot;Hello!&quot; } def getProperty(String name) { storage[name] } def setProperty(String name, value) { storage[name] = value } } <?php groovy_import( &quot;dynamic.groovy&quot; ); $foo = new Dynamic(); $foo ->bar(); $foo ->guff = &quot;Hello World!&quot; ; echo $foo ->guff;
    • 18. PHP in Message Broker
      • Message Broker “ connects anything to anything ”
      • Routes and transforms data along the way
      • Use graphical mapping, XSLT, ESQL, Java and now PHP !
      • With PHP, use a SimpleXML-inspired syntax to easily manipulate XML message formats.
    • 19. PHP in CICS
        Build RESTful services based on CICS assets using PHP
      Transaction Server CICS assets: RESTful API to CICS assets SupportPac CA1S ... DB2 COBOL Java
    • 20. Learn more & Try it out: http://projectzero.org/php Thanks! [email_address] / @rewbs

    ×