File indexing completed on 2024-09-22 05:21:20

0001 <?php
0002 /**
0003  * Zend Framework
0004  *
0005  * LICENSE
0006  *
0007  * This source file is subject to the new BSD license that is bundled
0008  * with this package in the file LICENSE.txt.
0009  * It is also available through the world-wide-web at this URL:
0010  * http://framework.zend.com/license/new-bsd
0011  * If you did not receive a copy of the license and are unable to
0012  * obtain it through the world-wide-web, please send an email
0013  * to license@zend.com so we can send you a copy immediately.
0014  *
0015  * @category   Zend
0016  * @package    Zend_Service_WindowsAzure
0017  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0018  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0019  * @version    $Id$
0020  */
0021 
0022 
0023 /**
0024  * @category   Zend
0025  * @package    Zend_Service_WindowsAzure_CommandLine
0026  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0027  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0028  */ 
0029 class Scaffolder
0030   extends Zend_Service_WindowsAzure_CommandLine_PackageScaffolder_PackageScaffolderAbstract
0031 {
0032   /**
0033    * Invokes the scaffolder.
0034    *
0035    * @param Phar $phar Phar archive containing the current scaffolder.
0036    * @param string $root Path Root path.
0037    * @param array $options Options array (key/value).
0038    */
0039   public function invoke(Phar $phar, $rootPath, $options = array())
0040   {
0041     // Check required parameters
0042     if (empty($options['DiagnosticsConnectionString'])) {
0043       // require_once 'Zend/Service/Console/Exception.php';
0044       throw new Zend_Service_Console_Exception('Missing argument for scaffolder: DiagnosticsConnectionString');
0045     }
0046     
0047     // Extract to disk
0048     $this->log('Extracting resources...');
0049     $this->createDirectory($rootPath);
0050     $this->extractResources($phar, $rootPath);
0051     $this->log('Extracted resources.');
0052     
0053     // Apply transforms
0054     $this->log('Applying transforms...');
0055     $this->applyTransforms($rootPath, $options);
0056     $this->log('Applied transforms.');
0057     
0058     // Show "to do" message
0059     $contentRoot = realpath($rootPath . '/PhpOnAzure.Web');
0060     echo "\r\n";
0061     echo "Note: before packaging your application, please copy your application code to $contentRoot";
0062   }
0063 }