News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Maarten Balliauw's Blog:
A hidden gem in the Windows Azure SDK for PHP command line parsing
July 11, 2011 @ 11:41:38

In this new post Maarten Balliauw looks at a "hidden gem" in the Windows Azure SDK for PHP - the ability to create scripts to work with command-line scripts - the Microsoft_Console_Command class.

Usually when creating a command line script you would parse $_SERVER['argv'], validate values and check whether required switches are available or not. With the Microsoft_Console_Command class from the Windows Azure SDK for PHP, you can ease up this task. Let's compare writing a simple "hello" command.

He compares the two sides of making a PHP command-line script: the "ugly way" using normal PHP code and $_SERVER['argv'] and the "easy way" using the Microsoft_Console_Command class that uses a class to define the functionality. There's also methods to grab specific arguments, pull from STDIN and get environment variables.

0 comments voice your opinion now!
windows sdk azure commandline parse


blog comments powered by Disqus

Similar Posts

Maarten Balliauw's Blog: Windows Azure SDK for PHP 4 released

PeterGuy.com: How to install PHP 5.x on Windows Server 2003 with IIS 6

Brian Swan's Blog: Accessing OData for SQL Azure with AppFabric Access Control and PHP

Ruslan Yakushev: PHP Troubleshooting in Windows Azure Web Sites

Chris Jones' Blog: Using PHP OCI8 with 32-bit PHP on Windows 64-bit


Community Events











Don't see your event here?
Let us know!


release framework introduction unittest package opinion facebook composer language series component hhvm security performance database podcast symfony2 install hack application

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework