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

Source for file index.php

Documentation is available at index.php

  1. <?php
  2. /**
  3.  * Copyright (c) 2009 - 2011, RealDolmen
  4.  * All rights reserved.
  5.  *
  6.  * Redistribution and use in source and binary forms, with or without
  7.  * modification, are permitted provided that the following conditions are met:
  8.  *     * Redistributions of source code must retain the above copyright
  9.  *       notice, this list of conditions and the following disclaimer.
  10.  *     * Redistributions in binary form must reproduce the above copyright
  11.  *       notice, this list of conditions and the following disclaimer in the
  12.  *       documentation and/or other materials provided with the distribution.
  13.  *     * Neither the name of RealDolmen nor the
  14.  *       names of its contributors may be used to endorse or promote products
  15.  *       derived from this software without specific prior written permission.
  16.  *
  17.  * THIS SOFTWARE IS PROVIDED BY RealDolmen ''AS IS'' AND ANY
  18.  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  19.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  20.  * DISCLAIMED. IN NO EVENT SHALL RealDolmen BE LIABLE FOR ANY
  21.  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  22.  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  23.  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  24.  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25.  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  26.  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27.  *
  28.  * @category   Microsoft
  29.  * @package    Microsoft_WindowsAzure
  30.  * @copyright  Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
  31.  * @license    http://phpazure.codeplex.com/license
  32.  * @version    $Id: SharedKeyCredentials.php 14561 2009-05-07 08:05:12Z unknown $
  33.  */
  34.  
  35.  
  36. /**
  37.  * @category   Microsoft
  38.  * @package    Microsoft_WindowsAzure_CommandLine
  39.  * @copyright  Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
  40.  * @license    http://phpazure.codeplex.com/license
  41.  * 
  42.  * @command-handler ScaffoldTemplateScaffolder
  43.  * 
  44.  * @command-handler-description Windows Azure SDK for PHP ScaffoldTemplateScaffolder
  45.  * @command-handler-header Windows Azure SDK for PHP
  46.  * @command-handler-header Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
  47.  * @command-handler-footer
  48.  * @command-handler-footer The ScaffoldTemplateScaffolder scaffolds a new
  49.  * @command-handler-footer scaffolder structure to the specified path.
  50.  */ 
  51. {
  52.     /**
  53.      * Runs a scaffolder and creates a scaffolder project structure which can be customized before packaging.
  54.      * 
  55.      * @command-name Run
  56.      * @command-description Runs the scaffolder.
  57.      * 
  58.      * @command-parameter-for $scaffolderFile Argv --Phar Required. The scaffolder Phar file path. This is injected automatically.
  59.      * @command-parameter-for $rootPath Argv|ConfigFile --OutputPath|-out Required. The path to create the Windows Azure project structure. This is injected automatically.
  60.      * @command-parameter-for $scaffolderName Argv|ConfigFile|Env --Name|-n Required. The name of the scaffolder to generate.
  61.      */
  62.     public function runCommand($scaffolderFile$rootPath$scaffolderName)
  63.     {
  64.         // Load Phar
  65.         $phar new Phar($scaffolderFile);
  66.         
  67.         // Extract to disk
  68.         $this->log('Extracting resources...');
  69.         $this->createDirectory($rootPath);
  70.         $this->extractResources($phar$rootPath);
  71.         $this->log('Extracted resources.');
  72.         
  73.         // Apply transforms
  74.         $this->log('Applying transforms...');
  75.         $this->applyTransforms($rootPatharray(
  76.             'Name' => $scaffolderName
  77.         ));
  78.         $this->log('Applied transforms.');
  79.         
  80.         // Show "to do" message
  81.         $contentRoot realpath($rootPath);
  82.         echo "\r\n";
  83.         echo "Your empty scaffolder has been created at $contentRoot";
  84.     }
  85. }

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