diff -r 5a6b6e770365 -r 68c69c656a2c web/lib/Zend/Service/WindowsAzure/CommandLine/Storage.php --- a/web/lib/Zend/Service/WindowsAzure/CommandLine/Storage.php Thu May 07 15:10:09 2015 +0200 +++ b/web/lib/Zend/Service/WindowsAzure/CommandLine/Storage.php Thu May 07 15:16:02 2015 +0200 @@ -16,28 +16,37 @@ * @package Zend_Service_Console * @subpackage Exception * @version $Id$ - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ +/** +* @see Zend_Service_Console_Command +*/ +require_once 'Zend/Service/Console/Command.php'; + +/** +* @see Zend_Service_WindowsAzure_Management_Client +*/ +require_once 'Zend/Service/WindowsAzure/Management/Client.php'; /** * Storage commands - * + * * @category Zend * @package Zend_Service_WindowsAzure_CommandLine - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * + * * @command-handler storage * @command-handler-description Windows Azure Storage commands * @command-handler-header Windows Azure SDK for PHP * @command-handler-header Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com) - * @command-handler-footer Note: Parameters that are common across all commands can be stored + * @command-handler-footer Note: Parameters that are common across all commands can be stored * @command-handler-footer in two dedicated environment variables. * @command-handler-footer - SubscriptionId: The Windows Azure Subscription Id to operate on. * @command-handler-footer - Certificate The Windows Azure .cer Management Certificate. - * @command-handler-footer + * @command-handler-footer * @command-handler-footer All commands support the --ConfigurationFile or -F parameter. * @command-handler-footer The parameter file is a simple INI file carrying one parameter * @command-handler-footer value per line. It accepts the same parameters as one can @@ -45,10 +54,10 @@ */ class Zend_Service_WindowsAzure_CommandLine_Storage extends Zend_Service_Console_Command -{ +{ /** * List storage accounts for a specified subscription. - * + * * @command-name ListAccounts * @command-description List storage accounts for a specified subscription. * @command-parameter-for $subscriptionId Zend_Service_Console_Command_ParameterSource_Argv|Zend_Service_Console_Command_ParameterSource_ConfigFile|Zend_Service_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on. @@ -69,10 +78,10 @@ $this->_displayObjectInformation($object, array('ServiceName', 'Url')); } } - + /** * Get storage account properties. - * + * * @command-name GetProperties * @command-description Get storage account properties. * @command-parameter-for $subscriptionId Zend_Service_Console_Command_ParameterSource_Argv|Zend_Service_Console_Command_ParameterSource_ConfigFile|Zend_Service_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on. @@ -87,13 +96,13 @@ { $client = new Zend_Service_WindowsAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase); $result = $client->getStorageAccountProperties($accountName); - + $this->_displayObjectInformation($result, array('ServiceName', 'Label', 'AffinityGroup', 'Location')); } - + /** * Get storage account property. - * + * * @command-name GetProperty * @command-description Get storage account property. * @command-parameter-for $subscriptionId Zend_Service_Console_Command_ParameterSource_Argv|Zend_Service_Console_Command_ParameterSource_ConfigFile|Zend_Service_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on. @@ -109,13 +118,13 @@ { $client = new Zend_Service_WindowsAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase); $result = $client->getStorageAccountProperties($accountName); - + printf("%s\r\n", $result->$property); } - + /** * Get storage account keys. - * + * * @command-name GetKeys * @command-description Get storage account keys. * @command-parameter-for $subscriptionId Zend_Service_Console_Command_ParameterSource_Argv|Zend_Service_Console_Command_ParameterSource_ConfigFile|Zend_Service_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on. @@ -130,14 +139,14 @@ { $client = new Zend_Service_WindowsAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase); $result = $client->getStorageAccountKeys($accountName); - + $this->_displayObjectInformation((object)array('Key' => 'primary', 'Value' => $result[0]), array('Key', 'Value')); $this->_displayObjectInformation((object)array('Key' => 'secondary', 'Value' => $result[1]), array('Key', 'Value')); } - + /** * Get storage account key. - * + * * @command-name GetKey * @command-description Get storage account key. * @command-parameter-for $subscriptionId Zend_Service_Console_Command_ParameterSource_Argv|Zend_Service_Console_Command_ParameterSource_ConfigFile|Zend_Service_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on. @@ -153,16 +162,16 @@ { $client = new Zend_Service_WindowsAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase); $result = $client->getStorageAccountKeys($accountName); - + if (strtolower($key) == 'secondary') { printf("%s\r\n", $result[1]); } printf("%s\r\n", $result[0]); } - + /** * Regenerate storage account keys. - * + * * @command-name RegenerateKeys * @command-description Regenerate storage account keys. * @command-parameter-for $subscriptionId Zend_Service_Console_Command_ParameterSource_Argv|Zend_Service_Console_Command_ParameterSource_ConfigFile|Zend_Service_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on. @@ -186,4 +195,4 @@ } } -Zend_Service_Console_Command::bootstrap($_SERVER['argv']); \ No newline at end of file +Zend_Service_Console_Command::bootstrap($_SERVER['argv']);