Archive for the 'microsoft' Category
PHP library for Microsoft AJAX
By Justin Silverton
Microsoft has released their AJAX library package for non-windows systems which contains a complete set of client JavaScript components that are included in the full ASP.NET AJAX installation. Developers over at Codeplex have developed a library that allows you to integrate your PHP applications with this package.
requirements
- PHP 5.2 — 5.2 is required for json_encode/json_decode; For earlier versions, you will need to install php-json
How to install
- Download the PHP library from codeplex here
- Download the Microsoft AJAX Library here
- After extracting both of these, place all the files from the Microsoft Ajax library in a directory called “MicrosoftAjaxLibrary”
Example
The following is a simple example that demonstrates a simple ajax transmission using the microsoft libraries.
(hello.htm)
<html>
<head>
<title>Hello, World!</title>
<script type="text/javascript" src="../../MicrosoftAjaxLibrary/MicrosoftAjax.js"></script>
<script type="text/javascript" src="HelloService.php/js"></script>
</head>
<body>
Name: <input id="name" type="text" /> <input type="button" value="Say Hello" onclick="button_click(); return false;" />
<br />
Response from server: <span id="response"></span>
</body>
<script type="text/javascript">
function button_click() {
HelloService.SayHello($get('name').value, function (result) { $get('response').innerHTML = result; });
}
</script>
</html>
(HelloService.php)
<?php
require_once '../../dist/MSAjaxService.php';
class HelloService extends MSAjaxService
{
function SayHello($name)
{
return "Hello, " . $name . "!";
}
}
$h = new HelloService();
$h->ProcessRequest();
?>
1 commentSecret Internet Explorer behaviors
By Justin Silverton
Many people don’t realize that there is a way to store up to 100K (1mb per domain) of data within Internet Explorer (supported by 5.5 and above).
These behaviors can be used to preserve information in the browser’s history, in favorites, in an XML store, or directly within a Web page saved to disk. When a user returns to a persisted page, the state of the page can be restored. By allowing information to safely reside on the client, fewer server transactions are required. Custom start pages and Web applications prosper because information can continue to exist without the paternal support of the server, or repeated server queries. A Web page can remain interactive to a degree, after the connection with the host has been severed, by persisting required information on the client.
Code Example
Below is an code example of how to use these behaviors. After typing some text into the box and clicking save, you will now be able to come back to this page and click load, and it will be loaded from the the IE internal persistence store.

<STYLE>
.storeuserData {behavior:url(#default#userData);}
</STYLE>
<SCRIPT>
function fnSaveInput(){
var oPersist=oPersistForm.oPersistInput;
oPersist.setAttribute("sPersist",oPersist.value);
oPersist.save("oXMLBranch");
}
function fnLoadInput(){
var oPersist=oPersistForm.oPersistInput;
oPersist.load("oXMLBranch");
oPersist.value=oPersist.getAttribute("sPersist");
}
</SCRIPT>
<FORM ID="oPersistForm">
<INPUT CLASS="storeuserData" TYPE="text" ID="oPersistInput">
<table>
<td><INPUT TYPE="button" VALUE="Load" onclick="fnLoadInput()"></td>
<td><INPUT TYPE="button" VALUE="Save" onclick="fnSaveInput()"></td>
</table>
</FORM>
How to compile php scripts in ASP.net
By Justin Silverton
Phalanger is a new PHP implementation introducing the PHP language into the family of compiled .NET languages. It provides PHP applications an execution environment that is fast and extremely compatible with the vast array of existing PHP code. Phalanger gives web-application developers the ability to benefit from both the ease-of-use and effectiveness of the PHP language and the power and richness of the .NET platform taking profit from the best from both sides.
Using .net classes
Phalanger supports full interoperability with .NET. This means that you can access almost any .NET classes (written in C#, VB.NET and other managed languages) from your PHP applications. This requires adding several features to the PHP language that allows you to use .NET features like namespace (which are used to organize .NET classes) and generics (used for specifying type parameters of methods and classes). These language extensions are called PHP/CLR and are designed to retain dynamic PHP behavior (for more details see PHP/CLR Language Extensions).
Thanks to the PHP/CLR extensions you can easilly integrate existing PHP and ASP.NET applications, or use classes available for .NET Framework in your PHP application. This gives you for example the possibility to modify open-source PHP applications to use the standard ASP.NET 2.0 Membership (user management) system, which is very powerfull option for integrating web applications.
You can also develop new applications using PHP with the PHP/CLR language extensions and combine PHP and other .NET languages (for example C#) in one project. This gives you the possibility to leverage of the C# strictness in the application logic layer where the safety and strict object orientation is important, but use the simplicity and efficiency of PHP language for developing the presentation layer.
Features
- compiles PHP to the MSIL (Microsoft Intermediate Language), which is byte-code assembly used by the .NET CLR.
- Improves execution speed (because of just-in-time compilation)
- use any .NET object in a PHP application
- Visual studio integration: supports syntax highlighting for PHP source files and debugging
Benchmarks
How much faster is it than the standard version of PHP?

Download
The latest version of Phalanger can be found Here
4 commentsXenix: The Microsoft Linux
By Justin Silverton

History of Xenix
Microsoft created their own variant of the unix operating system called xenix. They purchased a license for Version 7 Unix from AT&T in 1979, and announced on August 25, 1980 that it would make it available for the 16-bit microcomputer market.
Xenix varied from its 7th Edition origins by incorporating elements from BSD, and soon possessed the most widely installed base of any Unix flavour due to the popularity of the inexpensive x86 processor, even though the port created for Tandy Corporation computers proved to be more robust.
Microsoft did not sell Xenix directly to end users; instead, they licensed it to software OEMs such as Intel, Tandy, Altos and SCO, who then ported it to their own proprietary computer architectures. Microsoft Xenix originally ran on the PDP-11; the first port was for the Zilog Z8001 16-bit processor. Altos shipped a version for their computers early in 1982, Tandy Corporation shipped TRS-XENIX for their 68000-based systems in January 1983, and SCO released their port to the Intel 8086 processor in September 1983. A port to the 68000-based Apple Lisa also existed. At the time, Xenix was based on AT&T’s UNIX System III.
Version 2.0 of Xenix was released in 1985 and was based on UNIX System V. An update numbered 2.1.1 added support for the Intel 80286 processor. Subsequent releases improved System V compatibility.
The end of an era
Xenix served as a workhorse for small businesses. It had the following features that many businesses were looking for in an operating system:
- Simple, small, and stable
- Unlimited-user licenses
- Command-line administration
With all of the benefits, Xenix had some major disadvantages. CD-ROMs, PCI, and mice were not supported (or barely functional) and it just barely supported SCSI disks and tapes, or Networking.
Later versions of Xenix did have networking support (and increased hardware support), but by this time, Linux had already started making its way into the business world.
Screenshot

Source: http://en.wikipedia.org/wiki/Xenix
No commentsMicrosoft’s PHP initiative
by Justin Silverton

Microsoft has recently released the second technical preview release of FastCGI for IIS, a new component for Microsoft’s Web server platform. This release is available immediately for download to Windows Vista, IIS including IIS 6.0 in Windows 2003 Server and IIS 5.1 in Windows XP.
The FastCGI component is part of the collaboration between Microsoft and Zend to improve performance and stability of PHP on the Windows platform. This effort aims to help PHP developers achieve improved performance on the Windows platform by leveraging the new IIS FastCGI feature together with Zend’s on-going work to improve the PHP engine on Windows.
Installing
This is just a technical release, so it is not recommended that you install this on a production server.
To install this on your server, go through the following steps:
- Download the beta here
- Extract the downloaded files
- within a command prompt, execute the following command in the same directory as the extracted files:
fgisetup.exe /install /add c:\php\php.exe php (This should point to your php installation)
New features of IIS 7
- The IIS7 output cache is a new feature in IIS7 which will make it possible to cache script responses in memory (including dynamic content). It is much smarter than the current caching system IIS offers because it can be configured to cache different copies of responses for the same page based on a query string value
- another interesting feature is kernel mode driver caching, allowing for very fast and improved performance. It will work with any content type, and can significantly speed up performance for applications where the underlying data doesn’t change.





