[Conférence Frameworks PHP à EPITA] - 19/03/2009 - Présentation Zend Framework

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.

1 comments

Comments 1 - 1 of 1 previous next Post a comment

Post a comment
Embed Video
Edit your comment Cancel

1 Favorite

[Conférence Frameworks PHP à EPITA] - 19/03/2009 - Présentation Zend Framework - Presentation Transcript

  1. Zend Framework Alban HANRY
  2. PHP : Souvenir, souvenir
    • < html >< head ></ head >< body >
    • <?php
    • function questionp( $input ) {
    • return strrpos ( $input , '?' ) === strlen ( $input ) - 1 ;
    • }
    • ?><?php if (! isset ( $_POST [ 'submit' ] )) {
    • // if the &quot;submit&quot; variable does not exist the form has not been submitted, so display form
    • ?> < form action =&quot; <?php echo $_SERVER [ 'PHP_SELF' ]; ?>&quot; method = &quot;post&quot; >
    • Enter your question: < input name = &quot;question&quot; size = &quot;50&quot; >
    • < input type = &quot;submit&quot; name = &quot;submit&quot; value = &quot;Ask&quot; >
    • </ form >
    • <?php } else {
    • // if the &quot;submit&quot; variable exists the form has been submitted, so look for and process form data,
    • // displaying the result
    • if (questionp( $_POST [ 'question' ])) {
    • if (rand( 0 , 1 )): echo 'yes' ; else : echo 'no' ; endif ;
    • } else {
    • echo 'Don't you know what a question is?' ;
    • }
    • }
    • ?> </ body ></ html >
    PHP : Passé et présent
  3. Anatomie d’une application PHP Présentation Contrôle de l’a pplication Accès aux données Logique métier Présentation Contrôle de l’application Logique métier Présentation PHP : Passé et présent
  4. Anatomie d’une application PHP index.php3 index.php3 index.php3 index.php
  5. Anatomie d’une application PHP index.php3 index.php3 index.php3 index.php index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php
  6. Anatomie d’une application PHP index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3 index.php3
  7. Anatomie d’une application PHP moderne Présentation Accès aux données Logique métier Contrôle de l’application Something.phtml Something.phtml Something.phtml Something.phtml Something.phtml Something.phtml Something.phtml Something.phtml Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php PHP : Passé et présent
  8. Un framework ? PHP : Passé et présent
    • Pourquoi utiliser un framework ?
    • Le cycle de vie d’une application…dans la vraie vie
      • Toujours en retard pour la livraison => vite !
      • Les fonctionnalités changent => modulaire !
      • Et puis l’application montent en charge => performance !
      • Puis les bugs arrivent => maintenance !
      • Et finalement la v2 arrivent => et ca recommence !
    • Ne pas réinventer la roue, être productif
    • Avoir des standards transversaux aux projets
    • DRY : Don’t Repeat Yourself
    • KISS : Keep It Stupid Simple
  9. Zend Framework : KEEP IT STUPID SIMPLE AND POWERFUL Alban HANRY
  10. Zend_Mail : Envoyer un mail PHP : Passé et présent
    • Une API intuitive pour envoyer des mails
  11. Zend_Mail : Pièce jointe PHP : Passé et présent
    • Ajouter une pièce jointe
  12. Zend_Mail : HTML et MIME PHP : Passé et présent
    • MIME : DISPOSITION_INLINE
  13. Zend_Mail : Envoi PHP : Passé et présent
    • Facile !!!=== Simpliste
  14. Zend_Db PHP : Passé et présent
    • Zend_Db : Couche d’abstraction/API
    • Utilise les drivers : db2, mysqli, oci, pdo_*
  15. Zend_Db PHP : Passé et présent
    • Zend_Db::insert($table,$fields)
    • Vous ne voyez pas un problème ??? !!!
  16. Zend_Db PHP : Passé et présent
    • Zend_Db::select
  17. Zend_Service PHP : Passé et présent
  18. Zend_Service_Aksimet PHP : Passé et présent
  19. Zend Framework : Extensibilité, Réutilisabilité Alban HANRY
  20. MVC : Ah la fameuse Séparation des responsabilités ! PHP : Passé et présent
    • Route
      • Route par defaut : /[module]/[controller]/[action]
      • http://monappli/index/index == http://monappli/
    • Controlleur : Class extends Zend_Controller_Action
      • Un nom !
    • Action : méthode [nom]Action dans la classe
      • Un verbe !
    • Vue : un fichier [action].phtml dans le répertoire scripts/[controlleur]
    • ErrorController : catch les controller/action non trouvés ou les exceptions lancées
  21. Dans la vraie vie… Présentation Accès aux données Logique métier Contrôle de l’application Something.phtml Something.phtml Something.phtml Something.phtml Something.phtml Something.phtml Something.phtml Something.phtml Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php Something.php PHP : Passé et présent index.php3 index.php index.php3 index.php index.php3 index.php index.php3 index.php index.php3 index.php index.php3 index.php index.php3 index.php index.php3 index.php index.php3 index.php index.php3 index.php3 index.php
  22. Zend Framework : MVC extensible PHP : Passé et présent
    • Composition vs Inheritance
    • Rester Orthogonal et favoriser la flexibilité et la réutilisabilité
    • Le controller frontal définit des “hooks” à chaque étape du dispatching : ne pas dériver le Dispatcher
    • Helper d’Action : rajouter des fonctionnalités sans dériver Zend_Controller_Action
    • Helper de Vues : rajouter des fonctionnalités (escape your output) sans dériver Zend_View
  23. Zend_Controlleur_Plugin PHP : Passé et présent
  24. Zend_Log : un bon exemple PHP : Passé et présent
    • Framework PHP5, open source
  25. Zend Framework Alban HANRY
  26. En Résumé : une communauté PHP : Passé et présent
    • Framework PHP5, open source
    • Class Framework : Fully OO
    • 80/20 : le cas fréquent est TRES simple
    • La simplicité et l’extensibilité permette d’implémenter les 20% restants sans tordre le framework
    • “ Use at will”
    • Couplage faible entre les composants MVC et les autres pour fournir une infrastructure par défaut
    • Licence BSD-style et CLA pour les contributeurs
    • Tests unitaires : code coverage > 80%
    • Documentation plusieurs langues
    • Backward compatible Bug Fixe Release (Often!)
  27. Zend Framework : More than that … PHP : Passé et présent
    • Zend_Form, Zend_Pdf, Zend_Search, …
    • Google : Zend_GData
    • Microsoft: Zend_InfoCard
    • Adobe : Zend_Amf
    • Zend_JSON et Zend_JSON_Server (json-rpc)
    • Dojo integré par défaut
    • La communauté : ZendX_JQuery, ZendX_Console_Process_Unix
  28. Un framework PHP : Passé et présent
    • Ce n’est pas une application.
    • Un blog ce n’est pas un CMS ! (Wordpress != SPIP)
    • Un CMS ce n’est pas un Framework !
    • Un Framework ce n’est pas un générateur d’application
    • « Ce n’est pas non plus la réponse à tout ! »
    • ZF propose un socle technique sur lequel vous pouvez construire votre « framework » ou votre couche « technico-fonctionnel »
    • Exemple Magento
  29. Software Development LifeCycle PHP : Passé et présent Developpement Assurance Qualité Test Production Maîtriser les fondamentaux Maintenance proactive Recette et validations Retours / Améliorations Supervision continue
  30. Zend : Professionnaliser et Industrialiser PHP : Passé et présent
    • ZEev + aNDi = Zend
    • Contributeur sur 3 communauté open source
      • PHP et Zend Engine, Eclipse PDT, Zend Framework
    • Offre commerciale pour répondre aux problématiques d’entreprise
      • Support PHP, Support Zend Framework
      • IDE : Zend Studio : Perspective ZF, Tests Unitaire, Complétion avancée
      • Serveur d’application : Monitoring applicatif, Session Clustering
      • Formation et Certification : PHP et ZF
  31. Conclusion Alban HANRY
  32. Choisir un framework ? PHP : Passé et présent Et pourquoi ne pas écrire le sien ?
  33. Choisir un framework ? PHP : Passé et présent Mon framework est PLUS GROS que le tien !
  34. Choisir un framework ? PHP : Passé et présent Y a t il un framework pour les réunir tous ?
  35. DON’T BE A GOLLUM !!! PHP : Passé et présent
  36. Call to Action : le week-end approche PHP : Passé et présent
    • Inst all
    • http://www.zend.com/fr/products/server/download
    • Zend Server Community Edition
      • APC compatible, MSI Installer, .deb, .rpm, production
    • Learn
    • http://framework.zend.com/manual/
    • Contribute
    • http://framework.zend.com/wiki

+ gauthier.garniergauthier.garnier, 7 months ago

custom

941 views, 1 favs, 0 embeds more stats

More info about this document

© All Rights Reserved

Go to text version

  • Total Views 941
    • 941 on SlideShare
    • 0 from embeds
  • Comments 1
  • Favorites 1
  • Downloads 0
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