Microsoft_WindowsAzure
[ class tree: Microsoft_WindowsAzure ] [ index: Microsoft_WindowsAzure ] [ all elements ]

Source for file sample.php

Documentation is available at sample.php

  1. <?php
  2. /**
  3.  * @see Microsoft_AutoLoader
  4.  */
  5. require_once dirname(__FILE__'/../../AutoLoader.php';
  6.  
  7. /**
  8.  * Sample command.
  9.  * 
  10.  * @command-handler sample
  11.  * @command-handler-description Sample command.
  12.  * @command-handler-header Windows Azure SDK for PHP
  13.  * @command-handler-header (C) RealDolmen 2011 - www.realdolmen.com
  14.  */
  15. class Sample
  16.     extends Microsoft_Console_Command
  17. {
  18.     /**
  19.      * Hello command
  20.      * 
  21.      * @command-name hello
  22.      * @command-description Prints Hello, World!
  23.      * @command-parameter-for $name Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_Env|Microsoft_Console_Command_ParameterSource_StdIn --name|-n Required. Name to say hello to.
  24.      * @command-parameter-for $bePolite Microsoft_Console_Command_ParameterSource_Argv -p Optional. Switch to enable polite mode or not.
  25.      * @command-example Print "Hello, Maarten! How are you?" (using polite mode):
  26.      * @command-example   hello -n="Maarten" -p
  27.      * 
  28.      * @param string $name 
  29.      */
  30.     public function helloCommand($name$bePolite false)
  31.     {
  32.         echo 'Hello, ' $name '.';
  33.         if ($bePolite{
  34.             echo ' How are you?';
  35.         }
  36.         echo "\r\n";
  37.     }
  38.     
  39.     /**
  40.      * What time is it command
  41.      * 
  42.      * @command-name timestamp
  43.      * @command-description Prints the current timestamp.
  44.      * 
  45.      * @param string $name 
  46.      */
  47.     public function timestampCommand()
  48.     {
  49.         echo date();
  50.         echo "\r\n";
  51.     }
  52. }
  53.  

Documentation generated on Sat, 03 Dec 2011 13:59:35 +0100 by phpDocumentor 1.4.3