Upload
elizabeth-smith
View
1.791
Download
5
Embed Size (px)
DESCRIPTION
My first talk ever, given at the Microsoft Web Dev Summit in 2007 Project is now winapiforphp on bitbucket
Citation preview
Win32API extension for PHP
Cool Windows Stuff for PHP
Aren’t Desktop Apps Dead?
• People aren’t always online• Some applications would be bandwidth
prohibitive• Some data is too sensitive to be passed
on the wire• Embedded OS’s don’t always work well
with websites• Browsers are just Quirky (I’m looking at you, IE6)
PHP Advantages
• No Compiling• Instant Changes• No learning curve for a new
language• Plug into PHP extensions• Easy to Use• Fast to Write
PHP Disadvantages
• Speed• Additional Extensions/Libraries
needed• Speed• Distribution (phar is helpful there)• Speed• Security
(do you see a theme?)
So what are your options?
• PHP-GTK2• PHP-QT• PHP-WxWidgets (vaporware)• Winbinder (so not thread safe)• Win32API – Win::Ui
Who is your audience?Who is your audience?
Things to Decide
• OS support (only PHP-GTK2 is truly cross-platform at the moment – you can even run it on Solaris if you’re insane)
• Distribution mechanism (you need to distribute PHP, your extension, plus your code)
• Upgrading• Security• Size
What has gone Before
What *nix has that we don’t1. Semaphores2. Shared Memory (not shmop)3. IPC Functions4. Process Control Functions
What’s Hiding in PECL
• Win32Std – resource files as streams, basic dialog boxes, registry access
• Win32service – services control• Win32scheduler – windows
scheduled tasks• Win32ps - PSAPI (Process Status
Helper) to get information • IISfunc - Provides IIS functions
Reinventing the Wheel
Problems with Winbinder
1. Thread safety issues2. PHP4 style API3. No BC breaks allowed4. Few developers5. Differences in Direction
So what works?
• PHP 5.3 target (we will release when they do)
• NAMESPACES• Intelligent, easy to use message
handling using callbacks• Locking CLI into a loop (modal process)
• Garbage Collection!!
Beyond Thunderdome
• Goal is ALL (and I do mean all) of the win32api
• An extension system (similar to PHP’s extensions) that allow only the “modules” of the API you intend to use
• Low level system items (such as threads, processes, IPC) are the “core” and available in all SAPIS
• Some features (Win::Ui) are specific to certain SAPI’s (embed, CLI)
Resources
• http://svn.bluga.net/win32apiSubversion repository
• http://gtk.php.netPHP-GTK2 Extension
• http://php-qt.orgPHP-QT Extension
• http://perisama.netWindows Builds for all kinds of PHP
stuff (win32api binaries to play will be here)