Replacing Native PHP4 Extensions with Managed Extensions
Phalanger, the PHP runtime for .NET and Mono, has reached a significant milestone with the eleven popular PHP extensions being replaced with .NET equivalents. Previously these extensions, written in native C or C++, were limiting Phalanger to only running in 32-bit mode.
Here is the list of managed libraries include in Phalanger 3.0:
- Class Library (PhpNetClasslibrary.dll) is basic part of Phalanger containing basic set of functionality (standard,Core,session,ctype,tokenizer,date,pcre,ereg,json,hash,SPL,filter).
- cURL (new) – for most common tasks, Phalanger now comes with cURL extension suporting HTTP/HTTPS protocols. Community is now free to extends its functionality as they need.
- GD2, exif and image (new) are well known PHP extensions allowing to read/manipulate with images.
- Iconv (new) for string encoding conversions built on .NET Encoding.
- MSSQL is Microsoft SQL extension using SqlConnection internally to increase performance. It also ensures compatibility with latest Microsoft SQL servers.
- PDO (new) is an abstraction over PHP database connections. Support for PDO was added, containing several DB drivers like SQLite or MySQL. Developers are free to extend PDO support with additional DB drivers now.
- SoapClient (new) is managed reimplementation of PHP SOAP taking advantage of .NET built-in SOAP support.
- SQLite (new) is another DB extension for Phalanger.
- MySQL extension for Phalanger takes advantage of latest managed Oracle/.NET connector. This makes DB operations faster and safer, allowing to configure additional options and security options in standard .NET-way.
- XML (new) extension is now contained in Phalanger too. Must-have extensions commonly used for its utf8 functions.
- XMLDom extension contains support for PHP SimpleXML, dom, xsl and libxml extensions. Its feature set was extended by libxml functions and improved HTML parsing functions. The extension takes advantage of .NET XML built-in support which offers great performance and security.
- Zip (new) extension was added thanks to community contributions. Anyway still needs some work to be finished.
- Zlib (new) extension is essential part of many PHP projects, mainly because of its gzip compression support. A part of Phalanger now.
Since these libraries are implemented in C# you could, in theory, use these libraries with other .NET based languages as well. And since it is released under the Apache License, you can extract just the parts you need.
Additional PHP 5.x features are also included such as Binary number format and boolval(). Function call array dereference is working, but still experimental.
In case you missed it, Phalanger Tools for Visual Studio was also updated recently. Released back in January, we saw IntelliSense improvements, region collapsing, go to definition, and support for the Class View and Object Browser.
Tom Gilb & Kai Gilb Jan 26, 2015