1 / 32

Développer avec PHP sur Windows

Développer avec PHP sur Windows. Pierre Lagarde blogs.developpeur.org/fox Microsoft France. Christophe Lauer blogs.msdn.com/ clauer Microsoft France. Bonjour !. Pierre Lagarde http://blogs.developpeur.org/fox Christophe Lauer http://blogs.msdn.com/clauer. Agenda. Pourquoi PHP ?

brook
Download Presentation

Développer avec PHP sur Windows

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Développer avec PHP sur Windows Pierre Lagarde blogs.developpeur.org/fox Microsoft France Christophe Lauer blogs.msdn.com/clauer Microsoft France

  2. Bonjour ! Pierre Lagarde http://blogs.developpeur.org/fox Christophe Lauer http://blogs.msdn.com/clauer

  3. Agenda • Pourquoi PHP ? • PHP sur Windows • PHP et IIS 7 : FastCGI • PHP et Microsoft Ajax • PHP sur .NET ? Phalanger

  4. Pourquoi PHP ? • Parce qu’on connait plutôt bien ;) • Le récent accord de collaboration technique avec Zend • Microsoft Ajax Library 1.0 • Utilisable depuis une application web en PHP • Fournie sous licence Ms-Pl (Permissive Licence) (Possibilité de Modifier, Redistribuer, utilisation Commerciale, etc…)

  5. PHP sur IIS 7.0 : Module FastCGI • Traditionnellement, IIS supporte CGI et ISAPI • FastCGI est un protocole standard • Contrairement à CGI, réutilisation des processus • La Tech Preview supporte IIS5.1, IIS6 et séparément IIS7 • FastCGI améliore : • Performances : Evite de re-créer un process à chaque nouvelle rêquête • Stabilité : Garantit l’isolation pour les modules non « thread safe » comme certaines extensions PHP

  6. L’accord entre Zend et Microsoft • Accord de collaboration technique • Nos deux sociétés cherchent à améliorer les performances et à renforcer la fiabilité et la stabilité de PHP sur Windows Server 2003 et Windows Server « Longhorn » • Microsoft travaille à un nouveau module FastCGI • Zend mettra en place un laboratoire de tests • Un laboratoire de test Windows pour effectuer des contrôles de qualité afin de maintenir, au niveau le plus haut, les performances de PHP sur Windows Server

  7. Zend Core For WindowsTechnicalPreview

  8. Amélioration des Performances ? • Installation de base … • Avec FastCGI(TechnicalPreview) … • En activant le Cache … ~6000 Rps ~120 Rps ~60 Rps

  9. L’accord entre Zend et Microsoft « Depuis notre travail préliminaire avec Microsoft, nous avons déjà observé un gain de performances supérieur à 100 %, sur certaines applications PHP s’exécutant sur Windows Server 2003. » -- Andy Gutmans, co-fondateur et CTO Zend • Le communiqué de presse : http://www.zend.com/fr/company/zend_news/announcements/2006/10/microsoft_and_zend_technologies_announce_technical_collaboration_to_improve_interoperability_of_php_on_the_windows_server_platform

  10. Démo FastCGIsur IIS7 (Windows Vista)

  11. Microsoft Ajax Library • Framework JavaScript proche de la programmation .NET • 100% JavaScript compatible IE / Safari / FireFox / Mozila / Opera • Inclut des libraires de programmation riche : • Traitement de chaînes, Enumérés, Debug • Une couche de contrôle, de Drag and Drop, d’animations et autres … • Tout sous la forme de fichiers .js

  12. “Atlas” Client Script Library Controls, Components ASP.NET “Atlas” Server Extensions App Services Bridge Component Model and UI Framework “Atlas” Client Application Services “Atlas” Server Controls Web Services Bridge Base Class Library Local Store, … Script Core ASP.NET 2.0 Browser Integration Page Framework, Server Controls Application Services Browser Compatibility Microsoft Ajax Framework Architecture HTML, Script, “Atlas” Markup “Atlas”-enabled ASP.NET Pages “Atlas” Service Proxies Web Services (PHP + JSON) “Atlas” Framework Serveur “Atlas” Framework Client et Service

  13. Fichiers .js 68ko 28ko 160ko 35ko 12ko

  14. Base Class Library (BCL)

  15. JavaScript OOP • Le Javascript est un langage « object-based » et non pas « object-oriented » • Ajout de type étendu • Array – add, contains, remove… • Boolean • Number - Parse • Object – getType, getTypeName • String – format, endsWith, startWith, trim … • Microsoft Ajax Framework ajoute • Namespaces • Classes • Héritage • Interface • Type Enumérés

  16. String.Format et StringBuilder var s = String.format(‘{0}, {1} and {2}’, 1, 2, 3); var sb = new Sys.StringBuilder(); for(var i = 0; i<100; i++){ sb.append(i); sb.append(‘<br/>’ } alert(sb.toString());

  17. Namespaces et Classes Type.registerNamespace('Frimr'); Frimr.Person = function(name) { Frimr.Person.initializeBase(this); this._name = name; } Frimr.Person.prototype = { get_name : function(){ return this._name; } } Frimr.Person.registerClass('Frimr.Person');

  18. Utiliser la classe Person var p = new Frimr.Person('Christophe'); alert(p.get_name()); alert(Object.getTypeName(p));

  19. Dérivé de la classe Person Frimr.Programmer = function(name, language) { Frimr.Programmer.initializeBase(this, [name]); this._language = language; } Frimr.Programmer.prototype = { get_name: function() { var name = Frimr.Programmer.callBaseMethod(this, 'get_name'); return name + '(Programmateur)'; }, get_language: function() { return this._language; } } Frimr.Programmer.registerClass('Frimr.Programmer', Frimr.Person);

  20. Utiliser la classe Programmer var p2 = new Frimr.Programmer('Christophe','JavaScript'); alert(p2.get_name()); alert(p2.get_language()); alert(Object.getTypeName(p2));

  21. Fonctions Globales et Debug • $create – Crée et initialise un composant • $find – Retrouve un composant avec sont ID • $get – Retrouve un élément dans le DOM [getElementByID] • $addHandler – Ajoute un événement à un objet du DOM • $removeHandler – Supprime un événement à un objet du DOM • debug.trace

  22. Le JavaScript vs XML-Script • Impératif var bt = new Sys.Preview.UI.Button($get('bt')); bt.initialize(); bt.add_click(OnClick) • Déclaratif <script type="text/xml-script"> <page xmlns:script="http://schemas.microsoft.com/xml-script/2005"> <components> <label id="lb"  /> <button id="bt"> <click> <setPropertyActiontarget="tb" property="text" value="coucou" /> </click> </button> </components> </page> </script>

  23. PHP et Microsoft Ajax • Utilisation de Microsoft Ajax Library • Utilisation du XML-Script avec des Web Services en PHP et sérialisation JSON • http://www.codeplex.com/phpmsajax • Utilisation de Ajax Control Toolkit (Extenders)

  24. Démo Utilisation de Microsoft Ajax Library Utilisation de XML-Script Slider Extender dansune page PHP

  25. PHP sur .NET ? Phalanger ! • Projet étudiant devenu projet communautaire • Licence type Open Source : MS-PL • Hébergé sur CodePlex • Version 1.0 : • Focalisée sur l’exécution en .NET de code PHP existant • Version 2.0 : • Etend ceci via un scénario d’intéropérabilitécomplêt (ASP.NET, Assemblies, …)

  26. Phalanger 2.0 • Composants majeurs : • Compilateur PHP vers MSIL • Support de ASP.NET • Réimplémentation des classes et modules PHP • MySQL Managed Extension • Intéropérabilité .NET / Assemblies • Projets Windows Forms !

  27. Phalanger 2.0 • Beta 2 : • MySQL Managed Extension • Beta 3 : • Quelques corrections • Visual Studio Integration Bêta

  28. Démo ProjetPhalanger Application existante (Wordpress) ASP.NET en PHP et Ajax Extenders

  29. En synthèse… • Plein de bonneschoses pour les développeurs PHP sur Windows ! • Microsoft Ajax Library • Web Services et JSON • IIS7 • Phalanger et ASP.NET, plus Extenders Ajax

  30. La référence technique • pour les développeurs : • msdn.microsoft.com La référence technique pour les IT Pros : technet.microsoft.com Abonnement TechNet Plus : Versions d’éval + 2 incidents support Visual Studio 2005 + Abonnement MSDN Premium • S’informer- Un portail d’informations, des événements, une newsletter bimensuelle personnalisée • Se former - Des webcasts, des articles techniques, des téléchargements, des forums pour échanger avec vos pairs • Bénéficier de services - Des cursus de formations et de certifications, des offres de support technique

  31. Merci !

  32. Votre potentiel, notre passion TM © 2007 Microsoft France

More Related