PHP on Java (BarCamp London 7)

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite & 1 Event

    PHP on Java (BarCamp London 7) - Presentation 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

    + Robin FernandesRobin Fernandes, 1 month ago

    custom

    208 views, 1 favs, 0 embeds more stats

    PHP on Java: why it makes sense to run PHP on the J more

    More info about this document

    CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

    Go to text version

    • Total Views 208
      • 208 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 8
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Groups / Events