Rodando PHP em um container Java

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

    2 Favorites

    Rodando PHP em um container Java - Presentation Transcript

    1. II Encontro do PHP-PB Desafio dos 15 minutos 07/03/2009
    2. Desafio dos 15 minutos Garoto de Programa Estou tentando ganhar um elefantinho
    3. Desafio dos 15 minutos Como ganhar do esquilinho?
    4. Rodando PHP em um container Java QUERCUS
    5. O que é o Quercus? Quercus é uma tecnologia da Caucho rápida, código-aberto, implementação 100% Java da linguagem PHP
    6. Preciso de quê? Um container Java Glassfish * Tomcat Baixar a última versão da biblioteca
    7. O que realmente importa? WEB-INF/lib/quercus.jar WEB-INF/lib/resin-util.jar WEB-INF/lib/javamail-141.jar WEB-INF/web.xml
    8. No arquivo web.xml – Parte 1 de 2 <!-- início: habilitando o quercus //--> <servlet> <servlet-name>Quercus Servlet</servlet-name> <servlet-class>com.caucho.quercus.servlet.QuercusServlet</servlet-class> <!-- para habilitar o banco de dados <init-param> <param-name>database</param-name> <param-value>java:comp/env/jdbc/BASEMAPEADAJNDI</param-value> </init-param> --> </servlet> <servlet-mapping> <servlet-name>Quercus Servlet</servlet-name> <url-pattern>*.php</url-pattern> </servlet-mapping> <!-- final: habilitando o quercus //--> ...
    9. No arquivo web.xml – Parte 2 de 2 ... <welcome-file-list> <welcome-file>index.php</welcome-file> </welcome-file-list> <!-- início: referência à origem dos dados //--> <!-- <resource-ref> <res-ref-name>jdbc/MINHABASE</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref> --> <!-- final: referência à origem dos dados //-->
    10. Agora já posso fazer meu projeto... MEUPROJETO.WAR/ - WEB-INF - lib: quercus.jar, resin-util.jar, javamail-141.jar - web.xml - index.php
    11. Do arquivo index.php... <?php phpinfo(); ?> ... minha saída é
    12. O pulo do elefantinho...
    13. Importando classes Java no PHP
    14. Classe QueroUmElefantinho.java package info.netinho.desafio; public class QueroUmElefantinho { private String queroumelefantinho; public QueroUmElefantinho() { this.queroumelefantinho = \"Quero um elefantinho!\"; } public String get() { return this.queroumelefantinho; } public static String getEstatico() { return \"Quero um elefantinho!\"; } }
    15. Arquivo quero.php <?php import info.netinho.desafio.QueroUmElefantinho; $quero = new QueroUmElefantinho(); echo $quero->get(); ?> Arquivo quero-estatico.php <?php $quero = java_class(“info.netinho.desafio.QueroUmElefantinho”); echo $quero->getEstatico(); ?>
    16. E a saída... Quero um elefantinho!
    17. Referências Quercus - http://quercus.caucho.com/ Glassfish - http://www.glassfish.org/ NetBeans - http://www.netbeans.org/ Outras referências HeidiSQL - http://www.heidisql.com/
    18. Muito Obrigado! http://netinho.info/
    SlideShare Zeitgeist 2009

    + netinhoteixeiranetinhoteixeira Nominate

    custom

    850 views, 2 favs, 0 embeds more stats

    Este foi o Desafio dos 15 minutos no II Encontro do more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 850
      • 850 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 2
    • Downloads 21
    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