You are on page 1of 48

Programming MS AJAX with

PHP

Joe Stagner
Microsoft Corporation
Joe.Stagner@Microsoft.com
http://www.JoeOn.net
February 9, 2008 Hyatt Regency Chicago, Illinois
MIX 07

Part ying wit h


PHP on W indo ws
Joe Stagner
Opinionated Misfit Geek
Microsoft Corporation
Joe.Stagner@Microsoft.com
www.JoeOn.net
Joelogical maxim ….

Good Information
Does Not Displace
OTHER
Good Information.
A PHP Guy at Microsoft ?

• I write REAL PHP Every Day.


• In my personal life I run PHP
Websites.
• My sites get millions of visitors.
• I've been the MSPHP guy for 6
years.
Microsoft & Open Source

• Microsoft is NOT Anti Open Source


– Sometimes it's business competition
– Often it's not.
• Microsoft does not support the GPL
– And Joe thinks …..
• Microsoft DOES REAL Open Source
• We do it where YOU tell us it matters
• And where it fits our business model.
PHP on Windows
….. is NOT an Oxymoron !!!!
• What’s the difference between
PHP and Linux
• Why I run PHP on Windows !
Why you might Run PHP On Windows
• The PHP Ecosystem
– Applications, Applications, Applications……
– Open source designs
– Loose and Wild
– The PHP community contributes to a variety
of defacto standard facilities to connect
everything
– Zend and the PHP community are invested
in Windows Specific PHP technology.
Some Favorite PHP Applications

PHP-Nuke PostNuke RunCMS Mambo Xoops MyPHPAdmin

PHPBB2 VBulletin VBPortal cPanel Drupal e107

MD-Pro MyPHPNuke PHPWebSite TikiWiki Typo3 Xaraya

b2Evolution bBlog Serendipity WordPress TextPattern OSCommerce

OSCNuke Zen Cart eGroupWare phpGroupWare Site@School ATutor

Moodle Segue Coppermine QwikiWikki SugarCRM WebCalendar


Potential Advantages to running PHP on
Windows.
• Windows Ecosystem
– Over 600,000 partners in the Microsoft
Ecosystem.
– Microsoft makes MUCH more than
Windows
– Microsoft is making huge investments
interoperability standards and technologies.
(WS-I, etc.)
– Microsoft provides
• …. a complete turn-key infrastructure
• …. Individual best-of-breed applications for you
to choose from
– FUTURE TECHNOLOGIES
Software Options from Microsoft

Identity
MS Access MS Outlook BizTalk SQL Server MS LCS Integration
Server

Business
MS Excel PowerPoint SharePoint SQL RS ISA Server
Manager

MS FrontPage MS Project MS CMS SQL AS Virtual Earth Data Analyzer

Small Business Exchange


MS InfoPath SQL NS Messenger MS Mobile
Accounting Server

Commerce
Live Meeting MS Visio Project Server MapPoint Tablet PC
Server

MS Starter
MS OneNote MS Word MS CRM MOM App Center
Kits
More Software Options from Microsoft

Active
IIS 6/7 Axapta Navision Info Bridge Media Center
Directory

Retail
ADAM MSMQ Great Plains WSH Info Card
Management

Small Windows
Authorization Windows
Business Unix DirectX WinFX
Manager Server 2003
Manager Services

Operations Windows Windows


MS Solomon VBA / VSA ActiveX
Manager Mobile Workflow

MS Presentation
XML-WS Application MSN Hosted
Enterprise Foundation
WSE Center Search Controls
Reporting (Avalon)

Windows System Windows Host


Windows Vista
Media Management Index Integration
Embedded Longhorn
Server Server Server Server
WHY - Helpers you might need.
• Component Creation
• Calling binary .DLLs
• Simplifying Interoperability
• Remote Instancing
• Application Multithreading
• Asynchronous Dependencies
• Multi Phase Transactions
• Aggregating Multi-Interfaced Objects
• Type Encapsulation & Abstraction
• Object Scope Promotion
• Static Instance Access
PHP on Windows
• PHP Developers work on Windows
machines anyway.
• PHP is PHP is PHP. (Sort-of)
• Zend offers the Winabler.
• Other 3rd parties offer…….
– Phalanger = Managed Code PHP
• http://www.php-compiler.net/
– JCX.Software
• VS.PHP
• Zend’s Windows Work Continues
PHP On Windows

• What’s the problem anyway.


– CGI on Windows ?
– The PHP ISAPI Extension
– Will it get fixed ?
PHP on Windows

• FASTCGI !
• PHP on IIS 6
– PHP Versions…. Why choose ?
• PHP on IIS 7
– New application context ?
PHP on Windows

• More Options
– Managed Code (.NET) PHP
• Phalanger http://php-compiler.net/
– Windows Applications
• NuSphere PHPDoc
• WinBinnder
• PHP-Gtk
Performance

• IIS
• CGI, ISAPI
• FastCGI
• Winabler
• Zend Platform
• Phalanger
• .NET Bridge
Integration Options
• The Windows File System
• SMTP
• X.500
• WDDX
• MS-SQL Server, ADO, ODBC
– What about the new auth provider?
– What about database’d session state
• XML
• LDAP
Integration Options

• Sockets
• RSS
• XML-RPC
• XML Web Services / SOAP
• PHP Extensibility Mechanisms
Integration Options

HTTP Form Tricks


 They can be Open
 They can be Hidden
 They can be Encrypted
Cookie Tricks
They can also be encrypted

Finally some ADVANTAGE to


HTTP’s stateless protocol.
Integration Options

• Build your own.


• PHP on Windows built with VC++ (6)
• PECL Extensions
• PHP is Open Source
Integration Options

• Office
Integration Options

• WinDNA / COM
• Microsoft .NET
PHP and COM

• What’s COM ?
• PHP doesn’t REALLY speak COM.
• COM is the Lingua Franca of Windows
– VB
– C++ (Ours and many others)
– Delphi
– Python
– Perl
– Cobol
– Fortran
Creating a COM Object Instance

<?php
$myCOMObject =new
COM("COMObject.COMClass");
$myCOMObject->someMethod(“Some Argument”);
?>
Creating a COM Veneer

• Build it in Visual Basic 6


• Then call from PHP

<?php
$myCOMObject =new
COM("COMObject.COMClass");
$myCOMObject->someMethod(“Some Argument”);
?>
.NET Framework and Tools

VB C++ C# J# …

Common Language Specification

Visual Studio .NET


ASP .NET Windows
Web Forms Web Services
Forms
Mobile Internet Toolkit

ADO .NET and XML

Base Class Library

Common Language Runtime

Operating System
The Shared Source CLI

VS.NET System.Web (ASP.NET) System.WinForms


C# SessionState UI Design ComponentModel
Caching HtmlControls
JScript Security WebControls
VB Configuration System.Drawing
Simple Web Services
VC/MC++ Drawing2D Printing
Protocols
Imaging Text
Debugger Discovery Description

Designers System.Data (ADO.NET) System.Xml


ADO SQL XSLT Serialization
SDK Tools Design Adapters XPath
CorDBG
System

ECMA CLI
ILAsm Collections IO Security Runtime
Configuration Net ServiceProcess InteropServices
ILDbDump
Diagnostics Reflection Text Remoting
SN
Globalization Resources Threading Serialization
ILDAsm
MetaInfo Common Language Runtime
GC App Domain Loader JIT
PEVerify
MSIL Common Type System Class Loader

Platform Adaptation Layer Networking


Boot Loader
Threads Sync Timers Filesystem
Base Class Library

System.Web System.Windows.Forms
Services UI Design ComponentModel
Description HtmlControls
Discovery WebControls
Protocols System.Drawing
Caching Security Drawing2D Printing
Configuration SessionState Imaging Text

System.Data System.Xml
OleDb SqlClient XSLT Serialization
Common SQLTypes XPath

System
Collections IO Security Runtime
Configuration Net ServiceProcess InteropServices
Diagnostics Reflection Text Remoting
Globalization Resources Threading Serialization
Microsoft .NET

• COM Callable Wrapper


• Runtime Callable Wrapper
• PHP Restrictions
– OLE 2
• Parameterless Constructors
XML Web Services

• NuSOAP
• PHP 5 – Native SOAP Extension
• ezSOAP
• PEAR::SOAP
My PHP Project Wish List

• A native Active Directory API PHP


• An AzMan API for PHP
• A PHP Bridge to ADAM
• An ASP.NET 2.0 Authentication Provider for
PHP
• A seamless session state bridge.
• A CDO / Exchange Bridge for PHP
• PHP-Nuke, Mambo, etc. etc.
– On Microsoft SQL
– Optionally in Phalanger
– Optionally using AD
Call to Action !
•Ge t yo ur F RE E V isu al St udio
•Un ders ta nd wh at produc ts Mi cro sof t ma ke s.
•Ema il J oe .Sta gner@Mi cro sof t.c om
•Re ad me a t www .Jo eO n.net
Thanks
•Andr ew Stopf ord
•Mic hae l Pha m
Q&A

THANKS !

© 2006 Microsoft Corporation. All rights reserved.


This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market
conditions,
it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.