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

• Windows Ecosystem

Potential Advantages to running PHP on Windows. – 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 Integration Server

MS Access

MS Outlook

BizTalk

SQL Server

MS LCS

MS Excel

PowerPoint

SharePoint

SQL RS

Business Manager

ISA Server

MS FrontPage

MS Project

MS CMS

SQL AS

Virtual Earth

Data Analyzer

MS InfoPath

Small Business Accounting

Exchange Server

SQL NS

Messenger

MS Mobile

Live Meeting

MS Visio

Commerce Server

Project Server

MapPoint

Tablet PC

MS OneNote

MS Word

MS CRM

MOM

App Center

MS Starter Kits

More Software Options from Microsoft
Active Directory IIS 6/7 Axapta Navision Info Bridge Media Center

ADAM

MSMQ

Great Plains

Retail Management

WSH

Info Card

Authorization Manager

Windows Server 2003

Small Business Manager

Windows Unix Services

DirectX

WinFX

Operations Manager

Windows Mobile

MS Solomon

VBA / VSA

ActiveX

Windows Workflow

MS Enterprise Reporting

XML-WS WSE

Application Center

MSN Search

Hosted Controls

Presentation Foundation (Avalon)

Windows Embedded

Windows Media Server

System Management Server

Windows Index Server

Host Integration Server

Vista Longhorn

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 They can also be encrypted

Cookie Tricks

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 Visual Studio .NET ASP .NET
Web Forms Web Services Mobile Internet Toolkit

Windows Forms

ADO .NET and XML Base Class Library Common Language Runtime Operating System

The Shared Source CLI
VS.NET

C# JScript

VB VC/MC++ Debugger Designers
SDK Tools CorDBG ILAsm ILDbDump SN ILDAsm MetaInfo PEVerify

System.Web (ASP.NET) UI SessionState HtmlControls Caching Security WebControls Configuration Simple Web Services Protocols Discovery Description System.Data (ADO.NET) ADO Design SQL Adapters

System.WinForms Design ComponentModel

System.Drawing Drawing2D Imaging Printing Text System.Xml XSLT XPath Serialization

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

ECMA CLI

Common Language Runtime
GC MSIL App Domain Loader Common Type System JIT Class Loader Networking Filesystem

Boot Loader Threads

Platform Adaptation Layer
Sync Timers

Base Class Library

System.Web
Services Description Discovery Protocols Caching Configuration UI HtmlControls WebControls Security SessionState

System.Windows.Forms
Design ComponentModel

System.Drawing
Drawing2D Imaging Printing Text

System.Data
OleDb Common SqlClient SQLTypes XSLT XPath

System.Xml
Serialization

System
Collections Configuration Diagnostics Globalization IO Net Reflection Resources Security ServiceProcess Text Threading Runtime InteropServices Remoting 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.