BackWPup – WordPress Backup Plugin - Version 2.1.15

Version Description

  • Fixed FTP folder bug
  • Dropbox chunking will done in memory not in temp
Download this release

Release Info

Developer danielhuesken
Plugin Icon 128x128 BackWPup – WordPress Backup Plugin
Version 2.1.15
Comparing to
See all releases

Code changes from version 2.1.14 to 2.1.15

Files changed (69) hide show
  1. backwpup-functions.php +1 -1
  2. backwpup.php +2 -2
  3. job/backup_create.php +7 -7
  4. job/dest_dropbox.php +1 -1
  5. job/dest_ftp.php +18 -12
  6. job/dest_gstorage.php +1 -1
  7. job/dest_mail.php +1 -1
  8. job/dest_s3.php +1 -1
  9. job/job_functions.php +17 -15
  10. job/wp_export.php +1 -1
  11. lang/backwpup-es_ES.po +1699 -1699
  12. lang/backwpup-nl_NL.mo +0 -0
  13. lang/backwpup-nl_NL.po +3305 -0
  14. libs/Microsoft/AutoLoader.php +73 -73
  15. libs/Microsoft/Console/Command.php +427 -427
  16. libs/Microsoft/Console/Command/ParameterSource/Argv.php +79 -79
  17. libs/Microsoft/Console/Command/ParameterSource/ConfigFile.php +110 -110
  18. libs/Microsoft/Console/Command/ParameterSource/Env.php +83 -83
  19. libs/Microsoft/Console/Command/ParameterSource/ParameterSourceInterface.php +56 -56
  20. libs/Microsoft/Console/Command/ParameterSource/Prompt.php +74 -74
  21. libs/Microsoft/Console/Command/ParameterSource/StdIn.php +89 -89
  22. libs/Microsoft/Console/Exception.php +48 -48
  23. libs/Microsoft/Exception.php +46 -46
  24. libs/Microsoft/Http/Exception.php +48 -48
  25. libs/Microsoft/SqlAzure/CommandLine/SqlAzure.php +297 -297
  26. libs/Microsoft/SqlAzure/Exception.php +48 -48
  27. libs/Microsoft/SqlAzure/Management/Client.php +564 -564
  28. libs/Microsoft/SqlAzure/Management/Exception.php +50 -50
  29. libs/Microsoft/SqlAzure/Management/FirewallRuleInstance.php +70 -70
  30. libs/Microsoft/SqlAzure/Management/ServerInstance.php +72 -72
  31. libs/Microsoft/SqlAzure/Management/ServiceEntityAbstract.php +84 -84
  32. libs/Microsoft/WindowsAzure/Credentials/Exception.php +48 -48
  33. libs/Microsoft/WindowsAzure/Diagnostics/ConfigurationDataSources.php +73 -73
  34. libs/Microsoft/WindowsAzure/Diagnostics/ConfigurationDiagnosticInfrastructureLogs.php +69 -69
  35. libs/Microsoft/WindowsAzure/Diagnostics/ConfigurationDirectories.php +92 -92
  36. libs/Microsoft/WindowsAzure/Diagnostics/ConfigurationInstance.php +224 -224
  37. libs/Microsoft/WindowsAzure/Diagnostics/ConfigurationLogs.php +69 -69
  38. libs/Microsoft/WindowsAzure/Diagnostics/ConfigurationObjectBaseAbstract.php +83 -83
  39. libs/Microsoft/WindowsAzure/Diagnostics/ConfigurationPerformanceCounters.php +91 -91
  40. libs/Microsoft/WindowsAzure/Diagnostics/ConfigurationWindowsEventLog.php +93 -93
  41. libs/Microsoft/WindowsAzure/Diagnostics/DirectoryConfigurationSubscription.php +69 -69
  42. libs/Microsoft/WindowsAzure/Diagnostics/Exception.php +50 -50
  43. libs/Microsoft/WindowsAzure/Diagnostics/LogLevel.php +51 -51
  44. libs/Microsoft/WindowsAzure/Diagnostics/Manager.php +224 -224
  45. libs/Microsoft/WindowsAzure/Diagnostics/PerformanceCounterSubscription.php +66 -66
  46. libs/Microsoft/WindowsAzure/Exception.php +48 -48
  47. libs/Microsoft/WindowsAzure/Management/AffinityGroupInstance.php +79 -79
  48. libs/Microsoft/WindowsAzure/Management/CertificateInstance.php +73 -73
  49. libs/Microsoft/WindowsAzure/Management/Client.php +2400 -2400
  50. libs/Microsoft/WindowsAzure/Management/DeploymentInstance.php +109 -109
  51. libs/Microsoft/WindowsAzure/Management/Exception.php +50 -50
  52. libs/Microsoft/WindowsAzure/Management/HostedServiceInstance.php +82 -82
  53. libs/Microsoft/WindowsAzure/Management/LocationInstance.php +64 -64
  54. libs/Microsoft/WindowsAzure/Management/OperatingSystemFamilyInstance.php +70 -70
  55. libs/Microsoft/WindowsAzure/Management/OperatingSystemInstance.php +79 -79
  56. libs/Microsoft/WindowsAzure/Management/OperationStatusInstance.php +73 -73
  57. libs/Microsoft/WindowsAzure/Management/ServiceEntityAbstract.php +84 -84
  58. libs/Microsoft/WindowsAzure/Management/StorageServiceInstance.php +79 -79
  59. libs/Microsoft/WindowsAzure/Management/SubscriptionOperationInstance.php +96 -96
  60. libs/Microsoft/WindowsAzure/RetryPolicy/Exception.php +49 -49
  61. libs/Microsoft/WindowsAzure/RetryPolicy/NoRetry.php +70 -70
  62. libs/Microsoft/WindowsAzure/RetryPolicy/RetryN.php +99 -99
  63. libs/Microsoft/WindowsAzure/RetryPolicy/RetryPolicyAbstract.php +79 -79
  64. libs/Microsoft/WindowsAzure/RoleEnvironment.php +190 -190
  65. libs/Microsoft/WindowsAzure/SessionHandler.php +347 -347
  66. libs/Microsoft/WindowsAzure/Storage.php +629 -629
  67. libs/Microsoft/WindowsAzure/Storage/Batch.php +259 -259
  68. libs/Microsoft/WindowsAzure/Storage/BatchStorageAbstract.php +184 -184
  69. libs/Microsoft/WindowsAzure/Storage/Blob.php +0 -1368
backwpup-functions.php CHANGED
@@ -978,7 +978,7 @@ function backwpup_get_job_vars($jobid='',$jobnewsettings='') {
978
  if (!isset($jobsettings['ftpdir']) or !is_string($jobsettings['ftpdir']))
979
  $jobsettings['ftpdir']='';
980
  if (!empty($jobsettings['ftpdir']))
981
- $jobsettings['ftpdir']=trailingslashit(str_replace('//','/',str_replace('\\','/',trim($jobsettings['ftpdir']))));
982
 
983
  if (!isset($jobsettings['ftpmaxbackups']) or !is_int($jobsettings['ftpmaxbackups']))
984
  $jobsettings['ftpmaxbackups']=0;
978
  if (!isset($jobsettings['ftpdir']) or !is_string($jobsettings['ftpdir']))
979
  $jobsettings['ftpdir']='';
980
  if (!empty($jobsettings['ftpdir']))
981
+ $jobsettings['ftpdir']=trailingslashit(ltrim(str_replace('//','/',str_replace('\\','/',trim($jobsettings['ftpdir'])))),'/');
982
 
983
  if (!isset($jobsettings['ftpmaxbackups']) or !is_int($jobsettings['ftpmaxbackups']))
984
  $jobsettings['ftpmaxbackups']=0;
backwpup.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: BackWPup
4
  Plugin URI: http://backwpup.com
5
  Description: WordPress Backup and more...
6
  Author: Daniel Hüsken
7
- Version: 2.1.14
8
  Author URI: http://danielhuesken.de
9
  Text Domain: backwpup
10
  Domain Path: /lang/
@@ -32,7 +32,7 @@ Domain Path: /lang/
32
  define('BACKWPUP_PLUGIN_BASEDIR', dirname(plugin_basename(__FILE__)));
33
  define('BACKWPUP_PLUGIN_BASEURL',plugins_url('',__FILE__));
34
  //Set Plugin Version
35
- define('BACKWPUP_VERSION', '2.1.14');
36
  //Set Min Wordpress Version
37
  define('BACKWPUP_MIN_WORDPRESS_VERSION', '3.1');
38
  //Set User Capability
4
  Plugin URI: http://backwpup.com
5
  Description: WordPress Backup and more...
6
  Author: Daniel Hüsken
7
+ Version: 2.1.15
8
  Author URI: http://danielhuesken.de
9
  Text Domain: backwpup
10
  Domain Path: /lang/
32
  define('BACKWPUP_PLUGIN_BASEDIR', dirname(plugin_basename(__FILE__)));
33
  define('BACKWPUP_PLUGIN_BASEURL',plugins_url('',__FILE__));
34
  //Set Plugin Version
35
+ define('BACKWPUP_VERSION', '2.1.15');
36
  //Set Min Wordpress Version
37
  define('BACKWPUP_MIN_WORDPRESS_VERSION', '3.1');
38
  //Set User Capability
job/backup_create.php CHANGED
@@ -7,14 +7,14 @@ function backup_create() {
7
  $WORKING['STEPTODO']=count($filelist);
8
  if (empty($WORKING['STEPDONE']))
9
  $WORKING['STEPDONE']=0;
10
-
11
  if (strtolower($STATIC['JOB']['fileformart'])==".zip") { //Zip files
12
  if ($STATIC['CFG']['phpzip']) { //use php zip lib
13
  trigger_error(sprintf(__('%d. try to create backup zip archive...','backwpup'),$WORKING['BACKUP_CREATE']['STEP_TRY']),E_USER_NOTICE);
14
  $zip = new ZipArchive();
15
  if ($res=$zip->open($STATIC['JOB']['backupdir'].$STATIC['backupfile'],ZIPARCHIVE::CREATE) === TRUE) {
16
  for ($i=$WORKING['STEPDONE'];$i<$WORKING['STEPTODO'];$i++) {
17
- if (!$zip->addFile($filelist[$i]['FILE'], $filelist[$i]['OUTFILE']))
18
  trigger_error(sprintf(__('Can not add "%s" to zip archive!','backwpup'),$filelist[$i]['OUTFILE']),E_USER_ERROR);
19
  $WORKING['STEPDONE']++;
20
  update_working_file();
@@ -49,7 +49,7 @@ function backup_create() {
49
  }
50
  } else { //use PclZip
51
  define('PCLZIP_TEMPORARY_DIR', $STATIC['TEMPDIR']);
52
- require_once($STATIC['WP']['ABSPATH'].'wp-admin/includes/class-pclzip.php');
53
  if ( ini_get( 'mbstring.func_overload' ) && function_exists( 'mb_internal_encoding' ) ) {
54
  $previous_encoding = mb_internal_encoding();
55
  mb_internal_encoding( 'ISO-8859-1' );
@@ -76,7 +76,7 @@ function backup_create() {
76
  mb_internal_encoding( $previous_encoding );
77
  }
78
  } elseif (strtolower($STATIC['JOB']['fileformart'])==".tar.gz" or strtolower($STATIC['JOB']['fileformart'])==".tar.bz2" or strtolower($STATIC['JOB']['fileformart'])==".tar") { //tar files
79
-
80
  if (strtolower($STATIC['JOB']['fileformart'])=='.tar.gz') {
81
  $tarbackup=gzopen($STATIC['JOB']['backupdir'].$STATIC['backupfile'],'w9');
82
  } elseif (strtolower($STATIC['JOB']['fileformart'])=='.tar.bz2') {
@@ -125,7 +125,7 @@ function backup_create() {
125
  $info=posix_getgrgid($files['GID']);
126
  $filegroup=$info['name'];
127
  }
128
-
129
  // Generate the TAR header for this file
130
  $header = pack("a100a8a8a8a12a12a8a1a100a6a2a32a32a8a8a155a12",
131
  $filename, //name of file 100
@@ -196,13 +196,13 @@ function backup_create() {
196
  }
197
  $WORKING['STEPSDONE'][]='BACKUP_CREATE'; //set done
198
  if ($filesize=filesize($STATIC['JOB']['backupdir'].$STATIC['backupfile']))
199
- trigger_error(sprintf(__('Archive size is %s','backwpup'),formatBytes($filesize)),E_USER_NOTICE);
200
  }
201
 
202
 
203
  function _pclzipPostAddCallBack($p_event, &$p_header) {
204
  global $WORKING,$STATIC;
205
- if ($p_header['status'] != 'ok')
206
  trigger_error(sprintf(__('PCL ZIP Error "%1$s" on file %2$s!','backwpup'),$p_header['status'],$p_header['filename']),E_USER_ERROR);
207
  $WORKING['STEPDONE']++;
208
  update_working_file();
7
  $WORKING['STEPTODO']=count($filelist);
8
  if (empty($WORKING['STEPDONE']))
9
  $WORKING['STEPDONE']=0;
10
+
11
  if (strtolower($STATIC['JOB']['fileformart'])==".zip") { //Zip files
12
  if ($STATIC['CFG']['phpzip']) { //use php zip lib
13
  trigger_error(sprintf(__('%d. try to create backup zip archive...','backwpup'),$WORKING['BACKUP_CREATE']['STEP_TRY']),E_USER_NOTICE);
14
  $zip = new ZipArchive();
15
  if ($res=$zip->open($STATIC['JOB']['backupdir'].$STATIC['backupfile'],ZIPARCHIVE::CREATE) === TRUE) {
16
  for ($i=$WORKING['STEPDONE'];$i<$WORKING['STEPTODO'];$i++) {
17
+ if (!$zip->addFile($filelist[$i]['FILE'], $filelist[$i]['OUTFILE']))
18
  trigger_error(sprintf(__('Can not add "%s" to zip archive!','backwpup'),$filelist[$i]['OUTFILE']),E_USER_ERROR);
19
  $WORKING['STEPDONE']++;
20
  update_working_file();
49
  }
50
  } else { //use PclZip
51
  define('PCLZIP_TEMPORARY_DIR', $STATIC['TEMPDIR']);
52
+ require_once($STATIC['WP']['ABSPATH'].'wp-admin/includes/class-pclzip.php');
53
  if ( ini_get( 'mbstring.func_overload' ) && function_exists( 'mb_internal_encoding' ) ) {
54
  $previous_encoding = mb_internal_encoding();
55
  mb_internal_encoding( 'ISO-8859-1' );
76
  mb_internal_encoding( $previous_encoding );
77
  }
78
  } elseif (strtolower($STATIC['JOB']['fileformart'])==".tar.gz" or strtolower($STATIC['JOB']['fileformart'])==".tar.bz2" or strtolower($STATIC['JOB']['fileformart'])==".tar") { //tar files
79
+
80
  if (strtolower($STATIC['JOB']['fileformart'])=='.tar.gz') {
81
  $tarbackup=gzopen($STATIC['JOB']['backupdir'].$STATIC['backupfile'],'w9');
82
  } elseif (strtolower($STATIC['JOB']['fileformart'])=='.tar.bz2') {
125
  $info=posix_getgrgid($files['GID']);
126
  $filegroup=$info['name'];
127
  }
128
+
129
  // Generate the TAR header for this file
130
  $header = pack("a100a8a8a8a12a12a8a1a100a6a2a32a32a8a8a155a12",
131
  $filename, //name of file 100
196
  }
197
  $WORKING['STEPSDONE'][]='BACKUP_CREATE'; //set done
198
  if ($filesize=filesize($STATIC['JOB']['backupdir'].$STATIC['backupfile']))
199
+ trigger_error(sprintf(__('Archive size is %s','backwpup'),formatBytes($filesize)),E_USER_NOTICE);
200
  }
201
 
202
 
203
  function _pclzipPostAddCallBack($p_event, &$p_header) {
204
  global $WORKING,$STATIC;
205
+ if ($p_header['status'] != 'ok')
206
  trigger_error(sprintf(__('PCL ZIP Error "%1$s" on file %2$s!','backwpup'),$p_header['status'],$p_header['filename']),E_USER_ERROR);
207
  $WORKING['STEPDONE']++;
208
  update_working_file();
job/dest_dropbox.php CHANGED
@@ -7,7 +7,7 @@ function dest_dropbox() {
7
 
8
  require_once(realpath(dirname(__FILE__).'/../libs/dropbox.php'));
9
  try {
10
- need_free_memory(5000000);
11
  //set boxtype
12
  $dropbox = new backwpup_Dropbox('dropbox');
13
 
7
 
8
  require_once(realpath(dirname(__FILE__).'/../libs/dropbox.php'));
9
  try {
10
+ need_free_memory(10000000);
11
  //set boxtype
12
  $dropbox = new backwpup_Dropbox('dropbox');
13
 
job/dest_ftp.php CHANGED
@@ -58,27 +58,33 @@ function dest_ftp() {
58
  trigger_error(sprintf(__('FTP Server reply: %s','backwpup'),$systype),E_USER_NOTICE);
59
  else
60
  trigger_error(sprintf(__('FTP Server reply: %s','backwpup'),__('Error getting SYSTYPE','backwpup')),E_USER_ERROR);
61
-
 
62
  //test ftp dir and create it f not exists
63
- if ($STATIC['JOB']['ftpdir']!='/' && $STATIC['JOB']['ftpdir']='') {
64
- $ftpdirs=explode("/", rtrim($STATIC['JOB']['ftpdir'],'/'));
65
  foreach ($ftpdirs as $ftpdir) {
66
  if (empty($ftpdir))
67
  continue;
68
  if (!@ftp_chdir($ftp_conn_id, $ftpdir)) {
69
  if (@ftp_mkdir($ftp_conn_id, $ftpdir)) {
70
- trigger_error(sprintf(__('FTP Folder "%s" created!','backwpup'),$ftpdir),E_USER_NOTICE);
71
  ftp_chdir($ftp_conn_id, $ftpdir);
72
  } else {
73
- trigger_error(sprintf(__('FTP Folder "%s" can not created!','backwpup'),$ftpdir),E_USER_ERROR);
74
  return false;
75
  }
76
  }
77
  }
78
  }
 
 
 
 
 
79
  //delete file on ftp if new try
80
  if ($WORKING['STEPDONE']==0)
81
- @ftp_delete($ftp_conn_id, $STATIC['JOB']['ftpdir'].$STATIC['backupfile']);
82
 
83
  //PASV
84
  trigger_error(sprintf(__('FTP Client command: %s','backwpup'),' PASV'),E_USER_NOTICE);
@@ -97,7 +103,7 @@ function dest_ftp() {
97
  if ($WORKING['STEPDONE']<$WORKING['STEPTODO']) {
98
  trigger_error(__('Upload to FTP now started ... ','backwpup'),E_USER_NOTICE);
99
  $fp = fopen($STATIC['JOB']['backupdir'].$STATIC['backupfile'], 'r');
100
- $ret = ftp_nb_fput($ftp_conn_id, $STATIC['JOB']['ftpdir'].$STATIC['backupfile'], $fp, FTP_BINARY,$WORKING['STEPDONE']);
101
  while ($ret == FTP_MOREDATA) {
102
  $WORKING['STEPDONE']=ftell($fp);
103
  update_working_file();
@@ -108,8 +114,8 @@ function dest_ftp() {
108
  return false;
109
  } else {
110
  $WORKING['STEPDONE']=filesize($STATIC['JOB']['backupdir'].$STATIC['backupfile']);
111
- trigger_error(sprintf(__('Backup transferred to FTP server: %s','backwpup'),$STATIC['JOB']['ftpdir'].$STATIC['backupfile']),E_USER_NOTICE);
112
- $STATIC['JOB']['lastbackupdownloadurl']="ftp://".$STATIC['JOB']['ftpuser'].":".backwpup_base64($STATIC['JOB']['ftppass'])."@".$STATIC['JOB']['ftphost'].':'.$STATIC['JOB']['ftphostport'].$STATIC['JOB']['ftpdir'].$STATIC['backupfile'];
113
  $WORKING['STEPSDONE'][]='DEST_FTP'; //set done
114
  }
115
  fclose($fp);
@@ -117,7 +123,7 @@ function dest_ftp() {
117
 
118
  if ($STATIC['JOB']['ftpmaxbackups']>0) { //Delete old backups
119
  $backupfilelist=array();
120
- if ($filelist=ftp_nlist($ftp_conn_id, $STATIC['JOB']['ftpdir'])) {
121
  foreach($filelist as $files) {
122
  if ($STATIC['JOB']['fileprefix'] == substr(basename($files),0,strlen($STATIC['JOB']['fileprefix'])) and $STATIC['JOB']['fileformart'] == substr(basename($files),-strlen($STATIC['JOB']['fileformart'])))
123
  $backupfilelist[]=basename($files);
@@ -126,10 +132,10 @@ function dest_ftp() {
126
  rsort($backupfilelist);
127
  $numdeltefiles=0;
128
  for ($i=$STATIC['JOB']['ftpmaxbackups'];$i<sizeof($backupfilelist);$i++) {
129
- if (ftp_delete($ftp_conn_id, $STATIC['JOB']['ftpdir'].$backupfilelist[$i])) //delte files on ftp
130
  $numdeltefiles++;
131
  else
132
- trigger_error(sprintf(__('Can not delete "%s" on FTP server!','backwpup'),$STATIC['JOB']['ftpdir'].$backupfilelist[$i]),E_USER_ERROR);
133
  }
134
  if ($numdeltefiles>0)
135
  trigger_error(sprintf(_n('One file deleted on FTP Server','%d files deleted on FTP Server',$numdeltefiles,'backwpup'),$numdeltefiles),E_USER_NOTICE);
58
  trigger_error(sprintf(__('FTP Server reply: %s','backwpup'),$systype),E_USER_NOTICE);
59
  else
60
  trigger_error(sprintf(__('FTP Server reply: %s','backwpup'),__('Error getting SYSTYPE','backwpup')),E_USER_ERROR);
61
+
62
+
63
  //test ftp dir and create it f not exists
64
+ if ($STATIC['JOB']['ftpdir']!='/' && $STATIC['JOB']['ftpdir']!='') {
65
+ $ftpdirs=explode("/", trim($STATIC['JOB']['ftpdir'],'/'));
66
  foreach ($ftpdirs as $ftpdir) {
67
  if (empty($ftpdir))
68
  continue;
69
  if (!@ftp_chdir($ftp_conn_id, $ftpdir)) {
70
  if (@ftp_mkdir($ftp_conn_id, $ftpdir)) {
71
+ trigger_error(sprintf(__('FTP folder "%s" created!','backwpup'),$ftpdir),E_USER_NOTICE);
72
  ftp_chdir($ftp_conn_id, $ftpdir);
73
  } else {
74
+ trigger_error(sprintf(__('FTP folder "%s" can not created!','backwpup'),$ftpdir),E_USER_ERROR);
75
  return false;
76
  }
77
  }
78
  }
79
  }
80
+
81
+ // Get the current working directory
82
+ $currentftpdir = rtrim(ftp_pwd($ftp_conn_id),'/').'/';
83
+ trigger_error(sprintf(__('FTP current folder is: %s','backwpup'),$currentftpdir),E_USER_NOTICE);
84
+
85
  //delete file on ftp if new try
86
  if ($WORKING['STEPDONE']==0)
87
+ @ftp_delete($ftp_conn_id, $currentftpdir.$STATIC['backupfile']);
88
 
89
  //PASV
90
  trigger_error(sprintf(__('FTP Client command: %s','backwpup'),' PASV'),E_USER_NOTICE);
103
  if ($WORKING['STEPDONE']<$WORKING['STEPTODO']) {
104
  trigger_error(__('Upload to FTP now started ... ','backwpup'),E_USER_NOTICE);
105
  $fp = fopen($STATIC['JOB']['backupdir'].$STATIC['backupfile'], 'r');
106
+ $ret = ftp_nb_fput($ftp_conn_id, $currentftpdir.$STATIC['backupfile'], $fp, FTP_BINARY,$WORKING['STEPDONE']);
107
  while ($ret == FTP_MOREDATA) {
108
  $WORKING['STEPDONE']=ftell($fp);
109
  update_working_file();
114
  return false;
115
  } else {
116
  $WORKING['STEPDONE']=filesize($STATIC['JOB']['backupdir'].$STATIC['backupfile']);
117
+ trigger_error(sprintf(__('Backup transferred to FTP server: %s','backwpup'),$currentftpdir.$STATIC['backupfile']),E_USER_NOTICE);
118
+ $STATIC['JOB']['lastbackupdownloadurl']="ftp://".$STATIC['JOB']['ftpuser'].":".backwpup_base64($STATIC['JOB']['ftppass'])."@".$STATIC['JOB']['ftphost'].':'.$STATIC['JOB']['ftphostport'].$currentftpdir.$STATIC['backupfile'];
119
  $WORKING['STEPSDONE'][]='DEST_FTP'; //set done
120
  }
121
  fclose($fp);
123
 
124
  if ($STATIC['JOB']['ftpmaxbackups']>0) { //Delete old backups
125
  $backupfilelist=array();
126
+ if ($filelist=ftp_nlist($ftp_conn_id, $currentftpdir)) {
127
  foreach($filelist as $files) {
128
  if ($STATIC['JOB']['fileprefix'] == substr(basename($files),0,strlen($STATIC['JOB']['fileprefix'])) and $STATIC['JOB']['fileformart'] == substr(basename($files),-strlen($STATIC['JOB']['fileformart'])))
129
  $backupfilelist[]=basename($files);
132
  rsort($backupfilelist);
133
  $numdeltefiles=0;
134
  for ($i=$STATIC['JOB']['ftpmaxbackups'];$i<sizeof($backupfilelist);$i++) {
135
+ if (ftp_delete($ftp_conn_id, $currentftpdir.$backupfilelist[$i])) //delte files on ftp
136
  $numdeltefiles++;
137
  else
138
+ trigger_error(sprintf(__('Can not delete "%s" on FTP server!','backwpup'),$currentftpdir.$backupfilelist[$i]),E_USER_ERROR);
139
  }
140
  if ($numdeltefiles>0)
141
  trigger_error(sprintf(_n('One file deleted on FTP Server','%d files deleted on FTP Server',$numdeltefiles,'backwpup'),$numdeltefiles),E_USER_NOTICE);
job/dest_gstorage.php CHANGED
@@ -17,7 +17,7 @@ function dest_gstorage() {
17
  //set curl Prozess bar
18
  $curlops=array();
19
  if (defined('CURLOPT_PROGRESSFUNCTION'))
20
- $curlops=array(CURLOPT_NOPROGRESS=>false,CURLOPT_PROGRESSFUNCTION=>'curl_progresscallback',CURLOPT_BUFFERSIZE=>512);
21
  trigger_error(__('Upload to GStorage now started... ','backwpup'),E_USER_NOTICE);
22
  //transferee file to GStorage
23
  $result=$gstorage->create_object($STATIC['JOB']['GStorageBucket'], $STATIC['JOB']['GStoragedir'].$STATIC['backupfile'], array('fileUpload' => $STATIC['JOB']['backupdir'].$STATIC['backupfile'],'acl' => 'private','curlopts'=>$curlops));
17
  //set curl Prozess bar
18
  $curlops=array();
19
  if (defined('CURLOPT_PROGRESSFUNCTION'))
20
+ $curlops=array(CURLOPT_NOPROGRESS=>false,CURLOPT_PROGRESSFUNCTION=>'curl_progresscallback',CURLOPT_BUFFERSIZE=>1048576);
21
  trigger_error(__('Upload to GStorage now started... ','backwpup'),E_USER_NOTICE);
22
  //transferee file to GStorage
23
  $result=$gstorage->create_object($STATIC['JOB']['GStorageBucket'], $STATIC['JOB']['GStoragedir'].$STATIC['backupfile'], array('fileUpload' => $STATIC['JOB']['backupdir'].$STATIC['backupfile'],'acl' => 'private','curlopts'=>$curlops));
job/dest_mail.php CHANGED
@@ -48,7 +48,7 @@ function dest_mail() {
48
  }
49
 
50
  trigger_error(__('Adding backup archive to mail','backwpup'),E_USER_NOTICE);
51
- need_free_memory(filesize($STATIC['JOB']['backupdir'].$STATIC['backupfile'])*5);
52
  $phpmailer->AddAttachment($STATIC['JOB']['backupdir'].$STATIC['backupfile']);
53
 
54
  trigger_error(__('Send mail....','backwpup'),E_USER_NOTICE);
48
  }
49
 
50
  trigger_error(__('Adding backup archive to mail','backwpup'),E_USER_NOTICE);
51
+ need_free_memory(filesize($STATIC['JOB']['backupdir'].$STATIC['backupfile'])*6);
52
  $phpmailer->AddAttachment($STATIC['JOB']['backupdir'].$STATIC['backupfile']);
53
 
54
  trigger_error(__('Send mail....','backwpup'),E_USER_NOTICE);
job/dest_s3.php CHANGED
@@ -20,7 +20,7 @@ function dest_s3() {
20
  //set curl Progress bar
21
  $curlops=array();
22
  if (defined('CURLOPT_PROGRESSFUNCTION'))
23
- $curlops=array(CURLOPT_NOPROGRESS=>false,CURLOPT_PROGRESSFUNCTION=>'curl_progresscallback',CURLOPT_BUFFERSIZE=>512);
24
  trigger_error(__('Upload to Amazon S3 now started... ','backwpup'),E_USER_NOTICE);
25
  //transferee file to S3
26
  $result=$s3->create_object($STATIC['JOB']['awsBucket'], $STATIC['JOB']['awsdir'].$STATIC['backupfile'], array('fileUpload' => $STATIC['JOB']['backupdir'].$STATIC['backupfile'],'acl' => AmazonS3::ACL_PRIVATE,'storage' => $storage,'curlopts'=>$curlops));
20
  //set curl Progress bar
21
  $curlops=array();
22
  if (defined('CURLOPT_PROGRESSFUNCTION'))
23
+ $curlops=array(CURLOPT_NOPROGRESS=>false,CURLOPT_PROGRESSFUNCTION=>'curl_progresscallback',CURLOPT_BUFFERSIZE=>1048576);
24
  trigger_error(__('Upload to Amazon S3 now started... ','backwpup'),E_USER_NOTICE);
25
  //transferee file to S3
26
  $result=$s3->create_object($STATIC['JOB']['awsBucket'], $STATIC['JOB']['awsdir'].$STATIC['backupfile'], array('fileUpload' => $STATIC['JOB']['backupdir'].$STATIC['backupfile'],'acl' => AmazonS3::ACL_PRIVATE,'storage' => $storage,'curlopts'=>$curlops));
job/job_functions.php CHANGED
@@ -188,21 +188,23 @@ function update_working_file($mustwrite=false) {
188
  job_end();
189
  return false;
190
  }
191
- if ($mustwrite or empty($runmicrotime) or $savedmicrotime<microtime()) { //only update all 1 sec.
192
- if ($WORKING['STEPTODO']>0 and $WORKING['STEPDONE']>0)
193
- $steppersent=round($WORKING['STEPDONE']/$WORKING['STEPTODO']*100);
194
- else
195
- $steppersent=1;
196
- if (count($WORKING['STEPSDONE'])>0)
197
- $stepspersent=round(count($WORKING['STEPSDONE'])/count($WORKING['STEPS'])*100);
198
- else
199
- $stepspersent=1;
200
- @set_time_limit(0);
201
- if (is_writable($STATIC['TEMPDIR'].'.running')) {
202
- file_put_contents($STATIC['TEMPDIR'].'.running',serialize(array('timestamp'=>time(),'JOBID'=>$STATIC['JOB']['jobid'],'LOGFILE'=>$STATIC['LOGFILE'],'STEPSPERSENT'=>$stepspersent,'STEPPERSENT'=>$steppersent,'ABSPATH'=>$STATIC['WP']['ABSPATH'],'WORKING'=>$WORKING)));
203
- $savedmicrotime=microtime()+1000;
204
- }
205
- }
 
 
206
  return true;
207
  }
208
 
188
  job_end();
189
  return false;
190
  }
191
+ //only update all 1 sec.
192
+ $timetoupdate = microtime( true ) - $savedmicrotime;
193
+ if ( ! $mustwrite && $timetoupdate < 1 )
194
+ return true;
195
+ if ($WORKING['STEPTODO']>0 and $WORKING['STEPDONE']>0)
196
+ $steppersent=round($WORKING['STEPDONE']/$WORKING['STEPTODO']*100);
197
+ else
198
+ $steppersent=1;
199
+ if (count($WORKING['STEPSDONE'])>0)
200
+ $stepspersent=round(count($WORKING['STEPSDONE'])/count($WORKING['STEPS'])*100);
201
+ else
202
+ $stepspersent=1;
203
+ @set_time_limit(0);
204
+ if (is_writable($STATIC['TEMPDIR'].'.running')) {
205
+ file_put_contents($STATIC['TEMPDIR'].'.running',serialize(array('timestamp'=>time(),'JOBID'=>$STATIC['JOB']['jobid'],'LOGFILE'=>$STATIC['LOGFILE'],'STEPSPERSENT'=>$stepspersent,'STEPPERSENT'=>$steppersent,'ABSPATH'=>$STATIC['WP']['ABSPATH'],'WORKING'=>$WORKING)));
206
+ $savedmicrotime = microtime( true );
207
+ }
208
  return true;
209
  }
210
 
job/wp_export.php CHANGED
@@ -24,7 +24,7 @@ function wp_export() {
24
  if (defined('CURLOPT_PROGRESSFUNCTION')) {
25
  curl_setopt($ch, CURLOPT_NOPROGRESS, false);
26
  curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, 'curl_progresscallback');
27
- curl_setopt($ch, CURLOPT_BUFFERSIZE, 512);
28
  }
29
  if (!empty($STATIC['CFG']['httpauthuser']) and !empty($STATIC['CFG']['httpauthpassword'])) {
30
  curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
24
  if (defined('CURLOPT_PROGRESSFUNCTION')) {
25
  curl_setopt($ch, CURLOPT_NOPROGRESS, false);
26
  curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, 'curl_progresscallback');
27
+ curl_setopt($ch, CURLOPT_BUFFERSIZE, 1048576);
28
  }
29
  if (!empty($STATIC['CFG']['httpauthuser']) and !empty($STATIC['CFG']['httpauthpassword'])) {
30
  curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
lang/backwpup-es_ES.po CHANGED
@@ -1,1699 +1,1699 @@
1
- # Copyright (C) 2010 BackWPup
2
- # This file is distributed under the same license as the BackWPup package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: BackWPup 1.5.0 en español\n"
6
- "Report-Msgid-Bugs-To: \n"
7
- "POT-Creation-Date: 2011-03-07 09:19+0100\n"
8
- "PO-Revision-Date: 2011-03-07 09:20+0100\n"
9
- "Last-Translator: Eduardo Larequi <elarequi@educacion.navarra.es>\n"
10
- "Language-Team: Eduardo Larequi <elarequi@gmail.com>\n"
11
- "MIME-Version: 1.0\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
- "Content-Transfer-Encoding: 8bit\n"
14
- "X-Poedit-Language: Spanish\n"
15
- "X-Poedit-Country: Spain\n"
16
- "X-Poedit-Basepath: ..\n"
17
- "X-Poedit-KeywordsList: __;_e;_n:1,2;_c;_x;esc_html__\n"
18
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
19
- "X-Poedit-SearchPath-0: .\n"
20
-
21
- #: app/backwpup_dojob.php:64
22
- #, php-format
23
- msgid "BackWPup Log for %1$s from %2$s at %3$s"
24
- msgstr "Registro de BackWPup para %1$s, de %2$s, a las %3$s"
25
-
26
- #: app/backwpup_dojob.php:74
27
- msgid "Working Job will closed!!! And a new started!!!"
28
- msgstr "La tarea en ejecución se terminará y comenzará una nueva."
29
-
30
- #: app/backwpup_dojob.php:77
31
- #: app/backwpup_dojob.php:241
32
- #: app/options-save.php:63
33
- msgid "[ERROR]"
34
- msgstr "[ERROR]"
35
-
36
- #: app/backwpup_dojob.php:77
37
- msgid "Backup Aborted working to long!!!"
38
- msgstr "La copia de seguridad ha sido abortada. Tiempo de ejecución demasiado largo."
39
-
40
- #: app/backwpup_dojob.php:94
41
- #, php-format
42
- msgid "Job %1$s already running!!!"
43
- msgstr "La tarea %1$s ya se está ejecutando."
44
-
45
- #: app/backwpup_dojob.php:131
46
- #, php-format
47
- msgid "PHP Safe Mode is on!!! Max exec time is %1$d sec."
48
- msgstr "EL modo seguro (Safe Mode) de PHP está activado. El tiempo máximo de ejecución es de %1$d seg."
49
-
50
- #: app/backwpup_dojob.php:135
51
- #, php-format
52
- msgid "Memory limit set to %1$s ,because can not use PHP: memory_get_usage() function to dynamically increase the Memory!"
53
- msgstr "El límite de memoria se ha establecido en %1$s, porque no se puede tuilizar la función memory_get_usage() de PHP para incrementar dinámicamente la memoria."
54
-
55
- #: app/backwpup_dojob.php:203
56
- msgid "old Log files deleted!!!"
57
- msgstr "los ficheros antiguos del registro han sido borrados."
58
-
59
- #: app/backwpup_dojob.php:208
60
- #, php-format
61
- msgid "Backup Archive File size is %1s"
62
- msgstr "El fichero de copia de seguridad tiene un tamaño de %1s"
63
-
64
- #: app/backwpup_dojob.php:210
65
- #, php-format
66
- msgid "Job done in %1s sec."
67
- msgstr "Tarea realizada en %1s seg."
68
-
69
- #: app/backwpup_dojob.php:235
70
- msgid "[WARNING]"
71
- msgstr "[ADVERTENCIA]"
72
-
73
- #: app/backwpup_dojob.php:245
74
- msgid "[DEPRECATED]"
75
- msgstr "[OBSOLETO]"
76
-
77
- #: app/backwpup_dojob.php:248
78
- msgid "[STRICT NOTICE]"
79
- msgstr "[AVISO DE SUMA IMPORTANCIA]"
80
-
81
- #: app/backwpup_dojob.php:251
82
- msgid "[RECOVERABLE ERROR]"
83
- msgstr "[ERROR RECUPERABLE]"
84
-
85
- #: app/backwpup_dojob.php:307
86
- #, php-format
87
- msgid "Can not create Folder: %1$s"
88
- msgstr "No se ha podido crear el directorio: %1$s"
89
-
90
- #: app/backwpup_dojob.php:312
91
- #, php-format
92
- msgid "Can not write to Folder: %1$s"
93
- msgstr "No se puede escribir en el directorio: %1$s"
94
-
95
- #: app/backwpup_dojob.php:346
96
- #, php-format
97
- msgid "PHP Safe Mode is on!!! Can not increase Memory Limit is %1$s"
98
- msgstr "El modo seguro (Safe Mode) de PHP está activado. No se puede incrementar el límite de memoria, de %1$s"
99
-
100
- #: app/backwpup_dojob.php:373
101
- #, php-format
102
- msgid "Memory increased from %1$s to %2$s"
103
- msgstr "Memoria incrementada de %1$s a %2$s"
104
-
105
- #: app/backwpup_dojob.php:375
106
- #, php-format
107
- msgid "Can not increase Memory Limit is %1$s"
108
- msgstr "No se ha podido incrementar el límite de memoria, de %1$s"
109
-
110
- #: app/backwpup_dojob.php:385
111
- msgid "Set Blog to Maintenance Mode"
112
- msgstr "MIentras se realiza la copia de seguridad de la base de datos, el blog se ha puesto en modo de mantenimiento"
113
-
114
- #: app/backwpup_dojob.php:401
115
- msgid "Set Blog to normal Mode"
116
- msgstr "Finalizada la copia de seguridad de la base de datos, el blog ha vuelto al modo normal"
117
-
118
- #: app/backwpup_dojob.php:417
119
- msgid "Run Database check..."
120
- msgstr "Ejecutar comprobación de la base de datos..."
121
-
122
- #: app/backwpup_dojob.php:432
123
- #: app/backwpup_dojob.php:434
124
- #: app/backwpup_dojob.php:436
125
- #, php-format
126
- msgid "Result of table check for %1$s is: %2$s"
127
- msgstr "El resultado de la verificación de la tabla %1$s es: %2$s"
128
-
129
- #: app/backwpup_dojob.php:439
130
- #: app/backwpup_dojob.php:451
131
- #: app/backwpup_dojob.php:475
132
- #: app/backwpup_dojob.php:485
133
- #: app/backwpup_dojob.php:530
134
- #: app/backwpup_dojob.php:542
135
- #: app/backwpup_dojob.php:669
136
- #, php-format
137
- msgid "BackWPup database error %1$s for query %2$s"
138
- msgstr "Error %1$s de la base de datos para la consulta %2$s"
139
-
140
- #: app/backwpup_dojob.php:444
141
- #: app/backwpup_dojob.php:446
142
- #: app/backwpup_dojob.php:448
143
- #, php-format
144
- msgid "Result of table repair for %1$s is: %2$s"
145
- msgstr "El resultado de la reparación de la tabla %1$s es: %2$s"
146
-
147
- #: app/backwpup_dojob.php:456
148
- msgid "Database check done!"
149
- msgstr "Verificación de la base de datos realizada."
150
-
151
- #: app/backwpup_dojob.php:458
152
- msgid "No Tables to check"
153
- msgstr "No hay tablas que verificar"
154
-
155
- #: app/backwpup_dojob.php:523
156
- msgid "Run Database Dump to file..."
157
- msgstr "Ejecutar el volcado de la base de datos al fichero..."
158
-
159
- #: app/backwpup_dojob.php:575
160
- msgid "Dump Database table: "
161
- msgstr "Volcar la tabla de la base de datos:"
162
-
163
- #: app/backwpup_dojob.php:590
164
- msgid "Database Dump done!"
165
- msgstr "Volcado de la base de datos realizado."
166
-
167
- #: app/backwpup_dojob.php:592
168
- msgid "Can not create Database Dump file"
169
- msgstr "No se puede crear un fichero de volcado de la base de datos"
170
-
171
- #: app/backwpup_dojob.php:595
172
- msgid "No Tables to Dump"
173
- msgstr "No hay tablas para realizar un volcado"
174
-
175
- #: app/backwpup_dojob.php:601
176
- msgid "Add Database Dump to Backup:"
177
- msgstr "Añadir volcado de la base de datos a la copia de seguridad:"
178
-
179
- #: app/backwpup_dojob.php:611
180
- #: app/backwpup_dojob.php:628
181
- msgid "Run Wordpress Export to XML file..."
182
- msgstr "Ejecutar la exportación de WordPress a un fichero XML..."
183
-
184
- #: app/backwpup_dojob.php:620
185
- msgid "cURL:"
186
- msgstr "cURL:"
187
-
188
- #: app/backwpup_dojob.php:630
189
- msgid "Export to XML done!"
190
- msgstr "Exportación a XML realizada."
191
-
192
- #: app/backwpup_dojob.php:632
193
- msgid "Can not Export to XML!"
194
- msgstr "No se puede exportar a XML."
195
-
196
- #: app/backwpup_dojob.php:635
197
- msgid "Can not Export to XML! no cURL or allow_url_fopen Support!"
198
- msgstr "No se puede exportar a XML: las funciones cURL o allow_url_fopen no se pueden utilizar."
199
-
200
- #: app/backwpup_dojob.php:639
201
- msgid "Add XML Export to Backup:"
202
- msgstr "Añadir fichero XML de exportación a la copia de seguridad:"
203
-
204
- #: app/backwpup_dojob.php:648
205
- msgid "Run Database optimize..."
206
- msgstr "Ejecutar optimización de la base de datos..."
207
-
208
- #: app/backwpup_dojob.php:662
209
- #: app/backwpup_dojob.php:664
210
- #: app/backwpup_dojob.php:666
211
- #, php-format
212
- msgid "Result of table optimize for %1$s is: %2$s"
213
- msgstr "El resultado de la optimización de la tabla %1$s es: %2$s"
214
-
215
- #: app/backwpup_dojob.php:672
216
- msgid "Database optimize done!"
217
- msgstr "Optimización de la base de datos realizada."
218
-
219
- #: app/backwpup_dojob.php:675
220
- msgid "No Tables to optimize"
221
- msgstr "No hay tablas que optimizar"
222
-
223
- #: app/backwpup_dojob.php:693
224
- msgid "File or Folder is not readable:"
225
- msgstr "El fichero o el directorio no se puede leer:"
226
-
227
- #: app/backwpup_dojob.php:695
228
- msgid "Link not followed:"
229
- msgstr "No se ha seguido el enlace:"
230
-
231
- #: app/backwpup_dojob.php:703
232
- msgid "Is not a file or directory:"
233
- msgstr "No es un fichero o un directorio:"
234
-
235
- #: app/backwpup_dojob.php:713
236
- msgid "Make a list of files to Backup ...."
237
- msgstr "Hacer una lista de ficheros para la copia de seguridad..."
238
-
239
- #: app/backwpup_dojob.php:762
240
- msgid "No files to Backup"
241
- msgstr "No hay ficheros para la copia de seguridadd"
242
-
243
- #: app/backwpup_dojob.php:764
244
- msgid "Files to Backup:"
245
- msgstr "Ficheros para la copia de seguridad:"
246
-
247
- #: app/backwpup_dojob.php:765
248
- msgid "Size of all Files:"
249
- msgstr "Tamaño de todos los ficheros:"
250
-
251
- #: app/backwpup_dojob.php:773
252
- msgid "Create Backup Zip file..."
253
- msgstr "Crear fichero ZIP con la copia de seguridad:"
254
-
255
- #: app/backwpup_dojob.php:781
256
- #: app/backwpup_dojob.php:805
257
- msgid "Add File to ZIP file:"
258
- msgstr "Añadir fichero al fichero ZIP:"
259
-
260
- #: app/backwpup_dojob.php:785
261
- msgid "Can not add File to ZIP file:"
262
- msgstr "No se puede añadir un fichero al fichero ZIP:"
263
-
264
- #: app/backwpup_dojob.php:789
265
- #: app/backwpup_dojob.php:812
266
- msgid "Backup Zip file create done!"
267
- msgstr "Fichero ZIP de copia de seguridad creado."
268
-
269
- #: app/backwpup_dojob.php:791
270
- msgid "Can not create Backup ZIP file:"
271
- msgstr "No se puede crear el fichero ZIP de copia de seguridad:"
272
-
273
- #: app/backwpup_dojob.php:802
274
- msgid "Create Backup Zip (PclZip) file..."
275
- msgstr "Crear fichero ZIP (PclZip) de copia de seguridad..."
276
-
277
- #: app/backwpup_dojob.php:810
278
- msgid "Zip file create:"
279
- msgstr "Crear fichero ZIP:"
280
-
281
- #: app/backwpup_dojob.php:829
282
- msgid "Can not create TAR Backup file"
283
- msgstr "No se ha podido crear el fichero TAR de copia de seguridad"
284
-
285
- #: app/backwpup_dojob.php:832
286
- msgid "Create Backup Archive file..."
287
- msgstr "Crear fichero de copia de seguridad..."
288
-
289
- #: app/backwpup_dojob.php:839
290
- msgid "Add File to Backup Archive:"
291
- msgstr "Añadir fichero al fichero de copia de seguridad:"
292
-
293
- #: app/backwpup_dojob.php:915
294
- msgid "Backup Archive file create done!"
295
- msgstr "Fichero de copia de seguridad creado."
296
-
297
- #: app/backwpup_dojob.php:933
298
- msgid "Connected by SSL-FTP to Server:"
299
- msgstr "Conectado por SSL-FTP al servidor:"
300
-
301
- #: app/backwpup_dojob.php:935
302
- msgid "Can not connect by SSL-FTP to Server:"
303
- msgstr "No se puede conectar por SSL-FTP al servidor:"
304
-
305
- #: app/backwpup_dojob.php:939
306
- msgid "PHP Function to connect with SSL-FTP to Server not exists!"
307
- msgstr "La función de PHP para conectarse con el servidor por SSL-FTP no existe."
308
-
309
- #: app/backwpup_dojob.php:945
310
- msgid "Connected to FTP Server:"
311
- msgstr "Conectado al servidor FTP:"
312
-
313
- #: app/backwpup_dojob.php:947
314
- msgid "Can not connect to FTP Server:"
315
- msgstr "No se puede conectar por FTP al servidor:"
316
-
317
- #: app/backwpup_dojob.php:954
318
- #: app/backwpup_dojob.php:961
319
- #: app/backwpup_dojob.php:973
320
- #: app/backwpup_dojob.php:986
321
- msgid "FTP Client command:"
322
- msgstr "Comando del cliente FTP:"
323
-
324
- #: app/backwpup_dojob.php:956
325
- #: app/backwpup_dojob.php:959
326
- #: app/backwpup_dojob.php:963
327
- #: app/backwpup_dojob.php:976
328
- #: app/backwpup_dojob.php:978
329
- #: app/backwpup_dojob.php:981
330
- #: app/backwpup_dojob.php:983
331
- #: app/backwpup_dojob.php:989
332
- #: app/backwpup_dojob.php:991
333
- msgid "FTP Server reply:"
334
- msgstr "Respuesta del servidor FTP:"
335
-
336
- #: app/backwpup_dojob.php:976
337
- msgid "Entering Passive Mode"
338
- msgstr "Entrando en modo pasivo"
339
-
340
- #: app/backwpup_dojob.php:978
341
- msgid "Can not Entering Passive Mode"
342
- msgstr "No se puede entrar en modo pasivo"
343
-
344
- #: app/backwpup_dojob.php:981
345
- msgid "Entering Normal Mode"
346
- msgstr "Entrando en modo normal"
347
-
348
- #: app/backwpup_dojob.php:983
349
- msgid "Can not Entering Normal Mode"
350
- msgstr "No se puede entrar en modo normal"
351
-
352
- #: app/backwpup_dojob.php:991
353
- msgid "Error getting SYSTYPE"
354
- msgstr "Error al obtener SYSTYPE"
355
-
356
- #: app/backwpup_dojob.php:999
357
- msgid "FTP Folder on Server not exists!"
358
- msgstr "El directorio FTP en el servidor no existe."
359
-
360
- #: app/backwpup_dojob.php:1001
361
- msgid "FTP Folder created!"
362
- msgstr "Directorio FTP creado."
363
-
364
- #: app/backwpup_dojob.php:1004
365
- msgid "FTP Folder on Server can not created!"
366
- msgstr "No se ha podido crear el directorio en el servidor FTP."
367
-
368
- #: app/backwpup_dojob.php:1010
369
- msgid "Backup File transferred to FTP Server:"
370
- msgstr "Fichero de copia de seguridad transferido al servidor FTP:"
371
-
372
- #: app/backwpup_dojob.php:1013
373
- msgid "Can not transfer backup to FTP server."
374
- msgstr "No se ha podido transferir el fichero de copia de seguridad al servidor FTP."
375
-
376
- #: app/backwpup_dojob.php:1029
377
- msgid "Can not delete file on FTP Server:"
378
- msgstr "No se ha podido borrar el fichero en el servidor FTP:"
379
-
380
- #: app/backwpup_dojob.php:1032
381
- msgid "files deleted on FTP Server:"
382
- msgstr "ficheros borrados en el servidor FTP:"
383
-
384
- #: app/backwpup_dojob.php:1044
385
- msgid "Prepare Sending backup file with mail..."
386
- msgstr "Preparando en envío de fichero de copia de seguridad por email..."
387
-
388
- #: app/backwpup_dojob.php:1064
389
- msgid "Send mail with SMTP"
390
- msgstr "Enviar email con SMTP"
391
-
392
- #: app/backwpup_dojob.php:1068
393
- msgid "Send mail with Sendmail"
394
- msgstr "Enviar email con Sendmail"
395
-
396
- #: app/backwpup_dojob.php:1071
397
- msgid "Send mail with PHP mail"
398
- msgstr "Enviar email con PHP mail"
399
-
400
- #: app/backwpup_dojob.php:1075
401
- msgid "Creating mail"
402
- msgstr "Creando email"
403
-
404
- #: app/backwpup_dojob.php:1079
405
- msgid "BackWPup File from"
406
- msgstr "Fichero BackWPup de"
407
-
408
- #: app/backwpup_dojob.php:1087
409
- msgid "Backup Archive too big for sending by mail"
410
- msgstr "Fichero de copia de seguridad demasiado grande para enviar por email"
411
-
412
- #: app/backwpup_dojob.php:1092
413
- msgid "Adding Attachment to mail"
414
- msgstr "Añadiendo un fichero adjunto al email"
415
-
416
- #: app/backwpup_dojob.php:1096
417
- msgid "Send mail...."
418
- msgstr "Enviar email..."
419
-
420
- #: app/backwpup_dojob.php:1098
421
- msgid "Can not send mail:"
422
- msgstr "No se puede enviar el email:"
423
-
424
- #: app/backwpup_dojob.php:1100
425
- msgid "Mail send!!!"
426
- msgstr "Email enviado."
427
-
428
- #: app/backwpup_dojob.php:1118
429
- msgid "Connected to S3 Bucket:"
430
- msgstr "Conectado al S3 Bucket:"
431
-
432
- #: app/backwpup_dojob.php:1127
433
- msgid "Backup File transferred to S3://"
434
- msgstr "Fichero de copia de seguridad transferido a S3://"
435
-
436
- #: app/backwpup_dojob.php:1130
437
- msgid "Can not transfer backup to S3."
438
- msgstr "No se puede transferir la copia de seguridad a S3."
439
-
440
- #: app/backwpup_dojob.php:1149
441
- msgid "Can not delete file on S3://"
442
- msgstr "No se puede borrar el fichero en S3://"
443
-
444
- #: app/backwpup_dojob.php:1152
445
- msgid "files deleted on S3 Bucket!"
446
- msgstr "ficheros borrados en S3 Bucket."
447
-
448
- #: app/backwpup_dojob.php:1159
449
- msgid "S3 Bucket not exists:"
450
- msgstr "S3 Bucket no existe."
451
-
452
- #: app/backwpup_dojob.php:1162
453
- msgid "Amazon S3 API:"
454
- msgstr "API de Amazon S3:"
455
-
456
- #: app/backwpup_dojob.php:1173
457
- msgid "Can not load curl extension is needed for Rackspase Cloud!"
458
- msgstr "No se puede cargar la extensión curl, necesaria para Rackspace Cloud."
459
-
460
- #: app/backwpup_dojob.php:1185
461
- msgid "Connected to Rackspase ..."
462
- msgstr "Conectado a Rackspace..."
463
-
464
- #: app/backwpup_dojob.php:1201
465
- #: app/backwpup_dojob.php:1251
466
- msgid "Rackspase Cloud API:"
467
- msgstr "API de Rackspace Cloud:"
468
-
469
- #: app/backwpup_dojob.php:1207
470
- msgid "Rackspase Cloud Container not exists:"
471
- msgstr "Rackspace Cloud Container no existe:"
472
-
473
- #: app/backwpup_dojob.php:1219
474
- msgid "Backup File transferred to RSC://"
475
- msgstr "Fichero de copia de seguridad transferido a RSC://"
476
-
477
- #: app/backwpup_dojob.php:1222
478
- msgid "Can not transfer backup to RSC."
479
- msgstr "No se puede transferir la copia de seguridad a RSC."
480
-
481
- #: app/backwpup_dojob.php:1244
482
- msgid "Can not delete file on RSC://"
483
- msgstr "No se puede borrar el fichero en RSC://"
484
-
485
- #: app/backwpup_dojob.php:1247
486
- msgid "files deleted on Racspase Cloud Container!"
487
- msgstr "ficheros borrados en Rackspace Cloud Container."
488
-
489
- #: app/backwpup_dojob.php:1261
490
- msgid "Can not load curl extension is needed for Microsoft Azure!"
491
- msgstr "No se puede cargar la extensión curl, necesaria para Microsoft Azure."
492
-
493
- #: app/backwpup_dojob.php:1274
494
- msgid "Microsoft Azure Container not exists:"
495
- msgstr "Microsoft Azure Container no existe:"
496
-
497
- #: app/backwpup_dojob.php:1277
498
- msgid "Connected to Microsoft Azure Container:"
499
- msgstr "Conectado a Microsoft Azure Container:"
500
-
501
- #: app/backwpup_dojob.php:1287
502
- msgid "Backup File transferred to azure://"
503
- msgstr "Fichero de copia de seguridad transferido a azure://"
504
-
505
- #: app/backwpup_dojob.php:1290
506
- msgid "Can not transfer backup to Microsoft Azure."
507
- msgstr "No se puede transferir la copia de seguridad a Microsoft Azure."
508
-
509
- #: app/backwpup_dojob.php:1311
510
- msgid "files deleted on Microsoft Azure Container!"
511
- msgstr "ficheros borrados en Microsoft Azure Container."
512
-
513
- #: app/backwpup_dojob.php:1316
514
- msgid "Microsoft Azure API:"
515
- msgstr "API de Microsoft Azure:"
516
-
517
- #: app/backwpup_dojob.php:1342
518
- msgid "old backup files deleted!!!"
519
- msgstr "los ficheros de copia de seguridad antiguos han sido borrados."
520
-
521
- #: app/backwpup_dojob.php:1352
522
- msgid "Can not load curl extension is needed for Dropbox!"
523
- msgstr "No se puede cargar la extensión curl, necesaria para DropBox."
524
-
525
- #: app/backwpup_dojob.php:1366
526
- msgid "Authed to DropBox API from "
527
- msgstr "Autentificado con el API de DropBox desde"
528
-
529
- #: app/backwpup_dojob.php:1368
530
- msgid "Can not Auth with DropBox API:"
531
- msgstr "No se puede autentificar con el API de DropBox:"
532
-
533
- #: app/backwpup_dojob.php:1376
534
- msgid "Backup File transferred to DropBox."
535
- msgstr "Fichero de copia de seguridad transferido a DropBox."
536
-
537
- #: app/backwpup_dojob.php:1378
538
- msgid "Can not transfere Backup file to DropBox:"
539
- msgstr "No se puede transferir la copia de seguridad a DropBox:"
540
-
541
- #: app/backwpup_dojob.php:1399
542
- msgid "files deleted on DropBox Folder!"
543
- msgstr "ficheros borrados en el directorio de DropBox."
544
-
545
- #: app/backwpup_dojob.php:1403
546
- msgid "DropBox API:"
547
- msgstr "API de DropBox:"
548
-
549
- #: app/backwpup_dojob.php:1505
550
- msgid "Jobname:"
551
- msgstr "Nombre de la tarea:"
552
-
553
- #: app/backwpup_dojob.php:1506
554
- msgid "Jobtype:"
555
- msgstr "Tipo de la tarea:"
556
-
557
- #: app/backwpup_dojob.php:1508
558
- msgid "Errors:"
559
- msgstr "Errores:"
560
-
561
- #: app/backwpup_dojob.php:1510
562
- msgid "Warnings:"
563
- msgstr "Avisos:"
564
-
565
- #: app/backwpup_dojob.php:1515
566
- msgid "BackWPup Log from"
567
- msgstr "Registro de BackWPup de"
568
-
569
- #: app/list-tables.php:22
570
- #: app/list-tables.php:198
571
- #: app/list-tables.php:375
572
- msgid "No rights"
573
- msgstr "No tienes permisos"
574
-
575
- #: app/list-tables.php:41
576
- msgid "No Jobs."
577
- msgstr "No hay tareas."
578
-
579
- #: app/list-tables.php:46
580
- #: app/list-tables.php:107
581
- msgid "Export"
582
- msgstr "Exportar"
583
-
584
- #: app/list-tables.php:47
585
- #: app/list-tables.php:108
586
- #: app/list-tables.php:254
587
- #: app/list-tables.php:317
588
- #: app/list-tables.php:417
589
- #: app/list-tables.php:483
590
- #: app/options-edit-job.php:45
591
- msgid "Delete"
592
- msgstr "Borrar"
593
-
594
- #: app/list-tables.php:55
595
- msgid "ID"
596
- msgstr "ID"
597
-
598
- #: app/list-tables.php:56
599
- msgid "Job Name"
600
- msgstr "Nombre de la tarea"
601
-
602
- #: app/list-tables.php:57
603
- #: app/list-tables.php:263
604
- msgid "Type"
605
- msgstr "Tipo"
606
-
607
- #: app/list-tables.php:58
608
- msgid "Information"
609
- msgstr "Información"
610
-
611
- #: app/list-tables.php:59
612
- msgid "Next Run"
613
- msgstr "Próxima ejecución"
614
-
615
- #: app/list-tables.php:60
616
- msgid "Last Run"
617
- msgstr "Última ejecución"
618
-
619
- #: app/list-tables.php:102
620
- msgid "Edit:"
621
- msgstr "Editar:"
622
-
623
- #: app/list-tables.php:105
624
- msgid "Edit"
625
- msgstr "Editar"
626
-
627
- #: app/list-tables.php:106
628
- msgid "Copy"
629
- msgstr "Copiar"
630
-
631
- #: app/list-tables.php:108
632
- #: app/options-edit-job.php:45
633
- msgid ""
634
- "You are about to delete this Job. \n"
635
- " 'Cancel' to stop, 'OK' to delete."
636
- msgstr ""
637
- "Estás a punto de borrar esta tarea.\n"
638
- " 'Cancelar' para parar, 'OK' para borrar."
639
-
640
- #: app/list-tables.php:109
641
- msgid "Run Now"
642
- msgstr "Ejecutar ahora"
643
-
644
- #: app/list-tables.php:111
645
- msgid "Clear"
646
- msgstr "Limpiar"
647
-
648
- #: app/list-tables.php:133
649
- msgid "Files Size:"
650
- msgstr "Tamaño de los ficheros:"
651
-
652
- #: app/list-tables.php:135
653
- msgid "Files count:"
654
- msgstr "Número de ficheros:"
655
-
656
- #: app/list-tables.php:140
657
- msgid "DB Size: "
658
- msgstr "Tamaño de la base de datos: "
659
-
660
- #: app/list-tables.php:142
661
- msgid "DB Tables:"
662
- msgstr "Tablas de la base de datos:"
663
-
664
- #: app/list-tables.php:143
665
- msgid "DB Rows:"
666
- msgstr "Registros de la base de datos:"
667
-
668
- #: app/list-tables.php:152
669
- #: app/php-functions.php:419
670
- msgid "Running since:"
671
- msgstr "Funcionando desde:"
672
-
673
- #: app/list-tables.php:152
674
- #: app/list-tables.php:168
675
- #: app/list-tables.php:353
676
- #: app/php-functions.php:419
677
- msgid "sec."
678
- msgstr "seg."
679
-
680
- #: app/list-tables.php:156
681
- msgid "Inactive"
682
- msgstr "Inactivo"
683
-
684
- #: app/list-tables.php:159
685
- msgid "<a href=\"http://wikipedia.org/wiki/Cron\" target=\"_blank\">Cron</a>:"
686
- msgstr "<a href=\"http://wikipedia.org/wiki/Cron\" target=\"_blank\">Cron</a>:"
687
-
688
- #: app/list-tables.php:168
689
- msgid "Runtime:"
690
- msgstr "Tiempo de ejecución:"
691
-
692
- #: app/list-tables.php:170
693
- msgid "None"
694
- msgstr "Nunca"
695
-
696
- #: app/list-tables.php:173
697
- msgid "Download last Backup"
698
- msgstr "Descargar la última copia de seguridad"
699
-
700
- #: app/list-tables.php:173
701
- #: app/list-tables.php:318
702
- #: app/list-tables.php:484
703
- msgid "Download"
704
- msgstr "Descargar"
705
-
706
- #: app/list-tables.php:175
707
- msgid "View last Log"
708
- msgstr "Ver el último registro"
709
-
710
- #: app/list-tables.php:175
711
- msgid "Log"
712
- msgstr "Registro"
713
-
714
- #: app/list-tables.php:249
715
- msgid "No Logs."
716
- msgstr "No hay registros."
717
-
718
- #: app/list-tables.php:262
719
- msgid "Job"
720
- msgstr "Tarea"
721
-
722
- #: app/list-tables.php:264
723
- msgid "Backup/Log Date/Time"
724
- msgstr "Fecha y hora del registro/Nombre de la copia de seguridad"
725
-
726
- #: app/list-tables.php:265
727
- msgid "Status"
728
- msgstr "Estado"
729
-
730
- #: app/list-tables.php:266
731
- #: app/list-tables.php:426
732
- msgid "Size"
733
- msgstr "Tamaño"
734
-
735
- #: app/list-tables.php:267
736
- msgid "Runtime"
737
- msgstr "Tiempo de ejecución"
738
-
739
- #: app/list-tables.php:314
740
- msgid "View log"
741
- msgstr "Ver registro"
742
-
743
- #: app/list-tables.php:316
744
- msgid "View"
745
- msgstr "Ver"
746
-
747
- #: app/list-tables.php:334
748
- #: app/php-functions.php:398
749
- msgid "ERROR(S)"
750
- msgstr "ERROR(ES)"
751
-
752
- #: app/list-tables.php:336
753
- #: app/php-functions.php:400
754
- msgid "WARNING(S)"
755
- msgstr "AVISO(S)"
756
-
757
- #: app/list-tables.php:338
758
- #: app/php-functions.php:402
759
- msgid "OK"
760
- msgstr "OK"
761
-
762
- #: app/list-tables.php:347
763
- msgid "only Log"
764
- msgstr "sólo registro"
765
-
766
- #: app/list-tables.php:411
767
- msgid "No Backups."
768
- msgstr "No hay copias de seguridad."
769
-
770
- #: app/list-tables.php:425
771
- msgid "Backupfile"
772
- msgstr "Fichero de copia de seguridad"
773
-
774
- #: app/list-tables.php:483
775
- msgid ""
776
- "You are about to delete this Backup Archive. \n"
777
- " 'Cancel' to stop, 'OK' to delete."
778
- msgstr ""
779
- "Estás a punto de borrar este fichero de copia de seguridad. \n"
780
- " 'Cancelar' para parar, 'OK' para borrar."
781
-
782
- #: app/list-tables.php:501
783
- msgid "?"
784
- msgstr "?"
785
-
786
- #: app/options-edit-job.php:12
787
- msgid "BackWPup Job Settings"
788
- msgstr "Configuración de tareas de BackWPup"
789
-
790
- #: app/options-edit-job.php:33
791
- msgid "Job Type"
792
- msgstr "Tipo de tarea"
793
-
794
- #: app/options-edit-job.php:48
795
- #: app/options-settings.php:22
796
- #: app/options-settings.php:84
797
- #: app/compatibility/class-wp-list-table.php:960
798
- msgid "Save Changes"
799
- msgstr "Guardar cambios"
800
-
801
- #: app/options-edit-job.php:55
802
- msgid "Job Schedule"
803
- msgstr "Programación de tareas"
804
-
805
- #: app/options-edit-job.php:57
806
- msgid "Activate scheduling"
807
- msgstr "Activar programación"
808
-
809
- #: app/options-edit-job.php:60
810
- msgid "Minutes: "
811
- msgstr "Minutos:"
812
-
813
- #: app/options-edit-job.php:68
814
- #: app/options-edit-job.php:85
815
- #: app/options-edit-job.php:102
816
- #: app/options-edit-job.php:120
817
- #: app/options-edit-job.php:144
818
- msgid "Any (*)"
819
- msgstr "Todos (*)"
820
-
821
- #: app/options-edit-job.php:77
822
- msgid "Hours:"
823
- msgstr "Horas:"
824
-
825
- #: app/options-edit-job.php:94
826
- msgid "Days:"
827
- msgstr "Días:"
828
-
829
- #: app/options-edit-job.php:112
830
- msgid "Months:"
831
- msgstr "Meses:"
832
-
833
- #: app/options-edit-job.php:121
834
- msgid "January"
835
- msgstr "Enero"
836
-
837
- #: app/options-edit-job.php:122
838
- msgid "February"
839
- msgstr "Febrero"
840
-
841
- #: app/options-edit-job.php:123
842
- msgid "March"
843
- msgstr "Marzo"
844
-
845
- #: app/options-edit-job.php:124
846
- msgid "April"
847
- msgstr "Abril"
848
-
849
- #: app/options-edit-job.php:125
850
- msgid "May"
851
- msgstr "Mayo"
852
-
853
- #: app/options-edit-job.php:126
854
- msgid "June"
855
- msgstr "Junio"
856
-
857
- #: app/options-edit-job.php:127
858
- msgid "July"
859
- msgstr "Julio"
860
-
861
- #: app/options-edit-job.php:128
862
- msgid "Augest"
863
- msgstr "Agosto"
864
-
865
- #: app/options-edit-job.php:129
866
- msgid "September"
867
- msgstr "Septiembre"
868
-
869
- #: app/options-edit-job.php:130
870
- msgid "October"
871
- msgstr "Octubre"
872
-
873
- #: app/options-edit-job.php:131
874
- msgid "November"
875
- msgstr "Noviembre"
876
-
877
- #: app/options-edit-job.php:132
878
- msgid "December"
879
- msgstr "Diciembre"
880
-
881
- #: app/options-edit-job.php:136
882
- msgid "Weekday:"
883
- msgstr "Día de la semana:"
884
-
885
- #: app/options-edit-job.php:145
886
- msgid "Sunday"
887
- msgstr "Domingo"
888
-
889
- #: app/options-edit-job.php:146
890
- msgid "Monday"
891
- msgstr "Lunes"
892
-
893
- #: app/options-edit-job.php:147
894
- msgid "Tuesday"
895
- msgstr "Martes"
896
-
897
- #: app/options-edit-job.php:148
898
- msgid "Wednesday"
899
- msgstr "Miércoles"
900
-
901
- #: app/options-edit-job.php:149
902
- msgid "Thursday"
903
- msgstr "Jueves"
904
-
905
- #: app/options-edit-job.php:150
906
- msgid "Friday"
907
- msgstr "Viernes"
908
-
909
- #: app/options-edit-job.php:151
910
- msgid "Saturday"
911
- msgstr "Sábado"
912
-
913
- #: app/options-edit-job.php:156
914
- msgid "Working as <a href=\"http://wikipedia.org/wiki/Cron\" target=\"_blank\">Cron</a> job schedule:"
915
- msgstr "Está funcionando como una tarea programada en el <a href=\"http://wikipedia.org/wiki/Cron\" target=\"_blank\">Cron</a>:"
916
-
917
- #: app/options-edit-job.php:157
918
- msgid "Next runtime:"
919
- msgstr "Próxima ejecución:"
920
-
921
- #: app/options-edit-job.php:163
922
- msgid "Backup File"
923
- msgstr "Fichero de copia de seguridad"
924
-
925
- #: app/options-edit-job.php:165
926
- msgid "File Prefix:"
927
- msgstr "Prefijo del fichero:"
928
-
929
- #: app/options-edit-job.php:167
930
- msgid "File Formart:"
931
- msgstr "Formato del fichero:"
932
-
933
- #: app/options-edit-job.php:170
934
- #: app/options-edit-job.php:172
935
- msgid "Zip"
936
- msgstr "Zip"
937
-
938
- #: app/options-edit-job.php:173
939
- msgid "Tar"
940
- msgstr "Tar"
941
-
942
- #: app/options-edit-job.php:175
943
- #: app/options-edit-job.php:177
944
- msgid "Tar GZip"
945
- msgstr "Tar GZip"
946
-
947
- #: app/options-edit-job.php:179
948
- #: app/options-edit-job.php:181
949
- msgid "Tar BZip2"
950
- msgstr "Tar BZip2"
951
-
952
- #: app/options-edit-job.php:182
953
- #: app/options-edit-job.php:318
954
- #: app/options-edit-job.php:322
955
- msgid "Example:"
956
- msgstr "Ejemplo:"
957
-
958
- #: app/options-edit-job.php:189
959
- msgid "Send log"
960
- msgstr "Enviar registro"
961
-
962
- #: app/options-edit-job.php:191
963
- #: app/options-edit-job.php:446
964
- msgid "E-Mail-Adress:"
965
- msgstr "Dirección de email:"
966
-
967
- #: app/options-edit-job.php:193
968
- msgid "Send only E-Mail on errors."
969
- msgstr "Solo enviar emails cuando se produzcan errores"
970
-
971
- #: app/options-edit-job.php:205
972
- msgid "Enter Job name here"
973
- msgstr "Escribe aquí el nombre de la tarea"
974
-
975
- #: app/options-edit-job.php:211
976
- msgid "Database Jobs"
977
- msgstr "Tareas de la base de datos"
978
-
979
- #: app/options-edit-job.php:214
980
- msgid "Database Tabels to Exclude:"
981
- msgstr "Tablas de la base de datos que se excluirán:"
982
-
983
- #: app/options-edit-job.php:225
984
- msgid "Use short INSERTs instat of full (with keys)"
985
- msgstr "Use short INSERTs instat of full (with keys)"
986
-
987
- #: app/options-edit-job.php:226
988
- msgid "Set Blog Maintenance Mode on Database Operations"
989
- msgstr "Poner el blog en modo de mantenimiento cuando se lleven a cabo operaciones en la base de datos"
990
-
991
- #: app/options-edit-job.php:231
992
- #: app/php-functions.php:316
993
- msgid "File Backup"
994
- msgstr "Hacer una copia de seguridad de los ficheros de la aplicación"
995
-
996
- #: app/options-edit-job.php:233
997
- msgid "Blog Folders to Backup:"
998
- msgstr "Directorios incluidos en la copia de seguridad:"
999
-
1000
- #: app/options-edit-job.php:236
1001
- msgid "root"
1002
- msgstr "Directorio raíz"
1003
-
1004
- #: app/options-edit-job.php:239
1005
- #: app/options-edit-job.php:255
1006
- #: app/options-edit-job.php:271
1007
- #: app/options-edit-job.php:287
1008
- #: app/options-edit-job.php:303
1009
- msgid "Exclude:"
1010
- msgstr "Excluir:"
1011
-
1012
- #: app/options-edit-job.php:252
1013
- msgid "Content"
1014
- msgstr "Directorio wp-content"
1015
-
1016
- #: app/options-edit-job.php:268
1017
- msgid "Plugins"
1018
- msgstr "Directorio de plugins"
1019
-
1020
- #: app/options-edit-job.php:284
1021
- msgid "Themes"
1022
- msgstr "Directorio de temas"
1023
-
1024
- #: app/options-edit-job.php:300
1025
- msgid "Blog Uploads"
1026
- msgstr "Directorio de subida de archivos"
1027
-
1028
- #: app/options-edit-job.php:317
1029
- msgid "Include Folders to Backup:"
1030
- msgstr "Incluir directorios en la copia de seguridad:"
1031
-
1032
- #: app/options-edit-job.php:321
1033
- msgid "Exclude Files/Folders from Backup:"
1034
- msgstr "Excluir ficheros o directorios de la copia de seguridad"
1035
-
1036
- #: app/options-edit-job.php:328
1037
- msgid "Backup to Directory"
1038
- msgstr "Guardar la copia de seguridad en el directorio"
1039
-
1040
- #: app/options-edit-job.php:330
1041
- msgid "Full Path to Folder for Backup Files:"
1042
- msgstr "Ruta completa al directorio donde se guardarán los ficheros de la copia de seguridad:"
1043
-
1044
- #: app/options-edit-job.php:332
1045
- msgid "Max. Backup Files in Folder:"
1046
- msgstr "Número máximo de ficheros de copia de seguridad que se guardarán en el directorio:"
1047
-
1048
- #: app/options-edit-job.php:332
1049
- #: app/options-edit-job.php:349
1050
- #: app/options-edit-job.php:373
1051
- #: app/options-edit-job.php:399
1052
- #: app/options-edit-job.php:422
1053
- #: app/options-edit-job.php:438
1054
- #: app/options-settings.php:62
1055
- msgid "(Oldest files will deleted first.)"
1056
- msgstr "(los más antiguos se borrarán en primer lugar)"
1057
-
1058
- #: app/options-edit-job.php:338
1059
- msgid "Backup to FTP Server"
1060
- msgstr "Copia de seguridad por FTP"
1061
-
1062
- #: app/options-edit-job.php:340
1063
- msgid "Hostname:"
1064
- msgstr "Nombre del servidor:"
1065
-
1066
- #: app/options-edit-job.php:342
1067
- #: app/options-edit-job.php:412
1068
- msgid "Username:"
1069
- msgstr "Nombre de usuario:"
1070
-
1071
- #: app/options-edit-job.php:344
1072
- #: app/options-edit-job.php:434
1073
- msgid "Password:"
1074
- msgstr "Contraseña:"
1075
-
1076
- #: app/options-edit-job.php:346
1077
- msgid "Directory on Server:"
1078
- msgstr "Directorio en el servidor:"
1079
-
1080
- #: app/options-edit-job.php:349
1081
- msgid "Max. Backup Files in FTP Folder:"
1082
- msgstr "Máximo número de ficheros de copia de seguridad en el directorio FTP:"
1083
-
1084
- #: app/options-edit-job.php:350
1085
- msgid "Use SSL-FTP Connection."
1086
- msgstr "Utilizar conexión SSL-FTP."
1087
-
1088
- #: app/options-edit-job.php:351
1089
- msgid "Use FTP Passiv mode."
1090
- msgstr "Utilizar FTP pasivo."
1091
-
1092
- #: app/options-edit-job.php:358
1093
- msgid "Backup to Amazon S3"
1094
- msgstr "Copia de seguridad en Amazon S3"
1095
-
1096
- #: app/options-edit-job.php:358
1097
- #: app/options-edit-job.php:382
1098
- #: app/options-edit-job.php:407
1099
- #: app/options-edit-job.php:430
1100
- msgid "Create Account"
1101
- msgstr "Crear cuenta"
1102
-
1103
- #: app/options-edit-job.php:361
1104
- #: app/options-edit-job.php:385
1105
- #: app/options-edit-job.php:410
1106
- msgid "curl Support required"
1107
- msgstr "se requiere soporte para curl"
1108
-
1109
- #: app/options-edit-job.php:363
1110
- msgid "Access Key ID:"
1111
- msgstr "ID de clave de acceso:"
1112
-
1113
- #: app/options-edit-job.php:363
1114
- #: app/options-edit-job.php:391
1115
- #: app/options-edit-job.php:414
1116
- msgid "Find it"
1117
- msgstr "Encontrarlo"
1118
-
1119
- #: app/options-edit-job.php:365
1120
- msgid "Secret Access Key:"
1121
- msgstr "Clave de acceso secreta:"
1122
-
1123
- #: app/options-edit-job.php:367
1124
- msgid "Bucket:"
1125
- msgstr "Bucket:"
1126
-
1127
- #: app/options-edit-job.php:370
1128
- msgid "Create Bucket:"
1129
- msgstr "Crear bucket:"
1130
-
1131
- #: app/options-edit-job.php:370
1132
- msgid "Bucket Region"
1133
- msgstr "Región del bucket:"
1134
-
1135
- #: app/options-edit-job.php:370
1136
- msgid "US-East (Northern Virginia)"
1137
- msgstr "Estados Unidos-Este (Northern Virginia)"
1138
-
1139
- #: app/options-edit-job.php:370
1140
- msgid "US-West (Northern California)"
1141
- msgstr "Estados Unidos-Oeste (Northern California)"
1142
-
1143
- #: app/options-edit-job.php:370
1144
- msgid "EU (Ireland)"
1145
- msgstr "Unión Europea (Irlanda)"
1146
-
1147
- #: app/options-edit-job.php:370
1148
- msgid "Asia Pacific (Singapore)"
1149
- msgstr "Asia Pacífico (Singapur)"
1150
-
1151
- #: app/options-edit-job.php:370
1152
- msgid "Asia Pacific (Japan)"
1153
- msgstr "Asia Pacífico (Japón)"
1154
-
1155
- #: app/options-edit-job.php:371
1156
- msgid "Directory in Bucket:"
1157
- msgstr "Directorio en el bucket:"
1158
-
1159
- #: app/options-edit-job.php:373
1160
- msgid "Max. Backup Files in Bucket Folder:"
1161
- msgstr "Máximo número de ficheros de copia de seguridad en el directorio del bucket:"
1162
-
1163
- #: app/options-edit-job.php:374
1164
- msgid "Save Backups with reduced redundancy!"
1165
- msgstr "Guardar copias de seguridad con redundancia reducida."
1166
-
1167
- #: app/options-edit-job.php:382
1168
- msgid "Backup to Micosoft Azure (Blob)"
1169
- msgstr "Copia de seguridad en Microsoft Azure (Blob)"
1170
-
1171
- #: app/options-edit-job.php:387
1172
- msgid "Host:"
1173
- msgstr "Servidor:"
1174
-
1175
- #: app/options-edit-job.php:388
1176
- msgid "Normely: blob.core.windows.net"
1177
- msgstr "Normalmente: blob.core.windows.net"
1178
-
1179
- #: app/options-edit-job.php:389
1180
- msgid "Account Name:"
1181
- msgstr "Nombre de cuenta:"
1182
-
1183
- #: app/options-edit-job.php:391
1184
- msgid "Access Key:"
1185
- msgstr "Clave de acceso:"
1186
-
1187
- #: app/options-edit-job.php:393
1188
- #: app/options-edit-job.php:416
1189
- msgid "Container:"
1190
- msgstr "Contenedor:"
1191
-
1192
- #: app/options-edit-job.php:396
1193
- #: app/options-edit-job.php:419
1194
- msgid "Create Container:"
1195
- msgstr "Crear contenedor:"
1196
-
1197
- #: app/options-edit-job.php:397
1198
- #: app/options-edit-job.php:420
1199
- msgid "Directory in Container:"
1200
- msgstr "Directorio en el contenedor:"
1201
-
1202
- #: app/options-edit-job.php:399
1203
- #: app/options-edit-job.php:422
1204
- msgid "Max. Backup Files in Container Folder:"
1205
- msgstr "Máximo número de ficheros de copia de seguridad en el directorio del contenedor:"
1206
-
1207
- #: app/options-edit-job.php:407
1208
- msgid "Backup to Rackspace Cloud"
1209
- msgstr "Backup en Rackspace Cloud"
1210
-
1211
- #: app/options-edit-job.php:414
1212
- msgid "API Key:"
1213
- msgstr "Clave API:"
1214
-
1215
- #: app/options-edit-job.php:430
1216
- msgid "Backup to Dropbox"
1217
- msgstr "Copia de seguridad con Dropbox"
1218
-
1219
- #: app/options-edit-job.php:432
1220
- msgid "Email:"
1221
- msgstr "Email:"
1222
-
1223
- #: app/options-edit-job.php:436
1224
- msgid "Directory:"
1225
- msgstr "Directorio:"
1226
-
1227
- #: app/options-edit-job.php:438
1228
- msgid "Max. Backup Files in Dopbox Folder:"
1229
- msgstr "Número máximo de ficheros de copia de seguridad en el directorio de DropBox:"
1230
-
1231
- #: app/options-edit-job.php:444
1232
- msgid "Backup to E-Mail"
1233
- msgstr "Enviar la copia de seguridad por email"
1234
-
1235
- #: app/options-edit-job.php:449
1236
- msgid "Max. File Size for sending Backups with mail:"
1237
- msgstr "Tamaño máximo del fichero para enviar copias de seguridad por email:"
1238
-
1239
- #: app/options-runnow-iframe.php:13
1240
- msgid "Do Job"
1241
- msgstr "Ejecutar la tarea"
1242
-
1243
- #: app/options-save.php:28
1244
- msgid "Copy of"
1245
- msgstr "Copia de"
1246
-
1247
- #: app/options-save.php:63
1248
- msgid "Backup Cleand by User!!!"
1249
- msgstr "Copia de seguridad borrada por el usuario."
1250
-
1251
- #: app/options-save.php:133
1252
- #: app/options-save.php:261
1253
- #: app/options-save.php:377
1254
- msgid "File does not exist."
1255
- msgstr "El fichero no exite"
1256
-
1257
- #: app/options-save.php:413
1258
- msgid "Settings saved"
1259
- msgstr "Configuración guardada"
1260
-
1261
- #: app/options-save.php:577
1262
- msgid "Job '%1' changes saved."
1263
- msgstr "Los cambios en la tarea '%1' se han guardado."
1264
-
1265
- #: app/options-save.php:577
1266
- msgid "Jobs overview."
1267
- msgstr "Vista general de las tareas programadas."
1268
-
1269
- #: app/options-settings.php:10
1270
- msgid "BackWPup Settings"
1271
- msgstr "Configuración de BackWPup"
1272
-
1273
- #: app/options-settings.php:29
1274
- msgid "Send Mail"
1275
- msgstr "Enviar email"
1276
-
1277
- #: app/options-settings.php:31
1278
- msgid "Sender Email:"
1279
- msgstr "Dirección del remitente del email:"
1280
-
1281
- #: app/options-settings.php:32
1282
- msgid "Sender Name:"
1283
- msgstr "Nombre del remitente:"
1284
-
1285
- #: app/options-settings.php:33
1286
- msgid "Send mail method:"
1287
- msgstr "Método de envío del email:"
1288
-
1289
- #: app/options-settings.php:36
1290
- msgid "PHP: mail()"
1291
- msgstr "PHP: mail()"
1292
-
1293
- #: app/options-settings.php:37
1294
- msgid "Sendmail"
1295
- msgstr "Sendmail"
1296
-
1297
- #: app/options-settings.php:38
1298
- msgid "SMTP"
1299
- msgstr "SMTP"
1300
-
1301
- #: app/options-settings.php:41
1302
- msgid "Sendmail Path:"
1303
- msgstr "Ruta del sendmail"
1304
-
1305
- #: app/options-settings.php:43
1306
- msgid "SMTP Hostname:"
1307
- msgstr "Servidor SMTP:"
1308
-
1309
- #: app/options-settings.php:44
1310
- msgid "SMTP Secure Connection:"
1311
- msgstr "Conexión segura SMTP:"
1312
-
1313
- #: app/options-settings.php:46
1314
- #: app/php-functions.php:410
1315
- #: app/php-functions.php:427
1316
- msgid "none"
1317
- msgstr "ninguno"
1318
-
1319
- #: app/options-settings.php:50
1320
- msgid "SMTP Username:"
1321
- msgstr "Nombre de usuario SMTP:"
1322
-
1323
- #: app/options-settings.php:51
1324
- msgid "SMTP Password:"
1325
- msgstr "Contraseña SMTP:"
1326
-
1327
- #: app/options-settings.php:57
1328
- #: app/php-functions.php:191
1329
- msgid "Logs"
1330
- msgstr "Registros"
1331
-
1332
- #: app/options-settings.php:59
1333
- msgid "Log file Folder:"
1334
- msgstr "Directorio para los ficheros de registro:"
1335
-
1336
- #: app/options-settings.php:61
1337
- msgid "Max. Log Files in Folder:"
1338
- msgstr "Máximo número de ficheros en el directorio de registro:"
1339
-
1340
- #: app/options-settings.php:63
1341
- msgid "Gzip Log files!"
1342
- msgstr "Comprimir los ficheros de registro con Gzip."
1343
-
1344
- #: app/options-settings.php:64
1345
- msgid "Log deteiled File list."
1346
- msgstr "Lista detallada de los ficheros de registro."
1347
-
1348
- #: app/options-settings.php:69
1349
- msgid "Disable WP-Cron"
1350
- msgstr "Desactivar el cron de WordPress"
1351
-
1352
- #: app/options-settings.php:71
1353
- msgid "Use Cron job of Hoster and disable WP_Cron"
1354
- msgstr "Utilizar el programador de tareas del servidor y desactivar el WP_Cron"
1355
-
1356
- #: app/options-settings.php:72
1357
- msgid "You must set up a cron job that calls:"
1358
- msgstr "Debes establecer una tarea programada que llame a:"
1359
-
1360
- #: app/options-settings.php:74
1361
- msgid "or URL:"
1362
- msgstr "o bien una URL:"
1363
-
1364
- #: app/options-settings.php:79
1365
- msgid "Temp Folder"
1366
- msgstr "Directorio temporal"
1367
-
1368
- #: app/options-tools.php:8
1369
- msgid "BackWPup Tools"
1370
- msgstr "Herramientas de BackWPup"
1371
-
1372
- #: app/options-tools.php:29
1373
- msgid "Database restore"
1374
- msgstr "Restauración de la base de datos"
1375
-
1376
- #: app/options-tools.php:32
1377
- #: app/options-tools.php:50
1378
- msgid "Restore"
1379
- msgstr "Restaurar"
1380
-
1381
- #: app/options-tools.php:47
1382
- msgid "SQL File to restore:"
1383
- msgstr "Fichero SQL para restaurar:"
1384
-
1385
- #: app/options-tools.php:53
1386
- msgid "Copy SQL file to Blog root folder to use restore."
1387
- msgstr "Para llevar a cabo la restauración, copia el fichero SQL al directorio raíz del blog."
1388
-
1389
- #: app/options-tools.php:61
1390
- msgid "Import Jobs settings"
1391
- msgstr "Importar tareas programadas"
1392
-
1393
- #: app/options-tools.php:63
1394
- msgid "Select File to import:"
1395
- msgstr "Selecciona el fichero para importar:"
1396
-
1397
- #: app/options-tools.php:64
1398
- #: app/options-tools.php:66
1399
- msgid "Upload"
1400
- msgstr "Subir"
1401
-
1402
- #: app/options-tools.php:67
1403
- msgid "Select Jobs to Import:"
1404
- msgstr "Selecciona las tareas que se importarán:"
1405
-
1406
- #: app/options-tools.php:71
1407
- msgid "Import Type"
1408
- msgstr "Importar tipo"
1409
-
1410
- #: app/options-tools.php:71
1411
- msgid "No Import"
1412
- msgstr "No importar"
1413
-
1414
- #: app/options-tools.php:73
1415
- msgid "Overwrite"
1416
- msgstr "Sobrescribir"
1417
-
1418
- #: app/options-tools.php:73
1419
- msgid "Append"
1420
- msgstr "Añadir"
1421
-
1422
- #: app/options-tools.php:75
1423
- #: app/options-tools.php:79
1424
- #: app/options-tools.php:81
1425
- msgid "Import"
1426
- msgstr "Importar"
1427
-
1428
- #: app/options-tools.php:117
1429
- msgid "Jobs imported!"
1430
- msgstr "Las tareas han sido importadas"
1431
-
1432
- #: app/php-functions.php:8
1433
- #: app/php-functions.php:82
1434
- #: app/php-functions.php:264
1435
- msgid "BackWPup"
1436
- msgstr "BackWPup"
1437
-
1438
- #: app/php-functions.php:26
1439
- msgid "BackWPup Logs"
1440
- msgstr "Registros de BackWPup"
1441
-
1442
- #: app/php-functions.php:45
1443
- msgid "BackWPup Manage Backups"
1444
- msgstr "Gestionar copias de seguridad de BackWPup"
1445
-
1446
- #: app/php-functions.php:61
1447
- msgid "BackWPup Job Running"
1448
- msgstr "Tarea de BackWPup en ejecución"
1449
-
1450
- #: app/php-functions.php:64
1451
- msgid "Running Job"
1452
- msgstr "Tarea en ejecución"
1453
-
1454
- #: app/php-functions.php:72
1455
- msgid "BackWPup View Logs"
1456
- msgstr "Ver registros de BackWPup"
1457
-
1458
- #: app/php-functions.php:75
1459
- #: app/php-functions.php:390
1460
- msgid "View Log"
1461
- msgstr "Ver registro"
1462
-
1463
- #: app/php-functions.php:82
1464
- msgid "Add New"
1465
- msgstr "Añadir nuevo"
1466
-
1467
- #: app/php-functions.php:105
1468
- #: app/php-functions.php:256
1469
- msgid "Support"
1470
- msgstr "Suporte"
1471
-
1472
- #: app/php-functions.php:106
1473
- #: app/php-functions.php:255
1474
- msgid "FAQ"
1475
- msgstr "Preguntas más frecuentes (FAQ)"
1476
-
1477
- #: app/php-functions.php:107
1478
- msgid "Plugin Homepage"
1479
- msgstr "Página del plugin"
1480
-
1481
- #: app/php-functions.php:108
1482
- msgid "Plugin Home on WordPress.org"
1483
- msgstr "Página del plugin en WordPress.org"
1484
-
1485
- #: app/php-functions.php:109
1486
- #: app/php-functions.php:257
1487
- msgid "Donate"
1488
- msgstr "Hacer una donación"
1489
-
1490
- #: app/php-functions.php:116
1491
- msgid "Version:"
1492
- msgstr "Versión:"
1493
-
1494
- #: app/php-functions.php:117
1495
- msgid "Author:"
1496
- msgstr "Autor"
1497
-
1498
- #: app/php-functions.php:190
1499
- msgid "Jobs"
1500
- msgstr "Tareas"
1501
-
1502
- #: app/php-functions.php:192
1503
- msgid "Backups"
1504
- msgstr "Copias de seguridad"
1505
-
1506
- #: app/php-functions.php:193
1507
- msgid "Tools"
1508
- msgstr "Herramientas"
1509
-
1510
- #: app/php-functions.php:194
1511
- #: app/php-functions.php:245
1512
- msgid "Settings"
1513
- msgstr "Configuración"
1514
-
1515
- #: app/php-functions.php:245
1516
- msgid "Go to Settings Page"
1517
- msgstr "Ir a la página de configuración"
1518
-
1519
- #: app/php-functions.php:310
1520
- msgid "WP XML Export"
1521
- msgstr "Generar un fichero WP XML de exportación"
1522
-
1523
- #: app/php-functions.php:313
1524
- msgid "Database Backup"
1525
- msgstr "Hacer una copia de seguridad de la base de datos"
1526
-
1527
- #: app/php-functions.php:319
1528
- msgid "Optimize Database Tables"
1529
- msgstr "Optimizar las tablas de la base de datos"
1530
-
1531
- #: app/php-functions.php:322
1532
- msgid "Check Database Tables"
1533
- msgstr "Verificar las tablas de la base de datos"
1534
-
1535
- #: app/php-functions.php:374
1536
- msgid "Logs:"
1537
- msgstr "Registros:"
1538
-
1539
- #: app/php-functions.php:413
1540
- msgid "Scheduled Jobs:"
1541
- msgstr "Tareas programadas:"
1542
-
1543
- #: app/php-functions.php:416
1544
- msgid "Edit Job"
1545
- msgstr "Editar tarea"
1546
-
1547
- #: app/php-functions.php:706
1548
- msgid "- WordPress 2.8 or heiger needed!"
1549
- msgstr "- Se necesita WordPress 2.8 o superior."
1550
-
1551
- #: app/php-functions.php:710
1552
- msgid "- PHP 5.2.0 or higher needed!"
1553
- msgstr "- Se necesita PHP 5.2.0 o superior."
1554
-
1555
- #: app/php-functions.php:714
1556
- msgid "- Logs Folder not exists (Try too create it on first Job run):"
1557
- msgstr "- El directorio de registro no existe (el plugin intentará crearlo la primera vez que se ejecute la tarea programada):"
1558
-
1559
- #: app/php-functions.php:717
1560
- msgid "- Logs Folder not writeable:"
1561
- msgstr "- El servidor no puede escribir en el directorio donde se guardan los registros:"
1562
-
1563
- #: app/php-functions.php:720
1564
- msgid "- Temp Folder not exists (Try too create it on first Job run):"
1565
- msgstr "- El directorio temporal no existe (el plugin intentará crearlo la primera vez que se ejecute la tarea programada):"
1566
-
1567
- #: app/php-functions.php:723
1568
- msgid "- Temp Folder not writeable:"
1569
- msgstr "- El servidor no puede escribir en el directorio temporal:"
1570
-
1571
- #: app/php-functions.php:728
1572
- msgid "- Please Check Scheduling time for Job:"
1573
- msgstr "- Por favor, verifica la programación de la tarea:"
1574
-
1575
- #: app/php-functions.php:731
1576
- msgid "- WP-Cron don't working please check it!"
1577
- msgstr "- El WP-Cron no funciona; por favor, compruébalo."
1578
-
1579
- #: app/php5-functions.php:22
1580
- msgid "New"
1581
- msgstr "Nuevo"
1582
-
1583
- #: app/php5-functions.php:500
1584
- msgid "Missing Access Key ID!"
1585
- msgstr "Falta la ID de la clave de acceso."
1586
-
1587
- #: app/php5-functions.php:507
1588
- msgid "Missing Secret Access Key!"
1589
- msgstr "Falta la clave secreta de acceso."
1590
-
1591
- #: app/php5-functions.php:524
1592
- msgid "No Buckets found!"
1593
- msgstr "No se ha encontrado ningún bucket."
1594
-
1595
- #: app/php5-functions.php:556
1596
- msgid "Missing Username!"
1597
- msgstr "Falta el nombre de usuario."
1598
-
1599
- #: app/php5-functions.php:563
1600
- msgid "Missing API Key!"
1601
- msgstr "Falta la clave API."
1602
-
1603
- #: app/php5-functions.php:584
1604
- msgid "No Containerss found!"
1605
- msgstr "No se ha encontrado ningún contenedor."
1606
-
1607
- #: app/php5-functions.php:618
1608
- msgid "Missing Hostname!"
1609
- msgstr "Falta el nombre del servidor."
1610
-
1611
- #: app/php5-functions.php:625
1612
- msgid "Missing Account Name!"
1613
- msgstr "Falta el nombre de usuario."
1614
-
1615
- #: app/php5-functions.php:632
1616
- msgid "Missing Access Key!"
1617
- msgstr "Falta la clave de acceso."
1618
-
1619
- #: app/php5-functions.php:649
1620
- msgid "No Container found!"
1621
- msgstr "No se ha encontrado el contenedor."
1622
-
1623
- #: app/compatibility/class-wp-list-table.php:181
1624
- msgid "No items found."
1625
- msgstr "No se ha encontrado ningún elemento."
1626
-
1627
- #: app/compatibility/class-wp-list-table.php:284
1628
- msgid "Bulk Actions"
1629
- msgstr "Acciones en masa"
1630
-
1631
- #: app/compatibility/class-wp-list-table.php:289
1632
- msgid "Apply"
1633
- msgstr "Aplicar"
1634
-
1635
- #: app/compatibility/class-wp-list-table.php:363
1636
- msgid "Show all dates"
1637
- msgstr "Mostrar todas las fechas"
1638
-
1639
- #: app/compatibility/class-wp-list-table.php:391
1640
- msgid "List View"
1641
- msgstr "Vista de lista"
1642
-
1643
- #: app/compatibility/class-wp-list-table.php:392
1644
- msgid "Excerpt View"
1645
- msgstr "Vista de resumen"
1646
-
1647
- #: app/compatibility/class-wp-list-table.php:418
1648
- #, php-format
1649
- msgid "%s pending"
1650
- msgstr "%s pendiente"
1651
-
1652
- #: app/compatibility/class-wp-list-table.php:474
1653
- #: app/compatibility/class-wp-list-table.php:870
1654
- #, php-format
1655
- msgid "1 item"
1656
- msgid_plural "%s items"
1657
- msgstr[0] "1 elemento"
1658
- msgstr[1] "%s elementos"
1659
-
1660
- #: app/compatibility/class-wp-list-table.php:515
1661
- #, php-format
1662
- msgid "%1$s of %2$s"
1663
- msgstr "%1$s de %2$s"
1664
-
1665
- #: app/tools/db_restore.php:34
1666
- #: app/tools/db_restore.php:53
1667
- #: app/tools/db_restore.php:68
1668
- #: app/tools/db_restore.php:79
1669
- #: app/tools/db_restore.php:82
1670
- #: app/tools/db_restore.php:85
1671
- #: app/tools/db_restore.php:90
1672
- msgid "ERROR:"
1673
- msgstr "ERROR:"
1674
-
1675
- #: app/tools/db_restore.php:34
1676
- #, php-format
1677
- msgid "Pleace set <i>$table_prefix = '%1$s';</i> in wp-config.php"
1678
- msgstr "Por favor, establece la variable <i>$table_prefix = '%1$s';</i> en wp-config.php"
1679
-
1680
- #: app/tools/db_restore.php:53
1681
- #, php-format
1682
- msgid "Pleace set <i>define('DB_iso-8859-1', '%1$s');</i> in wp-config.php"
1683
- msgstr "Por favor, establece la variable <i>define('DB_iso-8859-1', '%1$s');</i> en wp-config.php"
1684
-
1685
- #: app/tools/db_restore.php:74
1686
- #, php-format
1687
- msgid "%1$s Database Querys done."
1688
- msgstr "Se han realizado %1$s consultas a la base de datos."
1689
-
1690
- #: app/tools/db_restore.php:75
1691
- msgid "Make changes for Blogurl and ABSPATH if needed."
1692
- msgstr "Realiza los cambios en Blogurl y ABSPATH si son necesarios."
1693
-
1694
- #: app/tools/db_restore.php:92
1695
- msgid "Restore Done. Please delete the SQL file after Restore."
1696
- msgstr "Restauración realizada. Por favor, borra el fichero SQL después de restaurar."
1697
-
1698
- #~ msgid "Connect to DropBox ..."
1699
- #~ msgstr "Conectar a DropBox..."
1
+ # Copyright (C) 2010 BackWPup
2
+ # This file is distributed under the same license as the BackWPup package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: BackWPup 1.5.0 en español\n"
6
+ "Report-Msgid-Bugs-To: \n"
7
+ "POT-Creation-Date: 2011-03-07 09:19+0100\n"
8
+ "PO-Revision-Date: 2011-03-07 09:20+0100\n"
9
+ "Last-Translator: Eduardo Larequi <elarequi@educacion.navarra.es>\n"
10
+ "Language-Team: Eduardo Larequi <elarequi@gmail.com>\n"
11
+ "MIME-Version: 1.0\n"
12
+ "Content-Type: text/plain; charset=UTF-8\n"
13
+ "Content-Transfer-Encoding: 8bit\n"
14
+ "X-Poedit-Language: Spanish\n"
15
+ "X-Poedit-Country: Spain\n"
16
+ "X-Poedit-Basepath: ..\n"
17
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_c;_x;esc_html__\n"
18
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+
21
+ #: app/backwpup_dojob.php:64
22
+ #, php-format
23
+ msgid "BackWPup Log for %1$s from %2$s at %3$s"
24
+ msgstr "Registro de BackWPup para %1$s, de %2$s, a las %3$s"
25
+
26
+ #: app/backwpup_dojob.php:74
27
+ msgid "Working Job will closed!!! And a new started!!!"
28
+ msgstr "La tarea en ejecución se terminará y comenzará una nueva."
29
+
30
+ #: app/backwpup_dojob.php:77
31
+ #: app/backwpup_dojob.php:241
32
+ #: app/options-save.php:63
33
+ msgid "[ERROR]"
34
+ msgstr "[ERROR]"
35
+
36
+ #: app/backwpup_dojob.php:77
37
+ msgid "Backup Aborted working to long!!!"
38
+ msgstr "La copia de seguridad ha sido abortada. Tiempo de ejecución demasiado largo."
39
+
40
+ #: app/backwpup_dojob.php:94
41
+ #, php-format
42
+ msgid "Job %1$s already running!!!"
43
+ msgstr "La tarea %1$s ya se está ejecutando."
44
+
45
+ #: app/backwpup_dojob.php:131
46
+ #, php-format
47
+ msgid "PHP Safe Mode is on!!! Max exec time is %1$d sec."
48
+ msgstr "EL modo seguro (Safe Mode) de PHP está activado. El tiempo máximo de ejecución es de %1$d seg."
49
+
50
+ #: app/backwpup_dojob.php:135
51
+ #, php-format
52
+ msgid "Memory limit set to %1$s ,because can not use PHP: memory_get_usage() function to dynamically increase the Memory!"
53
+ msgstr "El límite de memoria se ha establecido en %1$s, porque no se puede tuilizar la función memory_get_usage() de PHP para incrementar dinámicamente la memoria."
54
+
55
+ #: app/backwpup_dojob.php:203
56
+ msgid "old Log files deleted!!!"
57
+ msgstr "los ficheros antiguos del registro han sido borrados."
58
+
59
+ #: app/backwpup_dojob.php:208
60
+ #, php-format
61
+ msgid "Backup Archive File size is %1s"
62
+ msgstr "El fichero de copia de seguridad tiene un tamaño de %1s"
63
+
64
+ #: app/backwpup_dojob.php:210
65
+ #, php-format
66
+ msgid "Job done in %1s sec."
67
+ msgstr "Tarea realizada en %1s seg."
68
+
69
+ #: app/backwpup_dojob.php:235
70
+ msgid "[WARNING]"
71
+ msgstr "[ADVERTENCIA]"
72
+
73
+ #: app/backwpup_dojob.php:245
74
+ msgid "[DEPRECATED]"
75
+ msgstr "[OBSOLETO]"
76
+
77
+ #: app/backwpup_dojob.php:248
78
+ msgid "[STRICT NOTICE]"
79
+ msgstr "[AVISO DE SUMA IMPORTANCIA]"
80
+
81
+ #: app/backwpup_dojob.php:251
82
+ msgid "[RECOVERABLE ERROR]"
83
+ msgstr "[ERROR RECUPERABLE]"
84
+
85
+ #: app/backwpup_dojob.php:307
86
+ #, php-format
87
+ msgid "Can not create Folder: %1$s"
88
+ msgstr "No se ha podido crear el directorio: %1$s"
89
+
90
+ #: app/backwpup_dojob.php:312
91
+ #, php-format
92
+ msgid "Can not write to Folder: %1$s"
93
+ msgstr "No se puede escribir en el directorio: %1$s"
94
+
95
+ #: app/backwpup_dojob.php:346
96
+ #, php-format
97
+ msgid "PHP Safe Mode is on!!! Can not increase Memory Limit is %1$s"
98
+ msgstr "El modo seguro (Safe Mode) de PHP está activado. No se puede incrementar el límite de memoria, de %1$s"
99
+
100
+ #: app/backwpup_dojob.php:373
101
+ #, php-format
102
+ msgid "Memory increased from %1$s to %2$s"
103
+ msgstr "Memoria incrementada de %1$s a %2$s"
104
+
105
+ #: app/backwpup_dojob.php:375
106
+ #, php-format
107
+ msgid "Can not increase Memory Limit is %1$s"
108
+ msgstr "No se ha podido incrementar el límite de memoria, de %1$s"
109
+
110
+ #: app/backwpup_dojob.php:385
111
+ msgid "Set Blog to Maintenance Mode"
112
+ msgstr "MIentras se realiza la copia de seguridad de la base de datos, el blog se ha puesto en modo de mantenimiento"
113
+
114
+ #: app/backwpup_dojob.php:401
115
+ msgid "Set Blog to normal Mode"
116
+ msgstr "Finalizada la copia de seguridad de la base de datos, el blog ha vuelto al modo normal"
117
+
118
+ #: app/backwpup_dojob.php:417
119
+ msgid "Run Database check..."
120
+ msgstr "Ejecutar comprobación de la base de datos..."
121
+
122
+ #: app/backwpup_dojob.php:432
123
+ #: app/backwpup_dojob.php:434
124
+ #: app/backwpup_dojob.php:436
125
+ #, php-format
126
+ msgid "Result of table check for %1$s is: %2$s"
127
+ msgstr "El resultado de la verificación de la tabla %1$s es: %2$s"
128
+
129
+ #: app/backwpup_dojob.php:439
130
+ #: app/backwpup_dojob.php:451
131
+ #: app/backwpup_dojob.php:475
132
+ #: app/backwpup_dojob.php:485
133
+ #: app/backwpup_dojob.php:530
134
+ #: app/backwpup_dojob.php:542
135
+ #: app/backwpup_dojob.php:669
136
+ #, php-format
137
+ msgid "BackWPup database error %1$s for query %2$s"
138
+ msgstr "Error %1$s de la base de datos para la consulta %2$s"
139
+
140
+ #: app/backwpup_dojob.php:444
141
+ #: app/backwpup_dojob.php:446
142
+ #: app/backwpup_dojob.php:448
143
+ #, php-format
144
+ msgid "Result of table repair for %1$s is: %2$s"
145
+ msgstr "El resultado de la reparación de la tabla %1$s es: %2$s"
146
+
147
+ #: app/backwpup_dojob.php:456
148
+ msgid "Database check done!"
149
+ msgstr "Verificación de la base de datos realizada."
150
+
151
+ #: app/backwpup_dojob.php:458
152
+ msgid "No Tables to check"
153
+ msgstr "No hay tablas que verificar"
154
+
155
+ #: app/backwpup_dojob.php:523
156
+ msgid "Run Database Dump to file..."
157
+ msgstr "Ejecutar el volcado de la base de datos al fichero..."
158
+
159
+ #: app/backwpup_dojob.php:575
160
+ msgid "Dump Database table: "
161
+ msgstr "Volcar la tabla de la base de datos:"
162
+
163
+ #: app/backwpup_dojob.php:590
164
+ msgid "Database Dump done!"
165
+ msgstr "Volcado de la base de datos realizado."
166
+
167
+ #: app/backwpup_dojob.php:592
168
+ msgid "Can not create Database Dump file"
169
+ msgstr "No se puede crear un fichero de volcado de la base de datos"
170
+
171
+ #: app/backwpup_dojob.php:595
172
+ msgid "No Tables to Dump"
173
+ msgstr "No hay tablas para realizar un volcado"
174
+
175
+ #: app/backwpup_dojob.php:601
176
+ msgid "Add Database Dump to Backup:"
177
+ msgstr "Añadir volcado de la base de datos a la copia de seguridad:"
178
+
179
+ #: app/backwpup_dojob.php:611
180
+ #: app/backwpup_dojob.php:628
181
+ msgid "Run Wordpress Export to XML file..."
182
+ msgstr "Ejecutar la exportación de WordPress a un fichero XML..."
183
+
184
+ #: app/backwpup_dojob.php:620
185
+ msgid "cURL:"
186
+ msgstr "cURL:"
187
+
188
+ #: app/backwpup_dojob.php:630
189
+ msgid "Export to XML done!"
190
+ msgstr "Exportación a XML realizada."
191
+
192
+ #: app/backwpup_dojob.php:632
193
+ msgid "Can not Export to XML!"
194
+ msgstr "No se puede exportar a XML."
195
+
196
+ #: app/backwpup_dojob.php:635
197
+ msgid "Can not Export to XML! no cURL or allow_url_fopen Support!"
198
+ msgstr "No se puede exportar a XML: las funciones cURL o allow_url_fopen no se pueden utilizar."
199
+
200
+ #: app/backwpup_dojob.php:639
201
+ msgid "Add XML Export to Backup:"
202
+ msgstr "Añadir fichero XML de exportación a la copia de seguridad:"
203
+
204
+ #: app/backwpup_dojob.php:648
205
+ msgid "Run Database optimize..."
206
+ msgstr "Ejecutar optimización de la base de datos..."
207
+
208
+ #: app/backwpup_dojob.php:662
209
+ #: app/backwpup_dojob.php:664
210
+ #: app/backwpup_dojob.php:666
211
+ #, php-format
212
+ msgid "Result of table optimize for %1$s is: %2$s"
213
+ msgstr "El resultado de la optimización de la tabla %1$s es: %2$s"
214
+
215
+ #: app/backwpup_dojob.php:672
216
+ msgid "Database optimize done!"
217
+ msgstr "Optimización de la base de datos realizada."
218
+
219
+ #: app/backwpup_dojob.php:675
220
+ msgid "No Tables to optimize"
221
+ msgstr "No hay tablas que optimizar"
222
+
223
+ #: app/backwpup_dojob.php:693
224
+ msgid "File or Folder is not readable:"
225
+ msgstr "El fichero o el directorio no se puede leer:"
226
+
227
+ #: app/backwpup_dojob.php:695
228
+ msgid "Link not followed:"
229
+ msgstr "No se ha seguido el enlace:"
230
+
231
+ #: app/backwpup_dojob.php:703
232
+ msgid "Is not a file or directory:"
233
+ msgstr "No es un fichero o un directorio:"
234
+
235
+ #: app/backwpup_dojob.php:713
236
+ msgid "Make a list of files to Backup ...."
237
+ msgstr "Hacer una lista de ficheros para la copia de seguridad..."
238
+
239
+ #: app/backwpup_dojob.php:762
240
+ msgid "No files to Backup"
241
+ msgstr "No hay ficheros para la copia de seguridadd"
242
+
243
+ #: app/backwpup_dojob.php:764
244
+ msgid "Files to Backup:"
245
+ msgstr "Ficheros para la copia de seguridad:"
246
+
247
+ #: app/backwpup_dojob.php:765
248
+ msgid "Size of all Files:"
249
+ msgstr "Tamaño de todos los ficheros:"
250
+
251
+ #: app/backwpup_dojob.php:773
252
+ msgid "Create Backup Zip file..."
253
+ msgstr "Crear fichero ZIP con la copia de seguridad:"
254
+
255
+ #: app/backwpup_dojob.php:781
256
+ #: app/backwpup_dojob.php:805
257
+ msgid "Add File to ZIP file:"
258
+ msgstr "Añadir fichero al fichero ZIP:"
259
+
260
+ #: app/backwpup_dojob.php:785
261
+ msgid "Can not add File to ZIP file:"
262
+ msgstr "No se puede añadir un fichero al fichero ZIP:"
263
+
264
+ #: app/backwpup_dojob.php:789
265
+ #: app/backwpup_dojob.php:812
266
+ msgid "Backup Zip file create done!"
267
+ msgstr "Fichero ZIP de copia de seguridad creado."
268
+
269
+ #: app/backwpup_dojob.php:791
270
+ msgid "Can not create Backup ZIP file:"
271
+ msgstr "No se puede crear el fichero ZIP de copia de seguridad:"
272
+
273
+ #: app/backwpup_dojob.php:802
274
+ msgid "Create Backup Zip (PclZip) file..."
275
+ msgstr "Crear fichero ZIP (PclZip) de copia de seguridad..."
276
+
277
+ #: app/backwpup_dojob.php:810
278
+ msgid "Zip file create:"
279
+ msgstr "Crear fichero ZIP:"
280
+
281
+ #: app/backwpup_dojob.php:829
282
+ msgid "Can not create TAR Backup file"
283
+ msgstr "No se ha podido crear el fichero TAR de copia de seguridad"
284
+
285
+ #: app/backwpup_dojob.php:832
286
+ msgid "Create Backup Archive file..."
287
+ msgstr "Crear fichero de copia de seguridad..."
288
+
289
+ #: app/backwpup_dojob.php:839
290
+ msgid "Add File to Backup Archive:"
291
+ msgstr "Añadir fichero al fichero de copia de seguridad:"
292
+
293
+ #: app/backwpup_dojob.php:915
294
+ msgid "Backup Archive file create done!"
295
+ msgstr "Fichero de copia de seguridad creado."
296
+
297
+ #: app/backwpup_dojob.php:933
298
+ msgid "Connected by SSL-FTP to Server:"
299
+ msgstr "Conectado por SSL-FTP al servidor:"
300
+
301
+ #: app/backwpup_dojob.php:935
302
+ msgid "Can not connect by SSL-FTP to Server:"
303
+ msgstr "No se puede conectar por SSL-FTP al servidor:"
304
+
305
+ #: app/backwpup_dojob.php:939
306
+ msgid "PHP Function to connect with SSL-FTP to Server not exists!"
307
+ msgstr "La función de PHP para conectarse con el servidor por SSL-FTP no existe."
308
+
309
+ #: app/backwpup_dojob.php:945
310
+ msgid "Connected to FTP Server:"
311
+ msgstr "Conectado al servidor FTP:"
312
+
313
+ #: app/backwpup_dojob.php:947
314
+ msgid "Can not connect to FTP Server:"
315
+ msgstr "No se puede conectar por FTP al servidor:"
316
+
317
+ #: app/backwpup_dojob.php:954
318
+ #: app/backwpup_dojob.php:961
319
+ #: app/backwpup_dojob.php:973
320
+ #: app/backwpup_dojob.php:986
321
+ msgid "FTP Client command:"
322
+ msgstr "Comando del cliente FTP:"
323
+
324
+ #: app/backwpup_dojob.php:956
325
+ #: app/backwpup_dojob.php:959
326
+ #: app/backwpup_dojob.php:963
327
+ #: app/backwpup_dojob.php:976
328
+ #: app/backwpup_dojob.php:978
329
+ #: app/backwpup_dojob.php:981
330
+ #: app/backwpup_dojob.php:983
331
+ #: app/backwpup_dojob.php:989
332
+ #: app/backwpup_dojob.php:991
333
+ msgid "FTP Server reply:"
334
+ msgstr "Respuesta del servidor FTP:"
335
+
336
+ #: app/backwpup_dojob.php:976
337
+ msgid "Entering Passive Mode"
338
+ msgstr "Entrando en modo pasivo"
339
+
340
+ #: app/backwpup_dojob.php:978
341
+ msgid "Can not Entering Passive Mode"
342
+ msgstr "No se puede entrar en modo pasivo"
343
+
344
+ #: app/backwpup_dojob.php:981
345
+ msgid "Entering Normal Mode"
346
+ msgstr "Entrando en modo normal"
347
+
348
+ #: app/backwpup_dojob.php:983
349
+ msgid "Can not Entering Normal Mode"
350
+ msgstr "No se puede entrar en modo normal"
351
+
352
+ #: app/backwpup_dojob.php:991
353
+ msgid "Error getting SYSTYPE"
354
+ msgstr "Error al obtener SYSTYPE"
355
+
356
+ #: app/backwpup_dojob.php:999
357
+ msgid "FTP Folder on Server not exists!"
358
+ msgstr "El directorio FTP en el servidor no existe."
359
+
360
+ #: app/backwpup_dojob.php:1001
361
+ msgid "FTP Folder created!"
362
+ msgstr "Directorio FTP creado."
363
+
364
+ #: app/backwpup_dojob.php:1004
365
+ msgid "FTP Folder on Server can not created!"
366
+ msgstr "No se ha podido crear el directorio en el servidor FTP."
367
+
368
+ #: app/backwpup_dojob.php:1010
369
+ msgid "Backup File transferred to FTP Server:"
370
+ msgstr "Fichero de copia de seguridad transferido al servidor FTP:"
371
+
372
+ #: app/backwpup_dojob.php:1013
373
+ msgid "Can not transfer backup to FTP server."
374
+ msgstr "No se ha podido transferir el fichero de copia de seguridad al servidor FTP."
375
+
376
+ #: app/backwpup_dojob.php:1029
377
+ msgid "Can not delete file on FTP Server:"
378
+ msgstr "No se ha podido borrar el fichero en el servidor FTP:"
379
+
380
+ #: app/backwpup_dojob.php:1032
381
+ msgid "files deleted on FTP Server:"
382
+ msgstr "ficheros borrados en el servidor FTP:"
383
+
384
+ #: app/backwpup_dojob.php:1044
385
+ msgid "Prepare Sending backup file with mail..."
386
+ msgstr "Preparando en envío de fichero de copia de seguridad por email..."
387
+
388
+ #: app/backwpup_dojob.php:1064
389
+ msgid "Send mail with SMTP"
390
+ msgstr "Enviar email con SMTP"
391
+
392
+ #: app/backwpup_dojob.php:1068
393
+ msgid "Send mail with Sendmail"
394
+ msgstr "Enviar email con Sendmail"
395
+
396
+ #: app/backwpup_dojob.php:1071
397
+ msgid "Send mail with PHP mail"
398
+ msgstr "Enviar email con PHP mail"
399
+
400
+ #: app/backwpup_dojob.php:1075
401
+ msgid "Creating mail"
402
+ msgstr "Creando email"
403
+
404
+ #: app/backwpup_dojob.php:1079
405
+ msgid "BackWPup File from"
406
+ msgstr "Fichero BackWPup de"
407
+
408
+ #: app/backwpup_dojob.php:1087
409
+ msgid "Backup Archive too big for sending by mail"
410
+ msgstr "Fichero de copia de seguridad demasiado grande para enviar por email"
411
+
412
+ #: app/backwpup_dojob.php:1092
413
+ msgid "Adding Attachment to mail"
414
+ msgstr "Añadiendo un fichero adjunto al email"
415
+
416
+ #: app/backwpup_dojob.php:1096
417
+ msgid "Send mail...."
418
+ msgstr "Enviar email..."
419
+
420
+ #: app/backwpup_dojob.php:1098
421
+ msgid "Can not send mail:"
422
+ msgstr "No se puede enviar el email:"
423
+
424
+ #: app/backwpup_dojob.php:1100
425
+ msgid "Mail send!!!"
426
+ msgstr "Email enviado."
427
+
428
+ #: app/backwpup_dojob.php:1118
429
+ msgid "Connected to S3 Bucket:"
430
+ msgstr "Conectado al S3 Bucket:"
431
+
432
+ #: app/backwpup_dojob.php:1127
433
+ msgid "Backup File transferred to S3://"
434
+ msgstr "Fichero de copia de seguridad transferido a S3://"
435
+
436
+ #: app/backwpup_dojob.php:1130
437
+ msgid "Can not transfer backup to S3."
438
+ msgstr "No se puede transferir la copia de seguridad a S3."
439
+
440
+ #: app/backwpup_dojob.php:1149
441
+ msgid "Can not delete file on S3://"
442
+ msgstr "No se puede borrar el fichero en S3://"
443
+
444
+ #: app/backwpup_dojob.php:1152
445
+ msgid "files deleted on S3 Bucket!"
446
+ msgstr "ficheros borrados en S3 Bucket."
447
+
448
+ #: app/backwpup_dojob.php:1159
449
+ msgid "S3 Bucket not exists:"
450
+ msgstr "S3 Bucket no existe."
451
+
452
+ #: app/backwpup_dojob.php:1162
453
+ msgid "Amazon S3 API:"
454
+ msgstr "API de Amazon S3:"
455
+
456
+ #: app/backwpup_dojob.php:1173
457
+ msgid "Can not load curl extension is needed for Rackspase Cloud!"
458
+ msgstr "No se puede cargar la extensión curl, necesaria para Rackspace Cloud."
459
+
460
+ #: app/backwpup_dojob.php:1185
461
+ msgid "Connected to Rackspase ..."
462
+ msgstr "Conectado a Rackspace..."
463
+
464
+ #: app/backwpup_dojob.php:1201
465
+ #: app/backwpup_dojob.php:1251
466
+ msgid "Rackspase Cloud API:"
467
+ msgstr "API de Rackspace Cloud:"
468
+
469
+ #: app/backwpup_dojob.php:1207
470
+ msgid "Rackspase Cloud Container not exists:"
471
+ msgstr "Rackspace Cloud Container no existe:"
472
+
473
+ #: app/backwpup_dojob.php:1219
474
+ msgid "Backup File transferred to RSC://"
475
+ msgstr "Fichero de copia de seguridad transferido a RSC://"
476
+
477
+ #: app/backwpup_dojob.php:1222
478
+ msgid "Can not transfer backup to RSC."
479
+ msgstr "No se puede transferir la copia de seguridad a RSC."
480
+
481
+ #: app/backwpup_dojob.php:1244
482
+ msgid "Can not delete file on RSC://"
483
+ msgstr "No se puede borrar el fichero en RSC://"
484
+
485
+ #: app/backwpup_dojob.php:1247
486
+ msgid "files deleted on Racspase Cloud Container!"
487
+ msgstr "ficheros borrados en Rackspace Cloud Container."
488
+
489
+ #: app/backwpup_dojob.php:1261
490
+ msgid "Can not load curl extension is needed for Microsoft Azure!"
491
+ msgstr "No se puede cargar la extensión curl, necesaria para Microsoft Azure."
492
+
493
+ #: app/backwpup_dojob.php:1274
494
+ msgid "Microsoft Azure Container not exists:"
495
+ msgstr "Microsoft Azure Container no existe:"
496
+
497
+ #: app/backwpup_dojob.php:1277
498
+ msgid "Connected to Microsoft Azure Container:"
499
+ msgstr "Conectado a Microsoft Azure Container:"
500
+
501
+ #: app/backwpup_dojob.php:1287
502
+ msgid "Backup File transferred to azure://"
503
+ msgstr "Fichero de copia de seguridad transferido a azure://"
504
+
505
+ #: app/backwpup_dojob.php:1290
506
+ msgid "Can not transfer backup to Microsoft Azure."
507
+ msgstr "No se puede transferir la copia de seguridad a Microsoft Azure."
508
+
509
+ #: app/backwpup_dojob.php:1311
510
+ msgid "files deleted on Microsoft Azure Container!"
511
+ msgstr "ficheros borrados en Microsoft Azure Container."
512
+
513
+ #: app/backwpup_dojob.php:1316
514
+ msgid "Microsoft Azure API:"
515
+ msgstr "API de Microsoft Azure:"
516
+
517
+ #: app/backwpup_dojob.php:1342
518
+ msgid "old backup files deleted!!!"
519
+ msgstr "los ficheros de copia de seguridad antiguos han sido borrados."
520
+
521
+ #: app/backwpup_dojob.php:1352
522
+ msgid "Can not load curl extension is needed for Dropbox!"
523
+ msgstr "No se puede cargar la extensión curl, necesaria para DropBox."
524
+
525
+ #: app/backwpup_dojob.php:1366
526
+ msgid "Authed to DropBox API from "
527
+ msgstr "Autentificado con el API de DropBox desde"
528
+
529
+ #: app/backwpup_dojob.php:1368
530
+ msgid "Can not Auth with DropBox API:"
531
+ msgstr "No se puede autentificar con el API de DropBox:"
532
+
533
+ #: app/backwpup_dojob.php:1376
534
+ msgid "Backup File transferred to DropBox."
535
+ msgstr "Fichero de copia de seguridad transferido a DropBox."
536
+
537
+ #: app/backwpup_dojob.php:1378
538
+ msgid "Can not transfere Backup file to DropBox:"
539
+ msgstr "No se puede transferir la copia de seguridad a DropBox:"
540
+
541
+ #: app/backwpup_dojob.php:1399
542
+ msgid "files deleted on DropBox Folder!"
543
+ msgstr "ficheros borrados en el directorio de DropBox."
544
+
545
+ #: app/backwpup_dojob.php:1403
546
+ msgid "DropBox API:"
547
+ msgstr "API de DropBox:"
548
+
549
+ #: app/backwpup_dojob.php:1505
550
+ msgid "Jobname:"
551
+ msgstr "Nombre de la tarea:"
552
+
553
+ #: app/backwpup_dojob.php:1506
554
+ msgid "Jobtype:"
555
+ msgstr "Tipo de la tarea:"
556
+
557
+ #: app/backwpup_dojob.php:1508
558
+ msgid "Errors:"
559
+ msgstr "Errores:"
560
+
561
+ #: app/backwpup_dojob.php:1510
562
+ msgid "Warnings:"
563
+ msgstr "Avisos:"
564
+
565
+ #: app/backwpup_dojob.php:1515
566
+ msgid "BackWPup Log from"
567
+ msgstr "Registro de BackWPup de"
568
+
569
+ #: app/list-tables.php:22
570
+ #: app/list-tables.php:198
571
+ #: app/list-tables.php:375
572
+ msgid "No rights"
573
+ msgstr "No tienes permisos"
574
+
575
+ #: app/list-tables.php:41
576
+ msgid "No Jobs."
577
+ msgstr "No hay tareas."
578
+
579
+ #: app/list-tables.php:46
580
+ #: app/list-tables.php:107
581
+ msgid "Export"
582
+ msgstr "Exportar"
583
+
584
+ #: app/list-tables.php:47
585
+ #: app/list-tables.php:108
586
+ #: app/list-tables.php:254
587
+ #: app/list-tables.php:317
588
+ #: app/list-tables.php:417
589
+ #: app/list-tables.php:483
590
+ #: app/options-edit-job.php:45
591
+ msgid "Delete"
592
+ msgstr "Borrar"
593
+
594
+ #: app/list-tables.php:55
595
+ msgid "ID"
596
+ msgstr "ID"
597
+
598
+ #: app/list-tables.php:56
599
+ msgid "Job Name"
600
+ msgstr "Nombre de la tarea"
601
+
602
+ #: app/list-tables.php:57
603
+ #: app/list-tables.php:263
604
+ msgid "Type"
605
+ msgstr "Tipo"
606
+
607
+ #: app/list-tables.php:58
608
+ msgid "Information"
609
+ msgstr "Información"
610
+
611
+ #: app/list-tables.php:59
612
+ msgid "Next Run"
613
+ msgstr "Próxima ejecución"
614
+
615
+ #: app/list-tables.php:60
616
+ msgid "Last Run"
617
+ msgstr "Última ejecución"
618
+
619
+ #: app/list-tables.php:102
620
+ msgid "Edit:"
621
+ msgstr "Editar:"
622
+
623
+ #: app/list-tables.php:105
624
+ msgid "Edit"
625
+ msgstr "Editar"
626
+
627
+ #: app/list-tables.php:106
628
+ msgid "Copy"
629
+ msgstr "Copiar"
630
+
631
+ #: app/list-tables.php:108
632
+ #: app/options-edit-job.php:45
633
+ msgid ""
634
+ "You are about to delete this Job. \n"
635
+ " 'Cancel' to stop, 'OK' to delete."
636
+ msgstr ""
637
+ "Estás a punto de borrar esta tarea.\n"
638
+ " 'Cancelar' para parar, 'OK' para borrar."
639
+
640
+ #: app/list-tables.php:109
641
+ msgid "Run Now"
642
+ msgstr "Ejecutar ahora"
643
+
644
+ #: app/list-tables.php:111
645
+ msgid "Clear"
646
+ msgstr "Limpiar"
647
+
648
+ #: app/list-tables.php:133
649
+ msgid "Files Size:"
650
+ msgstr "Tamaño de los ficheros:"
651
+
652
+ #: app/list-tables.php:135
653
+ msgid "Files count:"
654
+ msgstr "Número de ficheros:"
655
+
656
+ #: app/list-tables.php:140
657
+ msgid "DB Size: "
658
+ msgstr "Tamaño de la base de datos: "
659
+
660
+ #: app/list-tables.php:142
661
+ msgid "DB Tables:"
662
+ msgstr "Tablas de la base de datos:"
663
+
664
+ #: app/list-tables.php:143
665
+ msgid "DB Rows:"
666
+ msgstr "Registros de la base de datos:"
667
+
668
+ #: app/list-tables.php:152
669
+ #: app/php-functions.php:419
670
+ msgid "Running since:"
671
+ msgstr "Funcionando desde:"
672
+
673
+ #: app/list-tables.php:152
674
+ #: app/list-tables.php:168
675
+ #: app/list-tables.php:353
676
+ #: app/php-functions.php:419
677
+ msgid "sec."
678
+ msgstr "seg."
679
+
680
+ #: app/list-tables.php:156
681
+ msgid "Inactive"
682
+ msgstr "Inactivo"
683
+
684
+ #: app/list-tables.php:159
685
+ msgid "<a href=\"http://wikipedia.org/wiki/Cron\" target=\"_blank\">Cron</a>:"
686
+ msgstr "<a href=\"http://wikipedia.org/wiki/Cron\" target=\"_blank\">Cron</a>:"
687
+
688
+ #: app/list-tables.php:168
689
+ msgid "Runtime:"
690
+ msgstr "Tiempo de ejecución:"
691
+
692
+ #: app/list-tables.php:170
693
+ msgid "None"
694
+ msgstr "Nunca"
695
+
696
+ #: app/list-tables.php:173
697
+ msgid "Download last Backup"
698
+ msgstr "Descargar la última copia de seguridad"
699
+
700
+ #: app/list-tables.php:173
701
+ #: app/list-tables.php:318
702
+ #: app/list-tables.php:484
703
+ msgid "Download"
704
+ msgstr "Descargar"
705
+
706
+ #: app/list-tables.php:175
707
+ msgid "View last Log"
708
+ msgstr "Ver el último registro"
709
+
710
+ #: app/list-tables.php:175
711
+ msgid "Log"
712
+ msgstr "Registro"
713
+
714
+ #: app/list-tables.php:249
715
+ msgid "No Logs."
716
+ msgstr "No hay registros."
717
+
718
+ #: app/list-tables.php:262
719
+ msgid "Job"
720
+ msgstr "Tarea"
721
+
722
+ #: app/list-tables.php:264
723
+ msgid "Backup/Log Date/Time"
724
+ msgstr "Fecha y hora del registro/Nombre de la copia de seguridad"
725
+
726
+ #: app/list-tables.php:265
727
+ msgid "Status"
728
+ msgstr "Estado"
729
+
730
+ #: app/list-tables.php:266
731
+ #: app/list-tables.php:426
732
+ msgid "Size"
733
+ msgstr "Tamaño"
734
+
735
+ #: app/list-tables.php:267
736
+ msgid "Runtime"
737
+ msgstr "Tiempo de ejecución"
738
+
739
+ #: app/list-tables.php:314
740
+ msgid "View log"
741
+ msgstr "Ver registro"
742
+
743
+ #: app/list-tables.php:316
744
+ msgid "View"
745
+ msgstr "Ver"
746
+
747
+ #: app/list-tables.php:334
748
+ #: app/php-functions.php:398
749
+ msgid "ERROR(S)"
750
+ msgstr "ERROR(ES)"
751
+
752
+ #: app/list-tables.php:336
753
+ #: app/php-functions.php:400
754
+ msgid "WARNING(S)"
755
+ msgstr "AVISO(S)"
756
+
757
+ #: app/list-tables.php:338
758
+ #: app/php-functions.php:402
759
+ msgid "OK"
760
+ msgstr "OK"
761
+
762
+ #: app/list-tables.php:347
763
+ msgid "only Log"
764
+ msgstr "sólo registro"
765
+
766
+ #: app/list-tables.php:411
767
+ msgid "No Backups."
768
+ msgstr "No hay copias de seguridad."
769
+
770
+ #: app/list-tables.php:425
771
+ msgid "Backupfile"
772
+ msgstr "Fichero de copia de seguridad"
773
+
774
+ #: app/list-tables.php:483
775
+ msgid ""
776
+ "You are about to delete this Backup Archive. \n"
777
+ " 'Cancel' to stop, 'OK' to delete."
778
+ msgstr ""
779
+ "Estás a punto de borrar este fichero de copia de seguridad. \n"
780
+ " 'Cancelar' para parar, 'OK' para borrar."
781
+
782
+ #: app/list-tables.php:501
783
+ msgid "?"
784
+ msgstr "?"
785
+
786
+ #: app/options-edit-job.php:12
787
+ msgid "BackWPup Job Settings"
788
+ msgstr "Configuración de tareas de BackWPup"
789
+
790
+ #: app/options-edit-job.php:33
791
+ msgid "Job Type"
792
+ msgstr "Tipo de tarea"
793
+
794
+ #: app/options-edit-job.php:48
795
+ #: app/options-settings.php:22
796
+ #: app/options-settings.php:84
797
+ #: app/compatibility/class-wp-list-table.php:960
798
+ msgid "Save Changes"
799
+ msgstr "Guardar cambios"
800
+
801
+ #: app/options-edit-job.php:55
802
+ msgid "Job Schedule"
803
+ msgstr "Programación de tareas"
804
+
805
+ #: app/options-edit-job.php:57
806
+ msgid "Activate scheduling"
807
+ msgstr "Activar programación"
808
+
809
+ #: app/options-edit-job.php:60
810
+ msgid "Minutes: "
811
+ msgstr "Minutos:"
812
+
813
+ #: app/options-edit-job.php:68
814
+ #: app/options-edit-job.php:85
815
+ #: app/options-edit-job.php:102
816
+ #: app/options-edit-job.php:120
817
+ #: app/options-edit-job.php:144
818
+ msgid "Any (*)"
819
+ msgstr "Todos (*)"
820
+
821
+ #: app/options-edit-job.php:77
822
+ msgid "Hours:"
823
+ msgstr "Horas:"
824
+
825
+ #: app/options-edit-job.php:94
826
+ msgid "Days:"
827
+ msgstr "Días:"
828
+
829
+ #: app/options-edit-job.php:112
830
+ msgid "Months:"
831
+ msgstr "Meses:"
832
+
833
+ #: app/options-edit-job.php:121
834
+ msgid "January"
835
+ msgstr "Enero"
836
+
837
+ #: app/options-edit-job.php:122
838
+ msgid "February"
839
+ msgstr "Febrero"
840
+
841
+ #: app/options-edit-job.php:123
842
+ msgid "March"
843
+ msgstr "Marzo"
844
+
845
+ #: app/options-edit-job.php:124
846
+ msgid "April"
847
+ msgstr "Abril"
848
+
849
+ #: app/options-edit-job.php:125
850
+ msgid "May"
851
+ msgstr "Mayo"
852
+
853
+ #: app/options-edit-job.php:126
854
+ msgid "June"
855
+ msgstr "Junio"
856
+
857
+ #: app/options-edit-job.php:127
858
+ msgid "July"
859
+ msgstr "Julio"
860
+
861
+ #: app/options-edit-job.php:128
862
+ msgid "Augest"
863
+ msgstr "Agosto"
864
+
865
+ #: app/options-edit-job.php:129
866
+ msgid "September"
867
+ msgstr "Septiembre"
868
+
869
+ #: app/options-edit-job.php:130
870
+ msgid "October"
871
+ msgstr "Octubre"
872
+
873
+ #: app/options-edit-job.php:131
874
+ msgid "November"
875
+ msgstr "Noviembre"
876
+
877
+ #: app/options-edit-job.php:132
878
+ msgid "December"
879
+ msgstr "Diciembre"
880
+
881
+ #: app/options-edit-job.php:136
882
+ msgid "Weekday:"
883
+ msgstr "Día de la semana:"
884
+
885
+ #: app/options-edit-job.php:145
886
+ msgid "Sunday"
887
+ msgstr "Domingo"
888
+
889
+ #: app/options-edit-job.php:146
890
+ msgid "Monday"
891
+ msgstr "Lunes"
892
+
893
+ #: app/options-edit-job.php:147
894
+ msgid "Tuesday"
895
+ msgstr "Martes"
896
+
897
+ #: app/options-edit-job.php:148
898
+ msgid "Wednesday"
899
+ msgstr "Miércoles"
900
+
901
+ #: app/options-edit-job.php:149
902
+ msgid "Thursday"
903
+ msgstr "Jueves"
904
+
905
+ #: app/options-edit-job.php:150
906
+ msgid "Friday"
907
+ msgstr "Viernes"
908
+
909
+ #: app/options-edit-job.php:151
910
+ msgid "Saturday"
911
+ msgstr "Sábado"
912
+
913
+ #: app/options-edit-job.php:156
914
+ msgid "Working as <a href=\"http://wikipedia.org/wiki/Cron\" target=\"_blank\">Cron</a> job schedule:"
915
+ msgstr "Está funcionando como una tarea programada en el <a href=\"http://wikipedia.org/wiki/Cron\" target=\"_blank\">Cron</a>:"
916
+
917
+ #: app/options-edit-job.php:157
918
+ msgid "Next runtime:"
919
+ msgstr "Próxima ejecución:"
920
+
921
+ #: app/options-edit-job.php:163
922
+ msgid "Backup File"
923
+ msgstr "Fichero de copia de seguridad"
924
+
925
+ #: app/options-edit-job.php:165
926
+ msgid "File Prefix:"
927
+ msgstr "Prefijo del fichero:"
928
+
929
+ #: app/options-edit-job.php:167
930
+ msgid "File Formart:"
931
+ msgstr "Formato del fichero:"
932
+
933
+ #: app/options-edit-job.php:170
934
+ #: app/options-edit-job.php:172
935
+ msgid "Zip"
936
+ msgstr "Zip"
937
+
938
+ #: app/options-edit-job.php:173
939
+ msgid "Tar"
940
+ msgstr "Tar"
941
+
942
+ #: app/options-edit-job.php:175
943
+ #: app/options-edit-job.php:177
944
+ msgid "Tar GZip"
945
+ msgstr "Tar GZip"
946
+
947
+ #: app/options-edit-job.php:179
948
+ #: app/options-edit-job.php:181
949
+ msgid "Tar BZip2"
950
+ msgstr "Tar BZip2"
951
+
952
+ #: app/options-edit-job.php:182
953
+ #: app/options-edit-job.php:318
954
+ #: app/options-edit-job.php:322
955
+ msgid "Example:"
956
+ msgstr "Ejemplo:"
957
+
958
+ #: app/options-edit-job.php:189
959
+ msgid "Send log"
960
+ msgstr "Enviar registro"
961
+
962
+ #: app/options-edit-job.php:191
963
+ #: app/options-edit-job.php:446
964
+ msgid "E-Mail-Adress:"
965
+ msgstr "Dirección de email:"
966
+
967
+ #: app/options-edit-job.php:193
968
+ msgid "Send only E-Mail on errors."
969
+ msgstr "Solo enviar emails cuando se produzcan errores"
970
+
971
+ #: app/options-edit-job.php:205
972
+ msgid "Enter Job name here"
973
+ msgstr "Escribe aquí el nombre de la tarea"
974
+
975
+ #: app/options-edit-job.php:211
976
+ msgid "Database Jobs"
977
+ msgstr "Tareas de la base de datos"
978
+
979
+ #: app/options-edit-job.php:214
980
+ msgid "Database Tabels to Exclude:"
981
+ msgstr "Tablas de la base de datos que se excluirán:"
982
+
983
+ #: app/options-edit-job.php:225
984
+ msgid "Use short INSERTs instat of full (with keys)"
985
+ msgstr "Use short INSERTs instat of full (with keys)"
986
+
987
+ #: app/options-edit-job.php:226
988
+ msgid "Set Blog Maintenance Mode on Database Operations"
989
+ msgstr "Poner el blog en modo de mantenimiento cuando se lleven a cabo operaciones en la base de datos"
990
+
991
+ #: app/options-edit-job.php:231
992
+ #: app/php-functions.php:316
993
+ msgid "File Backup"
994
+ msgstr "Hacer una copia de seguridad de los ficheros de la aplicación"
995
+
996
+ #: app/options-edit-job.php:233
997
+ msgid "Blog Folders to Backup:"
998
+ msgstr "Directorios incluidos en la copia de seguridad:"
999
+
1000
+ #: app/options-edit-job.php:236
1001
+ msgid "root"
1002
+ msgstr "Directorio raíz"
1003
+
1004
+ #: app/options-edit-job.php:239
1005
+ #: app/options-edit-job.php:255
1006
+ #: app/options-edit-job.php:271
1007
+ #: app/options-edit-job.php:287
1008
+ #: app/options-edit-job.php:303
1009
+ msgid "Exclude:"
1010
+ msgstr "Excluir:"
1011
+
1012
+ #: app/options-edit-job.php:252
1013
+ msgid "Content"
1014
+ msgstr "Directorio wp-content"
1015
+
1016
+ #: app/options-edit-job.php:268
1017
+ msgid "Plugins"
1018
+ msgstr "Directorio de plugins"
1019
+
1020
+ #: app/options-edit-job.php:284
1021
+ msgid "Themes"
1022
+ msgstr "Directorio de temas"
1023
+
1024
+ #: app/options-edit-job.php:300
1025
+ msgid "Blog Uploads"
1026
+ msgstr "Directorio de subida de archivos"
1027
+
1028
+ #: app/options-edit-job.php:317
1029
+ msgid "Include Folders to Backup:"
1030
+ msgstr "Incluir directorios en la copia de seguridad:"
1031
+
1032
+ #: app/options-edit-job.php:321
1033
+ msgid "Exclude Files/Folders from Backup:"
1034
+ msgstr "Excluir ficheros o directorios de la copia de seguridad"
1035
+
1036
+ #: app/options-edit-job.php:328
1037
+ msgid "Backup to Directory"
1038
+ msgstr "Guardar la copia de seguridad en el directorio"
1039
+
1040
+ #: app/options-edit-job.php:330
1041
+ msgid "Full Path to Folder for Backup Files:"
1042
+ msgstr "Ruta completa al directorio donde se guardarán los ficheros de la copia de seguridad:"
1043
+
1044
+ #: app/options-edit-job.php:332
1045
+ msgid "Max. Backup Files in Folder:"
1046
+ msgstr "Número máximo de ficheros de copia de seguridad que se guardarán en el directorio:"
1047
+
1048
+ #: app/options-edit-job.php:332
1049
+ #: app/options-edit-job.php:349
1050
+ #: app/options-edit-job.php:373
1051
+ #: app/options-edit-job.php:399
1052
+ #: app/options-edit-job.php:422
1053
+ #: app/options-edit-job.php:438
1054
+ #: app/options-settings.php:62
1055
+ msgid "(Oldest files will deleted first.)"
1056
+ msgstr "(los más antiguos se borrarán en primer lugar)"
1057
+
1058
+ #: app/options-edit-job.php:338
1059
+ msgid "Backup to FTP Server"
1060
+ msgstr "Copia de seguridad por FTP"
1061
+
1062
+ #: app/options-edit-job.php:340
1063
+ msgid "Hostname:"
1064
+ msgstr "Nombre del servidor:"
1065
+
1066
+ #: app/options-edit-job.php:342
1067
+ #: app/options-edit-job.php:412
1068
+ msgid "Username:"
1069
+ msgstr "Nombre de usuario:"
1070
+
1071
+ #: app/options-edit-job.php:344
1072
+ #: app/options-edit-job.php:434
1073
+ msgid "Password:"
1074
+ msgstr "Contraseña:"
1075
+
1076
+ #: app/options-edit-job.php:346
1077
+ msgid "Directory on Server:"
1078
+ msgstr "Directorio en el servidor:"
1079
+
1080
+ #: app/options-edit-job.php:349
1081
+ msgid "Max. Backup Files in FTP Folder:"
1082
+ msgstr "Máximo número de ficheros de copia de seguridad en el directorio FTP:"
1083
+
1084
+ #: app/options-edit-job.php:350
1085
+ msgid "Use SSL-FTP Connection."
1086
+ msgstr "Utilizar conexión SSL-FTP."
1087
+
1088
+ #: app/options-edit-job.php:351
1089
+ msgid "Use FTP Passiv mode."
1090
+ msgstr "Utilizar FTP pasivo."
1091
+
1092
+ #: app/options-edit-job.php:358
1093
+ msgid "Backup to Amazon S3"
1094
+ msgstr "Copia de seguridad en Amazon S3"
1095
+
1096
+ #: app/options-edit-job.php:358
1097
+ #: app/options-edit-job.php:382
1098
+ #: app/options-edit-job.php:407
1099
+ #: app/options-edit-job.php:430
1100
+ msgid "Create Account"
1101
+ msgstr "Crear cuenta"
1102
+
1103
+ #: app/options-edit-job.php:361
1104
+ #: app/options-edit-job.php:385
1105
+ #: app/options-edit-job.php:410
1106
+ msgid "curl Support required"
1107
+ msgstr "se requiere soporte para curl"
1108
+
1109
+ #: app/options-edit-job.php:363
1110
+ msgid "Access Key ID:"
1111
+ msgstr "ID de clave de acceso:"
1112
+
1113
+ #: app/options-edit-job.php:363
1114
+ #: app/options-edit-job.php:391
1115
+ #: app/options-edit-job.php:414
1116
+ msgid "Find it"
1117
+ msgstr "Encontrarlo"
1118
+
1119
+ #: app/options-edit-job.php:365
1120
+ msgid "Secret Access Key:"
1121
+ msgstr "Clave de acceso secreta:"
1122
+
1123
+ #: app/options-edit-job.php:367
1124
+ msgid "Bucket:"
1125
+ msgstr "Bucket:"
1126
+
1127
+ #: app/options-edit-job.php:370
1128
+ msgid "Create Bucket:"
1129
+ msgstr "Crear bucket:"
1130
+
1131
+ #: app/options-edit-job.php:370
1132
+ msgid "Bucket Region"
1133
+ msgstr "Región del bucket:"
1134
+
1135
+ #: app/options-edit-job.php:370
1136
+ msgid "US-East (Northern Virginia)"
1137
+ msgstr "Estados Unidos-Este (Northern Virginia)"
1138
+
1139
+ #: app/options-edit-job.php:370
1140
+ msgid "US-West (Northern California)"
1141
+ msgstr "Estados Unidos-Oeste (Northern California)"
1142
+
1143
+ #: app/options-edit-job.php:370
1144
+ msgid "EU (Ireland)"
1145
+ msgstr "Unión Europea (Irlanda)"
1146
+
1147
+ #: app/options-edit-job.php:370
1148
+ msgid "Asia Pacific (Singapore)"
1149
+ msgstr "Asia Pacífico (Singapur)"
1150
+
1151
+ #: app/options-edit-job.php:370
1152
+ msgid "Asia Pacific (Japan)"
1153
+ msgstr "Asia Pacífico (Japón)"
1154
+
1155
+ #: app/options-edit-job.php:371
1156
+ msgid "Directory in Bucket:"
1157
+ msgstr "Directorio en el bucket:"
1158
+
1159
+ #: app/options-edit-job.php:373
1160
+ msgid "Max. Backup Files in Bucket Folder:"
1161
+ msgstr "Máximo número de ficheros de copia de seguridad en el directorio del bucket:"
1162
+
1163
+ #: app/options-edit-job.php:374
1164
+ msgid "Save Backups with reduced redundancy!"
1165
+ msgstr "Guardar copias de seguridad con redundancia reducida."
1166
+
1167
+ #: app/options-edit-job.php:382
1168
+ msgid "Backup to Micosoft Azure (Blob)"
1169
+ msgstr "Copia de seguridad en Microsoft Azure (Blob)"
1170
+
1171
+ #: app/options-edit-job.php:387
1172
+ msgid "Host:"
1173
+ msgstr "Servidor:"
1174
+
1175
+ #: app/options-edit-job.php:388
1176
+ msgid "Normely: blob.core.windows.net"
1177
+ msgstr "Normalmente: blob.core.windows.net"
1178
+
1179
+ #: app/options-edit-job.php:389
1180
+ msgid "Account Name:"
1181
+ msgstr "Nombre de cuenta:"
1182
+
1183
+ #: app/options-edit-job.php:391
1184
+ msgid "Access Key:"
1185
+ msgstr "Clave de acceso:"
1186
+
1187
+ #: app/options-edit-job.php:393
1188
+ #: app/options-edit-job.php:416
1189
+ msgid "Container:"
1190
+ msgstr "Contenedor:"
1191
+
1192
+ #: app/options-edit-job.php:396
1193
+ #: app/options-edit-job.php:419
1194
+ msgid "Create Container:"
1195
+ msgstr "Crear contenedor:"
1196
+
1197
+ #: app/options-edit-job.php:397
1198
+ #: app/options-edit-job.php:420
1199
+ msgid "Directory in Container:"
1200
+ msgstr "Directorio en el contenedor:"
1201
+
1202
+ #: app/options-edit-job.php:399
1203
+ #: app/options-edit-job.php:422
1204
+ msgid "Max. Backup Files in Container Folder:"
1205
+ msgstr "Máximo número de ficheros de copia de seguridad en el directorio del contenedor:"
1206
+
1207
+ #: app/options-edit-job.php:407
1208
+ msgid "Backup to Rackspace Cloud"
1209
+ msgstr "Backup en Rackspace Cloud"
1210
+
1211
+ #: app/options-edit-job.php:414
1212
+ msgid "API Key:"
1213
+ msgstr "Clave API:"
1214
+
1215
+ #: app/options-edit-job.php:430
1216
+ msgid "Backup to Dropbox"
1217
+ msgstr "Copia de seguridad con Dropbox"
1218
+
1219
+ #: app/options-edit-job.php:432
1220
+ msgid "Email:"
1221
+ msgstr "Email:"
1222
+
1223
+ #: app/options-edit-job.php:436
1224
+ msgid "Directory:"
1225
+ msgstr "Directorio:"
1226
+
1227
+ #: app/options-edit-job.php:438
1228
+ msgid "Max. Backup Files in Dopbox Folder:"
1229
+ msgstr "Número máximo de ficheros de copia de seguridad en el directorio de DropBox:"
1230
+
1231
+ #: app/options-edit-job.php:444
1232
+ msgid "Backup to E-Mail"
1233
+ msgstr "Enviar la copia de seguridad por email"
1234
+
1235
+ #: app/options-edit-job.php:449
1236
+ msgid "Max. File Size for sending Backups with mail:"
1237
+ msgstr "Tamaño máximo del fichero para enviar copias de seguridad por email:"
1238
+
1239
+ #: app/options-runnow-iframe.php:13
1240
+ msgid "Do Job"
1241
+ msgstr "Ejecutar la tarea"
1242
+
1243
+ #: app/options-save.php:28
1244
+ msgid "Copy of"
1245
+ msgstr "Copia de"
1246
+
1247
+ #: app/options-save.php:63
1248
+ msgid "Backup Cleand by User!!!"
1249
+ msgstr "Copia de seguridad borrada por el usuario."
1250
+
1251
+ #: app/options-save.php:133
1252
+ #: app/options-save.php:261
1253
+ #: app/options-save.php:377
1254
+ msgid "File does not exist."
1255
+ msgstr "El fichero no exite"
1256
+
1257
+ #: app/options-save.php:413
1258
+ msgid "Settings saved"
1259
+ msgstr "Configuración guardada"
1260
+
1261
+ #: app/options-save.php:577
1262
+ msgid "Job '%1' changes saved."
1263
+ msgstr "Los cambios en la tarea '%1' se han guardado."
1264
+
1265
+ #: app/options-save.php:577
1266
+ msgid "Jobs overview."
1267
+ msgstr "Vista general de las tareas programadas."
1268
+
1269
+ #: app/options-settings.php:10
1270
+ msgid "BackWPup Settings"
1271
+ msgstr "Configuración de BackWPup"
1272
+
1273
+ #: app/options-settings.php:29
1274
+ msgid "Send Mail"
1275
+ msgstr "Enviar email"
1276
+
1277
+ #: app/options-settings.php:31
1278
+ msgid "Sender Email:"
1279
+ msgstr "Dirección del remitente del email:"
1280
+
1281
+ #: app/options-settings.php:32
1282
+ msgid "Sender Name:"
1283
+ msgstr "Nombre del remitente:"
1284
+
1285
+ #: app/options-settings.php:33
1286
+ msgid "Send mail method:"
1287
+ msgstr "Método de envío del email:"
1288
+
1289
+ #: app/options-settings.php:36
1290
+ msgid "PHP: mail()"
1291
+ msgstr "PHP: mail()"
1292
+
1293
+ #: app/options-settings.php:37
1294
+ msgid "Sendmail"
1295
+ msgstr "Sendmail"
1296
+
1297
+ #: app/options-settings.php:38
1298
+ msgid "SMTP"
1299
+ msgstr "SMTP"
1300
+
1301
+ #: app/options-settings.php:41
1302
+ msgid "Sendmail Path:"
1303
+ msgstr "Ruta del sendmail"
1304
+
1305
+ #: app/options-settings.php:43
1306
+ msgid "SMTP Hostname:"
1307
+ msgstr "Servidor SMTP:"
1308
+
1309
+ #: app/options-settings.php:44
1310
+ msgid "SMTP Secure Connection:"
1311
+ msgstr "Conexión segura SMTP:"
1312
+
1313
+ #: app/options-settings.php:46
1314
+ #: app/php-functions.php:410
1315
+ #: app/php-functions.php:427
1316
+ msgid "none"
1317
+ msgstr "ninguno"
1318
+
1319
+ #: app/options-settings.php:50
1320
+ msgid "SMTP Username:"
1321
+ msgstr "Nombre de usuario SMTP:"
1322
+
1323
+ #: app/options-settings.php:51
1324
+ msgid "SMTP Password:"
1325
+ msgstr "Contraseña SMTP:"
1326
+
1327
+ #: app/options-settings.php:57
1328
+ #: app/php-functions.php:191
1329
+ msgid "Logs"
1330
+ msgstr "Registros"
1331
+
1332
+ #: app/options-settings.php:59
1333
+ msgid "Log file Folder:"
1334
+ msgstr "Directorio para los ficheros de registro:"
1335
+
1336
+ #: app/options-settings.php:61
1337
+ msgid "Max. Log Files in Folder:"
1338
+ msgstr "Máximo número de ficheros en el directorio de registro:"
1339
+
1340
+ #: app/options-settings.php:63
1341
+ msgid "Gzip Log files!"
1342
+ msgstr "Comprimir los ficheros de registro con Gzip."
1343
+
1344
+ #: app/options-settings.php:64
1345
+ msgid "Log deteiled File list."
1346
+ msgstr "Lista detallada de los ficheros de registro."
1347
+
1348
+ #: app/options-settings.php:69
1349
+ msgid "Disable WP-Cron"
1350
+ msgstr "Desactivar el cron de WordPress"
1351
+
1352
+ #: app/options-settings.php:71
1353
+ msgid "Use Cron job of Hoster and disable WP_Cron"
1354
+ msgstr "Utilizar el programador de tareas del servidor y desactivar el WP_Cron"
1355
+
1356
+ #: app/options-settings.php:72
1357
+ msgid "You must set up a cron job that calls:"
1358
+ msgstr "Debes establecer una tarea programada que llame a:"
1359
+
1360
+ #: app/options-settings.php:74
1361
+ msgid "or URL:"
1362
+ msgstr "o bien una URL:"
1363
+
1364
+ #: app/options-settings.php:79
1365
+ msgid "Temp Folder"
1366
+ msgstr "Directorio temporal"
1367
+
1368
+ #: app/options-tools.php:8
1369
+ msgid "BackWPup Tools"
1370
+ msgstr "Herramientas de BackWPup"
1371
+
1372
+ #: app/options-tools.php:29
1373
+ msgid "Database restore"
1374
+ msgstr "Restauración de la base de datos"
1375
+
1376
+ #: app/options-tools.php:32
1377
+ #: app/options-tools.php:50
1378
+ msgid "Restore"
1379
+ msgstr "Restaurar"
1380
+
1381
+ #: app/options-tools.php:47
1382
+ msgid "SQL File to restore:"
1383
+ msgstr "Fichero SQL para restaurar:"
1384
+
1385
+ #: app/options-tools.php:53
1386
+ msgid "Copy SQL file to Blog root folder to use restore."
1387
+ msgstr "Para llevar a cabo la restauración, copia el fichero SQL al directorio raíz del blog."
1388
+
1389
+ #: app/options-tools.php:61
1390
+ msgid "Import Jobs settings"
1391
+ msgstr "Importar tareas programadas"
1392
+
1393
+ #: app/options-tools.php:63
1394
+ msgid "Select File to import:"
1395
+ msgstr "Selecciona el fichero para importar:"
1396
+
1397
+ #: app/options-tools.php:64
1398
+ #: app/options-tools.php:66
1399
+ msgid "Upload"
1400
+ msgstr "Subir"
1401
+
1402
+ #: app/options-tools.php:67
1403
+ msgid "Select Jobs to Import:"
1404
+ msgstr "Selecciona las tareas que se importarán:"
1405
+
1406
+ #: app/options-tools.php:71
1407
+ msgid "Import Type"
1408
+ msgstr "Importar tipo"
1409
+
1410
+ #: app/options-tools.php:71
1411
+ msgid "No Import"
1412
+ msgstr "No importar"
1413
+
1414
+ #: app/options-tools.php:73
1415
+ msgid "Overwrite"
1416
+ msgstr "Sobrescribir"
1417
+
1418
+ #: app/options-tools.php:73
1419
+ msgid "Append"
1420
+ msgstr "Añadir"
1421
+
1422
+ #: app/options-tools.php:75
1423
+ #: app/options-tools.php:79
1424
+ #: app/options-tools.php:81
1425
+ msgid "Import"
1426
+ msgstr "Importar"
1427
+
1428
+ #: app/options-tools.php:117
1429
+ msgid "Jobs imported!"
1430
+ msgstr "Las tareas han sido importadas"
1431
+
1432
+ #: app/php-functions.php:8
1433
+ #: app/php-functions.php:82
1434
+ #: app/php-functions.php:264
1435
+ msgid "BackWPup"
1436
+ msgstr "BackWPup"
1437
+
1438
+ #: app/php-functions.php:26
1439
+ msgid "BackWPup Logs"
1440
+ msgstr "Registros de BackWPup"
1441
+
1442
+ #: app/php-functions.php:45
1443
+ msgid "BackWPup Manage Backups"
1444
+ msgstr "Gestionar copias de seguridad de BackWPup"
1445
+
1446
+ #: app/php-functions.php:61
1447
+ msgid "BackWPup Job Running"
1448
+ msgstr "Tarea de BackWPup en ejecución"
1449
+
1450
+ #: app/php-functions.php:64
1451
+ msgid "Running Job"
1452
+ msgstr "Tarea en ejecución"
1453
+
1454
+ #: app/php-functions.php:72
1455
+ msgid "BackWPup View Logs"
1456
+ msgstr "Ver registros de BackWPup"
1457
+
1458
+ #: app/php-functions.php:75
1459
+ #: app/php-functions.php:390
1460
+ msgid "View Log"
1461
+ msgstr "Ver registro"
1462
+
1463
+ #: app/php-functions.php:82
1464
+ msgid "Add New"
1465
+ msgstr "Añadir nuevo"
1466
+
1467
+ #: app/php-functions.php:105
1468
+ #: app/php-functions.php:256
1469
+ msgid "Support"
1470
+ msgstr "Suporte"
1471
+
1472
+ #: app/php-functions.php:106
1473
+ #: app/php-functions.php:255
1474
+ msgid "FAQ"
1475
+ msgstr "Preguntas más frecuentes (FAQ)"
1476
+
1477
+ #: app/php-functions.php:107
1478
+ msgid "Plugin Homepage"
1479
+ msgstr "Página del plugin"
1480
+
1481
+ #: app/php-functions.php:108
1482
+ msgid "Plugin Home on WordPress.org"
1483
+ msgstr "Página del plugin en WordPress.org"
1484
+
1485
+ #: app/php-functions.php:109
1486
+ #: app/php-functions.php:257
1487
+ msgid "Donate"
1488
+ msgstr "Hacer una donación"
1489
+
1490
+ #: app/php-functions.php:116
1491
+ msgid "Version:"
1492
+ msgstr "Versión:"
1493
+
1494
+ #: app/php-functions.php:117
1495
+ msgid "Author:"
1496
+ msgstr "Autor"
1497
+
1498
+ #: app/php-functions.php:190
1499
+ msgid "Jobs"
1500
+ msgstr "Tareas"
1501
+
1502
+ #: app/php-functions.php:192
1503
+ msgid "Backups"
1504
+ msgstr "Copias de seguridad"
1505
+
1506
+ #: app/php-functions.php:193
1507
+ msgid "Tools"
1508
+ msgstr "Herramientas"
1509
+
1510
+ #: app/php-functions.php:194
1511
+ #: app/php-functions.php:245
1512
+ msgid "Settings"
1513
+ msgstr "Configuración"
1514
+
1515
+ #: app/php-functions.php:245
1516
+ msgid "Go to Settings Page"
1517
+ msgstr "Ir a la página de configuración"
1518
+
1519
+ #: app/php-functions.php:310
1520
+ msgid "WP XML Export"
1521
+ msgstr "Generar un fichero WP XML de exportación"
1522
+
1523
+ #: app/php-functions.php:313
1524
+ msgid "Database Backup"
1525
+ msgstr "Hacer una copia de seguridad de la base de datos"
1526
+
1527
+ #: app/php-functions.php:319
1528
+ msgid "Optimize Database Tables"
1529
+ msgstr "Optimizar las tablas de la base de datos"
1530
+
1531
+ #: app/php-functions.php:322
1532
+ msgid "Check Database Tables"
1533
+ msgstr "Verificar las tablas de la base de datos"
1534
+
1535
+ #: app/php-functions.php:374
1536
+ msgid "Logs:"
1537
+ msgstr "Registros:"
1538
+
1539
+ #: app/php-functions.php:413
1540
+ msgid "Scheduled Jobs:"
1541
+ msgstr "Tareas programadas:"
1542
+
1543
+ #: app/php-functions.php:416
1544
+ msgid "Edit Job"
1545
+ msgstr "Editar tarea"
1546
+
1547
+ #: app/php-functions.php:706
1548
+ msgid "- WordPress 2.8 or heiger needed!"
1549
+ msgstr "- Se necesita WordPress 2.8 o superior."
1550
+
1551
+ #: app/php-functions.php:710
1552
+ msgid "- PHP 5.2.0 or higher needed!"
1553
+ msgstr "- Se necesita PHP 5.2.0 o superior."
1554
+
1555
+ #: app/php-functions.php:714
1556
+ msgid "- Logs Folder not exists (Try too create it on first Job run):"
1557
+ msgstr "- El directorio de registro no existe (el plugin intentará crearlo la primera vez que se ejecute la tarea programada):"
1558
+
1559
+ #: app/php-functions.php:717
1560
+ msgid "- Logs Folder not writeable:"
1561
+ msgstr "- El servidor no puede escribir en el directorio donde se guardan los registros:"
1562
+
1563
+ #: app/php-functions.php:720
1564
+ msgid "- Temp Folder not exists (Try too create it on first Job run):"
1565
+ msgstr "- El directorio temporal no existe (el plugin intentará crearlo la primera vez que se ejecute la tarea programada):"
1566
+
1567
+ #: app/php-functions.php:723
1568
+ msgid "- Temp Folder not writeable:"
1569
+ msgstr "- El servidor no puede escribir en el directorio temporal:"
1570
+
1571
+ #: app/php-functions.php:728
1572
+ msgid "- Please Check Scheduling time for Job:"
1573
+ msgstr "- Por favor, verifica la programación de la tarea:"
1574
+
1575
+ #: app/php-functions.php:731
1576
+ msgid "- WP-Cron don't working please check it!"
1577
+ msgstr "- El WP-Cron no funciona; por favor, compruébalo."
1578
+
1579
+ #: app/php5-functions.php:22
1580
+ msgid "New"
1581
+ msgstr "Nuevo"
1582
+
1583
+ #: app/php5-functions.php:500
1584
+ msgid "Missing Access Key ID!"
1585
+ msgstr "Falta la ID de la clave de acceso."
1586
+
1587
+ #: app/php5-functions.php:507
1588
+ msgid "Missing Secret Access Key!"
1589
+ msgstr "Falta la clave secreta de acceso."
1590
+
1591
+ #: app/php5-functions.php:524
1592
+ msgid "No Buckets found!"
1593
+ msgstr "No se ha encontrado ningún bucket."
1594
+
1595
+ #: app/php5-functions.php:556
1596
+ msgid "Missing Username!"
1597
+ msgstr "Falta el nombre de usuario."
1598
+
1599
+ #: app/php5-functions.php:563
1600
+ msgid "Missing API Key!"
1601
+ msgstr "Falta la clave API."
1602
+
1603
+ #: app/php5-functions.php:584
1604
+ msgid "No Containerss found!"
1605
+ msgstr "No se ha encontrado ningún contenedor."
1606
+
1607
+ #: app/php5-functions.php:618
1608
+ msgid "Missing Hostname!"
1609
+ msgstr "Falta el nombre del servidor."
1610
+
1611
+ #: app/php5-functions.php:625
1612
+ msgid "Missing Account Name!"
1613
+ msgstr "Falta el nombre de usuario."
1614
+
1615
+ #: app/php5-functions.php:632
1616
+ msgid "Missing Access Key!"
1617
+ msgstr "Falta la clave de acceso."
1618
+
1619
+ #: app/php5-functions.php:649
1620
+ msgid "No Container found!"
1621
+ msgstr "No se ha encontrado el contenedor."
1622
+
1623
+ #: app/compatibility/class-wp-list-table.php:181
1624
+ msgid "No items found."
1625
+ msgstr "No se ha encontrado ningún elemento."
1626
+
1627
+ #: app/compatibility/class-wp-list-table.php:284
1628
+ msgid "Bulk Actions"
1629
+ msgstr "Acciones en masa"
1630
+
1631
+ #: app/compatibility/class-wp-list-table.php:289
1632
+ msgid "Apply"
1633
+ msgstr "Aplicar"
1634
+
1635
+ #: app/compatibility/class-wp-list-table.php:363
1636
+ msgid "Show all dates"
1637
+ msgstr "Mostrar todas las fechas"
1638
+
1639
+ #: app/compatibility/class-wp-list-table.php:391
1640
+ msgid "List View"
1641
+ msgstr "Vista de lista"
1642
+
1643
+ #: app/compatibility/class-wp-list-table.php:392
1644
+ msgid "Excerpt View"
1645
+ msgstr "Vista de resumen"
1646
+
1647
+ #: app/compatibility/class-wp-list-table.php:418
1648
+ #, php-format
1649
+ msgid "%s pending"
1650
+ msgstr "%s pendiente"
1651
+
1652
+ #: app/compatibility/class-wp-list-table.php:474
1653
+ #: app/compatibility/class-wp-list-table.php:870
1654
+ #, php-format
1655
+ msgid "1 item"
1656
+ msgid_plural "%s items"
1657
+ msgstr[0] "1 elemento"
1658
+ msgstr[1] "%s elementos"
1659
+
1660
+ #: app/compatibility/class-wp-list-table.php:515
1661
+ #, php-format
1662
+ msgid "%1$s of %2$s"
1663
+ msgstr "%1$s de %2$s"
1664
+
1665
+ #: app/tools/db_restore.php:34
1666
+ #: app/tools/db_restore.php:53
1667
+ #: app/tools/db_restore.php:68
1668
+ #: app/tools/db_restore.php:79
1669
+ #: app/tools/db_restore.php:82
1670
+ #: app/tools/db_restore.php:85
1671
+ #: app/tools/db_restore.php:90
1672
+ msgid "ERROR:"
1673
+ msgstr "ERROR:"
1674
+
1675
+ #: app/tools/db_restore.php:34
1676
+ #, php-format
1677
+ msgid "Pleace set <i>$table_prefix = '%1$s';</i> in wp-config.php"
1678
+ msgstr "Por favor, establece la variable <i>$table_prefix = '%1$s';</i> en wp-config.php"
1679
+
1680
+ #: app/tools/db_restore.php:53
1681
+ #, php-format
1682
+ msgid "Pleace set <i>define('DB_iso-8859-1', '%1$s');</i> in wp-config.php"
1683
+ msgstr "Por favor, establece la variable <i>define('DB_iso-8859-1', '%1$s');</i> en wp-config.php"
1684
+
1685
+ #: app/tools/db_restore.php:74
1686
+ #, php-format
1687
+ msgid "%1$s Database Querys done."
1688
+ msgstr "Se han realizado %1$s consultas a la base de datos."
1689
+
1690
+ #: app/tools/db_restore.php:75
1691
+ msgid "Make changes for Blogurl and ABSPATH if needed."
1692
+ msgstr "Realiza los cambios en Blogurl y ABSPATH si son necesarios."
1693
+
1694
+ #: app/tools/db_restore.php:92
1695
+ msgid "Restore Done. Please delete the SQL file after Restore."
1696
+ msgstr "Restauración realizada. Por favor, borra el fichero SQL después de restaurar."
1697
+
1698
+ #~ msgid "Connect to DropBox ..."
1699
+ #~ msgstr "Conectar a DropBox..."
lang/backwpup-nl_NL.mo ADDED
Binary file
lang/backwpup-nl_NL.po ADDED
@@ -0,0 +1,3305 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: BackWPup 3.0-Dev\n"
4
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/backwpup\n"
5
+ "POT-Creation-Date: 2012-01-19 09:12:05+00:00\n"
6
+ "PO-Revision-Date: 2012-02-14 12:11+0100\n"
7
+ "Last-Translator: Alfred van Hoorn <email@alfredvanhoorn.nl>\n"
8
+ "Language-Team: Alfred van Hoorn\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Poedit-Language: Dutch\n"
14
+ "X-Poedit-Country: NETHERLANDS\n"
15
+ "X-Poedit-SourceCharset: utf-8\n"
16
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
17
+ "X-Poedit-Basepath: .\n"
18
+ "X-Poedit-Bookmarks: \n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+ "X-Textdomain-Support: yes"
21
+
22
+ #: inc/class-page-backups.php:370
23
+ #@ backwpup
24
+ msgid "BackWPup Manage Backups"
25
+ msgstr "BackWPup Backups beheren"
26
+
27
+ #: backwpup.php:282
28
+ #: inc/class-page-logs.php:99
29
+ #@ backwpup
30
+ msgid "BackWPup Logs"
31
+ msgstr "BackWPup Logboeken"
32
+
33
+ #: inc/class-page-logs-table.php:84
34
+ #@ backwpup
35
+ msgid "No Logs."
36
+ msgstr "Geen logboeken"
37
+
38
+ #: inc/class-page-backups-table.php:149
39
+ #: inc/class-page-backups-table.php:259
40
+ #: inc/class-page-backwpup-table.php:66
41
+ #: inc/class-page-backwpup-table.php:131
42
+ #: inc/class-page-editjob-metaboxes.php:41
43
+ #: inc/class-page-logs-table.php:92
44
+ #: inc/class-page-logs-table.php:155
45
+ #@ default
46
+ #@ backwpup
47
+ msgid "Delete"
48
+ msgstr "Verwijder"
49
+
50
+ #: inc/class-page-logs-table.php:102
51
+ #@ backwpup
52
+ msgid "Job"
53
+ msgstr "Taak"
54
+
55
+ #: inc/class-page-backwpup-table.php:79
56
+ #: inc/class-page-editjob-metaboxes.php:218
57
+ #: inc/class-page-logs-table.php:103
58
+ #@ backwpup
59
+ msgid "Type"
60
+ msgstr "Type"
61
+
62
+ #: inc/class-page-logs-table.php:104
63
+ #@ backwpup
64
+ msgid "Backup/Log Date/Time"
65
+ msgstr "Backup-datum en -tijd"
66
+
67
+ #: inc/class-page-logs-table.php:105
68
+ #@ backwpup
69
+ msgid "Status"
70
+ msgstr "Status"
71
+
72
+ #: inc/class-page-backups-table.php:214
73
+ #: inc/class-page-logs-table.php:106
74
+ #@ backwpup
75
+ msgid "Size"
76
+ msgstr "Grootte"
77
+
78
+ #: inc/class-page-logs-table.php:107
79
+ #@ backwpup
80
+ msgid "Runtime"
81
+ msgstr "Verwerkingstijd"
82
+
83
+ #: inc/class-page-logs-table.php:152
84
+ #@ backwpup
85
+ msgid "View log"
86
+ msgstr "Bekijk logboek"
87
+
88
+ #: inc/class-page-logs-table.php:154
89
+ #@ backwpup
90
+ msgid "View"
91
+ msgstr "Bekijken"
92
+
93
+ #: inc/class-page-backups-table.php:260
94
+ #: inc/class-page-backwpup-table.php:217
95
+ #: inc/class-page-logs-table.php:156
96
+ #@ backwpup
97
+ msgid "Download"
98
+ msgstr "Downloaden"
99
+
100
+ #: inc/class-adminbar.php:85
101
+ #: inc/class-dashboard.php:35
102
+ #: inc/class-page-logs-table.php:163
103
+ #, php-format
104
+ #@ backwpup
105
+ msgid "%d ERROR"
106
+ msgid_plural "%d ERRORS"
107
+ msgstr[0] "%d FOUT"
108
+ msgstr[1] "%d FOUTEN"
109
+
110
+ #: inc/class-adminbar.php:87
111
+ #: inc/class-dashboard.php:37
112
+ #: inc/class-page-logs-table.php:165
113
+ #, php-format
114
+ #@ backwpup
115
+ msgid "%d WARNING"
116
+ msgid_plural "%d WARNINGS"
117
+ msgstr[0] "%d WAARSCHUWING"
118
+ msgstr[1] "%d WAARSCHUWINGEN"
119
+
120
+ #: inc/class-adminbar.php:89
121
+ #: inc/class-dashboard.php:39
122
+ #: inc/class-page-logs-table.php:167
123
+ #@ backwpup
124
+ msgid "O.K."
125
+ msgstr "OK"
126
+
127
+ #: inc/class-page-logs-table.php:175
128
+ #@ backwpup
129
+ msgid "only Log"
130
+ msgstr "alleen logboek"
131
+
132
+ #: inc/class-page-backwpup-table.php:188
133
+ #: inc/class-page-backwpup-table.php:211
134
+ #: inc/class-page-editjob-metaboxes.php:319
135
+ #: inc/class-page-logs-table.php:181
136
+ #@ backwpup
137
+ msgid "sec."
138
+ msgstr "sec."
139
+
140
+ #: inc/class-page-tools.php:16
141
+ #: inc/class-page-tools.php:151
142
+ #@ backwpup
143
+ msgid "Put DB restore tool to blog root..."
144
+ msgstr "Plaats DB herstelprogramma in blog-hoofdmap..."
145
+
146
+ #: inc/class-page-tools.php:34
147
+ #@ backwpup
148
+ msgid "Files for restore transferred!"
149
+ msgstr "Bestanden voor herstel verzonden!"
150
+
151
+ #: inc/class-page-tools.php:38
152
+ #: inc/class-page-tools.php:154
153
+ #@ backwpup
154
+ msgid "Delete restore tool from blog root..."
155
+ msgstr "Verwijder herstelprogramma uit blog-hoofdmap..."
156
+
157
+ #: inc/class-page-tools.php:46
158
+ #@ backwpup
159
+ msgid "Files for restore deleted!"
160
+ msgstr "Bestanden voor herstel verwijderd!"
161
+
162
+ #: inc/class-page-tools.php:49
163
+ #: inc/class-page-tools.php:236
164
+ #@ backwpup
165
+ msgid "Save to config!"
166
+ msgstr "Opslaan naar instellingen!"
167
+
168
+ #: inc/class-page-tools.php:55
169
+ #, php-format
170
+ #@ backwpup
171
+ msgid "Max. execution time saved with %d sec."
172
+ msgstr "Max. verwerkingstijd %d sec."
173
+
174
+ #: inc/class-page-tools.php:59
175
+ #: inc/class-page-tools.php:230
176
+ #: inc/class-page-tools.php:235
177
+ #@ backwpup
178
+ msgid "Start time test..."
179
+ msgstr "Start tijdtest..."
180
+
181
+ #: inc/class-page-tools.php:91
182
+ #: inc/class-page-tools.php:241
183
+ #@ backwpup
184
+ msgid "Terminate time test!"
185
+ msgstr "Stop tijdtest!"
186
+
187
+ #: inc/class-page-tools.php:94
188
+ #@ backwpup
189
+ msgid "Execution Time test terminated!"
190
+ msgstr "Tijdtest afgebroken!"
191
+
192
+ #: inc/class-page-backups.php:334
193
+ #: inc/class-page-backwpup.php:142
194
+ #: inc/class-page-editjob.php:403
195
+ #: inc/class-page-logs.php:65
196
+ #: inc/class-page-settings.php:86
197
+ #: inc/class-page-tools.php:101
198
+ #: inc/class-page-working.php:30
199
+ #@ default
200
+ msgid "Overview"
201
+ msgstr "Overzicht"
202
+
203
+ #: inc/class-page-working.php:32
204
+ #@ backwpup
205
+ msgid "Here you see a working jobs or a logfile"
206
+ msgstr "Hier zie je een actieve taak of een logboekbestand"
207
+
208
+ #: inc/class-ajax-editjob.php:60
209
+ #@ backwpup
210
+ msgid "Working as <a href=\"http://wikipedia.org/wiki/Cron\" target=\"_blank\">Cron</a> job schedule:"
211
+ msgstr "Taak gepland met <a href=\"http://wikipedia.org/wiki/Cron\" target=\"_blank\">Cron</a>:"
212
+
213
+ #: inc/class-ajax-editjob.php:67
214
+ #, php-format
215
+ #@ backwpup
216
+ msgid "ATTENTION: Job runs every %d mins.!!!"
217
+ msgstr "ATTENTIE: Taak start elke %d min.!!!"
218
+
219
+ #: inc/class-ajax-editjob.php:73
220
+ #, php-format
221
+ #@ backwpup
222
+ msgid "ATTENTION: Job runs every %d houers.!!!"
223
+ msgstr "ATTENTIE: Taak start elke %d uren!!!"
224
+
225
+ #: inc/class-ajax-editjob.php:77
226
+ #@ backwpup
227
+ msgid "ATTENTION: Can't calculate cron!!!"
228
+ msgstr "ATTENTIE: Kan cron niet bepalen!!!"
229
+
230
+ #: inc/class-ajax-editjob.php:79
231
+ #@ backwpup
232
+ msgid "Next runtime:"
233
+ msgstr "Volgende start op:"
234
+
235
+ #: inc/class-ajax-editjob.php:125
236
+ #: inc/class-ajax-editjob.php:185
237
+ #@ backwpup
238
+ msgid "Missing access key!"
239
+ msgstr "Toegangsleutel ontbreekt!"
240
+
241
+ #: inc/class-ajax-editjob.php:127
242
+ #: inc/class-ajax-editjob.php:187
243
+ #@ backwpup
244
+ msgid "Missing secret access key!"
245
+ msgstr "Geheime toegangsleutel ontbreekt!"
246
+
247
+ #: inc/class-ajax-editjob.php:133
248
+ #: inc/class-ajax-editjob.php:193
249
+ #@ backwpup
250
+ msgid "No bucket fount!"
251
+ msgstr "Geen bucket gevonden!"
252
+
253
+ #: inc/class-ajax-editjob.php:242
254
+ #: inc/class-ajax-editjob.php:351
255
+ #@ backwpup
256
+ msgid "Missing Username!"
257
+ msgstr "Gebruikersnaam ontbreekt!"
258
+
259
+ #: inc/class-ajax-editjob.php:244
260
+ #@ backwpup
261
+ msgid "Missing API Key!"
262
+ msgstr "API sleutel ontbreekt!"
263
+
264
+ #: inc/class-ajax-editjob.php:248
265
+ #@ backwpup
266
+ msgid "No Container's found!"
267
+ msgstr "Geen containers gevonden!"
268
+
269
+ #: inc/class-ajax-editjob.php:296
270
+ #@ backwpup
271
+ msgid "Missing Hostname!"
272
+ msgstr "Hostnaam ontbreekt!"
273
+
274
+ #: inc/class-ajax-editjob.php:298
275
+ #@ backwpup
276
+ msgid "Missing Account Name!"
277
+ msgstr "Accountnaam ontbreekt!"
278
+
279
+ #: inc/class-ajax-editjob.php:300
280
+ #@ backwpup
281
+ msgid "Missing Access Key!"
282
+ msgstr "Toegangsleutel ontbreekt!"
283
+
284
+ #: inc/class-ajax-editjob.php:304
285
+ #@ backwpup
286
+ msgid "No Container found!"
287
+ msgstr "Geen container gevonden!"
288
+
289
+ #: inc/class-ajax-editjob.php:353
290
+ #@ backwpup
291
+ msgid "Missing Password!"
292
+ msgstr "Wachtwoord ontbreekt!"
293
+
294
+ #: inc/class-ajax-editjob.php:357
295
+ #@ backwpup
296
+ msgid "No Syncfolders found!"
297
+ msgstr "Geen synchronisatiemap gevonden!"
298
+
299
+ #: inc/class-page-working.php:61
300
+ #@ backwpup
301
+ msgid "BackWPup Working"
302
+ msgstr "BackWPup Logboek"
303
+
304
+ #: inc/class-page-working.php:66
305
+ #, php-format
306
+ #@ backwpup
307
+ msgid "Job \"%s\" is running."
308
+ msgstr "Taak \"%s\" is actief."
309
+
310
+ #: inc/class-adminbar.php:31
311
+ #: inc/class-dashboard.php:99
312
+ #: inc/class-page-backwpup-table.php:139
313
+ #: inc/class-page-working.php:67
314
+ #@ backwpup
315
+ msgid "Abort!"
316
+ msgstr "Afbreken!"
317
+
318
+ #: inc/class-page-working.php:97
319
+ #@ backwpup
320
+ msgid "Warnings:"
321
+ msgstr "Waarschuwingen:"
322
+
323
+ #: inc/class-page-working.php:101
324
+ #@ backwpup
325
+ msgid "Errors:"
326
+ msgstr "Fouten:"
327
+
328
+ #: inc/class-page-backwpup.php:259
329
+ #@ backwpup
330
+ msgid "BackWPup Jobs"
331
+ msgstr "BackWPup Taken"
332
+
333
+ #: backwpup.php:223
334
+ #: inc/class-adminbar.php:40
335
+ #: inc/class-page-backwpup.php:259
336
+ #: inc/class-page-editjob.php:456
337
+ #@ backwpup
338
+ msgid "Add New"
339
+ msgstr "Nieuwe taak"
340
+
341
+ #: inc/class-page-tools.php:136
342
+ #@ backwpup
343
+ msgid "BackWPup Tools"
344
+ msgstr "BackWPup Gereedschappen"
345
+
346
+ #: inc/class-page-tools.php:142
347
+ #@ backwpup
348
+ msgid "Database restore"
349
+ msgstr "Herstellen Database"
350
+
351
+ #: inc/class-page-tools.php:145
352
+ #@ backwpup
353
+ msgid "DB Restore"
354
+ msgstr "DB herstellen"
355
+
356
+ #: inc/class-page-tools.php:149
357
+ #@ backwpup
358
+ msgid "Download manually DB restore tool: <a href=\"http://api.backwpup.com/download/backwpup_db_restore.zip\">http://api.backwpup.com/download/backwpup_db_restore.zip</a>"
359
+ msgstr "Download handmatig het DB herstelprogramma: <a href=\"http://api.backwpup.com/download/backwpup_db_restore.zip\">http://api.backwpup.com/download/backwpup_db_restore.zip</a>"
360
+
361
+ #: inc/class-page-tools.php:155
362
+ #, php-format
363
+ #@ backwpup
364
+ msgid "Make a DB restore: <a href=\"%1$s/backwpup_db_restore.php\">%1$s/backwpup_db_restore.php</a>"
365
+ msgstr "Herstel de DB: <a href=\"%1$s/backwpup_db_restore.php\">%1$s/backwpup_db_restore.php</a>"
366
+
367
+ #: inc/class-page-tools.php:162
368
+ #@ backwpup
369
+ msgid "Import Jobs settings"
370
+ msgstr "Importeer taakinstellingen"
371
+
372
+ #: inc/class-page-tools.php:165
373
+ #@ backwpup
374
+ msgid "Select file to import:"
375
+ msgstr "Selecteer te importeren bestand:"
376
+
377
+ #: inc/class-page-tools.php:168
378
+ #: inc/class-page-tools.php:173
379
+ #@ backwpup
380
+ msgid "Upload"
381
+ msgstr "Uploaden"
382
+
383
+ #: inc/class-page-tools.php:174
384
+ #@ backwpup
385
+ msgid "Select jobs to import"
386
+ msgstr "Selecteer te importeren taken"
387
+
388
+ #: inc/class-page-tools.php:178
389
+ #@ backwpup
390
+ msgid "Import Type"
391
+ msgstr "Importtype"
392
+
393
+ #: inc/class-page-tools.php:178
394
+ #@ backwpup
395
+ msgid "No Import"
396
+ msgstr "Geen import"
397
+
398
+ #: inc/class-page-tools.php:180
399
+ #@ backwpup
400
+ msgid "Overwrite"
401
+ msgstr "Overschrijven"
402
+
403
+ #: inc/class-page-tools.php:180
404
+ #@ backwpup
405
+ msgid "Append"
406
+ msgstr "Toevoegen"
407
+
408
+ #: inc/class-page-tools.php:182
409
+ #: inc/class-page-tools.php:187
410
+ #: inc/class-page-tools.php:189
411
+ #: inc/class-page-tools.php:190
412
+ #@ backwpup
413
+ msgid "Import"
414
+ msgstr "Importeren"
415
+
416
+ #: inc/class-page-tools.php:214
417
+ #@ backwpup
418
+ msgid "Jobs imported!"
419
+ msgstr "Taken geïmporteerd!"
420
+
421
+ #: inc/class-page-tools.php:221
422
+ #@ backwpup
423
+ msgid "Test max. script execution time"
424
+ msgstr "Maximaal toegestane verwerkingstijd:"
425
+
426
+ #: inc/class-page-tools.php:224
427
+ #@ backwpup
428
+ msgid "Test result:"
429
+ msgstr "Testresultaat:"
430
+
431
+ #: inc/class-page-tools.php:229
432
+ #@ default
433
+ msgid "No result"
434
+ msgstr "Geen resultaat"
435
+
436
+ #: inc/class-page-tools.php:234
437
+ #: inc/class-page-tools.php:240
438
+ #, php-format
439
+ #@ backwpup
440
+ msgid "%d sec."
441
+ msgstr "%d sec."
442
+
443
+ #: inc/class-page-tools.php:240
444
+ #@ default
445
+ msgid "In progress"
446
+ msgstr "In behandeling"
447
+
448
+ #: inc/class-page-settings.php:79
449
+ #@ backwpup
450
+ msgid "Settings saved"
451
+ msgstr "Instellingen opgeslagen"
452
+
453
+ #: inc/class-page-logs.php:66
454
+ #@ backwpup
455
+ msgid "Here you can manage the log files of the jobs. You can download, view, or delete them."
456
+ msgstr "Hier kun je logfiles van uitgevoerde taken downloaden, bekijken of verwijderen."
457
+
458
+ #: backwpup.php:239
459
+ #: inc/class-adminbar.php:44
460
+ #: inc/class-page-backups.php:339
461
+ #: inc/class-page-logs.php:69
462
+ #: inc/class-page-settings.php:162
463
+ #@ backwpup
464
+ msgid "Logs"
465
+ msgstr "Logboeken"
466
+
467
+ #: inc/class-page-backups.php:67
468
+ #, php-format
469
+ #@ backwpup
470
+ msgid "GStorage API: %s"
471
+ msgstr "GStorage API: %s"
472
+
473
+ #: inc/class-page-backups.php:168
474
+ #@ backwpup
475
+ msgid "Login failure!"
476
+ msgstr "Login fout!"
477
+
478
+ #: inc/class-page-backups.php:336
479
+ #@ backwpup
480
+ msgid "Here you see a list of backup files. Change the destination to jobname:destination to become a list of backups from other destinations and jobs. Then you can delete or download backup files. <br />NOTE: The lists will be only generated on backup jobs to reduce traffic."
481
+ msgstr "Hier zie je een lijst van backupfiles. Verander de bestemming naar taaknaam:bestemming om de backups van andere bestemmingen en taken in te zien. Daarna kun je backupfiles verwijderen of downloaden. <br />NOTE: Om het netwerkverkeer te beperken zal de lijst zal alleen worden aangemaakt voor backuptaken."
482
+
483
+ #: inc/class-page-backwpup-table.php:57
484
+ #@ backwpup
485
+ msgid "No Jobs."
486
+ msgstr "Geen taken."
487
+
488
+ #: inc/class-page-backwpup-table.php:65
489
+ #: inc/class-page-backwpup-table.php:130
490
+ #@ default
491
+ #@ backwpup
492
+ msgid "Export"
493
+ msgstr "Exporteren"
494
+
495
+ #: inc/class-page-backwpup-table.php:77
496
+ #@ backwpup
497
+ msgid "ID"
498
+ msgstr "ID"
499
+
500
+ #: inc/class-page-backwpup-table.php:78
501
+ #@ backwpup
502
+ msgid "Job Name"
503
+ msgstr "Taaknaam"
504
+
505
+ #: inc/class-page-backwpup-table.php:80
506
+ #@ backwpup
507
+ msgid "Information"
508
+ msgstr "Details"
509
+
510
+ #: inc/class-page-backwpup-table.php:81
511
+ #@ backwpup
512
+ msgid "Next Run"
513
+ msgstr "Volgende run"
514
+
515
+ #: inc/class-page-backwpup-table.php:82
516
+ #@ backwpup
517
+ msgid "Last Run"
518
+ msgstr "Vorige run"
519
+
520
+ #: inc/class-page-backwpup-table.php:125
521
+ #@ backwpup
522
+ msgid "Edit:"
523
+ msgstr "Bewerken:"
524
+
525
+ #: inc/class-page-backwpup-table.php:128
526
+ #@ default
527
+ msgid "Edit"
528
+ msgstr "Bewerken"
529
+
530
+ #: inc/class-page-backwpup-table.php:129
531
+ #@ backwpup
532
+ msgid "Copy"
533
+ msgstr "Kopiëren"
534
+
535
+ #: inc/class-page-backwpup-table.php:134
536
+ #: inc/class-page-editjob.php:367
537
+ #@ backwpup
538
+ msgid "Run now"
539
+ msgstr "Starten"
540
+
541
+ #: inc/class-dashboard.php:98
542
+ #: inc/class-page-backwpup-table.php:138
543
+ #@ backwpup
544
+ msgid "View!"
545
+ msgstr "Bekijken!"
546
+
547
+ #: inc/class-page-backwpup-table.php:188
548
+ #@ backwpup
549
+ msgid "Running since:"
550
+ msgstr "Actief sinds:"
551
+
552
+ #: inc/class-page-backwpup-table.php:199
553
+ #@ backwpup
554
+ msgid "Inactive"
555
+ msgstr "Inactief"
556
+
557
+ #: inc/class-page-backwpup-table.php:202
558
+ #@ backwpup
559
+ msgid "<a href=\"http://wikipedia.org/wiki/Cron\" target=\"_blank\">Cron</a>:"
560
+ msgstr "<a href=\"http://wikipedia.org/wiki/Cron\" target=\"_blank\">Cron</a>:"
561
+
562
+ #: inc/class-page-backwpup-table.php:211
563
+ #@ backwpup
564
+ msgid "Runtime:"
565
+ msgstr "Verwerkingstijd:"
566
+
567
+ #: inc/class-page-backwpup-table.php:213
568
+ #@ backwpup
569
+ msgid "None"
570
+ msgstr "Geen"
571
+
572
+ #: inc/class-page-backwpup-table.php:217
573
+ #@ backwpup
574
+ msgid "Download last Backup"
575
+ msgstr "Download laatste backup"
576
+
577
+ #: inc/class-page-backwpup-table.php:219
578
+ #@ backwpup
579
+ msgid "View last Log"
580
+ msgstr "Bekijk laatste logboek"
581
+
582
+ #: inc/class-page-backwpup-table.php:219
583
+ #@ backwpup
584
+ msgid "Log"
585
+ msgstr "Logboek"
586
+
587
+ #: inc/class-page-backwpup.php:41
588
+ #@ backwpup
589
+ msgid "Copy of"
590
+ msgstr "Kopie van"
591
+
592
+ #: inc/class-job.php:424
593
+ #: inc/class-page-backwpup.php:96
594
+ #@ backwpup
595
+ msgid "ERROR:"
596
+ msgstr "FOUT:"
597
+
598
+ #: inc/class-page-backwpup.php:96
599
+ #@ backwpup
600
+ msgid "Aborted by user!!!"
601
+ msgstr "Afgebroken door gebruiker!!!"
602
+
603
+ #: inc/class-page-backwpup.php:112
604
+ #@ backwpup
605
+ msgid "Job will be terminated."
606
+ msgstr "Taak wordt afgebroken."
607
+
608
+ #: inc/class-page-backwpup.php:115
609
+ #@ backwpup
610
+ msgid "Process killed with PID:"
611
+ msgstr "Proces afgebroken met PID:"
612
+
613
+ #: inc/class-page-backwpup.php:117
614
+ #@ backwpup
615
+ msgid "Can't kill process with PID:"
616
+ msgstr "Kan proces niet afbreken met PID:"
617
+
618
+ #: inc/class-page-backwpup.php:144
619
+ #@ backwpup
620
+ msgid "Here can see some information about the jobs. How many can be switched with the view button. Also you can manage the jobs and abort working. With the links you have direct access to the last log or download."
621
+ msgstr "Hier kun je informatie over taken zien, taken beheren en actieve taken afbreken. Met de links heb je toegang tot het logboek van de laatste actieve taak."
622
+
623
+ #: inc/class-page-backwpup.php:179
624
+ #@ backwpup
625
+ msgid "- MySQL 5.0 or higher is needed!"
626
+ msgstr "- MySQL 5.0 of hoger is noodzakelijk!"
627
+
628
+ #: inc/class-page-backwpup.php:182
629
+ #, php-format
630
+ #@ backwpup
631
+ msgid "- Log folder '%s' is not in open_basedir path!"
632
+ msgstr "- Logboek-map '%s' niet opgenomen in open_basedir pad!"
633
+
634
+ #: inc/class-page-backwpup.php:186
635
+ #, php-format
636
+ #@ backwpup
637
+ msgid "- Log folder '%s' not exists!"
638
+ msgstr "- Logboek-map '%s' bestaat niet!"
639
+
640
+ #: inc/class-page-backwpup.php:188
641
+ #, php-format
642
+ #@ backwpup
643
+ msgid "- Log folder '%s' is not writable!"
644
+ msgstr "- Logboek-map '%s' niet beschrijfbaar!"
645
+
646
+ #: inc/class-page-backwpup.php:203
647
+ #, php-format
648
+ #@ backwpup
649
+ msgid "- Temp folder '%s' is not in open_basedir path!"
650
+ msgstr "- Tijdelijke map '%s' niet opgenomen in open_basedir pad!"
651
+
652
+ #: inc/class-page-backwpup.php:207
653
+ #, php-format
654
+ #@ backwpup
655
+ msgid "- Temp folder '%s' not exists!"
656
+ msgstr "- Tijdelijk map '%s' bestaat niet!"
657
+
658
+ #: inc/class-page-backwpup.php:209
659
+ #, php-format
660
+ #@ backwpup
661
+ msgid "- Temp folder '%s' is not writable!"
662
+ msgstr "- Tijdelijke map '%s' niet beschrijfbaar!"
663
+
664
+ #: inc/class-page-backwpup.php:223
665
+ #, php-format
666
+ #@ backwpup
667
+ msgid "- WP_CONTENT_URL '%s' must set as a full URL!"
668
+ msgstr "- WP_CONTENT_URL '%s' moet volledig URL zijn!"
669
+
670
+ #: inc/class-page-backwpup.php:226
671
+ #, php-format
672
+ #@ backwpup
673
+ msgid "- WP_PLUGIN_URL '%s' must set as a full URL!"
674
+ msgstr "- WP_PLUGIN_URL '%s' moet voledig URL zijn!"
675
+
676
+ #: inc/class-page-backwpup.php:234
677
+ #@ backwpup
678
+ msgid "- BackWPup DB restore script found in Blog root please delete it, for security!"
679
+ msgstr "- BackWPup DB-herstelprogramma gevonden in de blog-hoofdmap. Om beveiligingsredenen s.v.p. verwijderen!"
680
+
681
+ #: inc/class-page-backwpup.php:246
682
+ #, php-format
683
+ #@ backwpup
684
+ msgid "- SQL dumps '%s' found in Blog root please delete it, for security!"
685
+ msgstr "- SQL-dump(s) '%s' gevonden in blog-hoofdmap. Om beveiligingsredenen s.v.p. verwijderen!"
686
+
687
+ #: inc/class-page-settings.php:118
688
+ #@ backwpup
689
+ msgid "BackWPup Settings"
690
+ msgstr "BackWPup Instellingen"
691
+
692
+ #: inc/class-page-settings.php:144
693
+ #@ backwpup
694
+ msgid "Send Mail"
695
+ msgstr "Verzend email"
696
+
697
+ #: inc/class-page-settings.php:146
698
+ #@ backwpup
699
+ msgid "Here you can set the options for email sending. The settings will be used in jobs for sending backups via email or for sending log files."
700
+ msgstr "Opties voor verzending van backup- en logboek-files via email."
701
+
702
+ #: inc/class-page-settings.php:149
703
+ #@ backwpup
704
+ msgid "Sender email"
705
+ msgstr "Email afzender"
706
+
707
+ #: inc/class-page-settings.php:155
708
+ #@ backwpup
709
+ msgid "Sender name"
710
+ msgstr "Naam afzender"
711
+
712
+ #: inc/class-page-settings.php:164
713
+ #@ backwpup
714
+ msgid "Here you can set Logfile related options."
715
+ msgstr "Opties voor logboek-bestanden."
716
+
717
+ #: inc/class-page-settings.php:167
718
+ #@ backwpup
719
+ msgid "Log file Folder"
720
+ msgstr "Map logboek-bestanden"
721
+
722
+ #: inc/class-page-settings.php:173
723
+ #@ backwpup
724
+ msgid "Max. Log Files in Folder"
725
+ msgstr "Max. aantal logboek-bestanden in map"
726
+
727
+ #: inc/class-page-editjob-metaboxes.php:291
728
+ #: inc/class-page-settings.php:176
729
+ #@ backwpup
730
+ msgid "(Oldest files will deleted first.)"
731
+ msgstr "(Oudste bestanden worden het eerst verwijderd.)"
732
+
733
+ #: inc/class-page-settings.php:180
734
+ #: inc/class-page-settings.php:183
735
+ #@ backwpup
736
+ msgid "Compression"
737
+ msgstr "Compressie"
738
+
739
+ #: inc/class-page-settings.php:187
740
+ #@ backwpup
741
+ msgid "Gzip Log files!"
742
+ msgstr "Gzip logboek-bestanden!"
743
+
744
+ #: backwpup.php:219
745
+ #: inc/class-adminbar.php:36
746
+ #: inc/class-page-settings.php:192
747
+ #@ backwpup
748
+ msgid "Jobs"
749
+ msgstr "Taken"
750
+
751
+ #: inc/class-page-settings.php:194
752
+ #@ backwpup
753
+ msgid "Here you can set Job related options."
754
+ msgstr "Opties voor taken."
755
+
756
+ #: inc/class-page-settings.php:197
757
+ #: inc/class-page-settings.php:201
758
+ #@ backwpup
759
+ msgid "Alternate run noe job start"
760
+ msgstr "Alternatieve methode starten taak"
761
+
762
+ #: inc/class-page-settings.php:205
763
+ #@ backwpup
764
+ msgid "If problems with redirect on run now job start you can try this"
765
+ msgstr "Je kunt dit proberen bij problemen met starten van taken"
766
+
767
+ #: inc/class-page-settings.php:212
768
+ #@ backwpup
769
+ msgid "Where to store working data"
770
+ msgstr "Opslaan gegevens actieve taak in"
771
+
772
+ #: inc/class-page-settings.php:216
773
+ #@ backwpup
774
+ msgid "Database"
775
+ msgstr "Database"
776
+
777
+ #: inc/class-page-backups-table.php:212
778
+ #: inc/class-page-settings.php:217
779
+ #@ backwpup
780
+ msgid "File"
781
+ msgstr "Bestand"
782
+
783
+ #: inc/class-page-settings.php:219
784
+ #@ backwpup
785
+ msgid "(The data will stored every second if a job run!)"
786
+ msgstr "(Tijdens de uitvoering van een taak worden de gegevens elke seconde opgeslagen!)"
787
+
788
+ #: inc/class-page-settings.php:224
789
+ #@ backwpup
790
+ msgid "Max. Script Execution time"
791
+ msgstr "Max. uitvoeringstijd voor een script"
792
+
793
+ #: inc/class-page-settings.php:227
794
+ #@ backwpup
795
+ msgid "(0 = endless; Default. You can test the time under Tools. The job will be automatic restarted after this time.)"
796
+ msgstr "(0 = zonder begrenzing; Default. Je kunt de tijd testen bij Gereedschappen. De taak wordt na de ingestelde tijd automatisch gestart.)"
797
+
798
+ #: inc/class-page-settings.php:231
799
+ #@ backwpup
800
+ msgid "Max. retrys for job steps"
801
+ msgstr "Max. aantal pogingen voor een taakstap"
802
+
803
+ #: inc/class-page-settings.php:238
804
+ #@ backwpup
805
+ msgid "Max. retrys for job script retries"
806
+ msgstr "Max. aantal pogingen voor een taakscript"
807
+
808
+ #: inc/class-page-settings.php:245
809
+ #@ backwpup
810
+ msgid "Temp file Folder"
811
+ msgstr "Map voor tijdelijke bestanden"
812
+
813
+ #: inc/class-page-settings.php:252
814
+ #@ backwpup
815
+ msgid "Key for start jobs external with a URL"
816
+ msgstr "Sleutel om taken extern via een URL te starten"
817
+
818
+ #: inc/class-page-settings.php:256
819
+ #: inc/class-page-settings.php:309
820
+ #, php-format
821
+ #@ backwpup
822
+ msgid "A unique key is: %s"
823
+ msgstr "Een unieke sleutel is: %s"
824
+
825
+ #: inc/class-page-settings.php:257
826
+ #: inc/class-page-settings.php:310
827
+ #@ backwpup
828
+ msgid "(empty = deactivated. Will be used for, that nobody else can use the job start URLs.)"
829
+ msgstr "(leeg = gedeactiveerd. Een sleutel wordt gebruikt om te voorkomen dat iemand anders de taak kan starten via URL)"
830
+
831
+ #: inc/class-page-settings.php:262
832
+ #@ backwpup
833
+ msgid "WP Admin Bar"
834
+ msgstr "WP Admin Bar"
835
+
836
+ #: inc/class-page-settings.php:264
837
+ #@ backwpup
838
+ msgid "Will you see BackWPup in the WordPress Admin Bar?"
839
+ msgstr "Optie voor weergave BackWPup-icoon op de WordPress Admin Bar."
840
+
841
+ #: inc/class-page-settings.php:267
842
+ #: inc/class-page-settings.php:270
843
+ #@ backwpup
844
+ msgid "Admin Bar"
845
+ msgstr "Admin Bar"
846
+
847
+ #: inc/class-page-settings.php:273
848
+ #@ backwpup
849
+ msgid "Show BackWPup Links in Admin Bar."
850
+ msgstr "Toon BackWPup op de Admin Bar"
851
+
852
+ #: inc/class-page-settings.php:279
853
+ #@ backwpup
854
+ msgid "Http basic authentication"
855
+ msgstr "Http basis-verificatie"
856
+
857
+ #: inc/class-page-settings.php:281
858
+ #@ backwpup
859
+ msgid "Is your blog behind a http basic authentication (.htaccess)? Only then you must set the username and password for authentication to get jobs working."
860
+ msgstr "Een gebruikersnaam en wachtwoord zijn alleen noodzakelijk als de blog zich bevindt achter een http basis-aanmelding (.htaccess)."
861
+
862
+ #: inc/class-page-editjob-metaboxes.php:305
863
+ #: inc/class-page-editjob-metaboxes.php:442
864
+ #: inc/class-page-settings.php:284
865
+ #@ backwpup
866
+ msgid "Username:"
867
+ msgstr "Gebruikersnaam:"
868
+
869
+ #: inc/class-page-editjob-metaboxes.php:308
870
+ #: inc/class-page-editjob-metaboxes.php:511
871
+ #: inc/class-page-settings.php:290
872
+ #@ backwpup
873
+ msgid "Password:"
874
+ msgstr "Wachtwoord:"
875
+
876
+ #: inc/class-page-settings.php:295
877
+ #@ backwpup
878
+ msgid "Cron service of BackWPup.com"
879
+ msgstr "Cron service van BackWPup.com"
880
+
881
+ #: inc/class-page-settings.php:297
882
+ #@ backwpup
883
+ msgid "Use cron service of backwpup.com"
884
+ msgstr "Gebruik de cron-service van backwpup.com"
885
+
886
+ #: inc/class-page-settings.php:300
887
+ #: inc/class-page-settings.php:304
888
+ #@ backwpup
889
+ msgid "Key for cron service"
890
+ msgstr "Sleutel voor cron-service"
891
+
892
+ #: inc/class-page-settings.php:315
893
+ #@ backwpup
894
+ msgid "Terms of service"
895
+ msgstr "Algemene gebruiksvoorwaarden"
896
+
897
+ #: inc/class-page-settings.php:317
898
+ #@ backwpup
899
+ msgid "If you use this service in jobs, the schedule will submitted to api.backwpup.com. The api.backwpup.com will call the script to start the job directly. <em>Use this service only if you have not a cron service of your hoster, or a blog that has a few visitors.</em> The cron service can start a job behind a basic authentication (.htaccess), on that the http authentication data will transferred too! Please make a little donation for the plugin if you use this service. The service can be removed by me without a massage."
900
+ msgstr "Als je deze service in een taak gebruikt dan wordt de taakplanning verzonden naar api.backwpup.com. Api.backwpup.com zal het script aanroepen om de taak te starten. <em>Gebruik deze service alleen als je geen cron-service hebt van je provider of wanneer je blog weinig bezoekers heeft.</em> De cron-service kan een taak starten achter een http basis-aanmelding (.htaccess)! Doneer een klein bedrag als je deze service gebruikt. De service kan zonder aankondiging worden verwijderd."
901
+
902
+ #: inc/class-page-editjob-metaboxes.php:34
903
+ #@ backwpup
904
+ msgid "PHP curl functions not available! Most backup destinations deaktivated!"
905
+ msgstr "PHP curl-functies zijn niet beschikbaar! De meeste backup bestemmingen zijn uitgeschakeld!"
906
+
907
+ #: inc/class-page-editjob-metaboxes.php:41
908
+ #@ backwpup
909
+ msgid ""
910
+ "You are about to delete this Job. \n"
911
+ " 'Cancel' to stop, 'OK' to delete."
912
+ msgstr ""
913
+ "Je staat op het punt om deze taak te verwijderen. \n"
914
+ " 'Annuleer' om te stoppen, 'OK' om te verwijderen."
915
+
916
+ #: inc/class-page-editjob-metaboxes.php:44
917
+ #: inc/class-page-settings.php:324
918
+ #@ backwpup
919
+ msgid "Save Changes"
920
+ msgstr "Wijzigingen opslaan"
921
+
922
+ #: inc/class-page-editjob-metaboxes.php:55
923
+ #@ backwpup
924
+ msgid "Backup type:"
925
+ msgstr "Backup-type:"
926
+
927
+ #: inc/class-page-editjob-metaboxes.php:57
928
+ #@ backwpup
929
+ msgid "Sync files with destination"
930
+ msgstr "Synchroniseer bestanden met bestemming"
931
+
932
+ #: inc/class-page-editjob-metaboxes.php:58
933
+ #@ backwpup
934
+ msgid "Create backup archive"
935
+ msgstr "Maak backup-bestand"
936
+
937
+ #: inc/class-page-editjob-metaboxes.php:61
938
+ #@ backwpup
939
+ msgid "File Prefix:"
940
+ msgstr "Bestandsnaam:"
941
+
942
+ #: inc/class-page-editjob-metaboxes.php:63
943
+ #@ backwpup
944
+ msgid "File Formart:"
945
+ msgstr "Bestandsindeling:"
946
+
947
+ #: inc/class-page-editjob-metaboxes.php:66
948
+ #: inc/class-page-editjob-metaboxes.php:68
949
+ #@ backwpup
950
+ msgid "Zip"
951
+ msgstr "Zip"
952
+
953
+ #: inc/class-page-editjob-metaboxes.php:69
954
+ #@ backwpup
955
+ msgid "Tar"
956
+ msgstr "Tar"
957
+
958
+ #: inc/class-page-editjob-metaboxes.php:71
959
+ #: inc/class-page-editjob-metaboxes.php:73
960
+ #@ backwpup
961
+ msgid "Tar GZip"
962
+ msgstr "Tar GZip"
963
+
964
+ #: inc/class-page-editjob-metaboxes.php:75
965
+ #: inc/class-page-editjob-metaboxes.php:77
966
+ #@ backwpup
967
+ msgid "Tar BZip2"
968
+ msgstr "Tar BZip2"
969
+
970
+ #: inc/class-page-editjob-metaboxes.php:78
971
+ #@ backwpup
972
+ msgid "Preview:"
973
+ msgstr "Voorbeeld:"
974
+
975
+ #: inc/class-page-editjob-metaboxes.php:86
976
+ #@ backwpup
977
+ msgid "E-Mail-Adress:"
978
+ msgstr "Email-adres:"
979
+
980
+ #: inc/class-page-editjob-metaboxes.php:90
981
+ #@ backwpup
982
+ msgid "Only send an e-mail if there are errors."
983
+ msgstr "Verstuur e-mail alleen bij fouten"
984
+
985
+ #: inc/class-page-editjob-metaboxes.php:95
986
+ #@ backwpup
987
+ msgid "Run job with:"
988
+ msgstr "Start taak:"
989
+
990
+ #: inc/class-page-editjob-metaboxes.php:96
991
+ #@ backwpup
992
+ msgid "Manually"
993
+ msgstr "Handmatig"
994
+
995
+ #: inc/class-page-editjob-metaboxes.php:97
996
+ #@ backwpup
997
+ msgid "WordPress Cron"
998
+ msgstr "WordPress Cron"
999
+
1000
+ #: inc/class-page-editjob-metaboxes.php:101
1001
+ #@ backwpup
1002
+ msgid "BackWPup external cron service"
1003
+ msgstr "BackWPup externe cron service"
1004
+
1005
+ #: inc/class-page-editjob-metaboxes.php:131
1006
+ #@ backwpup
1007
+ msgid "advanced"
1008
+ msgstr "geavanceerd"
1009
+
1010
+ #: inc/class-page-editjob-metaboxes.php:132
1011
+ #@ backwpup
1012
+ msgid "basic"
1013
+ msgstr "standaard"
1014
+
1015
+ #: inc/class-page-editjob-metaboxes.php:136
1016
+ #@ backwpup
1017
+ msgid "Minutes: "
1018
+ msgstr "Minuten:"
1019
+
1020
+ #: inc/class-page-editjob-metaboxes.php:138
1021
+ #: inc/class-page-editjob-metaboxes.php:151
1022
+ #: inc/class-page-editjob-metaboxes.php:162
1023
+ #: inc/class-page-editjob-metaboxes.php:176
1024
+ #: inc/class-page-editjob-metaboxes.php:198
1025
+ #@ backwpup
1026
+ msgid "Any (*)"
1027
+ msgstr "Elke (*)"
1028
+
1029
+ #: inc/class-page-editjob-metaboxes.php:148
1030
+ #@ backwpup
1031
+ msgid "Hours:"
1032
+ msgstr "Uren:"
1033
+
1034
+ #: inc/class-page-editjob-metaboxes.php:161
1035
+ #@ backwpup
1036
+ msgid "Day of Month:"
1037
+ msgstr "Dag van de maand:"
1038
+
1039
+ #: inc/class-page-editjob-metaboxes.php:174
1040
+ #@ backwpup
1041
+ msgid "Month:"
1042
+ msgstr "Maand:"
1043
+
1044
+ #: inc/class-page-editjob-metaboxes.php:180
1045
+ #@ backwpup
1046
+ msgid "January"
1047
+ msgstr "januari"
1048
+
1049
+ #: inc/class-page-editjob-metaboxes.php:181
1050
+ #@ backwpup
1051
+ msgid "February"
1052
+ msgstr "februari"
1053
+
1054
+ #: inc/class-page-editjob-metaboxes.php:182
1055
+ #@ backwpup
1056
+ msgid "March"
1057
+ msgstr "maart"
1058
+
1059
+ #: inc/class-page-editjob-metaboxes.php:183
1060
+ #@ backwpup
1061
+ msgid "April"
1062
+ msgstr "april"
1063
+
1064
+ #: inc/class-page-editjob-metaboxes.php:184
1065
+ #@ backwpup
1066
+ msgid "May"
1067
+ msgstr "mei"
1068
+
1069
+ #: inc/class-page-editjob-metaboxes.php:185
1070
+ #@ backwpup
1071
+ msgid "June"
1072
+ msgstr "juni"
1073
+
1074
+ #: inc/class-page-editjob-metaboxes.php:186
1075
+ #@ backwpup
1076
+ msgid "July"
1077
+ msgstr "juli"
1078
+
1079
+ #: inc/class-page-editjob-metaboxes.php:187
1080
+ #@ backwpup
1081
+ msgid "Augest"
1082
+ msgstr "augustus"
1083
+
1084
+ #: inc/class-page-editjob-metaboxes.php:188
1085
+ #@ backwpup
1086
+ msgid "September"
1087
+ msgstr "september"
1088
+
1089
+ #: inc/class-page-editjob-metaboxes.php:189
1090
+ #@ backwpup
1091
+ msgid "October"
1092
+ msgstr "oktober"
1093
+
1094
+ #: inc/class-page-editjob-metaboxes.php:190
1095
+ #@ backwpup
1096
+ msgid "November"
1097
+ msgstr "november"
1098
+
1099
+ #: inc/class-page-editjob-metaboxes.php:191
1100
+ #@ backwpup
1101
+ msgid "December"
1102
+ msgstr "december"
1103
+
1104
+ #: inc/class-page-editjob-metaboxes.php:196
1105
+ #@ backwpup
1106
+ msgid "Day of Week:"
1107
+ msgstr "Weekdag:"
1108
+
1109
+ #: inc/class-page-editjob-metaboxes.php:202
1110
+ #: inc/class-page-editjob-metaboxes.php:244
1111
+ #@ backwpup
1112
+ msgid "Sunday"
1113
+ msgstr "zondag"
1114
+
1115
+ #: inc/class-page-editjob-metaboxes.php:203
1116
+ #: inc/class-page-editjob-metaboxes.php:245
1117
+ #@ backwpup
1118
+ msgid "Monday"
1119
+ msgstr "maandag"
1120
+
1121
+ #: inc/class-page-editjob-metaboxes.php:204
1122
+ #: inc/class-page-editjob-metaboxes.php:246
1123
+ #@ backwpup
1124
+ msgid "Tuesday"
1125
+ msgstr "dinsdag"
1126
+
1127
+ #: inc/class-page-editjob-metaboxes.php:205
1128
+ #: inc/class-page-editjob-metaboxes.php:247
1129
+ #@ backwpup
1130
+ msgid "Wednesday"
1131
+ msgstr "woensdag"
1132
+
1133
+ #: inc/class-page-editjob-metaboxes.php:206
1134
+ #: inc/class-page-editjob-metaboxes.php:248
1135
+ #@ backwpup
1136
+ msgid "Thursday"
1137
+ msgstr "donderdag"
1138
+
1139
+ #: inc/class-page-editjob-metaboxes.php:207
1140
+ #: inc/class-page-editjob-metaboxes.php:249
1141
+ #@ backwpup
1142
+ msgid "Friday"
1143
+ msgstr "vrijdag"
1144
+
1145
+ #: inc/class-page-editjob-metaboxes.php:208
1146
+ #: inc/class-page-editjob-metaboxes.php:250
1147
+ #@ backwpup
1148
+ msgid "Saturday"
1149
+ msgstr "zaterdag"
1150
+
1151
+ #: inc/class-page-editjob-metaboxes.php:223
1152
+ #@ backwpup
1153
+ msgid "Hour"
1154
+ msgstr "Uur"
1155
+
1156
+ #: inc/class-page-editjob-metaboxes.php:226
1157
+ #@ backwpup
1158
+ msgid "Minute"
1159
+ msgstr "Minuut"
1160
+
1161
+ #: inc/class-page-editjob-metaboxes.php:230
1162
+ #@ backwpup
1163
+ msgid "monthly"
1164
+ msgstr "elke maand"
1165
+
1166
+ #: inc/class-page-editjob-metaboxes.php:232
1167
+ #@ backwpup
1168
+ msgid "on"
1169
+ msgstr "op"
1170
+
1171
+ #: inc/class-page-editjob-metaboxes.php:242
1172
+ #@ backwpup
1173
+ msgid "weekly"
1174
+ msgstr "elke week"
1175
+
1176
+ #: inc/class-page-editjob-metaboxes.php:260
1177
+ #@ backwpup
1178
+ msgid "daily"
1179
+ msgstr "elke dag"
1180
+
1181
+ #: inc/class-page-editjob-metaboxes.php:270
1182
+ #@ backwpup
1183
+ msgid "hourly"
1184
+ msgstr "elk uur"
1185
+
1186
+ #: inc/class-page-editjob-metaboxes.php:285
1187
+ #@ backwpup
1188
+ msgid "Full Path to folder for Backup Files:"
1189
+ msgstr "Volledig pad naar de bacukup-map:"
1190
+
1191
+ #: inc/class-page-editjob-metaboxes.php:288
1192
+ #@ backwpup
1193
+ msgid "Your WordPress dir is:"
1194
+ msgstr "Uw Wordpress-directory is:"
1195
+
1196
+ #: inc/class-page-editjob-metaboxes.php:290
1197
+ #: inc/class-page-editjob-metaboxes.php:521
1198
+ #@ backwpup
1199
+ msgid "Max. backup files in folder:"
1200
+ msgstr "Max. aantal backup-bestanden in map:"
1201
+
1202
+ #: inc/class-page-editjob-metaboxes.php:292
1203
+ #: inc/class-page-editjob-metaboxes.php:316
1204
+ #: inc/class-page-editjob-metaboxes.php:358
1205
+ #: inc/class-page-editjob-metaboxes.php:394
1206
+ #: inc/class-page-editjob-metaboxes.php:428
1207
+ #: inc/class-page-editjob-metaboxes.php:457
1208
+ #: inc/class-page-editjob-metaboxes.php:495
1209
+ #: inc/class-page-editjob-metaboxes.php:523
1210
+ #@ backwpup
1211
+ msgid "Do not delete files on sync destination!"
1212
+ msgstr "Verwijder geen bestanden op de synchronisatiebestemming!"
1213
+
1214
+ #: inc/class-page-editjob-metaboxes.php:299
1215
+ #@ backwpup
1216
+ msgid "Hostname:"
1217
+ msgstr "Hostnaam:"
1218
+
1219
+ #: inc/class-page-editjob-metaboxes.php:302
1220
+ #@ backwpup
1221
+ msgid "Port:"
1222
+ msgstr "Poort:"
1223
+
1224
+ #: inc/class-page-editjob-metaboxes.php:311
1225
+ #@ backwpup
1226
+ msgid "Folder on Server:"
1227
+ msgstr "Map op de server:"
1228
+
1229
+ #: inc/class-page-editjob-metaboxes.php:314
1230
+ #@ backwpup
1231
+ msgid "Max. backup files in FTP folder:"
1232
+ msgstr "Max. aantal backup-bestanden in FTP-map:"
1233
+
1234
+ #: inc/class-page-editjob-metaboxes.php:315
1235
+ #: inc/class-page-editjob-metaboxes.php:357
1236
+ #: inc/class-page-editjob-metaboxes.php:393
1237
+ #: inc/class-page-editjob-metaboxes.php:427
1238
+ #: inc/class-page-editjob-metaboxes.php:456
1239
+ #: inc/class-page-editjob-metaboxes.php:494
1240
+ #: inc/class-page-editjob-metaboxes.php:522
1241
+ #@ backwpup
1242
+ msgid "(Oldest files will be deleted first.)"
1243
+ msgstr "(Oudste bestanden worden het eerst verwijderd.)"
1244
+
1245
+ #: inc/class-page-editjob-metaboxes.php:318
1246
+ #@ backwpup
1247
+ msgid "Timeout for FTP connection:"
1248
+ msgstr "Timeout van FTP-verbinding:"
1249
+
1250
+ #: inc/class-page-editjob-metaboxes.php:321
1251
+ #@ backwpup
1252
+ msgid "Use SSL-FTP Connection."
1253
+ msgstr "Gebruik SSL FTP-verbinding:"
1254
+
1255
+ #: inc/class-page-editjob-metaboxes.php:323
1256
+ #@ backwpup
1257
+ msgid "Use FTP Passiv mode."
1258
+ msgstr "Gebruik FTP passiv mode."
1259
+
1260
+ #: inc/class-page-editjob-metaboxes.php:331
1261
+ #@ backwpup
1262
+ msgid "Access Key ID:"
1263
+ msgstr "Toeganssleutel ID:"
1264
+
1265
+ #: inc/class-page-editjob-metaboxes.php:333
1266
+ #@ backwpup
1267
+ msgid "Secret Access Key:"
1268
+ msgstr "Geheime toegangssleutel:"
1269
+
1270
+ #: inc/class-page-editjob-metaboxes.php:335
1271
+ #: inc/class-page-editjob-metaboxes.php:383
1272
+ #@ backwpup
1273
+ msgid "Bucket:"
1274
+ msgstr "Bucket:"
1275
+
1276
+ #: inc/class-page-editjob-metaboxes.php:341
1277
+ #: inc/class-page-editjob-metaboxes.php:388
1278
+ #@ backwpup
1279
+ msgid "Create bucket:"
1280
+ msgstr "Maak bucket:"
1281
+
1282
+ #: inc/class-page-editjob-metaboxes.php:343
1283
+ #@ backwpup
1284
+ msgid "Bucket Region"
1285
+ msgstr "Bucket regio"
1286
+
1287
+ #: inc/class-page-editjob-metaboxes.php:344
1288
+ #@ backwpup
1289
+ msgid "US-Standard (Northern Virginia & Washington State)"
1290
+ msgstr "US-Standard (Northern Virginia & Washington State)"
1291
+
1292
+ #: inc/class-page-editjob-metaboxes.php:345
1293
+ #@ backwpup
1294
+ msgid "US-West 1 (Northern California)"
1295
+ msgstr "US-West 1 (Northern California)"
1296
+
1297
+ #: inc/class-page-editjob-metaboxes.php:346
1298
+ #@ backwpup
1299
+ msgid "US-West 2 (Oregon)"
1300
+ msgstr "US-West 2 (Oregon)"
1301
+
1302
+ #: inc/class-page-editjob-metaboxes.php:347
1303
+ #@ backwpup
1304
+ msgid "EU (Ireland)"
1305
+ msgstr "EU (Ireland)"
1306
+
1307
+ #: inc/class-page-editjob-metaboxes.php:348
1308
+ #@ backwpup
1309
+ msgid "Asia Pacific (Singapore)"
1310
+ msgstr "Asia Pacific (Singapore)"
1311
+
1312
+ #: inc/class-page-editjob-metaboxes.php:349
1313
+ #@ backwpup
1314
+ msgid "Asia Pacific (Japan)"
1315
+ msgstr "Asia Pacific (Japan)"
1316
+
1317
+ #: inc/class-page-editjob-metaboxes.php:350
1318
+ #@ backwpup
1319
+ msgid "South America (Sao Paulo)"
1320
+ msgstr "South America (Sao Paulo)"
1321
+
1322
+ #: inc/class-page-editjob-metaboxes.php:351
1323
+ #@ backwpup
1324
+ msgid "United States GovCloud"
1325
+ msgstr "United States GovCloud"
1326
+
1327
+ #: inc/class-page-editjob-metaboxes.php:352
1328
+ #@ backwpup
1329
+ msgid "United States GovCloud FIPS 140-2"
1330
+ msgstr "United States GovCloud FIPS 140-2"
1331
+
1332
+ #: inc/class-page-editjob-metaboxes.php:354
1333
+ #: inc/class-page-editjob-metaboxes.php:390
1334
+ #@ backwpup
1335
+ msgid "Folder in bucket:"
1336
+ msgstr "Map in bucket:"
1337
+
1338
+ #: inc/class-page-editjob-metaboxes.php:356
1339
+ #: inc/class-page-editjob-metaboxes.php:392
1340
+ #@ backwpup
1341
+ msgid "Max. backup files in bucket folder:"
1342
+ msgstr "Max. aantal backup-bestanden in bucket-map:"
1343
+
1344
+ #: inc/class-page-editjob-metaboxes.php:360
1345
+ #@ backwpup
1346
+ msgid "Save Files with reduced redundancy!"
1347
+ msgstr "Bestanden opslaan met gereduceerde redundantie!"
1348
+
1349
+ #: inc/class-page-editjob-metaboxes.php:362
1350
+ #@ backwpup
1351
+ msgid "Save Files Server Side Encrypted!"
1352
+ msgstr "Bestanden op de server versleuteld opslaan!"
1353
+
1354
+ #: inc/class-page-editjob-metaboxes.php:364
1355
+ #@ backwpup
1356
+ msgid "Disable SSL connection on transfer!"
1357
+ msgstr "Schakel SSL-verbinding uit tijdens verzending!"
1358
+
1359
+ #: inc/class-page-editjob-metaboxes.php:368
1360
+ #: inc/class-page-editjob-metaboxes.php:398
1361
+ #: inc/class-page-editjob-metaboxes.php:432
1362
+ #: inc/class-page-editjob-metaboxes.php:461
1363
+ #: inc/class-page-editjob-metaboxes.php:499
1364
+ #: inc/class-page-editjob-metaboxes.php:527
1365
+ #@ backwpup
1366
+ msgid "Create Account"
1367
+ msgstr "Maak account"
1368
+
1369
+ #: inc/class-page-editjob-metaboxes.php:369
1370
+ #: inc/class-page-editjob-metaboxes.php:399
1371
+ #@ backwpup
1372
+ msgid "Find Keys"
1373
+ msgstr "Zoek sleutels"
1374
+
1375
+ #: inc/class-page-editjob-metaboxes.php:370
1376
+ #: inc/class-page-editjob-metaboxes.php:400
1377
+ #: inc/class-page-editjob-metaboxes.php:463
1378
+ #: inc/class-page-editjob-metaboxes.php:500
1379
+ #: inc/class-page-editjob-metaboxes.php:528
1380
+ #@ backwpup
1381
+ msgid "Webinterface"
1382
+ msgstr "Webinterface"
1383
+
1384
+ #: inc/class-page-editjob-metaboxes.php:379
1385
+ #: inc/class-page-editjob-metaboxes.php:414
1386
+ #@ backwpup
1387
+ msgid "Access Key:"
1388
+ msgstr "Toegangsleutel:"
1389
+
1390
+ #: inc/class-page-editjob-metaboxes.php:381
1391
+ #@ backwpup
1392
+ msgid "Secret:"
1393
+ msgstr "Geheim"
1394
+
1395
+ #: inc/class-page-editjob-metaboxes.php:388
1396
+ #@ backwpup
1397
+ msgid "Please create it in Webinterface!"
1398
+ msgstr " s.v.p. in webinterface aanmaken!"
1399
+
1400
+ #: inc/class-page-editjob-metaboxes.php:410
1401
+ #@ backwpup
1402
+ msgid "Host:"
1403
+ msgstr "Host:"
1404
+
1405
+ #: inc/class-page-editjob-metaboxes.php:411
1406
+ #@ backwpup
1407
+ msgid "Normely: blob.core.windows.net"
1408
+ msgstr "Normaal: blob.core.windows.net"
1409
+
1410
+ #: inc/class-page-editjob-metaboxes.php:412
1411
+ #@ backwpup
1412
+ msgid "Account Name:"
1413
+ msgstr "Accountnaam:"
1414
+
1415
+ #: inc/class-page-editjob-metaboxes.php:416
1416
+ #: inc/class-page-editjob-metaboxes.php:446
1417
+ #@ backwpup
1418
+ msgid "Container:"
1419
+ msgstr "Container:"
1420
+
1421
+ #: inc/class-page-editjob-metaboxes.php:422
1422
+ #: inc/class-page-editjob-metaboxes.php:451
1423
+ #@ backwpup
1424
+ msgid "Create Container:"
1425
+ msgstr "Maak container:"
1426
+
1427
+ #: inc/class-page-editjob-metaboxes.php:424
1428
+ #@ backwpup
1429
+ msgid "Folder in Container:"
1430
+ msgstr "Map in container:"
1431
+
1432
+ #: inc/class-page-editjob-metaboxes.php:426
1433
+ #: inc/class-page-editjob-metaboxes.php:455
1434
+ #@ backwpup
1435
+ msgid "Max. backup files in container folder:"
1436
+ msgstr "Max. aantal backup-bestanden in container-map:"
1437
+
1438
+ #: inc/class-page-editjob-metaboxes.php:433
1439
+ #: inc/class-page-editjob-metaboxes.php:462
1440
+ #@ backwpup
1441
+ msgid "Find Key"
1442
+ msgstr "Zoek sleutel"
1443
+
1444
+ #: inc/class-page-editjob-metaboxes.php:444
1445
+ #@ backwpup
1446
+ msgid "API Key:"
1447
+ msgstr "API-sleutel:"
1448
+
1449
+ #: inc/class-page-editjob-metaboxes.php:453
1450
+ #@ backwpup
1451
+ msgid "Folder in container:"
1452
+ msgstr "Map in container"
1453
+
1454
+ #: inc/class-page-editjob-metaboxes.php:473
1455
+ #: inc/class-page-editjob-metaboxes.php:484
1456
+ #: inc/class-page-editjob-metaboxes.php:513
1457
+ #@ backwpup
1458
+ msgid "Root:"
1459
+ msgstr "Hoofdmap:"
1460
+
1461
+ #: inc/class-page-editjob-metaboxes.php:475
1462
+ #: inc/class-page-editjob-metaboxes.php:484
1463
+ #@ backwpup
1464
+ msgid "Sandbox (App folder)"
1465
+ msgstr "Sandbox (App map)"
1466
+
1467
+ #: inc/class-page-editjob-metaboxes.php:476
1468
+ #: inc/class-page-editjob-metaboxes.php:484
1469
+ #@ backwpup
1470
+ msgid "DropBox (full DropBox)"
1471
+ msgstr "DropBox (volledige DropBox)"
1472
+
1473
+ #: inc/class-page-editjob-metaboxes.php:478
1474
+ #: inc/class-page-editjob-metaboxes.php:486
1475
+ #@ backwpup
1476
+ msgid "Login:"
1477
+ msgstr "Login:"
1478
+
1479
+ #: inc/class-page-editjob-metaboxes.php:479
1480
+ #@ backwpup
1481
+ msgid "Not authenticated!"
1482
+ msgstr "Niet aangemeld!"
1483
+
1484
+ #: inc/class-page-editjob-metaboxes.php:480
1485
+ #: inc/class-page-editjob.php:351
1486
+ #@ backwpup
1487
+ msgid "DropBox authenticate!"
1488
+ msgstr "Aanmelden bij DropBox!"
1489
+
1490
+ #: inc/class-page-editjob-metaboxes.php:487
1491
+ #@ backwpup
1492
+ msgid "Authenticated!"
1493
+ msgstr "Aangemeld!"
1494
+
1495
+ #: inc/class-page-editjob-metaboxes.php:488
1496
+ #: inc/class-page-editjob.php:344
1497
+ #@ backwpup
1498
+ msgid "Delete DropBox authentication!"
1499
+ msgstr "Afmelden bij DropBox!"
1500
+
1501
+ #: inc/class-page-editjob-metaboxes.php:491
1502
+ #: inc/class-page-editjob-metaboxes.php:519
1503
+ #@ backwpup
1504
+ msgid "Folder:"
1505
+ msgstr "Map:"
1506
+
1507
+ #: inc/class-page-editjob-metaboxes.php:493
1508
+ #@ backwpup
1509
+ msgid "Max. backup files in DropBox folder:"
1510
+ msgstr "Max. aantal backup-bestanden in DropBox-map:"
1511
+
1512
+ #: inc/class-page-editjob-metaboxes.php:509
1513
+ #: inc/class-page-editjob-metaboxes.php:536
1514
+ #@ backwpup
1515
+ msgid "E-mail address:"
1516
+ msgstr "Email adres:"
1517
+
1518
+ #: inc/class-page-editjob-metaboxes.php:539
1519
+ #@ backwpup
1520
+ msgid "Max. File Size for sending Backups with mail:"
1521
+ msgstr "Max. grootte backup-bestand bij verzending via email:"
1522
+
1523
+ #: inc/class-page-editjob.php:442
1524
+ #@ backwpup
1525
+ msgid "Job Type"
1526
+ msgstr "Taaktype"
1527
+
1528
+ #: inc/class-page-editjob.php:443
1529
+ #@ backwpup
1530
+ msgid "Job Schedule"
1531
+ msgstr "Planning taak"
1532
+
1533
+ #: inc/class-page-editjob.php:456
1534
+ #@ backwpup
1535
+ msgid "BackWPup Job Settings"
1536
+ msgstr "BackWpup Taakinstellingen"
1537
+
1538
+ #: inc/class-page-editjob.php:481
1539
+ #@ backwpup
1540
+ msgid "Enter Job name here"
1541
+ msgstr "Type hier de taaknaam"
1542
+
1543
+ #: inc/class-page-editjob.php:490
1544
+ #@ backwpup
1545
+ msgid "External start link:"
1546
+ msgstr "Link voor externe activering:"
1547
+
1548
+ #: inc/class-page-editjob.php:494
1549
+ #@ backwpup
1550
+ msgid "Commandline start:"
1551
+ msgstr "Commandoregel:"
1552
+
1553
+ #: inc/class-page-editjob.php:504
1554
+ #@ backwpup
1555
+ msgid "Database Jobs"
1556
+ msgstr "Database taken"
1557
+
1558
+ #: inc/class-page-editjob.php:508
1559
+ #@ backwpup
1560
+ msgid "Database tables for use:"
1561
+ msgstr "Selecteer database-tabellen:"
1562
+
1563
+ #: inc/class-page-editjob.php:520
1564
+ #@ backwpup
1565
+ msgid "Filename for Dump:"
1566
+ msgstr "Bestandsnaam voor sql-dump"
1567
+
1568
+ #: inc/class-page-editjob.php:521
1569
+ #@ backwpup
1570
+ msgid "Copmpression for dump:"
1571
+ msgstr "Compressie van dump:"
1572
+
1573
+ #: inc/class-dashboard.php:47
1574
+ #: inc/class-dashboard.php:79
1575
+ #: inc/class-page-editjob.php:523
1576
+ #: inc/class-page-editjob.php:547
1577
+ #@ backwpup
1578
+ msgid "none"
1579
+ msgstr "geen"
1580
+
1581
+ #: inc/class-page-editjob.php:525
1582
+ #: inc/class-page-editjob.php:527
1583
+ #: inc/class-page-editjob.php:549
1584
+ #: inc/class-page-editjob.php:551
1585
+ #@ backwpup
1586
+ msgid "GZip"
1587
+ msgstr "GZip"
1588
+
1589
+ #: inc/class-page-editjob.php:529
1590
+ #: inc/class-page-editjob.php:531
1591
+ #: inc/class-page-editjob.php:553
1592
+ #: inc/class-page-editjob.php:555
1593
+ #@ backwpup
1594
+ msgid "BZip2"
1595
+ msgstr "BZip2"
1596
+
1597
+ #: inc/class-page-editjob.php:534
1598
+ #@ backwpup
1599
+ msgid "Set Blog Maintenance Mode on Database Operations"
1600
+ msgstr "Zet blog in onderhoudsmodus tijdens databasebewerkingen"
1601
+
1602
+ #: inc/class-page-editjob.php:540
1603
+ #@ backwpup
1604
+ msgid "Wordpress Export"
1605
+ msgstr "Wordpress export"
1606
+
1607
+ #: inc/class-page-editjob.php:565
1608
+ #: inc/functions.php:366
1609
+ #@ backwpup
1610
+ msgid "File Backup"
1611
+ msgstr "Backup bestanden"
1612
+
1613
+ #: inc/class-page-editjob.php:568
1614
+ #@ backwpup
1615
+ msgid "Blog Folders to Backup:"
1616
+ msgstr "Te backuppen blogmappen:"
1617
+
1618
+ #: inc/class-page-editjob.php:572
1619
+ #@ backwpup
1620
+ msgid "root"
1621
+ msgstr "root (hoofdmap)"
1622
+
1623
+ #: inc/class-page-editjob.php:577
1624
+ #: inc/class-page-editjob.php:595
1625
+ #: inc/class-page-editjob.php:613
1626
+ #: inc/class-page-editjob.php:631
1627
+ #: inc/class-page-editjob.php:649
1628
+ #@ backwpup
1629
+ msgid "Exclude:"
1630
+ msgstr "Uitsluiten:"
1631
+
1632
+ #: inc/class-page-editjob.php:590
1633
+ #@ backwpup
1634
+ msgid "Content"
1635
+ msgstr "Inhoud"
1636
+
1637
+ #: inc/class-page-editjob.php:608
1638
+ #@ backwpup
1639
+ msgid "Plugins"
1640
+ msgstr "Plugins"
1641
+
1642
+ #: inc/class-page-editjob.php:626
1643
+ #@ backwpup
1644
+ msgid "Themes"
1645
+ msgstr "Thema's"
1646
+
1647
+ #: inc/class-page-editjob.php:644
1648
+ #@ backwpup
1649
+ msgid "Blog uploads"
1650
+ msgstr "Blog-uploads"
1651
+
1652
+ #: inc/class-page-editjob.php:662
1653
+ #@ backwpup
1654
+ msgid "Don't backup thumbnails in blog uploads folder"
1655
+ msgstr "Thumbnails uit de blog-uploadmap niet meenemen in backup"
1656
+
1657
+ #: inc/class-page-editjob.php:664
1658
+ #@ backwpup
1659
+ msgid "Backup wp-config.php, robots.txt, .htaccess, .htpasswd and favicon.ico form root if it not selected"
1660
+ msgstr "Bestanden wp-config.php, robots.txt, .htaccess, .htpasswd and favicon.ico uit hoofdmap niet meenemen in backup"
1661
+
1662
+ #: inc/class-page-editjob.php:666
1663
+ #@ backwpup
1664
+ msgid "Include folders to backup:"
1665
+ msgstr "Backupmappen:"
1666
+
1667
+ #: inc/class-page-editjob.php:667
1668
+ #: inc/class-page-editjob.php:671
1669
+ #@ backwpup
1670
+ msgid "Example:"
1671
+ msgstr "Voorbeeld:"
1672
+
1673
+ #: inc/class-page-editjob.php:670
1674
+ #@ backwpup
1675
+ msgid "Exclude files/folders from backup:"
1676
+ msgstr "Bestanden/mappen uitsluiten van backup:"
1677
+
1678
+ #: inc/class-page-editjob.php:29
1679
+ #@ backwpup
1680
+ msgid "Dropbox authentication complete!"
1681
+ msgstr "Dropbox aanmelding gelukt!"
1682
+
1683
+ #: inc/class-page-editjob.php:31
1684
+ #@ backwpup
1685
+ msgid "Wrong Token for DropBox authentication received!"
1686
+ msgstr "Onjuist token voor Dropbox aanmelding ontvangen!"
1687
+
1688
+ #: inc/class-page-editjob.php:34
1689
+ #@ backwpup
1690
+ msgid "No DropBox authentication received!"
1691
+ msgstr "Geen Dropbox aanmelding ontvangen!"
1692
+
1693
+ #: inc/class-page-editjob.php:305
1694
+ #, php-format
1695
+ #@ backwpup
1696
+ msgid "S3 bucket \"%s\" created."
1697
+ msgstr "S3 bucket \"%s\" aangemaakt."
1698
+
1699
+ #: inc/class-page-editjob.php:308
1700
+ #: inc/class-page-editjob.php:311
1701
+ #, php-format
1702
+ #@ backwpup
1703
+ msgid "S3 bucket create: %s"
1704
+ msgstr "S3 bucket maken: %s"
1705
+
1706
+ #: inc/class-page-editjob.php:321
1707
+ #, php-format
1708
+ #@ backwpup
1709
+ msgid "MS azure container \"%s\" created."
1710
+ msgstr "MS azure container \"%s\" aangemaakt."
1711
+
1712
+ #: inc/class-page-editjob.php:324
1713
+ #, php-format
1714
+ #@ backwpup
1715
+ msgid "MS azure container create: %s"
1716
+ msgstr "MS azure container maken: %s"
1717
+
1718
+ #: inc/class-page-editjob.php:336
1719
+ #, php-format
1720
+ #@ backwpup
1721
+ msgid "Rackspase Cloud container \"%s\" created."
1722
+ msgstr "Rackspase Cloud container \"%s\" aangemaakt."
1723
+
1724
+ #: inc/class-page-editjob.php:339
1725
+ #, php-format
1726
+ #@ backwpup
1727
+ msgid "Rackspase Cloud container create: %s"
1728
+ msgstr "Rackspase Cloud container maken: %s"
1729
+
1730
+ #: inc/class-page-editjob.php:347
1731
+ #@ backwpup
1732
+ msgid "Dropbox authentication deleted!"
1733
+ msgstr "Dropbox aanmelding verwijderd!"
1734
+
1735
+ #: inc/class-page-editjob.php:367
1736
+ #, php-format
1737
+ #@ backwpup
1738
+ msgid "Job '%1' changes saved."
1739
+ msgstr "Wijzigingen taak '%1' opgeslagen."
1740
+
1741
+ #: inc/class-page-editjob.php:367
1742
+ #@ backwpup
1743
+ msgid "Jobs overview"
1744
+ msgstr "Taakoverzicht"
1745
+
1746
+ #: inc/class-page-editjob.php:373
1747
+ #@ backwpup
1748
+ msgid "Backup File"
1749
+ msgstr "Backup-bestand"
1750
+
1751
+ #: inc/class-page-editjob.php:374
1752
+ #@ backwpup
1753
+ msgid "Send log"
1754
+ msgstr "Verzend logboek"
1755
+
1756
+ #: inc/class-page-editjob.php:376
1757
+ #@ backwpup
1758
+ msgid "Backup to Folder"
1759
+ msgstr "Backup naar map"
1760
+
1761
+ #: inc/class-page-editjob.php:378
1762
+ #@ backwpup
1763
+ msgid "Backup to E-Mail"
1764
+ msgstr "Backup naar email"
1765
+
1766
+ #: inc/class-page-editjob.php:380
1767
+ #@ backwpup
1768
+ msgid "Backup to FTP Server"
1769
+ msgstr "Backup naar FTP-server"
1770
+
1771
+ #: inc/class-page-editjob.php:382
1772
+ #@ backwpup
1773
+ msgid "Backup to Dropbox"
1774
+ msgstr "Backup naar Dropbox"
1775
+
1776
+ #: inc/class-page-editjob.php:384
1777
+ #@ backwpup
1778
+ msgid "Backup to SugarSync"
1779
+ msgstr "Backup naar SugarSync"
1780
+
1781
+ #: inc/class-page-editjob.php:386
1782
+ #@ backwpup
1783
+ msgid "Backup to Amazon S3"
1784
+ msgstr "Backup naar Amazon S3"
1785
+
1786
+ #: inc/class-page-editjob.php:388
1787
+ #@ backwpup
1788
+ msgid "Backup to Google storage"
1789
+ msgstr "Backup naar Google Cloud Storage"
1790
+
1791
+ #: inc/class-page-editjob.php:390
1792
+ #@ backwpup
1793
+ msgid "Backup to Micosoft Azure (Blob)"
1794
+ msgstr "Backup naar Microsoft Azure (Blob)"
1795
+
1796
+ #: inc/class-page-editjob.php:392
1797
+ #@ backwpup
1798
+ msgid "Backup to Rackspace Cloud"
1799
+ msgstr "Backup naar Rackspace Cloud"
1800
+
1801
+ #: inc/class-page-backups-table.php:141
1802
+ #@ backwpup
1803
+ msgid "No Files found. (List will be generated on next backup)"
1804
+ msgstr "Geen bestanden gevonden"
1805
+
1806
+ #: inc/class-page-backups-table.php:168
1807
+ #@ backwpup
1808
+ msgid "Change Destination"
1809
+ msgstr "Wijzig bestemming"
1810
+
1811
+ #: inc/class-page-backups-table.php:213
1812
+ #: inc/class-page-backups-table.php:215
1813
+ #@ backwpup
1814
+ msgid "Folder"
1815
+ msgstr "Map"
1816
+
1817
+ #: inc/class-page-backups-table.php:216
1818
+ #@ backwpup
1819
+ msgid "Time"
1820
+ msgstr "Tijd"
1821
+
1822
+ #: inc/class-page-backups-table.php:259
1823
+ #@ backwpup
1824
+ msgid ""
1825
+ "You are about to delete this Backup Archive. \n"
1826
+ " 'Cancel' to stop, 'OK' to delete."
1827
+ msgstr ""
1828
+ "Je staat op het punt om dit Backup-bestand te verwijderen. \n"
1829
+ " 'Annuleer' om te stoppen, 'OK' om te verwijderen."
1830
+
1831
+ #: inc/class-page-backups-table.php:274
1832
+ #@ backwpup
1833
+ msgid "?"
1834
+ msgstr "?"
1835
+
1836
+ #: job.php:36
1837
+ #: job.php:62
1838
+ #@ backwpup
1839
+ msgid "JOBID check"
1840
+ msgstr "JOBID controle"
1841
+
1842
+ #: job.php:58
1843
+ #@ backwpup
1844
+ msgid "Nonce pre check"
1845
+ msgstr "Nonce pre controle"
1846
+
1847
+ #: job.php:60
1848
+ #@ backwpup
1849
+ msgid "Starttype check"
1850
+ msgstr "Starttype controle"
1851
+
1852
+ #: job.php:65
1853
+ #: job.php:67
1854
+ #: job.php:69
1855
+ #: job.php:71
1856
+ #@ backwpup
1857
+ msgid "Nonce check"
1858
+ msgstr "Nonce controle"
1859
+
1860
+ #: job.php:78
1861
+ #@ backwpup
1862
+ msgid "Wrong JOBID check"
1863
+ msgstr "Onjuist JOBID gevonden"
1864
+
1865
+ #: job.php:85
1866
+ #@ backwpup
1867
+ msgid "API run on false time"
1868
+ msgstr "API start op onjuiste tijd"
1869
+
1870
+ #: job.php:89
1871
+ #@ backwpup
1872
+ msgid "Log folder not exists or is not writable"
1873
+ msgstr "Logboek-map bestaat niet of is niet beschrijfbaar"
1874
+
1875
+ #: job.php:91
1876
+ #@ backwpup
1877
+ msgid "Temp folder not exists or is not writable"
1878
+ msgstr "Tijdelijke map bestaat niet of is niet beschrijfbaar"
1879
+
1880
+ #: job.php:94
1881
+ #@ backwpup
1882
+ msgid "A job already running"
1883
+ msgstr "Er is al een taak actief"
1884
+
1885
+ #: job.php:96
1886
+ #@ backwpup
1887
+ msgid "No job running"
1888
+ msgstr "Geen taak actief"
1889
+
1890
+ #: inc/class-api.php:143
1891
+ #@ default
1892
+ msgid "An Unexpected HTTP Error occurred during the API request.</p> <p><a href=\"?\" onclick=\"document.location.reload(); return false;\">Try again</a>"
1893
+ msgstr "Er heeft zich overwachte HTTP fout voorgedaan gedurende het API-verzoek.</p> <p><a href=\"?\" onclick=\"document.location.reload(); return false;\">Probeer opnieuw</a>"
1894
+
1895
+ #: inc/class-api.php:147
1896
+ #@ default
1897
+ msgid "An unknown error occurred"
1898
+ msgstr "Onbekende fout opgetreden"
1899
+
1900
+ #. translators: plugin header field 'Name'
1901
+ #: backwpup.php:0
1902
+ #: backwpup.php:218
1903
+ #: inc/class-adminbar.php:23
1904
+ #@ backwpup
1905
+ msgid "BackWPup"
1906
+ msgstr "BackWPup"
1907
+
1908
+ #: backwpup.php:228
1909
+ #@ backwpup
1910
+ msgid "Working Job"
1911
+ msgstr "Actieve taak"
1912
+
1913
+ #: backwpup.php:234
1914
+ #@ backwpup
1915
+ msgid "Watch Log"
1916
+ msgstr "Bekijk logboek"
1917
+
1918
+ #: backwpup.php:242
1919
+ #: inc/class-adminbar.php:48
1920
+ #@ backwpup
1921
+ msgid "Backups"
1922
+ msgstr "Backups"
1923
+
1924
+ #: backwpup.php:245
1925
+ #@ backwpup
1926
+ msgid "Tools"
1927
+ msgstr "Gereedschappen"
1928
+
1929
+ #: backwpup.php:248
1930
+ #@ backwpup
1931
+ msgid "Settings"
1932
+ msgstr "Instellingen"
1933
+
1934
+ #: inc/class-help.php:17
1935
+ #@ backwpup
1936
+ msgid "Plugin Info"
1937
+ msgstr "Plugin Info"
1938
+
1939
+ #: inc/class-help.php:19
1940
+ #: inc/class-help.php:31
1941
+ #@ backwpup
1942
+ msgid "BackWPup comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions."
1943
+ msgstr "De maker van BackWPup is ABSOLUUT NIET AANSPRAKELIJK voor het gebruik van de plugin. Deze gratis software kunt je onder voorwaarden vrij verspreiden."
1944
+
1945
+ #: inc/class-help.php:22
1946
+ #: inc/class-help.php:32
1947
+ #@ backwpup
1948
+ msgid "For more information:"
1949
+ msgstr "Voor meer informatie:"
1950
+
1951
+ #: backwpup.php:264
1952
+ #: inc/class-help.php:23
1953
+ #: inc/class-help.php:33
1954
+ #@ backwpup
1955
+ msgid "<a href=\"http://backwpup.com/manual/\" target=\"_blank\">Documentation</a>"
1956
+ msgstr "<a href=\"http://backwpup.com/manual/\" target=\"_blank\">Documentatie</a>"
1957
+
1958
+ #: backwpup.php:265
1959
+ #: inc/class-help.php:24
1960
+ #: inc/class-help.php:34
1961
+ #@ backwpup
1962
+ msgid "<a href=\"http://backwpup.com/faq/\" target=\"_blank\">FAQ</a>"
1963
+ msgstr "<a href=\"http://backwpup.com/faq/\" target=\"_blank\">FAQ</a>"
1964
+
1965
+ #: backwpup.php:266
1966
+ #: inc/class-help.php:25
1967
+ #: inc/class-help.php:35
1968
+ #@ backwpup
1969
+ msgid "<a href=\"http://backwpup.com/forums/\" target=\"_blank\">Support Forums</a>"
1970
+ msgstr "<a href=\"http://backwpup.com/forums/\" target=\"_blank\">Ondersteuningforums</a>"
1971
+
1972
+ #: backwpup.php:267
1973
+ #: inc/class-help.php:26
1974
+ #: inc/class-help.php:36
1975
+ #@ backwpup
1976
+ msgid "<a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Q3QSVRSFXBLSE\" target=\"_blank\">Donate</a>"
1977
+ msgstr "<a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Q3QSVRSFXBLSE\" target=\"_blank\">Doneer</a>"
1978
+
1979
+ #: backwpup.php:283
1980
+ #@ backwpup
1981
+ msgid "BackWPup Active Jobs"
1982
+ msgstr "BackWPup Actieve taken"
1983
+
1984
+ #: inc/class-dashboard.php:33
1985
+ #@ backwpup
1986
+ msgid "View Log:"
1987
+ msgstr "Logboek bekijken:"
1988
+
1989
+ #: inc/class-dashboard.php:64
1990
+ #@ backwpup
1991
+ msgid "How many of the lastes logs would you like to display?"
1992
+ msgstr "Hoeveel logboeken moeten worden getoond?"
1993
+
1994
+ #: inc/class-dashboard.php:97
1995
+ #, php-format
1996
+ #@ backwpup
1997
+ msgid "working since %d sec."
1998
+ msgstr "actief sinds %d sec."
1999
+
2000
+ #: inc/class-dashboard.php:104
2001
+ #@ backwpup
2002
+ msgid "Edit Job"
2003
+ msgstr "Taak bewerken"
2004
+
2005
+ #: inc/class-adminbar.php:27
2006
+ #@ backwpup
2007
+ msgid "See Working!"
2008
+ msgstr "Zie actief!"
2009
+
2010
+ #: inc/class-adminbar.php:61
2011
+ #@ backwpup
2012
+ msgid "Run Now"
2013
+ msgstr "Starten"
2014
+
2015
+ #: inc/functions.php:58
2016
+ #@ backwpup
2017
+ msgid "New"
2018
+ msgstr "Nieuw"
2019
+
2020
+ #: inc/functions.php:363
2021
+ #@ backwpup
2022
+ msgid "WP XML Export"
2023
+ msgstr "WP XML export"
2024
+
2025
+ #: inc/functions.php:369
2026
+ #@ backwpup
2027
+ msgid "Database Backup"
2028
+ msgstr "Backup database"
2029
+
2030
+ #: inc/functions.php:372
2031
+ #@ backwpup
2032
+ msgid "Optimize Database Tables"
2033
+ msgstr "Optimalisatie DB-tabellen"
2034
+
2035
+ #: inc/functions.php:375
2036
+ #@ backwpup
2037
+ msgid "Check Database Tables"
2038
+ msgstr "Controle DB-tabellen"
2039
+
2040
+ #: inc/class-job.php:53
2041
+ #@ backwpup
2042
+ msgid "Job restart terminated, because job runs!"
2043
+ msgstr "Er is al een taak actief: taakstart afgebroken!"
2044
+
2045
+ #: inc/class-job.php:58
2046
+ #, php-format
2047
+ #@ backwpup
2048
+ msgid "Second process is running, but old job runs! Start type is %s"
2049
+ msgstr "Tweede taak is actief! Taaktype is %s"
2050
+
2051
+ #: inc/class-job.php:93
2052
+ #@ backwpup
2053
+ msgid "Step aborted has too many tries!"
2054
+ msgstr "Max. aantal pogingen bereikt: taakstap afgebroken!"
2055
+
2056
+ #: inc/class-job.php:95
2057
+ #, php-format
2058
+ #@ backwpup
2059
+ msgid "Can not find job step method %s!"
2060
+ msgstr "Kan methode voor taakstappen niet vinden %s!"
2061
+
2062
+ #: inc/class-job.php:121
2063
+ #, php-format
2064
+ #@ backwpup
2065
+ msgid "Signal %d send to script!"
2066
+ msgstr "Signaal %d naar naar script verzenden!"
2067
+
2068
+ #: inc/class-job.php:126
2069
+ #@ backwpup
2070
+ msgid "Can not restart on alternate cron...."
2071
+ msgstr "Kan niet herstarten van alternatieve cron..."
2072
+
2073
+ #: inc/class-job.php:128
2074
+ #@ backwpup
2075
+ msgid "To many restarts...."
2076
+ msgstr "Te veel startpogingen..."
2077
+
2078
+ #: inc/class-job.php:141
2079
+ #, php-format
2080
+ #@ backwpup
2081
+ msgid "%d. Script stop! Will started again now!"
2082
+ msgstr "%d. Script gestopt! Start opnieuw!"
2083
+
2084
+ #: inc/class-job.php:158
2085
+ #@ backwpup
2086
+ msgid "Run!"
2087
+ msgstr "Starten!"
2088
+
2089
+ #: inc/class-job.php:292
2090
+ #, php-format
2091
+ #@ backwpup
2092
+ msgid "BackWPup log for %1$s from %2$s at %3$s"
2093
+ msgstr "BackWPup log voor %1$s van %2$s om %3$s"
2094
+
2095
+ #: inc/class-job.php:293
2096
+ #, php-format
2097
+ #@ default
2098
+ msgid "[INFO]: BackWPup version %1$s, WordPress version %4$s Copyright %2$s %3$s"
2099
+ msgstr "[INFO]: BackWPup versie %1$s, WordPress versie %4$s Copyright %2$s %3$s"
2100
+
2101
+ #: inc/class-job.php:295
2102
+ #@ backwpup
2103
+ msgid "[INFO]: BackWPup job:"
2104
+ msgstr "[INFO]: BackWPup taak:"
2105
+
2106
+ #: inc/class-job.php:297
2107
+ #@ backwpup
2108
+ msgid "[INFO]: BackWPup cron:"
2109
+ msgstr "[INFO]: BackWPup cron:"
2110
+
2111
+ #: inc/class-job.php:299
2112
+ #@ backwpup
2113
+ msgid "[INFO]: BackWPup job started from wp-cron"
2114
+ msgstr "[INFO]: BackWPup taak gestart via wp-cron"
2115
+
2116
+ #: inc/class-job.php:301
2117
+ #@ backwpup
2118
+ msgid "[INFO]: BackWPup job started manually"
2119
+ msgstr "[INFO]: BackWPup taak handmatig gestart"
2120
+
2121
+ #: inc/class-job.php:303
2122
+ #@ backwpup
2123
+ msgid "[INFO]: BackWPup job started external from url"
2124
+ msgstr "[INFO]: BackWPup taak gestart vanuit een externe url"
2125
+
2126
+ #: inc/class-job.php:305
2127
+ #@ backwpup
2128
+ msgid "[INFO]: BackWPup job started by its API"
2129
+ msgstr "[INFO]: BackWPup gestart via API"
2130
+
2131
+ #: inc/class-job.php:307
2132
+ #@ backwpup
2133
+ msgid "[INFO]: BackWPup job started form commandline"
2134
+ msgstr "[INFO]: BackWPup gestart via een commandoregel"
2135
+
2136
+ #: inc/class-job.php:308
2137
+ #@ backwpup
2138
+ msgid "[INFO]: PHP ver.:"
2139
+ msgstr "[INFO]: PHP ver.:"
2140
+
2141
+ #: inc/class-job.php:310
2142
+ #, php-format
2143
+ #@ backwpup
2144
+ msgid "[INFO]: PHP Safe mode is ON! Maximum script execution time is %1$d sec."
2145
+ msgstr "[INFO]: PHP veilige modus is AAN! Maximale toegestane verwerkingstijd is %1$d sec."
2146
+
2147
+ #: inc/class-job.php:311
2148
+ #, php-format
2149
+ #@ backwpup
2150
+ msgid "[INFO]: MySQL ver.: %s"
2151
+ msgstr "[INFO]: MySQL ver.: %s"
2152
+
2153
+ #: inc/class-job.php:314
2154
+ #, php-format
2155
+ #@ backwpup
2156
+ msgid "[INFO]: curl ver.: %1$s; %2$s"
2157
+ msgstr "[INFO]: curl ver.: %1$s; %2$s"
2158
+
2159
+ #: inc/class-job.php:316
2160
+ #, php-format
2161
+ #@ backwpup
2162
+ msgid "[INFO]: Temp folder is: %s"
2163
+ msgstr "[INFO]: Tijdelijke map is: %s"
2164
+
2165
+ #: inc/class-job.php:317
2166
+ #, php-format
2167
+ #@ backwpup
2168
+ msgid "[INFO]: Logfile folder is: %s"
2169
+ msgstr "[INFO]: Log-file map is: %s"
2170
+
2171
+ #: inc/class-job.php:318
2172
+ #, php-format
2173
+ #@ backwpup
2174
+ msgid "[INFO]: Backup type is: %s"
2175
+ msgstr "[INFO]: Backup-type is: %s"
2176
+
2177
+ #: inc/class-job.php:320
2178
+ #, php-format
2179
+ #@ backwpup
2180
+ msgid "[INFO]: Backup file is: %s"
2181
+ msgstr "[INFO]: Backup-bestand is: %s"
2182
+
2183
+ #: inc/class-job.php:332
2184
+ #@ backwpup
2185
+ msgid "No destination defined for backup!!! Please correct job settings"
2186
+ msgstr "Geen bestemming gedefinieerd voor backup-bestand!!! Corrigeer de taakinstellingen"
2187
+
2188
+ #: inc/class-job.php:353
2189
+ #, php-format
2190
+ #@ backwpup
2191
+ msgid "Can not create folder: %1$s"
2192
+ msgstr "Kan map niet maken: %1$s"
2193
+
2194
+ #: inc/class-job.php:369
2195
+ #, php-format
2196
+ #@ backwpup
2197
+ msgid "Not writable folder: %1$s"
2198
+ msgstr "Map niet beschrijfbaar: %1$s"
2199
+
2200
+ #: inc/class-job.php:382
2201
+ #, php-format
2202
+ #@ backwpup
2203
+ msgid "Exception caught in %1$s: %2$s"
2204
+ msgstr "Uitzondering gevonden in %1$s: %2$s"
2205
+
2206
+ #: inc/class-job.php:415
2207
+ #@ backwpup
2208
+ msgid "WARNING:"
2209
+ msgstr "WAARSCHUWING:"
2210
+
2211
+ #: inc/class-job.php:428
2212
+ #@ backwpup
2213
+ msgid "DEPRECATED:"
2214
+ msgstr "AFGESCHAFT:"
2215
+
2216
+ #: inc/class-job.php:431
2217
+ #@ backwpup
2218
+ msgid "STRICT NOTICE:"
2219
+ msgstr "BELANGRIJKE BERICHT:"
2220
+
2221
+ #: inc/class-job.php:434
2222
+ #@ backwpup
2223
+ msgid "RECOVERABLE ERROR:"
2224
+ msgstr "HERSTELBARE FOUT:"
2225
+
2226
+ #: inc/class-job.php:497
2227
+ #@ backwpup
2228
+ msgid "Database connection is gone create a new one."
2229
+ msgstr "Verbinding met database verbroken. Verbindt opnieuw."
2230
+
2231
+ #: inc/class-job.php:558
2232
+ #, php-format
2233
+ #@ backwpup
2234
+ msgid "One old log deleted"
2235
+ msgid_plural "%d old logs deleted"
2236
+ msgstr[0] "Een oud logboek verwijderd"
2237
+ msgstr[1] "%d oude logboeken verwijderd"
2238
+
2239
+ #: inc/class-job.php:564
2240
+ #, php-format
2241
+ #@ backwpup
2242
+ msgid "Job done in %s sec."
2243
+ msgstr "Taak afgerond in %s sec."
2244
+
2245
+ #: inc/class-job.php:638
2246
+ #, php-format
2247
+ #@ backwpup
2248
+ msgid "[%3$s] BackWPup log %1$s: %2$s"
2249
+ msgstr "[%3$s] BackWPup logboek %1$s: %2$s"
2250
+
2251
+ #: inc/class-job.php:665
2252
+ #@ backwpup
2253
+ msgid "Done!"
2254
+ msgstr "Gereed!"
2255
+
2256
+ #: inc/class-job.php:679
2257
+ #@ backwpup
2258
+ msgid "Set Blog to maintenance mode"
2259
+ msgstr "Zet de blog in onderhoudsmodus"
2260
+
2261
+ #: inc/class-job.php:689
2262
+ #@ backwpup
2263
+ msgid "Cannot set Blog to maintenance mode! Root folder is not writable!"
2264
+ msgstr "Kan blog niet in onderhoudsmodus zetten! Hoofd-map is niet beschrijfbaar!"
2265
+
2266
+ #: inc/class-job.php:692
2267
+ #@ backwpup
2268
+ msgid "Set Blog to normal mode"
2269
+ msgstr "Zet de blog in normale modus"
2270
+
2271
+ #: inc/class-job.php:741
2272
+ #, php-format
2273
+ #@ backwpup
2274
+ msgid "Memory increased from %1$s to %2$s"
2275
+ msgstr "Geheugen vergroot van %1$s naar %2$s"
2276
+
2277
+ #: inc/class-job.php:743
2278
+ #, php-format
2279
+ #@ backwpup
2280
+ msgid "Can not increase memory limit is %1$s"
2281
+ msgstr "Kan geheugen niet vergroten. De limiet is %1$s"
2282
+
2283
+ #: inc/class-job.php:989
2284
+ #, php-format
2285
+ #@ backwpup
2286
+ msgid "%d. Try for database dump..."
2287
+ msgstr "%d. Database dump starten..."
2288
+
2289
+ #: inc/class-job.php:1021
2290
+ #, php-format
2291
+ #@ backwpup
2292
+ msgid "Can not create database dump file! \"%s\""
2293
+ msgstr "Kan database dump-bestand niet maken! \"%s\""
2294
+
2295
+ #: inc/class-job.php:1032
2296
+ #: inc/class-job.php:1042
2297
+ #: inc/class-job.php:1107
2298
+ #: inc/class-job.php:1138
2299
+ #: inc/class-job.php:1260
2300
+ #: inc/class-job.php:1276
2301
+ #: inc/class-job.php:1290
2302
+ #: inc/class-job.php:1325
2303
+ #: inc/class-job.php:1336
2304
+ #: inc/class-job.php:1350
2305
+ #: inc/class-job.php:1360
2306
+ #, php-format
2307
+ #@ backwpup
2308
+ msgid "Database error %1$s for query %2$s"
2309
+ msgstr "Database fout %1$s met query %2$s"
2310
+
2311
+ #: inc/class-job.php:1049
2312
+ #@ backwpup
2313
+ msgid "No tables to dump"
2314
+ msgstr "Geen tabellen voor dump gevonden"
2315
+
2316
+ #: inc/class-job.php:1094
2317
+ #, php-format
2318
+ #@ backwpup
2319
+ msgid "Dump database table \"%s\""
2320
+ msgstr "Dump database tabel \"%s\""
2321
+
2322
+ #: inc/class-job.php:1230
2323
+ #@ backwpup
2324
+ msgid "Database dump done!"
2325
+ msgstr "Database dump gereed!"
2326
+
2327
+ #: inc/class-job.php:1237
2328
+ #, php-format
2329
+ #@ backwpup
2330
+ msgid "Added database dump \"%1$s\" with %2$s to backup file list"
2331
+ msgstr "Database dump \"%1$s\" van %2$s toegevoegd aan lijst met backup-bestanden"
2332
+
2333
+ #: inc/class-job.php:1252
2334
+ #, php-format
2335
+ #@ backwpup
2336
+ msgid "%d. Try for database check..."
2337
+ msgstr "%d. Database controle starten..."
2338
+
2339
+ #: inc/class-job.php:1280
2340
+ #: inc/class-job.php:1282
2341
+ #: inc/class-job.php:1284
2342
+ #, php-format
2343
+ #@ backwpup
2344
+ msgid "Result of table check for %1$s is: %2$s"
2345
+ msgstr "Controle-resultaat van tabel %1$s is: %2$s"
2346
+
2347
+ #: inc/class-job.php:1294
2348
+ #: inc/class-job.php:1296
2349
+ #: inc/class-job.php:1298
2350
+ #, php-format
2351
+ #@ backwpup
2352
+ msgid "Result of table repair for %1$s is: %2$s"
2353
+ msgstr "Reparatie-resultaat van table %1$s is: %2$s"
2354
+
2355
+ #: inc/class-job.php:1304
2356
+ #@ backwpup
2357
+ msgid "Database check done!"
2358
+ msgstr "Database controle gereed!"
2359
+
2360
+ #: inc/class-job.php:1306
2361
+ #@ backwpup
2362
+ msgid "No tables to check"
2363
+ msgstr "Geen tabellen om te controleren"
2364
+
2365
+ #: inc/class-job.php:1317
2366
+ #, php-format
2367
+ #@ backwpup
2368
+ msgid "%d. Try for database optimize..."
2369
+ msgstr "%d. Database optimalisatie starten..."
2370
+
2371
+ #: inc/class-job.php:1352
2372
+ #: inc/class-job.php:1354
2373
+ #: inc/class-job.php:1356
2374
+ #, php-format
2375
+ #@ backwpup
2376
+ msgid "Result of table optimize for %1$s is: %2$s"
2377
+ msgstr "Optimalisatie-resultaat van tabel %1$s is: %2$s"
2378
+
2379
+ #: inc/class-job.php:1362
2380
+ #, php-format
2381
+ #@ backwpup
2382
+ msgid "InnoDB Table %1$s optimize done"
2383
+ msgstr "Optimalisatie InnoDB tabel %1$s gereed!"
2384
+
2385
+ #: inc/class-job.php:1367
2386
+ #@ backwpup
2387
+ msgid "Database optimize done!"
2388
+ msgstr "Database optimalisatie gereed!"
2389
+
2390
+ #: inc/class-job.php:1370
2391
+ #@ backwpup
2392
+ msgid "No tables to optimize"
2393
+ msgstr "Geen tabellen gevonden voor optimalisatie"
2394
+
2395
+ #: inc/class-job.php:1382
2396
+ #, php-format
2397
+ #@ backwpup
2398
+ msgid "%d. Try to make a WordPress Export to XML file..."
2399
+ msgstr "%d. WordPress naar XML-bestand exporteren..."
2400
+
2401
+ #: inc/class-job.php:1427
2402
+ #, php-format
2403
+ #@ backwpup
2404
+ msgid "Added XML export \"%1$s\" with %2$s to backup file list"
2405
+ msgstr "XML export \"%1$s\" van %2$s toegevoegd aan lijst met backup-bestanden"
2406
+
2407
+ #: inc/class-job.php:1515
2408
+ #, php-format
2409
+ #@ backwpup
2410
+ msgid "%d. Try to make list of folder to backup...."
2411
+ msgstr "%d. Lijst van mappen maken die in backup worden opgenomen..."
2412
+
2413
+ #: inc/class-job.php:1576
2414
+ #: inc/class-job.php:1581
2415
+ #: inc/class-job.php:1587
2416
+ #: inc/class-job.php:1593
2417
+ #: inc/class-job.php:1599
2418
+ #: inc/class-job.php:1605
2419
+ #, php-format
2420
+ #@ backwpup
2421
+ msgid "Added \"%s\" to backup file list"
2422
+ msgstr "\"%s\" toegevoegd aan lijst met backup-bestanden"
2423
+
2424
+ #: inc/class-job.php:1610
2425
+ #@ backwpup
2426
+ msgid "No Folder to backup"
2427
+ msgstr "Geen map voor backup gevonden"
2428
+
2429
+ #: inc/class-job.php:1612
2430
+ #, php-format
2431
+ #@ backwpup
2432
+ msgid "%1$d Folders to backup"
2433
+ msgstr "%1$d Mappen in de backup"
2434
+
2435
+ #: inc/class-job.php:1647
2436
+ #, php-format
2437
+ #@ backwpup
2438
+ msgid "Folder \"%s\" is not readable!"
2439
+ msgstr "Map \"%s\" kan niet worden gelezen!"
2440
+
2441
+ #: inc/class-job.php:1681
2442
+ #, php-format
2443
+ #@ backwpup
2444
+ msgid "File \"%s\" is not readable!"
2445
+ msgstr "Bestand \"%s\" kan niet worden gelezen!"
2446
+
2447
+ #: inc/class-job.php:1683
2448
+ #, php-format
2449
+ #@ backwpup
2450
+ msgid "Link \"%s\" not followed"
2451
+ msgstr "Link \"%s\" niet gevolgd"
2452
+
2453
+ #: inc/class-job.php:1703
2454
+ #, php-format
2455
+ #@ backwpup
2456
+ msgid "%d. Trying to create backup zip archive..."
2457
+ msgstr "%d. Backup-bestand (zip) maken..."
2458
+
2459
+ #: inc/class-job.php:1708
2460
+ #, php-format
2461
+ #@ backwpup
2462
+ msgid "Can not create backup zip archive: %d!"
2463
+ msgstr "Kan backup-bestand niet maken: %d!"
2464
+
2465
+ #: inc/class-job.php:1717
2466
+ #: inc/class-job.php:1736
2467
+ #, php-format
2468
+ #@ backwpup
2469
+ msgid "Can not add \"%s\" to zip archive!"
2470
+ msgstr "Kan \"%s\" niet toevoegen aan backup-bestand!"
2471
+
2472
+ #: inc/class-job.php:1729
2473
+ #, php-format
2474
+ #@ backwpup
2475
+ msgid "Can not add dir \"%s\" to zip archive!"
2476
+ msgstr "Kan map \"%s\" niet toevoegen aan backup-bestand!"
2477
+
2478
+ #: inc/class-job.php:1745
2479
+ #: inc/class-job.php:1777
2480
+ #@ backwpup
2481
+ msgid "(4) ER_SEEK"
2482
+ msgstr "(4) ER_SEEK"
2483
+
2484
+ #: inc/class-job.php:1747
2485
+ #: inc/class-job.php:1779
2486
+ #@ backwpup
2487
+ msgid "(5) ER_READ"
2488
+ msgstr "(5) ER_READ"
2489
+
2490
+ #: inc/class-job.php:1749
2491
+ #: inc/class-job.php:1781
2492
+ #@ backwpup
2493
+ msgid "(9) ER_NOENT"
2494
+ msgstr "(9) ER_NOENT"
2495
+
2496
+ #: inc/class-job.php:1751
2497
+ #: inc/class-job.php:1783
2498
+ #@ backwpup
2499
+ msgid "(10) ER_EXISTS"
2500
+ msgstr "(10) ER_EXISTS"
2501
+
2502
+ #: inc/class-job.php:1753
2503
+ #: inc/class-job.php:1785
2504
+ #@ backwpup
2505
+ msgid "(11) ER_OPEN"
2506
+ msgstr "(11) ER_OPEN"
2507
+
2508
+ #: inc/class-job.php:1755
2509
+ #: inc/class-job.php:1787
2510
+ #@ backwpup
2511
+ msgid "(14) ER_MEMORY"
2512
+ msgstr "(14) ER_MEMORY"
2513
+
2514
+ #: inc/class-job.php:1757
2515
+ #: inc/class-job.php:1789
2516
+ #@ backwpup
2517
+ msgid "(18) ER_INVAL"
2518
+ msgstr "(18) ER_INVAL"
2519
+
2520
+ #: inc/class-job.php:1759
2521
+ #: inc/class-job.php:1791
2522
+ #@ backwpup
2523
+ msgid "(19) ER_NOZIP"
2524
+ msgstr "(19) ER_NOZIP"
2525
+
2526
+ #: inc/class-job.php:1761
2527
+ #: inc/class-job.php:1793
2528
+ #@ backwpup
2529
+ msgid "(21) ER_INCONS"
2530
+ msgstr "(21) ER_INCONS"
2531
+
2532
+ #: inc/class-job.php:1762
2533
+ #: inc/class-job.php:1794
2534
+ #, php-format
2535
+ #@ backwpup
2536
+ msgid "Zip returns status: %s"
2537
+ msgstr "Status zip-resultaat: %s"
2538
+
2539
+ #: inc/class-job.php:1797
2540
+ #: inc/class-job.php:1835
2541
+ #@ backwpup
2542
+ msgid "Backup zip archive created"
2543
+ msgstr "Backup-bestand gemaakt"
2544
+
2545
+ #: inc/class-job.php:1807
2546
+ #, php-format
2547
+ #@ backwpup
2548
+ msgid "%d. Trying to create backup zip (PclZip) archive..."
2549
+ msgstr "%d. Backup-bestand (PclZip) maken..."
2550
+
2551
+ #: inc/class-job.php:1816
2552
+ #: inc/class-job.php:1829
2553
+ #, php-format
2554
+ #@ backwpup
2555
+ msgid "Zip archive add error: %s"
2556
+ msgstr "Zip toevoeg-fout: %s"
2557
+
2558
+ #: inc/class-job.php:1846
2559
+ #@ backwpup
2560
+ msgid "Can not create tar arcive file!"
2561
+ msgstr "Kan tar-bestand niet maken!"
2562
+
2563
+ #: inc/class-job.php:1850
2564
+ #, php-format
2565
+ #@ backwpup
2566
+ msgid "%1$d. Trying to create %2$s archive file..."
2567
+ msgstr "%1$d. Backup-bestand %2$s maken..."
2568
+
2569
+ #: inc/class-job.php:1884
2570
+ #, php-format
2571
+ #@ backwpup
2572
+ msgid "%s archive created"
2573
+ msgstr "%s backup-bestand gemaakt"
2574
+
2575
+ #: inc/class-job.php:1889
2576
+ #, php-format
2577
+ #@ backwpup
2578
+ msgid "Archive size is %s"
2579
+ msgstr "Backup-bestand is %s"
2580
+
2581
+ #: inc/class-job.php:1890
2582
+ #, php-format
2583
+ #@ backwpup
2584
+ msgid " %1$d Files with %2$s in Archive"
2585
+ msgstr " %1$d Bestanden met %2$s in backup-bestand"
2586
+
2587
+ #: inc/class-job.php:1913
2588
+ #, php-format
2589
+ #@ backwpup
2590
+ msgid "File name \"%1$s\" to long to save correctly in %2$s archive!"
2591
+ msgstr "Bestandsnaam \"%1$s\" te lang om correct te kunnen opslaan in %2$s backup-bestand!"
2592
+
2593
+ #: inc/class-job.php:1915
2594
+ #, php-format
2595
+ #@ backwpup
2596
+ msgid "File path \"%1$s\" to long to save correctly in %2$s archive!"
2597
+ msgstr "Bestandspad \"%1$s\" te lang om correct te kunnen opslaan in %2$s backup-bestand!"
2598
+
2599
+ #: inc/class-job.php:1920
2600
+ #: inc/class-job.php:1921
2601
+ #@ backwpup
2602
+ msgid "Unknown"
2603
+ msgstr "Onbekend"
2604
+
2605
+ #: inc/class-job.php:2026
2606
+ #, php-format
2607
+ #@ backwpup
2608
+ msgid "One backup file deleted"
2609
+ msgid_plural "%d backup files deleted"
2610
+ msgstr[0] "Een backup-bestand verwijderd"
2611
+ msgstr[1] "%d backup-bestanden verwijderd"
2612
+
2613
+ #: inc/class-job.php:2037
2614
+ #, php-format
2615
+ #@ backwpup
2616
+ msgid "%d. Try to sync files with folder..."
2617
+ msgstr "%d. Bestanden met map synchroniseren..."
2618
+
2619
+ #: inc/class-job.php:2039
2620
+ #@ backwpup
2621
+ msgid "No files/folder will deleted on destination!"
2622
+ msgstr "Geen bestanden/mappen verwijderd op bestemming!"
2623
+
2624
+ #: inc/class-job.php:2077
2625
+ #, php-format
2626
+ #@ backwpup
2627
+ msgid "File or folder \"%s\" is not readable!"
2628
+ msgstr "Bestand of map \"%s\" is onleesbaar!"
2629
+
2630
+ #: inc/class-job.php:2084
2631
+ #, php-format
2632
+ #@ backwpup
2633
+ msgid "Folder deleted %s"
2634
+ msgstr "Map verwijderd %s"
2635
+
2636
+ #: inc/class-job.php:2098
2637
+ #, php-format
2638
+ #@ backwpup
2639
+ msgid "File deleted %s"
2640
+ msgstr "Bestand verwijderd %s"
2641
+
2642
+ #: inc/class-job.php:2118
2643
+ #, php-format
2644
+ #@ backwpup
2645
+ msgid "%d. Try to sending backup file to DropBox..."
2646
+ msgstr "%d. Backup-bestand naar DropBox verzenden..."
2647
+
2648
+ #: inc/class-job.php:2126
2649
+ #, php-format
2650
+ #@ backwpup
2651
+ msgid "Authed with DropBox from %s"
2652
+ msgstr "Aangemeld bij DropBox met %s"
2653
+
2654
+ #: inc/class-job.php:2131
2655
+ #@ backwpup
2656
+ msgid "No free space left on DropBox!!!"
2657
+ msgstr "Geen vrije ruimte op DropBox!!"
2658
+
2659
+ #: inc/class-job.php:2135
2660
+ #, php-format
2661
+ #@ backwpup
2662
+ msgid "%s free on DropBox"
2663
+ msgstr "%s vrij op DropBox"
2664
+
2665
+ #: inc/class-job.php:2141
2666
+ #@ backwpup
2667
+ msgid "Upload to DropBox now started... "
2668
+ msgstr "Verzending naar DropBox gestart..."
2669
+
2670
+ #: inc/class-job.php:2147
2671
+ #: inc/class-job.php:2400
2672
+ #: inc/class-job.php:2492
2673
+ #: inc/class-job.php:2614
2674
+ #: inc/class-job.php:2803
2675
+ #, php-format
2676
+ #@ backwpup
2677
+ msgid "Backup transferred to %s"
2678
+ msgstr "Backup-bestand verzonden naar %s"
2679
+
2680
+ #: inc/class-job.php:2150
2681
+ #@ backwpup
2682
+ msgid "Uploaded file size and local file size not the same!!!"
2683
+ msgstr "Bestandsgrootte locale en verzonden bestand ongelijk!!!"
2684
+
2685
+ #: inc/class-job.php:2152
2686
+ #, php-format
2687
+ #@ backwpup
2688
+ msgid "Error on transfer backup to DropBox: %s"
2689
+ msgstr "Fout tijdens verzending backup-bestand naar DropBox: %s"
2690
+
2691
+ #: inc/class-job.php:2156
2692
+ #: inc/class-job.php:2202
2693
+ #, php-format
2694
+ #@ backwpup
2695
+ msgid "DropBox API: %s"
2696
+ msgstr "DropBox API: %s"
2697
+
2698
+ #: inc/class-job.php:2194
2699
+ #, php-format
2700
+ #@ backwpup
2701
+ msgid "Error on delete file on DropBox: %s"
2702
+ msgstr "Fout bij verwijderen bestand van DropBox: %s"
2703
+
2704
+ #: inc/class-job.php:2197
2705
+ #, php-format
2706
+ #@ backwpup
2707
+ msgid "One file deleted on DropBox"
2708
+ msgid_plural "%d files deleted on DropBox"
2709
+ msgstr[0] "Een bestand verwijderd van DropBox"
2710
+ msgstr[1] "%d bestanden verwijderd van DropBox"
2711
+
2712
+ #: inc/class-job.php:2214
2713
+ #, php-format
2714
+ #@ backwpup
2715
+ msgid "%d. Try to sending backup file to a FTP Server..."
2716
+ msgstr "%d. Backup-bestand naar FTP-server verzenden..."
2717
+
2718
+ #: inc/class-job.php:2222
2719
+ #, php-format
2720
+ #@ backwpup
2721
+ msgid "Connected by SSL-FTP to Server: %s"
2722
+ msgstr "Via SSL verbonden met FTP-server: %s"
2723
+
2724
+ #: inc/class-job.php:2224
2725
+ #, php-format
2726
+ #@ backwpup
2727
+ msgid "Can not connect by SSL-FTP to Server: %s"
2728
+ msgstr "Kan via SSL niet verbinden met FTP-server: %s"
2729
+
2730
+ #: inc/class-job.php:2228
2731
+ #@ backwpup
2732
+ msgid "PHP function to connect with SSL-FTP to server not exists!"
2733
+ msgstr "PHP-functie voor SSL-verbinding naar FTP-server bestaat niet!"
2734
+
2735
+ #: inc/class-job.php:2235
2736
+ #, php-format
2737
+ #@ backwpup
2738
+ msgid "Connected to FTP server: %s"
2739
+ msgstr "Verbonden met FTP-server: %s"
2740
+
2741
+ #: inc/class-job.php:2237
2742
+ #, php-format
2743
+ #@ backwpup
2744
+ msgid "Can not connect to FTP server: %s"
2745
+ msgstr "Kan niet verbinden met FTP-server: %s"
2746
+
2747
+ #: inc/class-job.php:2243
2748
+ #: inc/class-job.php:2250
2749
+ #: inc/class-job.php:2261
2750
+ #: inc/class-job.php:2274
2751
+ #, php-format
2752
+ #@ backwpup
2753
+ msgid "FTP Client command: %s"
2754
+ msgstr "FTP-client commando: %s"
2755
+
2756
+ #: inc/class-job.php:2245
2757
+ #: inc/class-job.php:2248
2758
+ #: inc/class-job.php:2252
2759
+ #: inc/class-job.php:2264
2760
+ #: inc/class-job.php:2266
2761
+ #: inc/class-job.php:2269
2762
+ #: inc/class-job.php:2271
2763
+ #: inc/class-job.php:2277
2764
+ #: inc/class-job.php:2279
2765
+ #, php-format
2766
+ #@ backwpup
2767
+ msgid "FTP Server reply: %s"
2768
+ msgstr "Antwoord van FTP-server: %s"
2769
+
2770
+ #: inc/class-job.php:2264
2771
+ #@ backwpup
2772
+ msgid "Entering Passive Mode"
2773
+ msgstr "Passive mode starten"
2774
+
2775
+ #: inc/class-job.php:2266
2776
+ #@ backwpup
2777
+ msgid "Can not Entering Passive Mode"
2778
+ msgstr "Kan Passive mode niet starten"
2779
+
2780
+ #: inc/class-job.php:2269
2781
+ #@ backwpup
2782
+ msgid "Entering Normal Mode"
2783
+ msgstr "Normal mode starten"
2784
+
2785
+ #: inc/class-job.php:2271
2786
+ #@ backwpup
2787
+ msgid "Can not Entering Normal Mode"
2788
+ msgstr "Kan Normal mode niet starten"
2789
+
2790
+ #: inc/class-job.php:2279
2791
+ #@ backwpup
2792
+ msgid "Error getting SYSTYPE"
2793
+ msgstr "Fout verkregen van SYSTYPE"
2794
+
2795
+ #: inc/class-job.php:2289
2796
+ #, php-format
2797
+ #@ backwpup
2798
+ msgid "FTP Folder \"%s\" created!"
2799
+ msgstr "FTP-map \"%s\" gemaakt!"
2800
+
2801
+ #: inc/class-job.php:2292
2802
+ #, php-format
2803
+ #@ backwpup
2804
+ msgid "FTP Folder \"%s\" can not created!"
2805
+ msgstr "FTP-map \"%s\" kan niet worden gemaakt!"
2806
+
2807
+ #: inc/class-job.php:2297
2808
+ #@ backwpup
2809
+ msgid "Upload to FTP now started ... "
2810
+ msgstr "Verzending naar FTP-server gestart ..."
2811
+
2812
+ #: inc/class-job.php:2300
2813
+ #, php-format
2814
+ #@ backwpup
2815
+ msgid "Backup transferred to FTP server: %s"
2816
+ msgstr "Backup-bestand verzonden naar FTP-server: %s"
2817
+
2818
+ #: inc/class-job.php:2304
2819
+ #@ backwpup
2820
+ msgid "Can not transfer backup to FTP server!"
2821
+ msgstr "Kan backup-bestand niet verzenden naar FTP-server!"
2822
+
2823
+ #: inc/class-job.php:2347
2824
+ #, php-format
2825
+ #@ backwpup
2826
+ msgid "Can not delete \"%s\" on FTP server!"
2827
+ msgstr "Kan \"%s\" niet verwijderen van FTP-server!"
2828
+
2829
+ #: inc/class-job.php:2351
2830
+ #, php-format
2831
+ #@ backwpup
2832
+ msgid "One file deleted on FTP Server"
2833
+ msgid_plural "%d files deleted on FTP Server"
2834
+ msgstr[0] "Een bestand verwijderd van de FTP-server"
2835
+ msgstr[1] "%d bestanden verwijderd van de FTP-Server"
2836
+
2837
+ #: inc/class-job.php:2367
2838
+ #, php-format
2839
+ #@ backwpup
2840
+ msgid "%d. Try to sending backup file to Amazon S3..."
2841
+ msgstr "%d. Backup-bestand naar Amazon S3 verzenden..."
2842
+
2843
+ #: inc/class-job.php:2376
2844
+ #, php-format
2845
+ #@ backwpup
2846
+ msgid "Connected to S3 Bucket \"%1$s\" in %2$s"
2847
+ msgstr "Verbonden met S3 Bucket \"%1$s\" in %2$s"
2848
+
2849
+ #: inc/class-job.php:2378
2850
+ #, php-format
2851
+ #@ backwpup
2852
+ msgid "S3 Bucket \"%s\" not exists!"
2853
+ msgstr "S3 Bucket \"%s\" bestaat niet!"
2854
+
2855
+ #: inc/class-job.php:2395
2856
+ #@ backwpup
2857
+ msgid "Upload to Amazon S3 now started... "
2858
+ msgstr "Verzending naar Amazon S3 gestart..."
2859
+
2860
+ #: inc/class-job.php:2404
2861
+ #, php-format
2862
+ #@ backwpup
2863
+ msgid "Can not transfer backup to S3! (%1$d) %2$s"
2864
+ msgstr "Kan backup-bestand niet verzenden naar S3! (%1$d) %2$s"
2865
+
2866
+ #: inc/class-job.php:2408
2867
+ #: inc/class-job.php:2454
2868
+ #, php-format
2869
+ #@ backwpup
2870
+ msgid "Amazon API: %s"
2871
+ msgstr "Amazon API: %s"
2872
+
2873
+ #: inc/class-job.php:2445
2874
+ #, php-format
2875
+ #@ backwpup
2876
+ msgid "Can not delete backup on S3://%s"
2877
+ msgstr "Kan backup niet verwijderen van S3://%s"
2878
+
2879
+ #: inc/class-job.php:2448
2880
+ #, php-format
2881
+ #@ backwpup
2882
+ msgid "One file deleted on S3 Bucket"
2883
+ msgid_plural "%d files deleted on S3 Bucket"
2884
+ msgstr[0] "Een bestand verwijderd van S3 Bucket"
2885
+ msgstr[1] "%d bestanden verwijderd van S3 Bucket"
2886
+
2887
+ #: inc/class-job.php:2466
2888
+ #, php-format
2889
+ #@ backwpup
2890
+ msgid "%d. Try to sending backup file to Google Storage..."
2891
+ msgstr "%d. Backup-bestand naar Google Storage verzenden..."
2892
+
2893
+ #: inc/class-job.php:2474
2894
+ #, php-format
2895
+ #@ backwpup
2896
+ msgid "Connected to Google Storage Bucket \"%1$s\""
2897
+ msgstr "Verbonden met Google Storage Bucket \"%1$s\""
2898
+
2899
+ #: inc/class-job.php:2476
2900
+ #, php-format
2901
+ #@ backwpup
2902
+ msgid "Google Storage Bucket \"%s\" not exists!"
2903
+ msgstr "Google Storage Bucket \"%s\" bestaat niet!"
2904
+
2905
+ #: inc/class-job.php:2487
2906
+ #@ backwpup
2907
+ msgid "Upload to Google Storage now started... "
2908
+ msgstr "Verzending naar Google Cloud Storage gestart..."
2909
+
2910
+ #: inc/class-job.php:2496
2911
+ #, php-format
2912
+ #@ backwpup
2913
+ msgid "Can not transfer backup to Google Storage! (%1$d) %2$s"
2914
+ msgstr "Kan backup-bestand niet verzenden naar Google Storage! (%1$d) %2$s"
2915
+
2916
+ #: inc/class-job.php:2500
2917
+ #: inc/class-job.php:2546
2918
+ #, php-format
2919
+ #@ backwpup
2920
+ msgid "Google Storage API: %s"
2921
+ msgstr "Google Storage API: %s"
2922
+
2923
+ #: inc/class-job.php:2537
2924
+ #, php-format
2925
+ #@ backwpup
2926
+ msgid "Can not delete backup on Google Storage://%s"
2927
+ msgstr "Kan backup-file niet verwijderen van Google Storage://%s"
2928
+
2929
+ #: inc/class-job.php:2540
2930
+ #, php-format
2931
+ #@ backwpup
2932
+ msgid "One file deleted on Google Storage Bucket"
2933
+ msgid_plural "%d files deleted on Google Storage Bucket"
2934
+ msgstr[0] "Een bestand verwijderd van de Google Storage Bucket"
2935
+ msgstr[1] "%d bestanden verwijderd van de Google Storage Bucket"
2936
+
2937
+ #: inc/class-job.php:2558
2938
+ #, php-format
2939
+ #@ backwpup
2940
+ msgid "%d. Try to sending backup with mail..."
2941
+ msgstr "%d. Email verzending backup-bestand starten..."
2942
+
2943
+ #: inc/class-job.php:2563
2944
+ #@ backwpup
2945
+ msgid "Backup archive too big for sending by mail!"
2946
+ msgstr "Backup-bestand te groot voor verzending via email!"
2947
+
2948
+ #: inc/class-job.php:2570
2949
+ #@ backwpup
2950
+ msgid "Sending mail..."
2951
+ msgstr "Verzending email..."
2952
+
2953
+ #: inc/class-job.php:2578
2954
+ #, php-format
2955
+ #@ backwpup
2956
+ msgid "BackWPup archive from %1$s: %2$s"
2957
+ msgstr "BackWPup backup-bestand van %1$s: %2$s"
2958
+
2959
+ #: inc/class-job.php:2579
2960
+ #, php-format
2961
+ #@ backwpup
2962
+ msgid "Backup archive: %s"
2963
+ msgstr "Backup-bestand: %s"
2964
+
2965
+ #: inc/class-job.php:2583
2966
+ #@ backwpup
2967
+ msgid "Error on sending mail!"
2968
+ msgstr "Fout bij verzending email!"
2969
+
2970
+ #: inc/class-job.php:2586
2971
+ #@ backwpup
2972
+ msgid "Mail sent."
2973
+ msgstr "Email verzonden."
2974
+
2975
+ #: inc/class-job.php:2597
2976
+ #, php-format
2977
+ #@ backwpup
2978
+ msgid "%d. Try sending backup to a Microsoft Azure (Blob)..."
2979
+ msgstr "%d. Verzending backup-bestand naar Microsoft Azure (Blob) starten..."
2980
+
2981
+ #: inc/class-job.php:2602
2982
+ #, php-format
2983
+ #@ backwpup
2984
+ msgid "Microsoft Azure container \"%s\" not exists!"
2985
+ msgstr "Microsoft Azure container \"%s\" bestaat niet!"
2986
+
2987
+ #: inc/class-job.php:2605
2988
+ #, php-format
2989
+ #@ backwpup
2990
+ msgid "Connected to Microsoft Azure container \"%s\""
2991
+ msgstr "Verbonden met Microsoft Azure container \"%s\""
2992
+
2993
+ #: inc/class-job.php:2608
2994
+ #@ backwpup
2995
+ msgid "Upload to MS Azure now started... "
2996
+ msgstr "Verzending naar MS Azure gestart..."
2997
+
2998
+ #: inc/class-job.php:2618
2999
+ #@ backwpup
3000
+ msgid "Can not transfer backup to Microsoft Azure!"
3001
+ msgstr "Kan backup-bestand niet verzenden naar Microsoft Azure!"
3002
+
3003
+ #: inc/class-job.php:2653
3004
+ #, php-format
3005
+ #@ backwpup
3006
+ msgid "One file deleted on Microsoft Azure container"
3007
+ msgid_plural "%d files deleted on Microsoft Azure container"
3008
+ msgstr[0] "Een bestand verwijderd van de Microsoft Azure container"
3009
+ msgstr[1] "%d bestanden verwijderd van de Microsoft Azure container"
3010
+
3011
+ #: inc/class-job.php:2658
3012
+ #, php-format
3013
+ #@ backwpup
3014
+ msgid "Microsoft Azure API: %s"
3015
+ msgstr "Microsoft Azure API: %s"
3016
+
3017
+ #: inc/class-job.php:2671
3018
+ #, php-format
3019
+ #@ backwpup
3020
+ msgid "%d. Try to sending backup file to Rackspace cloud..."
3021
+ msgstr "%d. Verzending backup-bestand naar Rackspace cloud starten..."
3022
+
3023
+ #: inc/class-job.php:2676
3024
+ #@ backwpup
3025
+ msgid "Connected to Rackspase cloud ..."
3026
+ msgstr "Verbonden met Rackspase cloud..."
3027
+
3028
+ #: inc/class-job.php:2692
3029
+ #: inc/class-job.php:2718
3030
+ #: inc/class-job.php:2763
3031
+ #, php-format
3032
+ #@ backwpup
3033
+ msgid "Rackspase Cloud API: %s"
3034
+ msgstr "Rackspase Cloud API: %s"
3035
+
3036
+ #: inc/class-job.php:2697
3037
+ #@ backwpup
3038
+ msgid "Rackspase cloud Container not exists:"
3039
+ msgstr "Rackspase cloud container bestaat niet:"
3040
+
3041
+ #: inc/class-job.php:2708
3042
+ #@ backwpup
3043
+ msgid "Upload to Rackspase cloud now started ... "
3044
+ msgstr "Verzending naar Rackspase Cloud gestart ..."
3045
+
3046
+ #: inc/class-job.php:2711
3047
+ #@ backwpup
3048
+ msgid "Backup File transferred to RSC://"
3049
+ msgstr "Backup-bestand verzonden naar Rackspase cloud://"
3050
+
3051
+ #: inc/class-job.php:2715
3052
+ #@ backwpup
3053
+ msgid "Can not transfer backup to Rackspase cloud."
3054
+ msgstr "Kan backup-bestand niet verzenden naar Rackspase cloud."
3055
+
3056
+ #: inc/class-job.php:2755
3057
+ #@ backwpup
3058
+ msgid "Can not delete file on RSC://"
3059
+ msgstr "Kan bestand niet verwijderen van Rackspase cloud://"
3060
+
3061
+ #: inc/class-job.php:2758
3062
+ #, php-format
3063
+ #@ backwpup
3064
+ msgid "One file deleted on Rackspase cloud container"
3065
+ msgid_plural "%d files deleted on Rackspase cloud container"
3066
+ msgstr[0] "Een bestand verwijderd van de Rackspase Cloud container"
3067
+ msgstr[1] "%d bestanden verwijderd van de Rackspase Cloud container"
3068
+
3069
+ #: inc/class-job.php:2775
3070
+ #, php-format
3071
+ #@ backwpup
3072
+ msgid "%d. Try to sending backup to SugarSync..."
3073
+ msgstr "%d. Verzending backup-bestand naar SugarSync starten..."
3074
+
3075
+ #: inc/class-job.php:2781
3076
+ #, php-format
3077
+ #@ backwpup
3078
+ msgid "Authed to SugarSync with Nick %s"
3079
+ msgstr "Aangemeld bij SugarSync met Nick %s"
3080
+
3081
+ #: inc/class-job.php:2784
3082
+ #@ backwpup
3083
+ msgid "No free space left on SugarSync!!!"
3084
+ msgstr "Geen vrije ruimte beschikbaar op SugarSync!!!"
3085
+
3086
+ #: inc/class-job.php:2789
3087
+ #, php-format
3088
+ #@ backwpup
3089
+ msgid "%s free on SugarSync"
3090
+ msgstr "%s vrij op SugarSync"
3091
+
3092
+ #: inc/class-job.php:2797
3093
+ #@ backwpup
3094
+ msgid "Upload to SugarSync now started... "
3095
+ msgstr "Verzending naar SugarSync gestart..."
3096
+
3097
+ #: inc/class-job.php:2805
3098
+ #@ backwpup
3099
+ msgid "Can not transfer backup to SugarSync!"
3100
+ msgstr "Kan backup-bestand niet verzenden naar SugarSync!"
3101
+
3102
+ #: inc/class-job.php:2842
3103
+ #, php-format
3104
+ #@ backwpup
3105
+ msgid "One file deleted on SugarSync folder"
3106
+ msgid_plural "%d files deleted on SugarSync folder"
3107
+ msgstr[0] "Een bestand verwijderd van de SugarSync map"
3108
+ msgstr[1] "%d bestanden verwijderd van de SugarSync map"
3109
+
3110
+ #: inc/class-job.php:2847
3111
+ #, php-format
3112
+ #@ backwpup
3113
+ msgid "SugarSync API: %s"
3114
+ msgstr "SugarSync API: %s"
3115
+
3116
+ #. translators: plugin header field 'PluginURI'
3117
+ #: backwpup.php:0
3118
+ #@ backwpup
3119
+ msgid "http://backwpup.com"
3120
+ msgstr "http://backwpup.com"
3121
+
3122
+ #. translators: plugin header field 'Description'
3123
+ #: backwpup.php:0
3124
+ #@ backwpup
3125
+ msgid "WordPress Backup and more..."
3126
+ msgstr "WordPress Backup en meer..."
3127
+
3128
+ #. translators: plugin header field 'Author'
3129
+ #: backwpup.php:0
3130
+ #@ backwpup
3131
+ msgid "Daniel H&uuml;sken"
3132
+ msgstr "Daniel H&uuml;sken"
3133
+
3134
+ #. translators: plugin header field 'AuthorURI'
3135
+ #: backwpup.php:0
3136
+ #@ backwpup
3137
+ msgid "http://danielhuesken.de"
3138
+ msgstr "http://danielhuesken.de"
3139
+
3140
+ #. translators: plugin header field 'Version'
3141
+ #: backwpup.php:0
3142
+ #@ backwpup
3143
+ msgid "3.0-Dev"
3144
+ msgstr "3.0-Dev"
3145
+
3146
+ #: backwpup.php:268
3147
+ #: inc/class-help.php:27
3148
+ #: inc/class-help.php:37
3149
+ #@ backwpup
3150
+ msgid "<a href=\"https://plus.google.com/112659782148359984250/\" target=\"_blank\">Google+</a>"
3151
+ msgstr "<a href=\"https://plus.google.com/112659782148359984250/\" target=\"_blank\">Google+</a>"
3152
+
3153
+ #: inc/class-ajax-fileinfo.php:130
3154
+ #: inc/class-page-backwpup-table.php:175
3155
+ #, php-format
3156
+ #@ backwpup
3157
+ msgid "Files Size: %s"
3158
+ msgstr "Omvang bestanden: %s"
3159
+
3160
+ #: inc/class-ajax-fileinfo.php:132
3161
+ #: inc/class-page-backwpup-table.php:177
3162
+ #, php-format
3163
+ #@ backwpup
3164
+ msgid "Folder count: %d"
3165
+ msgstr "Aantal mappen: %d"
3166
+
3167
+ #: inc/class-ajax-fileinfo.php:133
3168
+ #: inc/class-page-backwpup-table.php:178
3169
+ #, php-format
3170
+ #@ backwpup
3171
+ msgid "Files count: %d"
3172
+ msgstr "Aantal bestanden: %d"
3173
+
3174
+ #: inc/class-job.php:56
3175
+ #@ backwpup
3176
+ msgid "Job restart due to inactivity for more than 5 min.!"
3177
+ msgstr "Taak opnieuw gestart na inactiviteit van meer dan 5 min.!"
3178
+
3179
+ #: inc/class-job.php:294
3180
+ #@ backwpup
3181
+ msgid "[INFO]: This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions."
3182
+ msgstr "[INFO]: De maker van BackWPup is ABSOLUUT NIET AANSPRAKELIJK voor het gebruik van de plugin. Deze gratis software kun je onder voorwaarden vrij verspreiden."
3183
+
3184
+ #: inc/class-job.php:1458
3185
+ #, php-format
3186
+ #@ backwpup
3187
+ msgid "%d. Try to generate a file with installed Plugin names..."
3188
+ msgstr "%d. Bestand met geïnstalleerde plugins maken..."
3189
+
3190
+ #: inc/class-job.php:1483
3191
+ #@ backwpup
3192
+ msgid "All plugins information:"
3193
+ msgstr "Info over alle plugins:"
3194
+
3195
+ #: inc/class-job.php:1485
3196
+ #, php-format
3197
+ #@ backwpup
3198
+ msgid "from %s"
3199
+ msgstr "van %s"
3200
+
3201
+ #: inc/class-job.php:1487
3202
+ #@ backwpup
3203
+ msgid "Active plugins:"
3204
+ msgstr "Actieve plugins:"
3205
+
3206
+ #: inc/class-job.php:1492
3207
+ #@ backwpup
3208
+ msgid "Inactive plugins:"
3209
+ msgstr "Niet actieve plugins:"
3210
+
3211
+ #: inc/class-job.php:1503
3212
+ #, php-format
3213
+ #@ backwpup
3214
+ msgid "Added plugin list file \"%1$s\" with %2$s to backup file list"
3215
+ msgstr "Bestand \"%1$s\" met pluginlijst van %2$s toegevoegd aan backup-bestand"
3216
+
3217
+ #: inc/class-page-backwpup-table.php:165
3218
+ #, php-format
3219
+ #@ backwpup
3220
+ msgid "DB Size: %s"
3221
+ msgstr "DB grootte: %s"
3222
+
3223
+ #: inc/class-page-backwpup-table.php:167
3224
+ #, php-format
3225
+ #@ backwpup
3226
+ msgid "DB Tables: %d"
3227
+ msgstr "DB tabellen: %d"
3228
+
3229
+ #: inc/class-page-backwpup-table.php:168
3230
+ #, php-format
3231
+ #@ backwpup
3232
+ msgid "DB Rows: %d"
3233
+ msgstr "DB rijen: %d"
3234
+
3235
+ #: inc/class-page-backwpup-table.php:194
3236
+ #@ backwpup
3237
+ msgid "Not scheduled!"
3238
+ msgstr "Niet gepland!"
3239
+
3240
+ #: inc/class-page-backwpup.php:251
3241
+ #, php-format
3242
+ #@ backwpup
3243
+ msgid "- Server host '%1$s (%2$s)' can not resolved correctly! Resolved IP '%3$s'. Check Server config!"
3244
+ msgstr "- Server host '%1$s (%2$s)' kan niet worden bepaald! Gevonden IP '%3$s'. Controleer de server-configuratie!"
3245
+
3246
+ #: inc/class-page-backwpup.php:262
3247
+ #@ backwpup
3248
+ msgid "BackWPup:"
3249
+ msgstr "BackWPup:"
3250
+
3251
+ #: inc/class-page-editjob.php:543
3252
+ #@ backwpup
3253
+ msgid "Filename for the WP export file:"
3254
+ msgstr "WP-export bestandsnaam:"
3255
+
3256
+ #: inc/class-page-editjob.php:546
3257
+ #@ backwpup
3258
+ msgid "Compression:"
3259
+ msgstr "Compressie:"
3260
+
3261
+ #: inc/class-page-editjob.php:558
3262
+ #@ backwpup
3263
+ msgid "Filename for export a list of installed plugins:"
3264
+ msgstr "Naam bestand met de lijst van geïnstalleerde plugins:"
3265
+
3266
+ #: inc/class-page-settings.php:126
3267
+ #@ backwpup
3268
+ msgid "Updates"
3269
+ msgstr "Updates"
3270
+
3271
+ #: inc/class-page-settings.php:128
3272
+ #@ backwpup
3273
+ msgid "Wath type for Updates you would check for."
3274
+ msgstr "Te controleren plugin-versie-type voor updates."
3275
+
3276
+ #: inc/class-page-settings.php:131
3277
+ #@ backwpup
3278
+ msgid "Update version type"
3279
+ msgstr "Update versie-type"
3280
+
3281
+ #: inc/class-page-settings.php:135
3282
+ #@ backwpup
3283
+ msgid "Released Versions"
3284
+ msgstr "Officële versies"
3285
+
3286
+ #: inc/class-page-settings.php:136
3287
+ #@ backwpup
3288
+ msgid "Release candidates"
3289
+ msgstr "Release candidates"
3290
+
3291
+ #: inc/class-page-settings.php:137
3292
+ #@ backwpup
3293
+ msgid "Beta Versions"
3294
+ msgstr "Bèta versies"
3295
+
3296
+ #: inc/class-page-settings.php:138
3297
+ #@ backwpup
3298
+ msgid "Development Versions (Nightly Builds)"
3299
+ msgstr "Ontwikkelversies (Nightly builds)"
3300
+
3301
+ #: inc/class-page-settings.php:319
3302
+ #@ backwpup
3303
+ msgid "<a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Q3QSVRSFXBLSE\" target=\"_blank\"><img src=\"https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif\" border=\"0\" title=\"PayPal - The safer, easier way to pay online!\"></a>"
3304
+ msgstr "<a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Q3QSVRSFXBLSE\" target=\"_blank\"><img src=\"https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif\" border=\"0\" title=\"PayPal - The safer, easier way to pay online!\"></a>"
3305
+
libs/Microsoft/AutoLoader.php CHANGED
@@ -1,74 +1,74 @@
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
30
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
31
- * @license http://phpazure.codeplex.com/license
32
- */
33
-
34
- /** Microsoft root directory */
35
- if (!defined('MICROSOFT_ROOT')) {
36
- define('MICROSOFT_ROOT', realpath(dirname(__FILE__) . '/../') . DIRECTORY_SEPARATOR);
37
- }
38
- Microsoft_AutoLoader::Register();
39
-
40
- /**
41
- * @category Microsoft
42
- * @package Microsoft
43
- * @subpackage AutoLoader
44
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
- * @license http://phpazure.codeplex.com/license
46
- */
47
- class Microsoft_AutoLoader
48
- {
49
- /**
50
- * Registers the autoloader
51
- */
52
- public static function Register() {
53
- return spl_autoload_register(array('Microsoft_AutoLoader', 'Load'));
54
- }
55
-
56
- /**
57
- * Load a class
58
- *
59
- * @param string $className Class name to load
60
- */
61
- public static function Load($className){
62
- if ((class_exists($className)) || (strpos($className, 'Microsoft') === false)) {
63
- return false;
64
- }
65
-
66
- $classFilePath = MICROSOFT_ROOT . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
67
-
68
- if ((file_exists($classFilePath) === false) || (is_readable($classFilePath) === false)) {
69
- return false;
70
- }
71
-
72
- require($classFilePath);
73
- }
74
  }
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
30
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
31
+ * @license http://phpazure.codeplex.com/license
32
+ */
33
+
34
+ /** Microsoft root directory */
35
+ if (!defined('MICROSOFT_ROOT')) {
36
+ define('MICROSOFT_ROOT', realpath(dirname(__FILE__) . '/../') . DIRECTORY_SEPARATOR);
37
+ }
38
+ Microsoft_AutoLoader::Register();
39
+
40
+ /**
41
+ * @category Microsoft
42
+ * @package Microsoft
43
+ * @subpackage AutoLoader
44
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
+ * @license http://phpazure.codeplex.com/license
46
+ */
47
+ class Microsoft_AutoLoader
48
+ {
49
+ /**
50
+ * Registers the autoloader
51
+ */
52
+ public static function Register() {
53
+ return spl_autoload_register(array('Microsoft_AutoLoader', 'Load'));
54
+ }
55
+
56
+ /**
57
+ * Load a class
58
+ *
59
+ * @param string $className Class name to load
60
+ */
61
+ public static function Load($className){
62
+ if ((class_exists($className)) || (strpos($className, 'Microsoft') === false)) {
63
+ return false;
64
+ }
65
+
66
+ $classFilePath = MICROSOFT_ROOT . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
67
+
68
+ if ((file_exists($classFilePath) === false) || (is_readable($classFilePath) === false)) {
69
+ return false;
70
+ }
71
+
72
+ require($classFilePath);
73
+ }
74
  }
libs/Microsoft/Console/Command.php CHANGED
@@ -1,427 +1,427 @@
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_Console
30
- * @version $Id: Exception.php 55733 2011-01-03 09:17:16Z unknown $
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- */
34
-
35
- /**
36
- * @see Microsoft_AutoLoader
37
- */
38
- require_once dirname(__FILE__) . '/../AutoLoader.php';
39
-
40
- /**
41
- * @category Microsoft
42
- * @package Microsoft_Console
43
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
44
- * @license http://phpazure.codeplex.com/license
45
- */
46
- class Microsoft_Console_Command
47
- {
48
- /**
49
- * The handler.
50
- *
51
- * @var array
52
- */
53
- protected $_handler;
54
-
55
- /**
56
- * Gets the handler.
57
- *
58
- * @return array
59
- */
60
- public function getHandler()
61
- {
62
- return $this->_handler;
63
- }
64
-
65
- /**
66
- * Sets the handler.
67
- *
68
- * @param array $handler
69
- * @return Microsoft_Console_Command
70
- */
71
- public function setHandler($handler)
72
- {
73
- $this->_handler = $handler;
74
- return $this;
75
- }
76
-
77
- /**
78
- * Replaces PHP's error handler
79
- *
80
- * @param mixed $errno
81
- * @param mixed $errstr
82
- * @param mixed $errfile
83
- * @param mixed $errline
84
- */
85
- public static function phpstderr($errno, $errstr, $errfile, $errline)
86
- {
87
- self::stderr($errno . ': Error in ' . $errfile . ':' . $errline . ' - ' . $errstr);
88
- }
89
-
90
- /**
91
- * Replaces PHP's exception handler
92
- *
93
- * @param Exception $exception
94
- */
95
- public static function phpstdex($exception)
96
- {
97
- self::stderr('Error: ' . $exception->getMessage());
98
- }
99
-
100
- /**
101
- * Writes output to STDERR, followed by a newline (optional)
102
- *
103
- * @param string $errorMessage
104
- * @param string $newLine
105
- */
106
- public static function stderr($errorMessage, $newLine = true)
107
- {
108
- if (error_reporting() === 0) {
109
- return;
110
- }
111
- file_put_contents('php://stderr', $errorMessage . ($newLine ? "\r\n" : ''));
112
- }
113
-
114
- /**
115
- * Bootstrap the shell command.
116
- *
117
- * @param array $argv PHP argument values.
118
- */
119
- public static function bootstrap($argv)
120
- {
121
- // Abort bootstrapping depending on the MICROSOFT_CONSOLE_COMMAND_HOST constant.
122
- if (defined('MICROSOFT_CONSOLE_COMMAND_HOST') && strtolower(MICROSOFT_CONSOLE_COMMAND_HOST) != 'console') {
123
- return;
124
- }
125
-
126
- // Replace error handler
127
- set_error_handler(array('Microsoft_Console_Command', 'phpstderr'));
128
- set_exception_handler(array('Microsoft_Console_Command', 'phpstdex'));
129
-
130
- // Build the application model
131
- $model = self::_buildModel();
132
-
133
- // Find a class that corresponds to the $argv[0] script name
134
- $requiredHandlerName = str_replace('.bat', '', str_replace('.sh', '', str_replace('.php', '', strtolower(basename($argv[0])))));
135
- $handler = null;
136
- foreach ($model as $possibleHandler) {
137
- if ($possibleHandler->handler == strtolower($requiredHandlerName)) {
138
- $handler = $possibleHandler;
139
- break;
140
- }
141
- }
142
- if (is_null($handler)) {
143
- self::stderr("No class found that implements handler '" . $requiredHandlerName . "'. Create a class that is named '" . $requiredHandlerName . "' and extends Microsoft_Console_Command or is decorated with a docblock comment '@command-handler " . $requiredHandlerName . "'. Make sure it is loaded either through an autoloader or explicitly using require_once().");
144
- die();
145
- }
146
-
147
- // Find a method that matches the command name
148
- $command = null;
149
- foreach ($handler->commands as $possibleCommand) {
150
- if (in_array(strtolower(isset($argv[1]) ? $argv[1] : '<default>'), $possibleCommand->aliases)) {
151
- $command = $possibleCommand;
152
- break;
153
- }
154
- }
155
- if (is_null($command)) {
156
- $commandName = (isset($argv[1]) ? $argv[1] : '<default>');
157
- self::stderr("No method found that implements command " . $commandName . ". Create a method in class '" . $handler->class . "' that is named '" . strtolower($commandName) . "Command' or is decorated with a docblock comment '@command-name " . $commandName . "'.");
158
- die();
159
- }
160
-
161
- // Parse parameter values
162
- $parameterValues = array();
163
- $missingParameterValues = array();
164
- $parameterInputs = array_splice($argv, 2);
165
- foreach ($command->parameters as $parameter) {
166
- // Default value: null
167
- $value = null;
168
-
169
- // Consult value providers for value. First one wins.
170
- foreach ($parameter->valueproviders as $valueProviderName) {
171
- if (!class_exists($valueProviderName)) {
172
- $valueProviderName = 'Microsoft_Console_Command_ParameterSource_' . $valueProviderName;
173
- }
174
- $valueProvider = new $valueProviderName();
175
-
176
- $value = $valueProvider->getValueForParameter($parameter, $parameterInputs);
177
- if (!is_null($value)) {
178
- break;
179
- }
180
- }
181
- if (is_null($value) && $parameter->required) {
182
- $missingParameterValues[] = $parameter->aliases[0];
183
- } else if (is_null($value)) {
184
- $value = $parameter->defaultvalue;
185
- }
186
-
187
- // Set value
188
- $parameterValues[] = $value;
189
- $argvValues[$parameter->aliases[0]] = $value;
190
- }
191
-
192
- // Mising parameters?
193
- if (count($missingParameterValues) > 0) {
194
- self::stderr("Some parameters are missing:\r\n" . implode("\r\n", $missingParameterValues));
195
- die();
196
- }
197
-
198
- // Supply argv in a nice way
199
- $parameterValues['argv'] = $parameterInputs;
200
-
201
- // Run the command
202
- $className = $handler->class;
203
- $classInstance = new $className();
204
- $classInstance->setHandler($handler);
205
- call_user_func_array(array($classInstance, $command->method), $parameterValues);
206
-
207
- // Restore error handler
208
- restore_exception_handler();
209
- restore_error_handler();
210
- }
211
-
212
- /**
213
- * Builds the handler model.
214
- *
215
- * @return array
216
- */
217
- protected static function _buildModel()
218
- {
219
- $model = array();
220
-
221
- $classes = get_declared_classes();
222
- foreach ($classes as $class) {
223
- $type = new ReflectionClass($class);
224
-
225
- $handlers = self::_findValueForDocComment('@command-handler', $type->getDocComment());
226
- if (count($handlers) == 0 && $type->isSubclassOf('Microsoft_Console_Command')) {
227
- // Fallback: if the class extends Microsoft_Console_Command, register it as
228
- // a command handler.
229
- $handlers[] = $class;
230
- }
231
- $handlerDescriptions = self::_findValueForDocComment('@command-handler-description', $type->getDocComment());
232
- $handlerHeaders = self::_findValueForDocComment('@command-handler-header', $type->getDocComment());
233
- $handlerFooters = self::_findValueForDocComment('@command-handler-footer', $type->getDocComment());
234
-
235
- for ($hi = 0; $hi < count($handlers); $hi++) {
236
- $handler = $handlers[$hi];
237
- $handlerDescription = isset($handlerDescriptions[$hi]) ? $handlerDescriptions[$hi] : isset($handlerDescriptions[0]) ? $handlerDescriptions[0] : '';
238
- $handlerDescription = str_replace('\r\n', "\r\n", $handlerDescription);
239
- $handlerDescription = str_replace('\n', "\n", $handlerDescription);
240
-
241
- $handlerModel = (object)array(
242
- 'handler' => strtolower($handler),
243
- 'description' => $handlerDescription,
244
- 'headers' => $handlerHeaders,
245
- 'footers' => $handlerFooters,
246
- 'class' => $class,
247
- 'commands' => array()
248
- );
249
-
250
- $methods = $type->getMethods();
251
- foreach ($methods as $method) {
252
- $commands = self::_findValueForDocComment('@command-name', $method->getDocComment());
253
- if (substr($method->getName(), -7) == 'Command' && !in_array(substr($method->getName(), 0, -7), $commands)) {
254
- // Fallback: if the method is named <commandname>Command,
255
- // register it as a command.
256
- $commands[] = substr($method->getName(), 0, -7);
257
- }
258
- for ($x = 0; $x < count($commands); $x++) {
259
- $commands[$x] = strtolower($commands[$x]);
260
- }
261
- $commands = array_unique($commands);
262
- $commandDescriptions = self::_findValueForDocComment('@command-description', $method->getDocComment());
263
- $commandExamples = self::_findValueForDocComment('@command-example', $method->getDocComment());
264
-
265
- if (count($commands) > 0) {
266
- $command = $commands[0];
267
- $commandDescription = isset($commandDescriptions[0]) ? $commandDescriptions[0] : '';
268
-
269
- $commandModel = (object)array(
270
- 'command' => $command,
271
- 'aliases' => $commands,
272
- 'description' => $commandDescription,
273
- 'examples' => $commandExamples,
274
- 'class' => $class,
275
- 'method' => $method->getName(),
276
- 'parameters' => array()
277
- );
278
-
279
- $parameters = $method->getParameters();
280
- $parametersFor = self::_findValueForDocComment('@command-parameter-for', $method->getDocComment());
281
- for ($pi = 0; $pi < count($parameters); $pi++) {
282
- // Initialize
283
- $parameter = $parameters[$pi];
284
- $parameterFor = null;
285
- $parameterForDefaultValue = null;
286
-
287
- // Is it a "catch-all" parameter?
288
- if ($parameter->getName() == 'argv') {
289
- continue;
290
- }
291
-
292
- // Find the $parametersFor with the same name defined
293
- foreach ($parametersFor as $possibleParameterFor) {
294
- $possibleParameterFor = explode(' ', $possibleParameterFor, 4);
295
- if ($possibleParameterFor[0] == '$' . $parameter->getName()) {
296
- $parameterFor = $possibleParameterFor;
297
- break;
298
- }
299
- }
300
- if (is_null($parameterFor)) {
301
- die('@command-parameter-for missing for parameter $' . $parameter->getName());
302
- }
303
-
304
- if (is_null($parameterForDefaultValue) && $parameter->isOptional()) {
305
- $parameterForDefaultValue = $parameter->getDefaultValue();
306
- }
307
-
308
- $parameterModel = (object)array(
309
- 'name' => '$' . $parameter->getName(),
310
- 'defaultvalue' => $parameterForDefaultValue,
311
- 'valueproviders' => explode('|', $parameterFor[1]),
312
- 'aliases' => explode('|', $parameterFor[2]),
313
- 'description' => (isset($parameterFor[3]) ? $parameterFor[3] : ''),
314
- 'required' => (isset($parameterFor[3]) ? strpos(strtolower($parameterFor[3]), 'required') !== false && strpos(strtolower($parameterFor[3]), 'required if') === false : false),
315
- );
316
-
317
- // Add to model
318
- $commandModel->parameters[] = $parameterModel;
319
- }
320
-
321
- // Add to model
322
- $handlerModel->commands[] = $commandModel;
323
- }
324
- }
325
-
326
- // Add to model
327
- $model[] = $handlerModel;
328
- }
329
- }
330
-
331
- return $model;
332
- }
333
-
334
- /**
335
- * Finds the value for a specific docComment.
336
- *
337
- * @param string $docCommentName Comment name
338
- * @param unknown_type $docComment Comment object
339
- * @return array
340
- */
341
- protected static function _findValueForDocComment($docCommentName, $docComment)
342
- {
343
- $returnValue = array();
344
-
345
- $commentLines = explode("\n", $docComment);
346
- foreach ($commentLines as $commentLine) {
347
- if (strpos($commentLine, $docCommentName . ' ') !== false) {
348
- $returnValue[] = trim(substr($commentLine, strpos($commentLine, $docCommentName) + strlen($docCommentName) + 1));
349
- }
350
- }
351
-
352
- return $returnValue;
353
- }
354
-
355
- /**
356
- * Display information on an object
357
- *
358
- * @param object $object Object
359
- * @param array $propertiesToDump Property names to display
360
- */
361
- protected function _displayObjectInformation($object, $propertiesToDump = array())
362
- {
363
- foreach ($propertiesToDump as $property) {
364
- printf('%-16s: %s' . "\r\n", $property, $object->$property);
365
- }
366
- printf("\r\n");
367
- }
368
-
369
- /**
370
- * Displays the help information.
371
- *
372
- * @command-name <default>
373
- * @command-name -h
374
- * @command-name -help
375
- * @command-description Displays the current help information.
376
- */
377
- public function helpCommand() {
378
- $handler = $this->getHandler();
379
- $newline = "\r\n";
380
-
381
- if (count($handler->headers) > 0) {
382
- foreach ($handler->headers as $header) {
383
- printf('%s%s', $header, $newline);
384
- }
385
- printf($newline);
386
- }
387
- printf('%s%s', $handler->description, $newline);
388
- printf($newline);
389
- printf('Available commands:%s', $newline);
390
- foreach ($handler->commands as $command) {
391
- $description = str_split($command->description, 50);
392
- printf(' %-25s %s%s', implode(', ', $command->aliases), $description[0], $newline);
393
- for ($di = 1; $di < count($description); $di++) {
394
- printf(' %-25s %s%s', '', $description[$di], $newline);
395
- }
396
- printf($newline);
397
-
398
- if (count($command->parameters) > 0) {
399
- foreach ($command->parameters as $parameter) {
400
- $description = str_split($parameter->description, 50);
401
- printf(' %-23s %s%s', implode(', ', $parameter->aliases), $description[0], $newline);
402
- for ($di = 1; $di < count($description); $di++) {
403
- printf(' %-23s %s%s', '', $description[$di], $newline);
404
- }
405
- printf($newline);
406
- }
407
- }
408
- printf($newline);
409
-
410
- if (count($command->examples) > 0) {
411
- printf(' Example usage:%s', $newline);
412
- foreach ($command->examples as $example) {
413
- printf(' %s%s', $example, $newline);
414
- }
415
- printf($newline);
416
- }
417
- }
418
-
419
- if (count($handler->footers) > 0) {
420
- printf($newline);
421
- foreach ($handler->footers as $footer) {
422
- printf('%s%s', $footer, $newline);
423
- }
424
- printf($newline);
425
- }
426
- }
427
- }
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_Console
30
+ * @version $Id: Exception.php 55733 2011-01-03 09:17:16Z unknown $
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ */
34
+
35
+ /**
36
+ * @see Microsoft_AutoLoader
37
+ */
38
+ require_once dirname(__FILE__) . '/../AutoLoader.php';
39
+
40
+ /**
41
+ * @category Microsoft
42
+ * @package Microsoft_Console
43
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
44
+ * @license http://phpazure.codeplex.com/license
45
+ */
46
+ class Microsoft_Console_Command
47
+ {
48
+ /**
49
+ * The handler.
50
+ *
51
+ * @var array
52
+ */
53
+ protected $_handler;
54
+
55
+ /**
56
+ * Gets the handler.
57
+ *
58
+ * @return array
59
+ */
60
+ public function getHandler()
61
+ {
62
+ return $this->_handler;
63
+ }
64
+
65
+ /**
66
+ * Sets the handler.
67
+ *
68
+ * @param array $handler
69
+ * @return Microsoft_Console_Command
70
+ */
71
+ public function setHandler($handler)
72
+ {
73
+ $this->_handler = $handler;
74
+ return $this;
75
+ }
76
+
77
+ /**
78
+ * Replaces PHP's error handler
79
+ *
80
+ * @param mixed $errno
81
+ * @param mixed $errstr
82
+ * @param mixed $errfile
83
+ * @param mixed $errline
84
+ */
85
+ public static function phpstderr($errno, $errstr, $errfile, $errline)
86
+ {
87
+ self::stderr($errno . ': Error in ' . $errfile . ':' . $errline . ' - ' . $errstr);
88
+ }
89
+
90
+ /**
91
+ * Replaces PHP's exception handler
92
+ *
93
+ * @param Exception $exception
94
+ */
95
+ public static function phpstdex($exception)
96
+ {
97
+ self::stderr('Error: ' . $exception->getMessage());
98
+ }
99
+
100
+ /**
101
+ * Writes output to STDERR, followed by a newline (optional)
102
+ *
103
+ * @param string $errorMessage
104
+ * @param string $newLine
105
+ */
106
+ public static function stderr($errorMessage, $newLine = true)
107
+ {
108
+ if (error_reporting() === 0) {
109
+ return;
110
+ }
111
+ file_put_contents('php://stderr', $errorMessage . ($newLine ? "\r\n" : ''));
112
+ }
113
+
114
+ /**
115
+ * Bootstrap the shell command.
116
+ *
117
+ * @param array $argv PHP argument values.
118
+ */
119
+ public static function bootstrap($argv)
120
+ {
121
+ // Abort bootstrapping depending on the MICROSOFT_CONSOLE_COMMAND_HOST constant.
122
+ if (defined('MICROSOFT_CONSOLE_COMMAND_HOST') && strtolower(MICROSOFT_CONSOLE_COMMAND_HOST) != 'console') {
123
+ return;
124
+ }
125
+
126
+ // Replace error handler
127
+ set_error_handler(array('Microsoft_Console_Command', 'phpstderr'));
128
+ set_exception_handler(array('Microsoft_Console_Command', 'phpstdex'));
129
+
130
+ // Build the application model
131
+ $model = self::_buildModel();
132
+
133
+ // Find a class that corresponds to the $argv[0] script name
134
+ $requiredHandlerName = str_replace('.bat', '', str_replace('.sh', '', str_replace('.php', '', strtolower(basename($argv[0])))));
135
+ $handler = null;
136
+ foreach ($model as $possibleHandler) {
137
+ if ($possibleHandler->handler == strtolower($requiredHandlerName)) {
138
+ $handler = $possibleHandler;
139
+ break;
140
+ }
141
+ }
142
+ if (is_null($handler)) {
143
+ self::stderr("No class found that implements handler '" . $requiredHandlerName . "'. Create a class that is named '" . $requiredHandlerName . "' and extends Microsoft_Console_Command or is decorated with a docblock comment '@command-handler " . $requiredHandlerName . "'. Make sure it is loaded either through an autoloader or explicitly using require_once().");
144
+ die();
145
+ }
146
+
147
+ // Find a method that matches the command name
148
+ $command = null;
149
+ foreach ($handler->commands as $possibleCommand) {
150
+ if (in_array(strtolower(isset($argv[1]) ? $argv[1] : '<default>'), $possibleCommand->aliases)) {
151
+ $command = $possibleCommand;
152
+ break;
153
+ }
154
+ }
155
+ if (is_null($command)) {
156
+ $commandName = (isset($argv[1]) ? $argv[1] : '<default>');
157
+ self::stderr("No method found that implements command " . $commandName . ". Create a method in class '" . $handler->class . "' that is named '" . strtolower($commandName) . "Command' or is decorated with a docblock comment '@command-name " . $commandName . "'.");
158
+ die();
159
+ }
160
+
161
+ // Parse parameter values
162
+ $parameterValues = array();
163
+ $missingParameterValues = array();
164
+ $parameterInputs = array_splice($argv, 2);
165
+ foreach ($command->parameters as $parameter) {
166
+ // Default value: null
167
+ $value = null;
168
+
169
+ // Consult value providers for value. First one wins.
170
+ foreach ($parameter->valueproviders as $valueProviderName) {
171
+ if (!class_exists($valueProviderName)) {
172
+ $valueProviderName = 'Microsoft_Console_Command_ParameterSource_' . $valueProviderName;
173
+ }
174
+ $valueProvider = new $valueProviderName();
175
+
176
+ $value = $valueProvider->getValueForParameter($parameter, $parameterInputs);
177
+ if (!is_null($value)) {
178
+ break;
179
+ }
180
+ }
181
+ if (is_null($value) && $parameter->required) {
182
+ $missingParameterValues[] = $parameter->aliases[0];
183
+ } else if (is_null($value)) {
184
+ $value = $parameter->defaultvalue;
185
+ }
186
+
187
+ // Set value
188
+ $parameterValues[] = $value;
189
+ $argvValues[$parameter->aliases[0]] = $value;
190
+ }
191
+
192
+ // Mising parameters?
193
+ if (count($missingParameterValues) > 0) {
194
+ self::stderr("Some parameters are missing:\r\n" . implode("\r\n", $missingParameterValues));
195
+ die();
196
+ }
197
+
198
+ // Supply argv in a nice way
199
+ $parameterValues['argv'] = $parameterInputs;
200
+
201
+ // Run the command
202
+ $className = $handler->class;
203
+ $classInstance = new $className();
204
+ $classInstance->setHandler($handler);
205
+ call_user_func_array(array($classInstance, $command->method), $parameterValues);
206
+
207
+ // Restore error handler
208
+ restore_exception_handler();
209
+ restore_error_handler();
210
+ }
211
+
212
+ /**
213
+ * Builds the handler model.
214
+ *
215
+ * @return array
216
+ */
217
+ protected static function _buildModel()
218
+ {
219
+ $model = array();
220
+
221
+ $classes = get_declared_classes();
222
+ foreach ($classes as $class) {
223
+ $type = new ReflectionClass($class);
224
+
225
+ $handlers = self::_findValueForDocComment('@command-handler', $type->getDocComment());
226
+ if (count($handlers) == 0 && $type->isSubclassOf('Microsoft_Console_Command')) {
227
+ // Fallback: if the class extends Microsoft_Console_Command, register it as
228
+ // a command handler.
229
+ $handlers[] = $class;
230
+ }
231
+ $handlerDescriptions = self::_findValueForDocComment('@command-handler-description', $type->getDocComment());
232
+ $handlerHeaders = self::_findValueForDocComment('@command-handler-header', $type->getDocComment());
233
+ $handlerFooters = self::_findValueForDocComment('@command-handler-footer', $type->getDocComment());
234
+
235
+ for ($hi = 0; $hi < count($handlers); $hi++) {
236
+ $handler = $handlers[$hi];
237
+ $handlerDescription = isset($handlerDescriptions[$hi]) ? $handlerDescriptions[$hi] : isset($handlerDescriptions[0]) ? $handlerDescriptions[0] : '';
238
+ $handlerDescription = str_replace('\r\n', "\r\n", $handlerDescription);
239
+ $handlerDescription = str_replace('\n', "\n", $handlerDescription);
240
+
241
+ $handlerModel = (object)array(
242
+ 'handler' => strtolower($handler),
243
+ 'description' => $handlerDescription,
244
+ 'headers' => $handlerHeaders,
245
+ 'footers' => $handlerFooters,
246
+ 'class' => $class,
247
+ 'commands' => array()
248
+ );
249
+
250
+ $methods = $type->getMethods();
251
+ foreach ($methods as $method) {
252
+ $commands = self::_findValueForDocComment('@command-name', $method->getDocComment());
253
+ if (substr($method->getName(), -7) == 'Command' && !in_array(substr($method->getName(), 0, -7), $commands)) {
254
+ // Fallback: if the method is named <commandname>Command,
255
+ // register it as a command.
256
+ $commands[] = substr($method->getName(), 0, -7);
257
+ }
258
+ for ($x = 0; $x < count($commands); $x++) {
259
+ $commands[$x] = strtolower($commands[$x]);
260
+ }
261
+ $commands = array_unique($commands);
262
+ $commandDescriptions = self::_findValueForDocComment('@command-description', $method->getDocComment());
263
+ $commandExamples = self::_findValueForDocComment('@command-example', $method->getDocComment());
264
+
265
+ if (count($commands) > 0) {
266
+ $command = $commands[0];
267
+ $commandDescription = isset($commandDescriptions[0]) ? $commandDescriptions[0] : '';
268
+
269
+ $commandModel = (object)array(
270
+ 'command' => $command,
271
+ 'aliases' => $commands,
272
+ 'description' => $commandDescription,
273
+ 'examples' => $commandExamples,
274
+ 'class' => $class,
275
+ 'method' => $method->getName(),
276
+ 'parameters' => array()
277
+ );
278
+
279
+ $parameters = $method->getParameters();
280
+ $parametersFor = self::_findValueForDocComment('@command-parameter-for', $method->getDocComment());
281
+ for ($pi = 0; $pi < count($parameters); $pi++) {
282
+ // Initialize
283
+ $parameter = $parameters[$pi];
284
+ $parameterFor = null;
285
+ $parameterForDefaultValue = null;
286
+
287
+ // Is it a "catch-all" parameter?
288
+ if ($parameter->getName() == 'argv') {
289
+ continue;
290
+ }
291
+
292
+ // Find the $parametersFor with the same name defined
293
+ foreach ($parametersFor as $possibleParameterFor) {
294
+ $possibleParameterFor = explode(' ', $possibleParameterFor, 4);
295
+ if ($possibleParameterFor[0] == '$' . $parameter->getName()) {
296
+ $parameterFor = $possibleParameterFor;
297
+ break;
298
+ }
299
+ }
300
+ if (is_null($parameterFor)) {
301
+ die('@command-parameter-for missing for parameter $' . $parameter->getName());
302
+ }
303
+
304
+ if (is_null($parameterForDefaultValue) && $parameter->isOptional()) {
305
+ $parameterForDefaultValue = $parameter->getDefaultValue();
306
+ }
307
+
308
+ $parameterModel = (object)array(
309
+ 'name' => '$' . $parameter->getName(),
310
+ 'defaultvalue' => $parameterForDefaultValue,
311
+ 'valueproviders' => explode('|', $parameterFor[1]),
312
+ 'aliases' => explode('|', $parameterFor[2]),
313
+ 'description' => (isset($parameterFor[3]) ? $parameterFor[3] : ''),
314
+ 'required' => (isset($parameterFor[3]) ? strpos(strtolower($parameterFor[3]), 'required') !== false && strpos(strtolower($parameterFor[3]), 'required if') === false : false),
315
+ );
316
+
317
+ // Add to model
318
+ $commandModel->parameters[] = $parameterModel;
319
+ }
320
+
321
+ // Add to model
322
+ $handlerModel->commands[] = $commandModel;
323
+ }
324
+ }
325
+
326
+ // Add to model
327
+ $model[] = $handlerModel;
328
+ }
329
+ }
330
+
331
+ return $model;
332
+ }
333
+
334
+ /**
335
+ * Finds the value for a specific docComment.
336
+ *
337
+ * @param string $docCommentName Comment name
338
+ * @param unknown_type $docComment Comment object
339
+ * @return array
340
+ */
341
+ protected static function _findValueForDocComment($docCommentName, $docComment)
342
+ {
343
+ $returnValue = array();
344
+
345
+ $commentLines = explode("\n", $docComment);
346
+ foreach ($commentLines as $commentLine) {
347
+ if (strpos($commentLine, $docCommentName . ' ') !== false) {
348
+ $returnValue[] = trim(substr($commentLine, strpos($commentLine, $docCommentName) + strlen($docCommentName) + 1));
349
+ }
350
+ }
351
+
352
+ return $returnValue;
353
+ }
354
+
355
+ /**
356
+ * Display information on an object
357
+ *
358
+ * @param object $object Object
359
+ * @param array $propertiesToDump Property names to display
360
+ */
361
+ protected function _displayObjectInformation($object, $propertiesToDump = array())
362
+ {
363
+ foreach ($propertiesToDump as $property) {
364
+ printf('%-16s: %s' . "\r\n", $property, $object->$property);
365
+ }
366
+ printf("\r\n");
367
+ }
368
+
369
+ /**
370
+ * Displays the help information.
371
+ *
372
+ * @command-name <default>
373
+ * @command-name -h
374
+ * @command-name -help
375
+ * @command-description Displays the current help information.
376
+ */
377
+ public function helpCommand() {
378
+ $handler = $this->getHandler();
379
+ $newline = "\r\n";
380
+
381
+ if (count($handler->headers) > 0) {
382
+ foreach ($handler->headers as $header) {
383
+ printf('%s%s', $header, $newline);
384
+ }
385
+ printf($newline);
386
+ }
387
+ printf('%s%s', $handler->description, $newline);
388
+ printf($newline);
389
+ printf('Available commands:%s', $newline);
390
+ foreach ($handler->commands as $command) {
391
+ $description = str_split($command->description, 50);
392
+ printf(' %-25s %s%s', implode(', ', $command->aliases), $description[0], $newline);
393
+ for ($di = 1; $di < count($description); $di++) {
394
+ printf(' %-25s %s%s', '', $description[$di], $newline);
395
+ }
396
+ printf($newline);
397
+
398
+ if (count($command->parameters) > 0) {
399
+ foreach ($command->parameters as $parameter) {
400
+ $description = str_split($parameter->description, 50);
401
+ printf(' %-23s %s%s', implode(', ', $parameter->aliases), $description[0], $newline);
402
+ for ($di = 1; $di < count($description); $di++) {
403
+ printf(' %-23s %s%s', '', $description[$di], $newline);
404
+ }
405
+ printf($newline);
406
+ }
407
+ }
408
+ printf($newline);
409
+
410
+ if (count($command->examples) > 0) {
411
+ printf(' Example usage:%s', $newline);
412
+ foreach ($command->examples as $example) {
413
+ printf(' %s%s', $example, $newline);
414
+ }
415
+ printf($newline);
416
+ }
417
+ }
418
+
419
+ if (count($handler->footers) > 0) {
420
+ printf($newline);
421
+ foreach ($handler->footers as $footer) {
422
+ printf('%s%s', $footer, $newline);
423
+ }
424
+ printf($newline);
425
+ }
426
+ }
427
+ }
libs/Microsoft/Console/Command/ParameterSource/Argv.php CHANGED
@@ -1,80 +1,80 @@
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_Console
30
- * @subpackage Exception
31
- * @version $Id: Exception.php 55733 2011-01-03 09:17:16Z unknown $
32
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
- * @license http://phpazure.codeplex.com/license
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_Console
44
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
- * @license http://phpazure.codeplex.com/license
46
- */
47
- class Microsoft_Console_Command_ParameterSource_Argv
48
- implements Microsoft_Console_Command_ParameterSource_ParameterSourceInterface
49
- {
50
- /**
51
- * Get value for a named parameter.
52
- *
53
- * @param mixed $parameter Parameter to get a value for
54
- * @param array $argv Argument values passed to the script when run in console.
55
- * @return mixed
56
- */
57
- public function getValueForParameter($parameter, $argv = array())
58
- {
59
- // Default value
60
- $parameterValue = null;
61
-
62
- // Loop parameter inputs
63
- foreach ($argv as $parameterInput) {
64
- $parameterInput = explode('=', $parameterInput, 2);
65
-
66
- if (in_array($parameterInput[0], $parameter->aliases)) {
67
- $parameterValue = isset($parameterInput[1]) ? $parameterInput[1] : true;
68
- break;
69
- }
70
- }
71
- if (strtolower($parameterValue) == 'true') {
72
- $parameterValue = true;
73
- } else if (strtolower($parameterValue) == 'false') {
74
- $parameterValue = false;
75
- }
76
-
77
- // Done!
78
- return $parameterValue;
79
- }
80
  }
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_Console
30
+ * @subpackage Exception
31
+ * @version $Id: Exception.php 55733 2011-01-03 09:17:16Z unknown $
32
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
+ * @license http://phpazure.codeplex.com/license
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_Console
44
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
+ * @license http://phpazure.codeplex.com/license
46
+ */
47
+ class Microsoft_Console_Command_ParameterSource_Argv
48
+ implements Microsoft_Console_Command_ParameterSource_ParameterSourceInterface
49
+ {
50
+ /**
51
+ * Get value for a named parameter.
52
+ *
53
+ * @param mixed $parameter Parameter to get a value for
54
+ * @param array $argv Argument values passed to the script when run in console.
55
+ * @return mixed
56
+ */
57
+ public function getValueForParameter($parameter, $argv = array())
58
+ {
59
+ // Default value
60
+ $parameterValue = null;
61
+
62
+ // Loop parameter inputs
63
+ foreach ($argv as $parameterInput) {
64
+ $parameterInput = explode('=', $parameterInput, 2);
65
+
66
+ if (in_array($parameterInput[0], $parameter->aliases)) {
67
+ $parameterValue = isset($parameterInput[1]) ? $parameterInput[1] : true;
68
+ break;
69
+ }
70
+ }
71
+ if (strtolower($parameterValue) == 'true') {
72
+ $parameterValue = true;
73
+ } else if (strtolower($parameterValue) == 'false') {
74
+ $parameterValue = false;
75
+ }
76
+
77
+ // Done!
78
+ return $parameterValue;
79
+ }
80
  }
libs/Microsoft/Console/Command/ParameterSource/ConfigFile.php CHANGED
@@ -1,111 +1,111 @@
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_Console
30
- * @subpackage Exception
31
- * @version $Id: Exception.php 55733 2011-01-03 09:17:16Z unknown $
32
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
- * @license http://phpazure.codeplex.com/license
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_Console
44
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
- * @license http://phpazure.codeplex.com/license
46
- */
47
- class Microsoft_Console_Command_ParameterSource_ConfigFile
48
- implements Microsoft_Console_Command_ParameterSource_ParameterSourceInterface
49
- {
50
- /**
51
- * Get value for a named parameter.
52
- *
53
- * @param mixed $parameter Parameter to get a value for
54
- * @param array $argv Argument values passed to the script when run in console.
55
- * @return mixed
56
- */
57
- public function getValueForParameter($parameter, $argv = array())
58
- {
59
- // Configuration file path
60
- $configurationFilePath = null;
61
-
62
- // Check if a path to a configuration file is specified
63
- foreach ($argv as $parameterInput) {
64
- $parameterInput = explode('=', $parameterInput, 2);
65
-
66
- if (strtolower($parameterInput[0]) == '--configfile' || strtolower($parameterInput[0]) == '-f') {
67
- if (!isset($parameterInput[1])) {
68
- throw new Microsoft_Console_Exception("No path to a configuration file is given. Specify the path using the --ConfigFile or -F switch.");
69
- }
70
- $configurationFilePath = $parameterInput[1];
71
- break;
72
- }
73
- }
74
-
75
- // Value given?
76
- if (is_null($configurationFilePath)) {
77
- return null;
78
- }
79
- if (!file_exists($configurationFilePath)) {
80
- throw new Microsoft_Console_Exception("Invalid configuration file given. Specify the correct path using the --ConfigFile or -F switch.");
81
- }
82
-
83
- // Parse values
84
- $iniValues = parse_ini_file($configurationFilePath);
85
-
86
- // Default value
87
- $parameterValue = null;
88
-
89
- // Loop aliases
90
- foreach ($parameter->aliases as $alias) {
91
- if (array_key_exists($alias, $iniValues)) {
92
- $parameterValue = $iniValues[$alias]; break;
93
- } else if (array_key_exists(strtolower($alias), $iniValues)) {
94
- $parameterValue = $iniValues[strtolower($alias)]; break;
95
- } else if (array_key_exists(str_replace('-', '', $alias), $iniValues)) {
96
- $parameterValue = $iniValues[str_replace('-', '', $alias)]; break;
97
- } else if (array_key_exists(strtolower(str_replace('-', '', $alias)), $iniValues)) {
98
- $parameterValue = $iniValues[strtolower(str_replace('-', '', $alias))]; break;
99
- }
100
- }
101
-
102
- if (strtolower($parameterValue) == 'true') {
103
- $parameterValue = true;
104
- } else if (strtolower($parameterValue) == 'false') {
105
- $parameterValue = false;
106
- }
107
-
108
- // Done!
109
- return $parameterValue;
110
- }
111
  }
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_Console
30
+ * @subpackage Exception
31
+ * @version $Id: Exception.php 55733 2011-01-03 09:17:16Z unknown $
32
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
+ * @license http://phpazure.codeplex.com/license
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_Console
44
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
+ * @license http://phpazure.codeplex.com/license
46
+ */
47
+ class Microsoft_Console_Command_ParameterSource_ConfigFile
48
+ implements Microsoft_Console_Command_ParameterSource_ParameterSourceInterface
49
+ {
50
+ /**
51
+ * Get value for a named parameter.
52
+ *
53
+ * @param mixed $parameter Parameter to get a value for
54
+ * @param array $argv Argument values passed to the script when run in console.
55
+ * @return mixed
56
+ */
57
+ public function getValueForParameter($parameter, $argv = array())
58
+ {
59
+ // Configuration file path
60
+ $configurationFilePath = null;
61
+
62
+ // Check if a path to a configuration file is specified
63
+ foreach ($argv as $parameterInput) {
64
+ $parameterInput = explode('=', $parameterInput, 2);
65
+
66
+ if (strtolower($parameterInput[0]) == '--configfile' || strtolower($parameterInput[0]) == '-f') {
67
+ if (!isset($parameterInput[1])) {
68
+ throw new Microsoft_Console_Exception("No path to a configuration file is given. Specify the path using the --ConfigFile or -F switch.");
69
+ }
70
+ $configurationFilePath = $parameterInput[1];
71
+ break;
72
+ }
73
+ }
74
+
75
+ // Value given?
76
+ if (is_null($configurationFilePath)) {
77
+ return null;
78
+ }
79
+ if (!file_exists($configurationFilePath)) {
80
+ throw new Microsoft_Console_Exception("Invalid configuration file given. Specify the correct path using the --ConfigFile or -F switch.");
81
+ }
82
+
83
+ // Parse values
84
+ $iniValues = parse_ini_file($configurationFilePath);
85
+
86
+ // Default value
87
+ $parameterValue = null;
88
+
89
+ // Loop aliases
90
+ foreach ($parameter->aliases as $alias) {
91
+ if (array_key_exists($alias, $iniValues)) {
92
+ $parameterValue = $iniValues[$alias]; break;
93
+ } else if (array_key_exists(strtolower($alias), $iniValues)) {
94
+ $parameterValue = $iniValues[strtolower($alias)]; break;
95
+ } else if (array_key_exists(str_replace('-', '', $alias), $iniValues)) {
96
+ $parameterValue = $iniValues[str_replace('-', '', $alias)]; break;
97
+ } else if (array_key_exists(strtolower(str_replace('-', '', $alias)), $iniValues)) {
98
+ $parameterValue = $iniValues[strtolower(str_replace('-', '', $alias))]; break;
99
+ }
100
+ }
101
+
102
+ if (strtolower($parameterValue) == 'true') {
103
+ $parameterValue = true;
104
+ } else if (strtolower($parameterValue) == 'false') {
105
+ $parameterValue = false;
106
+ }
107
+
108
+ // Done!
109
+ return $parameterValue;
110
+ }
111
  }
libs/Microsoft/Console/Command/ParameterSource/Env.php CHANGED
@@ -1,84 +1,84 @@
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_Console
30
- * @subpackage Exception
31
- * @version $Id: Exception.php 55733 2011-01-03 09:17:16Z unknown $
32
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
- * @license http://phpazure.codeplex.com/license
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_Console
44
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
- * @license http://phpazure.codeplex.com/license
46
- */
47
- class Microsoft_Console_Command_ParameterSource_Env
48
- implements Microsoft_Console_Command_ParameterSource_ParameterSourceInterface
49
- {
50
- /**
51
- * Get value for a named parameter.
52
- *
53
- * @param mixed $parameter Parameter to get a value for
54
- * @param array $argv Argument values passed to the script when run in console.
55
- * @return mixed
56
- */
57
- public function getValueForParameter($parameter, $argv = array())
58
- {
59
- // Default value
60
- $parameterValue = null;
61
-
62
- // Fetch value for parameter
63
- foreach ($parameter->aliases as $alias) {
64
- while (strpos($alias, '-') !== false) {
65
- $alias = substr($alias, 1);
66
- }
67
- $value = getenv($alias);
68
-
69
- if (!is_null($value) && $value !== false) {
70
- $parameterValue = $value;
71
- break;
72
- }
73
- }
74
-
75
- if (strtolower($parameterValue) == 'true') {
76
- $parameterValue = true;
77
- } else if (strtolower($parameterValue) == 'false') {
78
- $parameterValue = false;
79
- }
80
-
81
- // Done!
82
- return $parameterValue;
83
- }
84
  }
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_Console
30
+ * @subpackage Exception
31
+ * @version $Id: Exception.php 55733 2011-01-03 09:17:16Z unknown $
32
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
+ * @license http://phpazure.codeplex.com/license
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_Console
44
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
+ * @license http://phpazure.codeplex.com/license
46
+ */
47
+ class Microsoft_Console_Command_ParameterSource_Env
48
+ implements Microsoft_Console_Command_ParameterSource_ParameterSourceInterface
49
+ {
50
+ /**
51
+ * Get value for a named parameter.
52
+ *
53
+ * @param mixed $parameter Parameter to get a value for
54
+ * @param array $argv Argument values passed to the script when run in console.
55
+ * @return mixed
56
+ */
57
+ public function getValueForParameter($parameter, $argv = array())
58
+ {
59
+ // Default value
60
+ $parameterValue = null;
61
+
62
+ // Fetch value for parameter
63
+ foreach ($parameter->aliases as $alias) {
64
+ while (strpos($alias, '-') !== false) {
65
+ $alias = substr($alias, 1);
66
+ }
67
+ $value = getenv($alias);
68
+
69
+ if (!is_null($value) && $value !== false) {
70
+ $parameterValue = $value;
71
+ break;
72
+ }
73
+ }
74
+
75
+ if (strtolower($parameterValue) == 'true') {
76
+ $parameterValue = true;
77
+ } else if (strtolower($parameterValue) == 'false') {
78
+ $parameterValue = false;
79
+ }
80
+
81
+ // Done!
82
+ return $parameterValue;
83
+ }
84
  }
libs/Microsoft/Console/Command/ParameterSource/ParameterSourceInterface.php CHANGED
@@ -1,57 +1,57 @@
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_Console
30
- * @subpackage Exception
31
- * @version $Id: Exception.php 55733 2011-01-03 09:17:16Z unknown $
32
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
- * @license http://phpazure.codeplex.com/license
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_Console
44
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
- * @license http://phpazure.codeplex.com/license
46
- */
47
- interface Microsoft_Console_Command_ParameterSource_ParameterSourceInterface
48
- {
49
- /**
50
- * Get value for a named parameter.
51
- *
52
- * @param mixed $parameter Parameter to get a value for
53
- * @param array $argv Argument values passed to the script when run in console.
54
- * @return mixed
55
- */
56
- public function getValueForParameter($parameter, $argv = array());
57
  }
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_Console
30
+ * @subpackage Exception
31
+ * @version $Id: Exception.php 55733 2011-01-03 09:17:16Z unknown $
32
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
+ * @license http://phpazure.codeplex.com/license
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_Console
44
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
+ * @license http://phpazure.codeplex.com/license
46
+ */
47
+ interface Microsoft_Console_Command_ParameterSource_ParameterSourceInterface
48
+ {
49
+ /**
50
+ * Get value for a named parameter.
51
+ *
52
+ * @param mixed $parameter Parameter to get a value for
53
+ * @param array $argv Argument values passed to the script when run in console.
54
+ * @return mixed
55
+ */
56
+ public function getValueForParameter($parameter, $argv = array());
57
  }
libs/Microsoft/Console/Command/ParameterSource/Prompt.php CHANGED
@@ -1,75 +1,75 @@
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_Console
30
- * @subpackage Exception
31
- * @version $Id: Exception.php 55733 2011-01-03 09:17:16Z unknown $
32
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
- * @license http://phpazure.codeplex.com/license
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_Console
44
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
- * @license http://phpazure.codeplex.com/license
46
- */
47
- class Microsoft_Console_Command_ParameterSource_Prompt
48
- implements Microsoft_Console_Command_ParameterSource_ParameterSourceInterface
49
- {
50
- /**
51
- * Get value for a named parameter.
52
- *
53
- * @param mixed $parameter Parameter to get a value for
54
- * @param array $argv Argument values passed to the script when run in console.
55
- * @return mixed
56
- */
57
- public function getValueForParameter($parameter, $argv = array())
58
- {
59
- // Default value
60
- $parameterValue = null;
61
-
62
- // Prompt the user
63
- fwrite(STDOUT, "Supply a value for " . $parameter->aliases[0] . ": ");
64
- /*if ($parameter->description != '' && !is_null($parameter->description)) {
65
- fwrite(STDOUT, $parameter->description . ".\r\n");
66
- }*/
67
-
68
- while (is_null($parameterValue) || $parameterValue == '') {
69
- $parameterValue = trim(fgets(STDIN));
70
- }
71
-
72
- // Done!
73
- return $parameterValue;
74
- }
75
  }
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_Console
30
+ * @subpackage Exception
31
+ * @version $Id: Exception.php 55733 2011-01-03 09:17:16Z unknown $
32
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
+ * @license http://phpazure.codeplex.com/license
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_Console
44
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
+ * @license http://phpazure.codeplex.com/license
46
+ */
47
+ class Microsoft_Console_Command_ParameterSource_Prompt
48
+ implements Microsoft_Console_Command_ParameterSource_ParameterSourceInterface
49
+ {
50
+ /**
51
+ * Get value for a named parameter.
52
+ *
53
+ * @param mixed $parameter Parameter to get a value for
54
+ * @param array $argv Argument values passed to the script when run in console.
55
+ * @return mixed
56
+ */
57
+ public function getValueForParameter($parameter, $argv = array())
58
+ {
59
+ // Default value
60
+ $parameterValue = null;
61
+
62
+ // Prompt the user
63
+ fwrite(STDOUT, "Supply a value for " . $parameter->aliases[0] . ": ");
64
+ /*if ($parameter->description != '' && !is_null($parameter->description)) {
65
+ fwrite(STDOUT, $parameter->description . ".\r\n");
66
+ }*/
67
+
68
+ while (is_null($parameterValue) || $parameterValue == '') {
69
+ $parameterValue = trim(fgets(STDIN));
70
+ }
71
+
72
+ // Done!
73
+ return $parameterValue;
74
+ }
75
  }
libs/Microsoft/Console/Command/ParameterSource/StdIn.php CHANGED
@@ -1,90 +1,90 @@
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_Console
30
- * @subpackage Exception
31
- * @version $Id: Exception.php 55733 2011-01-03 09:17:16Z unknown $
32
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
- * @license http://phpazure.codeplex.com/license
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_Console
44
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
- * @license http://phpazure.codeplex.com/license
46
- */
47
- class Microsoft_Console_Command_ParameterSource_StdIn
48
- implements Microsoft_Console_Command_ParameterSource_ParameterSourceInterface
49
- {
50
- /**
51
- * Get value for a named parameter.
52
- *
53
- * @param mixed $parameter Parameter to get a value for
54
- * @param array $argv Argument values passed to the script when run in console.
55
- * @return mixed
56
- */
57
- public function getValueForParameter($parameter, $argv = array())
58
- {
59
- // Default value
60
- $parameterValue = null;
61
-
62
- // Check STDIN for data
63
- if (ftell(STDIN) !== false) {
64
- // Read from STDIN
65
- $fs = fopen("php://stdin", "r");
66
- if ($fs !== false) {
67
- /*
68
- while (!feof($fs)) {
69
- $data = fread($fs, 1);
70
- var_dump($data);
71
- $parameterValue .= $data;
72
- } */
73
- $parameterValue = stream_get_contents($fs);
74
- fclose($fs);
75
- }
76
-
77
- // Remove ending \r\n
78
- $parameterValue = rtrim($parameterValue);
79
-
80
- if (strtolower($parameterValue) == 'true') {
81
- $parameterValue = true;
82
- } else if (strtolower($parameterValue) == 'false') {
83
- $parameterValue = false;
84
- }
85
- }
86
-
87
- // Done!
88
- return $parameterValue;
89
- }
90
  }
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_Console
30
+ * @subpackage Exception
31
+ * @version $Id: Exception.php 55733 2011-01-03 09:17:16Z unknown $
32
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
+ * @license http://phpazure.codeplex.com/license
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_Console
44
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
+ * @license http://phpazure.codeplex.com/license
46
+ */
47
+ class Microsoft_Console_Command_ParameterSource_StdIn
48
+ implements Microsoft_Console_Command_ParameterSource_ParameterSourceInterface
49
+ {
50
+ /**
51
+ * Get value for a named parameter.
52
+ *
53
+ * @param mixed $parameter Parameter to get a value for
54
+ * @param array $argv Argument values passed to the script when run in console.
55
+ * @return mixed
56
+ */
57
+ public function getValueForParameter($parameter, $argv = array())
58
+ {
59
+ // Default value
60
+ $parameterValue = null;
61
+
62
+ // Check STDIN for data
63
+ if (ftell(STDIN) !== false) {
64
+ // Read from STDIN
65
+ $fs = fopen("php://stdin", "r");
66
+ if ($fs !== false) {
67
+ /*
68
+ while (!feof($fs)) {
69
+ $data = fread($fs, 1);
70
+ var_dump($data);
71
+ $parameterValue .= $data;
72
+ } */
73
+ $parameterValue = stream_get_contents($fs);
74
+ fclose($fs);
75
+ }
76
+
77
+ // Remove ending \r\n
78
+ $parameterValue = rtrim($parameterValue);
79
+
80
+ if (strtolower($parameterValue) == 'true') {
81
+ $parameterValue = true;
82
+ } else if (strtolower($parameterValue) == 'false') {
83
+ $parameterValue = false;
84
+ }
85
+ }
86
+
87
+ // Done!
88
+ return $parameterValue;
89
+ }
90
  }
libs/Microsoft/Console/Exception.php CHANGED
@@ -1,48 +1,48 @@
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_Console
30
- * @subpackage Exception
31
- * @version $Id: Exception.php 55733 2011-01-03 09:17:16Z unknown $
32
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
- * @license http://phpazure.codeplex.com/license
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_Console
44
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
- * @license http://phpazure.codeplex.com/license
46
- */
47
- class Microsoft_Console_Exception extends Microsoft_Exception
48
- {}
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_Console
30
+ * @subpackage Exception
31
+ * @version $Id: Exception.php 55733 2011-01-03 09:17:16Z unknown $
32
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
+ * @license http://phpazure.codeplex.com/license
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_Console
44
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
+ * @license http://phpazure.codeplex.com/license
46
+ */
47
+ class Microsoft_Console_Exception extends Microsoft_Exception
48
+ {}
libs/Microsoft/Exception.php CHANGED
@@ -1,47 +1,47 @@
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
30
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
31
- * @license http://phpazure.codeplex.com/license
32
- */
33
-
34
- /**
35
- * @see Microsoft_AutoLoader
36
- */
37
- require_once dirname(__FILE__) . '/AutoLoader.php';
38
-
39
- /**
40
- * @category Microsoft
41
- * @package Microsoft
42
- * @subpackage Exception
43
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
44
- * @license http://phpazure.codeplex.com/license
45
- */
46
- class Microsoft_Exception extends Exception
47
  {}
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
30
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
31
+ * @license http://phpazure.codeplex.com/license
32
+ */
33
+
34
+ /**
35
+ * @see Microsoft_AutoLoader
36
+ */
37
+ require_once dirname(__FILE__) . '/AutoLoader.php';
38
+
39
+ /**
40
+ * @category Microsoft
41
+ * @package Microsoft
42
+ * @subpackage Exception
43
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
44
+ * @license http://phpazure.codeplex.com/license
45
+ */
46
+ class Microsoft_Exception extends Exception
47
  {}
libs/Microsoft/Http/Exception.php CHANGED
@@ -1,48 +1,48 @@
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_Http
30
- * @subpackage Exception
31
- * @version $Id: Exception.php 61042 2011-04-19 10:03:39Z unknown $
32
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
- * @license http://phpazure.codeplex.com/license
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_Http
44
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
- * @license http://phpazure.codeplex.com/license
46
- */
47
- class Microsoft_Http_Exception extends Microsoft_Exception
48
- {}
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_Http
30
+ * @subpackage Exception
31
+ * @version $Id: Exception.php 61042 2011-04-19 10:03:39Z unknown $
32
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
+ * @license http://phpazure.codeplex.com/license
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_Http
44
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
+ * @license http://phpazure.codeplex.com/license
46
+ */
47
+ class Microsoft_Http_Exception extends Microsoft_Exception
48
+ {}
libs/Microsoft/SqlAzure/CommandLine/SqlAzure.php CHANGED
@@ -1,298 +1,298 @@
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_Console
30
- * @subpackage Exception
31
- * @version $Id: Exception.php 55733 2011-01-03 09:17:16Z unknown $
32
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
- * @license http://phpazure.codeplex.com/license
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * Service commands
43
- *
44
- * @category Microsoft
45
- * @package Microsoft_SqlAzure_CommandLine
46
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
47
- * @license http://phpazure.codeplex.com/license
48
- *
49
- * @command-handler sqlazure
50
- * @command-handler-description Sql Azure Server commands
51
- * @command-handler-header Windows Azure SDK for PHP
52
- * @command-handler-header Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
53
- * @command-handler-footer Note: Parameters that are common across all commands can be stored
54
- * @command-handler-footer in two dedicated environment variables.
55
- * @command-handler-footer - SubscriptionId: The Windows Azure Subscription Id to operate on.
56
- * @command-handler-footer - Certificate The Windows Azure .cer Management Certificate.
57
- * @command-handler-footer
58
- * @command-handler-footer All commands support the --ConfigurationFile or -F parameter.
59
- * @command-handler-footer The parameter file is a simple INI file carrying one parameter
60
- * @command-handler-footer value per line. It accepts the same parameters as one can
61
- * @command-handler-footer use from the command line command.
62
- */
63
- class Microsoft_SqlAzure_CommandLine_SqlAzure
64
- extends Microsoft_Console_Command
65
- {
66
- /**
67
- * List servers for a specified subscription.
68
- *
69
- * @command-name List
70
- * @command-description List servers for a specified subscription.
71
- * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
72
- * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
73
- * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
74
- * @command-example List servers for a specified subscription:
75
- * @command-example List -sid="<your_subscription_id>" -cert="mycert.pem"
76
- */
77
- public function listCommand($subscriptionId, $certificate, $certificatePassphrase)
78
- {
79
- $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
80
- $result = $client->listServers();
81
-
82
- if (count($result) == 0) {
83
- echo 'No data to display.';
84
- }
85
- foreach ($result as $object) {
86
- $this->_displayObjectInformation($object, array('Name', 'AdministratorLogin'));
87
- }
88
- }
89
-
90
- /**
91
- * Get server properties.
92
- *
93
- * @command-name GetProperties
94
- * @command-description Get server properties.
95
- * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
96
- * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
97
- * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
98
- * @command-parameter-for $serverName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env|Microsoft_Console_Command_ParameterSource_StdIn --Name Required. The server name to operate on.
99
- * @command-example Get server properties for server "ie2l1ph28":
100
- * @command-example GetProperties -sid="<your_subscription_id>" -cert="mycert.pem"
101
- * @command-example --Name="ie2l1ph28"
102
- */
103
- public function getPropertiesCommand($subscriptionId, $certificate, $certificatePassphrase, $serverName)
104
- {
105
- $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
106
- $result = $client->listServers();
107
-
108
- $server = null;
109
- foreach ($result as $serverInstance) {
110
- if ($serverInstance->Name == $serverName) {
111
- $server = $serverInstance;
112
- break;
113
- }
114
- }
115
-
116
- $this->_displayObjectInformation($server, array('Name', 'DnsName', 'AdministratorLogin', 'Location'));
117
- }
118
-
119
- /**
120
- * Get server property.
121
- *
122
- * @command-name GetProperty
123
- * @command-description Get server property.
124
- * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
125
- * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
126
- * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
127
- * @command-parameter-for $serverName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env|Microsoft_Console_Command_ParameterSource_StdIn --Name Required. The server name to operate on.
128
- * @command-parameter-for $property Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --Property|-prop Required. The property to retrieve for the server.
129
- * @command-example Get server property "Name" for service "ie2l1ph28":
130
- * @command-example GetProperty -sid="<your_subscription_id>" -cert="mycert.pem"
131
- * @command-example --Name="ie2l1ph28" --Property=Name
132
- */
133
- public function getPropertyCommand($subscriptionId, $certificate, $certificatePassphrase, $serverName, $property)
134
- {
135
- $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
136
- $result = $client->listServers();
137
-
138
- $server = null;
139
- foreach ($result as $serverInstance) {
140
- if ($serverInstance->Name == $serverName) {
141
- $server = $serverInstance;
142
- break;
143
- }
144
- }
145
-
146
- printf("%s\r\n", $server->$property);
147
- }
148
-
149
- /**
150
- * Create server.
151
- *
152
- * @command-name Create
153
- * @command-description Create server.
154
- * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
155
- * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
156
- * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
157
- * @command-parameter-for $administratorLogin Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --Login|-l Required. The administrator login name for the server.
158
- * @command-parameter-for $administratorPassword Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --Password|-pass Required. The administrator password for the server.
159
- * @command-parameter-for $location Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --Location Required. The location where the server will be created.
160
- * @command-parameter-for $waitForOperation Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --WaitFor|-w Optional. Wait for the operation to complete?
161
- * @command-example Create server in West Europe
162
- * @command-example Create -p="phpazure" --Login="sqladm" --Password="PHP@zure11" --Location="West Europe"
163
- */
164
- public function createCommand($subscriptionId, $certificate, $certificatePassphrase, $administratorLogin, $administratorPassword, $location, $waitForOperation = false)
165
- {
166
- $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
167
- $server = $client->createServer($administratorLogin, $administratorPassword, $location);
168
- echo $server->Name;
169
- }
170
-
171
- /**
172
- * Drop server.
173
- *
174
- * @command-name Drop
175
- * @command-description Drop server.
176
- * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
177
- * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
178
- * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
179
- * @command-parameter-for $serverName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_StdIn --Name Required. The server name to operate on.
180
- * @command-parameter-for $waitForOperation Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --WaitFor|-w Optional. Wait for the operation to complete?
181
- * @command-example Drop server "ie2l1ph28":
182
- * @command-example Drop -p="phpazure" --Name="ie2l1ph28"
183
- */
184
- public function dropCommand($subscriptionId, $certificate, $certificatePassphrase, $serverName, $waitForOperation = false)
185
- {
186
- $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
187
- $server = $client->dropServer($serverName);
188
- }
189
-
190
- /**
191
- * Update administrator password for server.
192
- *
193
- * @command-name UpdatePassword
194
- * @command-description Update administrator password for server.
195
- * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
196
- * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
197
- * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
198
- * @command-parameter-for $serverName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_StdIn --Name Required. The server name to operate on.
199
- * @command-parameter-for $administratorPassword Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --Password|-pass Required. The administrator password for the server.
200
- * @command-parameter-for $waitForOperation Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --WaitFor|-w Optional. Wait for the operation to complete?
201
- * @command-example Update administrator password for server "ie2l1ph28":
202
- * @command-example UpdatePassword -p="phpazure" --Name="ie2l1ph28" --Password="PHP@zure11"
203
- */
204
- public function updatePasswordCommand($subscriptionId, $certificate, $certificatePassphrase, $serverName, $administratorPassword, $waitForOperation = false)
205
- {
206
- $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
207
- $server = $client->setAdministratorPassword($serverName, $administratorPassword);
208
- }
209
-
210
- /**
211
- * Create firewall rule for server.
212
- *
213
- * @command-name CreateFirewallRule
214
- * @command-description Create firewall rule for server.
215
- * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
216
- * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
217
- * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
218
- * @command-parameter-for $serverName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_StdIn --Name Required. The server name to operate on.
219
- * @command-parameter-for $ruleName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --RuleName|-r Required. Firewall rule name.
220
- * @command-parameter-for $startIpAddress Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --StartIp|-start Required. Start IP address.
221
- * @command-parameter-for $endIpAddress Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --EndIp|-end Required. End IP address.
222
- * @command-parameter-for $waitForOperation Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --WaitFor|-w Optional. Wait for the operation to complete?
223
- * @command-example Create firewall rule for server "ie2l1ph28":
224
- * @command-example CreateFirewallRule -p="phpazure" --Name="ie2l1ph28" -r="Rule1" -start="1.2.3.4" -end="1.2.3.4"
225
- */
226
- public function createFirewallRuleCommand($subscriptionId, $certificate, $certificatePassphrase, $serverName, $ruleName, $startIpAddress, $endIpAddress, $waitForOperation = false)
227
- {
228
- $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
229
- $rule = $client->createFirewallRule($serverName, $ruleName, $startIpAddress, $endIpAddress);
230
- }
231
-
232
- /**
233
- * Allow access from Windows Azure to SQL Azure.
234
- *
235
- * @command-name AllowWindowsAzure
236
- * @command-description Allow access from Windows Azure to SQL Azure.
237
- * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
238
- * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
239
- * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
240
- * @command-parameter-for $serverName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_StdIn --Name Required. The server name to operate on.
241
- * @command-parameter-for $allow Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --Allow|-a Required. Allow access from Windows Azure true/false.
242
- * @command-parameter-for $waitForOperation Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --WaitFor|-w Optional. Wait for the operation to complete?
243
- * @command-example Allow access from Windows Azure to SQL Azure for server "ie2l1ph28":
244
- * @command-example AllowWindowsAzure -p="phpazure" --Name="ie2l1ph28" -Allow:true
245
- */
246
- public function allowWindowsAzureCommand($subscriptionId, $certificate, $certificatePassphrase, $serverName, $allow = false, $waitForOperation = false)
247
- {
248
- $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
249
- $rule = $client->createFirewallRuleForMicrosoftServices($serverName, $allow);
250
- }
251
-
252
- /**
253
- * Delete firewall rule for server.
254
- *
255
- * @command-name DeleteFirewallRule
256
- * @command-description Delete firewall rule for server.
257
- * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
258
- * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
259
- * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
260
- * @command-parameter-for $serverName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_StdIn --Name Required. The server name to operate on.
261
- * @command-parameter-for $ruleName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --RuleName|-r Required. Firewall rule name.
262
- * @command-parameter-for $waitForOperation Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --WaitFor|-w Optional. Wait for the operation to complete?
263
- * @command-example Delete firewall rule for server "ie2l1ph28":
264
- * @command-example DeleteFirewallRule -p="phpazure" --Name="ie2l1ph28" -r="Rule1"
265
- */
266
- public function deleteFirewallRuleCommand($subscriptionId, $certificate, $certificatePassphrase, $serverName, $ruleName, $waitForOperation = false)
267
- {
268
- $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
269
- $rule = $client->deleteFirewallRule($serverName, $ruleName);
270
- }
271
-
272
- /**
273
- * List firewall rules for a specified server.
274
- *
275
- * @command-name ListFirewallRules
276
- * @command-description List firewall rules for a specified server.
277
- * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
278
- * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
279
- * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
280
- * @command-parameter-for $serverName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_StdIn --Name Required. The server name to operate on.
281
- * @command-example List firewall rules for server "ie2l1ph28":
282
- * @command-example ListFirewallRules -sid="<your_subscription_id>" --Name="ie2l1ph28"
283
- */
284
- public function listFirewallRuleCommand($subscriptionId, $certificate, $certificatePassphrase, $serverName)
285
- {
286
- $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
287
- $result = $client->listFirewallRules($serverName);
288
-
289
- if (count($result) == 0) {
290
- echo 'No data to display.';
291
- }
292
- foreach ($result as $object) {
293
- $this->_displayObjectInformation($object, array('Name', 'StartIpAddress', 'EndIpAddress'));
294
- }
295
- }
296
- }
297
-
298
  Microsoft_Console_Command::bootstrap($_SERVER['argv']);
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_Console
30
+ * @subpackage Exception
31
+ * @version $Id: Exception.php 55733 2011-01-03 09:17:16Z unknown $
32
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
+ * @license http://phpazure.codeplex.com/license
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * Service commands
43
+ *
44
+ * @category Microsoft
45
+ * @package Microsoft_SqlAzure_CommandLine
46
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
47
+ * @license http://phpazure.codeplex.com/license
48
+ *
49
+ * @command-handler sqlazure
50
+ * @command-handler-description Sql Azure Server commands
51
+ * @command-handler-header Windows Azure SDK for PHP
52
+ * @command-handler-header Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
53
+ * @command-handler-footer Note: Parameters that are common across all commands can be stored
54
+ * @command-handler-footer in two dedicated environment variables.
55
+ * @command-handler-footer - SubscriptionId: The Windows Azure Subscription Id to operate on.
56
+ * @command-handler-footer - Certificate The Windows Azure .cer Management Certificate.
57
+ * @command-handler-footer
58
+ * @command-handler-footer All commands support the --ConfigurationFile or -F parameter.
59
+ * @command-handler-footer The parameter file is a simple INI file carrying one parameter
60
+ * @command-handler-footer value per line. It accepts the same parameters as one can
61
+ * @command-handler-footer use from the command line command.
62
+ */
63
+ class Microsoft_SqlAzure_CommandLine_SqlAzure
64
+ extends Microsoft_Console_Command
65
+ {
66
+ /**
67
+ * List servers for a specified subscription.
68
+ *
69
+ * @command-name List
70
+ * @command-description List servers for a specified subscription.
71
+ * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
72
+ * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
73
+ * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
74
+ * @command-example List servers for a specified subscription:
75
+ * @command-example List -sid="<your_subscription_id>" -cert="mycert.pem"
76
+ */
77
+ public function listCommand($subscriptionId, $certificate, $certificatePassphrase)
78
+ {
79
+ $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
80
+ $result = $client->listServers();
81
+
82
+ if (count($result) == 0) {
83
+ echo 'No data to display.';
84
+ }
85
+ foreach ($result as $object) {
86
+ $this->_displayObjectInformation($object, array('Name', 'AdministratorLogin'));
87
+ }
88
+ }
89
+
90
+ /**
91
+ * Get server properties.
92
+ *
93
+ * @command-name GetProperties
94
+ * @command-description Get server properties.
95
+ * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
96
+ * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
97
+ * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
98
+ * @command-parameter-for $serverName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env|Microsoft_Console_Command_ParameterSource_StdIn --Name Required. The server name to operate on.
99
+ * @command-example Get server properties for server "ie2l1ph28":
100
+ * @command-example GetProperties -sid="<your_subscription_id>" -cert="mycert.pem"
101
+ * @command-example --Name="ie2l1ph28"
102
+ */
103
+ public function getPropertiesCommand($subscriptionId, $certificate, $certificatePassphrase, $serverName)
104
+ {
105
+ $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
106
+ $result = $client->listServers();
107
+
108
+ $server = null;
109
+ foreach ($result as $serverInstance) {
110
+ if ($serverInstance->Name == $serverName) {
111
+ $server = $serverInstance;
112
+ break;
113
+ }
114
+ }
115
+
116
+ $this->_displayObjectInformation($server, array('Name', 'DnsName', 'AdministratorLogin', 'Location'));
117
+ }
118
+
119
+ /**
120
+ * Get server property.
121
+ *
122
+ * @command-name GetProperty
123
+ * @command-description Get server property.
124
+ * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
125
+ * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
126
+ * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
127
+ * @command-parameter-for $serverName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env|Microsoft_Console_Command_ParameterSource_StdIn --Name Required. The server name to operate on.
128
+ * @command-parameter-for $property Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --Property|-prop Required. The property to retrieve for the server.
129
+ * @command-example Get server property "Name" for service "ie2l1ph28":
130
+ * @command-example GetProperty -sid="<your_subscription_id>" -cert="mycert.pem"
131
+ * @command-example --Name="ie2l1ph28" --Property=Name
132
+ */
133
+ public function getPropertyCommand($subscriptionId, $certificate, $certificatePassphrase, $serverName, $property)
134
+ {
135
+ $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
136
+ $result = $client->listServers();
137
+
138
+ $server = null;
139
+ foreach ($result as $serverInstance) {
140
+ if ($serverInstance->Name == $serverName) {
141
+ $server = $serverInstance;
142
+ break;
143
+ }
144
+ }
145
+
146
+ printf("%s\r\n", $server->$property);
147
+ }
148
+
149
+ /**
150
+ * Create server.
151
+ *
152
+ * @command-name Create
153
+ * @command-description Create server.
154
+ * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
155
+ * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
156
+ * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
157
+ * @command-parameter-for $administratorLogin Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --Login|-l Required. The administrator login name for the server.
158
+ * @command-parameter-for $administratorPassword Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --Password|-pass Required. The administrator password for the server.
159
+ * @command-parameter-for $location Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --Location Required. The location where the server will be created.
160
+ * @command-parameter-for $waitForOperation Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --WaitFor|-w Optional. Wait for the operation to complete?
161
+ * @command-example Create server in West Europe
162
+ * @command-example Create -p="phpazure" --Login="sqladm" --Password="PHP@zure11" --Location="West Europe"
163
+ */
164
+ public function createCommand($subscriptionId, $certificate, $certificatePassphrase, $administratorLogin, $administratorPassword, $location, $waitForOperation = false)
165
+ {
166
+ $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
167
+ $server = $client->createServer($administratorLogin, $administratorPassword, $location);
168
+ echo $server->Name;
169
+ }
170
+
171
+ /**
172
+ * Drop server.
173
+ *
174
+ * @command-name Drop
175
+ * @command-description Drop server.
176
+ * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
177
+ * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
178
+ * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
179
+ * @command-parameter-for $serverName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_StdIn --Name Required. The server name to operate on.
180
+ * @command-parameter-for $waitForOperation Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --WaitFor|-w Optional. Wait for the operation to complete?
181
+ * @command-example Drop server "ie2l1ph28":
182
+ * @command-example Drop -p="phpazure" --Name="ie2l1ph28"
183
+ */
184
+ public function dropCommand($subscriptionId, $certificate, $certificatePassphrase, $serverName, $waitForOperation = false)
185
+ {
186
+ $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
187
+ $server = $client->dropServer($serverName);
188
+ }
189
+
190
+ /**
191
+ * Update administrator password for server.
192
+ *
193
+ * @command-name UpdatePassword
194
+ * @command-description Update administrator password for server.
195
+ * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
196
+ * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
197
+ * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
198
+ * @command-parameter-for $serverName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_StdIn --Name Required. The server name to operate on.
199
+ * @command-parameter-for $administratorPassword Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --Password|-pass Required. The administrator password for the server.
200
+ * @command-parameter-for $waitForOperation Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --WaitFor|-w Optional. Wait for the operation to complete?
201
+ * @command-example Update administrator password for server "ie2l1ph28":
202
+ * @command-example UpdatePassword -p="phpazure" --Name="ie2l1ph28" --Password="PHP@zure11"
203
+ */
204
+ public function updatePasswordCommand($subscriptionId, $certificate, $certificatePassphrase, $serverName, $administratorPassword, $waitForOperation = false)
205
+ {
206
+ $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
207
+ $server = $client->setAdministratorPassword($serverName, $administratorPassword);
208
+ }
209
+
210
+ /**
211
+ * Create firewall rule for server.
212
+ *
213
+ * @command-name CreateFirewallRule
214
+ * @command-description Create firewall rule for server.
215
+ * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
216
+ * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
217
+ * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
218
+ * @command-parameter-for $serverName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_StdIn --Name Required. The server name to operate on.
219
+ * @command-parameter-for $ruleName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --RuleName|-r Required. Firewall rule name.
220
+ * @command-parameter-for $startIpAddress Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --StartIp|-start Required. Start IP address.
221
+ * @command-parameter-for $endIpAddress Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --EndIp|-end Required. End IP address.
222
+ * @command-parameter-for $waitForOperation Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --WaitFor|-w Optional. Wait for the operation to complete?
223
+ * @command-example Create firewall rule for server "ie2l1ph28":
224
+ * @command-example CreateFirewallRule -p="phpazure" --Name="ie2l1ph28" -r="Rule1" -start="1.2.3.4" -end="1.2.3.4"
225
+ */
226
+ public function createFirewallRuleCommand($subscriptionId, $certificate, $certificatePassphrase, $serverName, $ruleName, $startIpAddress, $endIpAddress, $waitForOperation = false)
227
+ {
228
+ $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
229
+ $rule = $client->createFirewallRule($serverName, $ruleName, $startIpAddress, $endIpAddress);
230
+ }
231
+
232
+ /**
233
+ * Allow access from Windows Azure to SQL Azure.
234
+ *
235
+ * @command-name AllowWindowsAzure
236
+ * @command-description Allow access from Windows Azure to SQL Azure.
237
+ * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
238
+ * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
239
+ * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
240
+ * @command-parameter-for $serverName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_StdIn --Name Required. The server name to operate on.
241
+ * @command-parameter-for $allow Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --Allow|-a Required. Allow access from Windows Azure true/false.
242
+ * @command-parameter-for $waitForOperation Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --WaitFor|-w Optional. Wait for the operation to complete?
243
+ * @command-example Allow access from Windows Azure to SQL Azure for server "ie2l1ph28":
244
+ * @command-example AllowWindowsAzure -p="phpazure" --Name="ie2l1ph28" -Allow:true
245
+ */
246
+ public function allowWindowsAzureCommand($subscriptionId, $certificate, $certificatePassphrase, $serverName, $allow = false, $waitForOperation = false)
247
+ {
248
+ $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
249
+ $rule = $client->createFirewallRuleForMicrosoftServices($serverName, $allow);
250
+ }
251
+
252
+ /**
253
+ * Delete firewall rule for server.
254
+ *
255
+ * @command-name DeleteFirewallRule
256
+ * @command-description Delete firewall rule for server.
257
+ * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
258
+ * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
259
+ * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
260
+ * @command-parameter-for $serverName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_StdIn --Name Required. The server name to operate on.
261
+ * @command-parameter-for $ruleName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --RuleName|-r Required. Firewall rule name.
262
+ * @command-parameter-for $waitForOperation Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile --WaitFor|-w Optional. Wait for the operation to complete?
263
+ * @command-example Delete firewall rule for server "ie2l1ph28":
264
+ * @command-example DeleteFirewallRule -p="phpazure" --Name="ie2l1ph28" -r="Rule1"
265
+ */
266
+ public function deleteFirewallRuleCommand($subscriptionId, $certificate, $certificatePassphrase, $serverName, $ruleName, $waitForOperation = false)
267
+ {
268
+ $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
269
+ $rule = $client->deleteFirewallRule($serverName, $ruleName);
270
+ }
271
+
272
+ /**
273
+ * List firewall rules for a specified server.
274
+ *
275
+ * @command-name ListFirewallRules
276
+ * @command-description List firewall rules for a specified server.
277
+ * @command-parameter-for $subscriptionId Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --SubscriptionId|-sid Required. This is the Windows Azure Subscription Id to operate on.
278
+ * @command-parameter-for $certificate Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Env --Certificate|-cert Required. This is the .pem certificate that user has uploaded to Windows Azure subscription as Management Certificate.
279
+ * @command-parameter-for $certificatePassphrase Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_Prompt --Passphrase|-p Required. The certificate passphrase. If not specified, a prompt will be displayed.
280
+ * @command-parameter-for $serverName Microsoft_Console_Command_ParameterSource_Argv|Microsoft_Console_Command_ParameterSource_ConfigFile|Microsoft_Console_Command_ParameterSource_StdIn --Name Required. The server name to operate on.
281
+ * @command-example List firewall rules for server "ie2l1ph28":
282
+ * @command-example ListFirewallRules -sid="<your_subscription_id>" --Name="ie2l1ph28"
283
+ */
284
+ public function listFirewallRuleCommand($subscriptionId, $certificate, $certificatePassphrase, $serverName)
285
+ {
286
+ $client = new Microsoft_SqlAzure_Management_Client($subscriptionId, $certificate, $certificatePassphrase);
287
+ $result = $client->listFirewallRules($serverName);
288
+
289
+ if (count($result) == 0) {
290
+ echo 'No data to display.';
291
+ }
292
+ foreach ($result as $object) {
293
+ $this->_displayObjectInformation($object, array('Name', 'StartIpAddress', 'EndIpAddress'));
294
+ }
295
+ }
296
+ }
297
+
298
  Microsoft_Console_Command::bootstrap($_SERVER['argv']);
libs/Microsoft/SqlAzure/Exception.php CHANGED
@@ -1,48 +1,48 @@
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
- * @subpackage Exception
31
- * @version $Id: Exception.php 61042 2011-04-19 10:03:39Z unknown $
32
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
- * @license http://phpazure.codeplex.com/license
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_SqlAzure
44
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
- * @license http://phpazure.codeplex.com/license
46
- */
47
- class Microsoft_SqlAzure_Exception extends Microsoft_Exception
48
- {}
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
+ * @subpackage Exception
31
+ * @version $Id: Exception.php 61042 2011-04-19 10:03:39Z unknown $
32
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
+ * @license http://phpazure.codeplex.com/license
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_SqlAzure
44
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
+ * @license http://phpazure.codeplex.com/license
46
+ */
47
+ class Microsoft_SqlAzure_Exception extends Microsoft_Exception
48
+ {}
libs/Microsoft/SqlAzure/Management/Client.php CHANGED
@@ -1,564 +1,564 @@
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
- * @subpackage Management
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 51671 2010-09-30 08:33:45Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_SqlAzure
44
- * @subpackage Management
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- */
48
- class Microsoft_SqlAzure_Management_Client
49
- {
50
- /**
51
- * Management service URL
52
- */
53
- const URL_MANAGEMENT = "https://management.database.windows.net:8443";
54
-
55
- /**
56
- * Operations
57
- */
58
- const OP_OPERATIONS = "operations";
59
- const OP_SERVERS = "servers";
60
- const OP_FIREWALLRULES = "firewallrules";
61
-
62
- /**
63
- * Current API version
64
- *
65
- * @var string
66
- */
67
- protected $_apiVersion = '1.0';
68
-
69
- /**
70
- * Subscription ID
71
- *
72
- * @var string
73
- */
74
- protected $_subscriptionId = '';
75
-
76
- /**
77
- * Management certificate path (.PEM)
78
- *
79
- * @var string
80
- */
81
- protected $_certificatePath = '';
82
-
83
- /**
84
- * Management certificate passphrase
85
- *
86
- * @var string
87
- */
88
- protected $_certificatePassphrase = '';
89
-
90
- /**
91
- * Microsoft_Http_Client channel used for communication with REST services
92
- *
93
- * @var Microsoft_Http_Client
94
- */
95
- protected $_httpClientChannel = null;
96
-
97
- /**
98
- * Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract instance
99
- *
100
- * @var Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract
101
- */
102
- protected $_retryPolicy = null;
103
-
104
- /**
105
- * Returns the last request ID
106
- *
107
- * @var string
108
- */
109
- protected $_lastRequestId = null;
110
-
111
- /**
112
- * Creates a new Microsoft_SqlAzure_Management_Client instance
113
- *
114
- * @param string $subscriptionId Subscription ID
115
- * @param string $certificatePath Management certificate path (.PEM)
116
- * @param string $certificatePassphrase Management certificate passphrase
117
- * @param Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy Retry policy to use when making requests
118
- */
119
- public function __construct(
120
- $subscriptionId,
121
- $certificatePath,
122
- $certificatePassphrase,
123
- Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null
124
- ) {
125
- $this->_subscriptionId = $subscriptionId;
126
- $this->_certificatePath = $certificatePath;
127
- $this->_certificatePassphrase = $certificatePassphrase;
128
-
129
- $this->_retryPolicy = $retryPolicy;
130
- if (is_null($this->_retryPolicy)) {
131
- $this->_retryPolicy = Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract::noRetry();
132
- }
133
-
134
- // Setup default Microsoft_Http_Client channel
135
- $options = array(
136
- 'adapter' => 'Microsoft_Http_Client_Adapter_Socket',
137
- 'ssltransport' => 'ssl',
138
- 'sslcert' => $this->_certificatePath,
139
- 'sslpassphrase' => $this->_certificatePassphrase,
140
- 'sslusecontext' => true,
141
- );
142
- if (function_exists('curl_init')) {
143
- // Set cURL options if cURL is used afterwards
144
- $options['curloptions'] = array(
145
- CURLOPT_FOLLOWLOCATION => true,
146
- CURLOPT_TIMEOUT => 120,
147
- );
148
- }
149
- $this->_httpClientChannel = new Microsoft_Http_Client(null, $options);
150
- }
151
-
152
- /**
153
- * Set the HTTP client channel to use
154
- *
155
- * @param Microsoft_Http_Client_Adapter_Interface|string $adapterInstance Adapter instance or adapter class name.
156
- */
157
- public function setHttpClientChannel($adapterInstance = 'Microsoft_Http_Client_Adapter_Socket')
158
- {
159
- $this->_httpClientChannel->setAdapter($adapterInstance);
160
- }
161
-
162
- /**
163
- * Retrieve HTTP client channel
164
- *
165
- * @return Microsoft_Http_Client_Adapter_Interface
166
- */
167
- public function getHttpClientChannel()
168
- {
169
- return $this->_httpClientChannel;
170
- }
171
-
172
- /**
173
- * Returns the Windows Azure subscription ID
174
- *
175
- * @return string
176
- */
177
- public function getSubscriptionId()
178
- {
179
- return $this->_subscriptionId;
180
- }
181
-
182
- /**
183
- * Returns the last request ID.
184
- *
185
- * @return string
186
- */
187
- public function getLastRequestId()
188
- {
189
- return $this->_lastRequestId;
190
- }
191
-
192
- /**
193
- * Get base URL for creating requests
194
- *
195
- * @return string
196
- */
197
- public function getBaseUrl()
198
- {
199
- return self::URL_MANAGEMENT . '/' . $this->_subscriptionId;
200
- }
201
-
202
- /**
203
- * Perform request using Microsoft_Http_Client channel
204
- *
205
- * @param string $path Path
206
- * @param array $query Query parameters
207
- * @param string $httpVerb HTTP verb the request will use
208
- * @param array $headers x-ms headers to add
209
- * @param mixed $rawData Optional RAW HTTP data to be sent over the wire
210
- * @return Microsoft_Http_Response
211
- */
212
- protected function _performRequest(
213
- $path = '/',
214
- $query = array(),
215
- $httpVerb = Microsoft_Http_Client::GET,
216
- $headers = array(),
217
- $rawData = null
218
- ) {
219
- // Clean path
220
- if (strpos($path, '/') !== 0) {
221
- $path = '/' . $path;
222
- }
223
-
224
- // Clean headers
225
- if (is_null($headers)) {
226
- $headers = array();
227
- }
228
-
229
- // Ensure cUrl will also work correctly:
230
- // - disable Content-Type if required
231
- // - disable Expect: 100 Continue
232
- if (!isset($headers["Content-Type"])) {
233
- $headers["Content-Type"] = '';
234
- }
235
- //$headers["Expect"] = '';
236
-
237
- // Add version header
238
- $headers['x-ms-version'] = $this->_apiVersion;
239
-
240
- // Generate URL and sign request
241
- $requestUrl = $this->getBaseUrl() . rawurlencode($path);
242
- $requestHeaders = $headers;
243
- if (count($query) > 0) {
244
- $queryString = '';
245
- foreach ($query as $key => $value) {
246
- $queryString .= ($queryString ? '&' : '?') . rawurlencode($key) . '=' . rawurlencode($value);
247
- }
248
- $requestUrl .= $queryString;
249
- }
250
-
251
- // Prepare request
252
- $this->_httpClientChannel->resetParameters(true);
253
- $this->_httpClientChannel->setUri($requestUrl);
254
- $this->_httpClientChannel->setHeaders($requestHeaders);
255
- $this->_httpClientChannel->setRawData($rawData);
256
-
257
- // Execute request
258
- $response = $this->_retryPolicy->execute(
259
- array($this->_httpClientChannel, 'request'),
260
- array($httpVerb)
261
- );
262
-
263
- // Store request id
264
- $this->_lastRequestId = $response->getHeader('x-ms-request-id');
265
-
266
- return $response;
267
- }
268
-
269
- /**
270
- * Parse result from Microsoft_Http_Response
271
- *
272
- * @param Microsoft_Http_Response $response Response from HTTP call
273
- * @return object
274
- * @throws Microsoft_WindowsAzure_Exception
275
- */
276
- protected function _parseResponse(Microsoft_Http_Response $response = null)
277
- {
278
- if (is_null($response)) {
279
- throw new Microsoft_SqlAzure_Exception('Response should not be null.');
280
- }
281
-
282
- $xml = @simplexml_load_string($response->getBody());
283
-
284
- if ($xml !== false) {
285
- // Fetch all namespaces
286
- $namespaces = array_merge($xml->getNamespaces(true), $xml->getDocNamespaces(true));
287
-
288
- // Register all namespace prefixes
289
- foreach ($namespaces as $prefix => $ns) {
290
- if ($prefix != '') {
291
- $xml->registerXPathNamespace($prefix, $ns);
292
- }
293
- }
294
- }
295
-
296
- return $xml;
297
- }
298
-
299
- /**
300
- * Get error message from Microsoft_Http_Response
301
- *
302
- * @param Microsoft_Http_Response $response Repsonse
303
- * @param string $alternativeError Alternative error message
304
- * @return string
305
- */
306
- protected function _getErrorMessage(Microsoft_Http_Response $response, $alternativeError = 'Unknown error.')
307
- {
308
- $response = $this->_parseResponse($response);
309
- if ($response && $response->Message) {
310
- return (string)$response->Message;
311
- } else {
312
- return $alternativeError;
313
- }
314
- }
315
-
316
- /**
317
- * The Create Server operation adds a new SQL Azure server to a subscription.
318
- *
319
- * @param string $administratorLogin Administrator login.
320
- * @param string $administratorPassword Administrator password.
321
- * @param string $location Location of the server.
322
- * @return Microsoft_SqlAzure_Management_ServerInstance Server information.
323
- * @throws Microsoft_SqlAzure_Management_Exception
324
- */
325
- public function createServer($administratorLogin, $administratorPassword, $location)
326
- {
327
- if ($administratorLogin == '' || is_null($administratorLogin)) {
328
- throw new Microsoft_SqlAzure_Management_Exception('Administrator login should be specified.');
329
- }
330
- if ($administratorPassword == '' || is_null($administratorPassword)) {
331
- throw new Microsoft_SqlAzure_Management_Exception('Administrator password should be specified.');
332
- }
333
- if (is_null($location) && is_null($affinityGroup)) {
334
- throw new Microsoft_SqlAzure_Management_Exception('Please specify a location for the server.');
335
- }
336
-
337
- $response = $this->_performRequest(self::OP_SERVERS, array(),
338
- Microsoft_Http_Client::POST,
339
- array('Content-Type' => 'application/xml; charset=utf-8'),
340
- '<Server xmlns="http://schemas.microsoft.com/sqlazure/2010/12/"><AdministratorLogin>' . $administratorLogin . '</AdministratorLogin><AdministratorLoginPassword>' . $administratorPassword . '</AdministratorLoginPassword><Location>' . $location . '</Location></Server>');
341
-
342
- if ($response->isSuccessful()) {
343
- $xml = $this->_parseResponse($response);
344
-
345
- return new Microsoft_SqlAzure_Management_ServerInstance(
346
- (string)$xml,
347
- $administratorLogin,
348
- $location
349
- );
350
- } else {
351
- throw new Microsoft_SqlAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
352
- }
353
- }
354
-
355
- /**
356
- * The Get Servers operation enumerates SQL Azure servers that are provisioned for a subscription.
357
- *
358
- * @return array An array of Microsoft_SqlAzure_Management_ServerInstance.
359
- * @throws Microsoft_SqlAzure_Management_Exception
360
- */
361
- public function listServers()
362
- {
363
- $response = $this->_performRequest(self::OP_SERVERS);
364
-
365
- if ($response->isSuccessful()) {
366
- $xml = $this->_parseResponse($response);
367
- $xmlServices = null;
368
-
369
- if (!$xml->Server) {
370
- return array();
371
- }
372
- if (count($xml->Server) > 1) {
373
- $xmlServices = $xml->Server;
374
- } else {
375
- $xmlServices = array($xml->Server);
376
- }
377
-
378
- $services = array();
379
- if (!is_null($xmlServices)) {
380
- for ($i = 0; $i < count($xmlServices); $i++) {
381
- $services[] = new Microsoft_SqlAzure_Management_ServerInstance(
382
- (string)$xmlServices[$i]->Name,
383
- (string)$xmlServices[$i]->AdministratorLogin,
384
- (string)$xmlServices[$i]->Location
385
- );
386
- }
387
- }
388
- return $services;
389
- } else {
390
- throw new Microsoft_SqlAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
391
- }
392
- }
393
-
394
- /**
395
- * The Drop Server operation drops a SQL Azure server from a subscription.
396
- *
397
- * @param string $serverName Server to drop.
398
- * @throws Microsoft_SqlAzure_Management_Exception
399
- */
400
- public function dropServer($serverName)
401
- {
402
- if ($serverName == '' || is_null($serverName)) {
403
- throw new Microsoft_SqlAzure_Management_Exception('Server name should be specified.');
404
- }
405
-
406
- $response = $this->_performRequest(self::OP_SERVERS . '/' . $serverName, array(), Microsoft_Http_Client::DELETE);
407
-
408
- if (!$response->isSuccessful()) {
409
- throw new Microsoft_SqlAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
410
- }
411
- }
412
-
413
- /**
414
- * The Set Server Administrator Password operation sets the administrative password of a SQL Azure server for a subscription.
415
- *
416
- * @param string $serverName Server to set password for.
417
- * @param string $administratorPassword Administrator password.
418
- * @throws Microsoft_SqlAzure_Management_Exception
419
- */
420
- public function setAdministratorPassword($serverName, $administratorPassword)
421
- {
422
- if ($serverName == '' || is_null($serverName)) {
423
- throw new Microsoft_SqlAzure_Management_Exception('Server name should be specified.');
424
- }
425
- if ($administratorPassword == '' || is_null($administratorPassword)) {
426
- throw new Microsoft_SqlAzure_Management_Exception('Administrator password should be specified.');
427
- }
428
-
429
- $response = $this->_performRequest(self::OP_SERVERS . '/' . $serverName, array('op' => 'ResetPassword'),
430
- Microsoft_Http_Client::POST,
431
- array('Content-Type' => 'application/xml; charset=utf-8'),
432
- '<AdministratorLoginPassword xmlns="http://schemas.microsoft.com/sqlazure/2010/12/">' . $administratorPassword . '</AdministratorLoginPassword>');
433
-
434
- if (!$response->isSuccessful()) {
435
- throw new Microsoft_SqlAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
436
- }
437
- }
438
-
439
- /**
440
- * The Set Server Firewall Rule operation updates an existing firewall rule or adds a new firewall rule for a SQL Azure server that belongs to a subscription.
441
- *
442
- * @param string $serverName Server name.
443
- * @param string $ruleName Firewall rule name.
444
- * @param string $startIpAddress Start IP address.
445
- * @param string $endIpAddress End IP address.
446
- * @return Microsoft_SqlAzure_Management_FirewallRuleInstance
447
- * @throws Microsoft_SqlAzure_Management_Exception
448
- */
449
- public function createFirewallRule($serverName, $ruleName, $startIpAddress, $endIpAddress)
450
- {
451
- if ($serverName == '' || is_null($serverName)) {
452
- throw new Microsoft_SqlAzure_Management_Exception('Server name should be specified.');
453
- }
454
- if ($ruleName == '' || is_null($ruleName)) {
455
- throw new Microsoft_SqlAzure_Management_Exception('Rule name should be specified.');
456
- }
457
- if ($startIpAddress == '' || is_null($startIpAddress) || !filter_var($startIpAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
458
- throw new Microsoft_SqlAzure_Management_Exception('Start IP address should be specified.');
459
- }
460
- if ($endIpAddress == '' || is_null($endIpAddress) || !filter_var($endIpAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
461
- throw new Microsoft_SqlAzure_Management_Exception('End IP address should be specified.');
462
- }
463
-
464
- $response = $this->_performRequest(self::OP_SERVERS . '/' . $serverName . '/' . self::OP_FIREWALLRULES . '/' . $ruleName, array(),
465
- Microsoft_Http_Client::PUT,
466
- array('Content-Type' => 'application/xml; charset=utf-8'),
467
- '<FirewallRule xmlns="http://schemas.microsoft.com/sqlazure/2010/12/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.microsoft.com/sqlazure/2010/12/ FirewallRule.xsd"><StartIpAddress>' . $startIpAddress . '</StartIpAddress><EndIpAddress>' . $endIpAddress . '</EndIpAddress></FirewallRule>');
468
-
469
- if ($response->isSuccessful()) {
470
- return new Microsoft_SqlAzure_Management_FirewallRuleInstance(
471
- $ruleName,
472
- $startIpAddress,
473
- $endIpAddress
474
- );
475
- } else {
476
- throw new Microsoft_SqlAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
477
- }
478
- }
479
-
480
- /**
481
- * The Get Server Firewall Rules operation retrieves a list of all the firewall rules for a SQL Azure server that belongs to a subscription.
482
- *
483
- * @param string $serverName Server name.
484
- * @return Array of Microsoft_SqlAzure_Management_FirewallRuleInstance.
485
- * @throws Microsoft_SqlAzure_Management_Exception
486
- */
487
- public function listFirewallRules($serverName)
488
- {
489
- if ($serverName == '' || is_null($serverName)) {
490
- throw new Microsoft_SqlAzure_Management_Exception('Server name should be specified.');
491
- }
492
-
493
- $response = $this->_performRequest(self::OP_SERVERS . '/' . $serverName . '/' . self::OP_FIREWALLRULES);
494
-
495
- if ($response->isSuccessful()) {
496
- $xml = $this->_parseResponse($response);
497
- $xmlServices = null;
498
-
499
- if (!$xml->FirewallRule) {
500
- return array();
501
- }
502
- if (count($xml->FirewallRule) > 1) {
503
- $xmlServices = $xml->FirewallRule;
504
- } else {
505
- $xmlServices = array($xml->FirewallRule);
506
- }
507
-
508
- $services = array();
509
- if (!is_null($xmlServices)) {
510
- for ($i = 0; $i < count($xmlServices); $i++) {
511
- $services[] = new Microsoft_SqlAzure_Management_FirewallRuleInstance(
512
- (string)$xmlServices[$i]->Name,
513
- (string)$xmlServices[$i]->StartIpAddress,
514
- (string)$xmlServices[$i]->EndIpAddress
515
- );
516
- }
517
- }
518
- return $services;
519
- } else {
520
- throw new Microsoft_SqlAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
521
- }
522
- }
523
-
524
- /**
525
- * The Delete Server Firewall Rule operation deletes a firewall rule from a SQL Azure server that belongs to a subscription.
526
- *
527
- * @param string $serverName Server name.
528
- * @param string $ruleName Rule name.
529
- * @throws Microsoft_SqlAzure_Management_Exception
530
- */
531
- public function deleteFirewallRule($serverName, $ruleName)
532
- {
533
- if ($serverName == '' || is_null($serverName)) {
534
- throw new Microsoft_SqlAzure_Management_Exception('Server name should be specified.');
535
- }
536
- if ($ruleName == '' || is_null($ruleName)) {
537
- throw new Microsoft_SqlAzure_Management_Exception('Rule name should be specified.');
538
- }
539
-
540
- $response = $this->_performRequest(self::OP_SERVERS . '/' . $serverName . '/' . self::OP_FIREWALLRULES . '/' . $ruleName, array(),
541
- Microsoft_Http_Client::DELETE);
542
-
543
- if (!$response->isSuccessful()) {
544
- throw new Microsoft_SqlAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
545
- }
546
- }
547
-
548
- /**
549
- * Creates a firewall rule for Microsoft Services. This is required if access to SQL Azure is required from other services like Windows Azure.
550
- *
551
- * @param string $serverName Server name.
552
- * @param boolean $allowAccess Allow access from other Microsoft Services?
553
- * @throws Microsoft_SqlAzure_Management_Exception
554
- */
555
- public function createFirewallRuleForMicrosoftServices($serverName, $allowAccess)
556
- {
557
- if ($allowAccess) {
558
- $this->createFirewallRule($serverName, 'MicrosoftServices', '0.0.0.0', '0.0.0.0');
559
- } else {
560
- $this->deleteFirewallRule($serverName, 'MicrosoftServices');
561
- }
562
- }
563
-
564
- }
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
+ * @subpackage Management
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 51671 2010-09-30 08:33:45Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_SqlAzure
44
+ * @subpackage Management
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ */
48
+ class Microsoft_SqlAzure_Management_Client
49
+ {
50
+ /**
51
+ * Management service URL
52
+ */
53
+ const URL_MANAGEMENT = "https://management.database.windows.net:8443";
54
+
55
+ /**
56
+ * Operations
57
+ */
58
+ const OP_OPERATIONS = "operations";
59
+ const OP_SERVERS = "servers";
60
+ const OP_FIREWALLRULES = "firewallrules";
61
+
62
+ /**
63
+ * Current API version
64
+ *
65
+ * @var string
66
+ */
67
+ protected $_apiVersion = '1.0';
68
+
69
+ /**
70
+ * Subscription ID
71
+ *
72
+ * @var string
73
+ */
74
+ protected $_subscriptionId = '';
75
+
76
+ /**
77
+ * Management certificate path (.PEM)
78
+ *
79
+ * @var string
80
+ */
81
+ protected $_certificatePath = '';
82
+
83
+ /**
84
+ * Management certificate passphrase
85
+ *
86
+ * @var string
87
+ */
88
+ protected $_certificatePassphrase = '';
89
+
90
+ /**
91
+ * Microsoft_Http_Client channel used for communication with REST services
92
+ *
93
+ * @var Microsoft_Http_Client
94
+ */
95
+ protected $_httpClientChannel = null;
96
+
97
+ /**
98
+ * Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract instance
99
+ *
100
+ * @var Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract
101
+ */
102
+ protected $_retryPolicy = null;
103
+
104
+ /**
105
+ * Returns the last request ID
106
+ *
107
+ * @var string
108
+ */
109
+ protected $_lastRequestId = null;
110
+
111
+ /**
112
+ * Creates a new Microsoft_SqlAzure_Management_Client instance
113
+ *
114
+ * @param string $subscriptionId Subscription ID
115
+ * @param string $certificatePath Management certificate path (.PEM)
116
+ * @param string $certificatePassphrase Management certificate passphrase
117
+ * @param Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy Retry policy to use when making requests
118
+ */
119
+ public function __construct(
120
+ $subscriptionId,
121
+ $certificatePath,
122
+ $certificatePassphrase,
123
+ Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null
124
+ ) {
125
+ $this->_subscriptionId = $subscriptionId;
126
+ $this->_certificatePath = $certificatePath;
127
+ $this->_certificatePassphrase = $certificatePassphrase;
128
+
129
+ $this->_retryPolicy = $retryPolicy;
130
+ if (is_null($this->_retryPolicy)) {
131
+ $this->_retryPolicy = Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract::noRetry();
132
+ }
133
+
134
+ // Setup default Microsoft_Http_Client channel
135
+ $options = array(
136
+ 'adapter' => 'Microsoft_Http_Client_Adapter_Socket',
137
+ 'ssltransport' => 'ssl',
138
+ 'sslcert' => $this->_certificatePath,
139
+ 'sslpassphrase' => $this->_certificatePassphrase,
140
+ 'sslusecontext' => true,
141
+ );
142
+ if (function_exists('curl_init')) {
143
+ // Set cURL options if cURL is used afterwards
144
+ $options['curloptions'] = array(
145
+ CURLOPT_FOLLOWLOCATION => true,
146
+ CURLOPT_TIMEOUT => 120,
147
+ );
148
+ }
149
+ $this->_httpClientChannel = new Microsoft_Http_Client(null, $options);
150
+ }
151
+
152
+ /**
153
+ * Set the HTTP client channel to use
154
+ *
155
+ * @param Microsoft_Http_Client_Adapter_Interface|string $adapterInstance Adapter instance or adapter class name.
156
+ */
157
+ public function setHttpClientChannel($adapterInstance = 'Microsoft_Http_Client_Adapter_Socket')
158
+ {
159
+ $this->_httpClientChannel->setAdapter($adapterInstance);
160
+ }
161
+
162
+ /**
163
+ * Retrieve HTTP client channel
164
+ *
165
+ * @return Microsoft_Http_Client_Adapter_Interface
166
+ */
167
+ public function getHttpClientChannel()
168
+ {
169
+ return $this->_httpClientChannel;
170
+ }
171
+
172
+ /**
173
+ * Returns the Windows Azure subscription ID
174
+ *
175
+ * @return string
176
+ */
177
+ public function getSubscriptionId()
178
+ {
179
+ return $this->_subscriptionId;
180
+ }
181
+
182
+ /**
183
+ * Returns the last request ID.
184
+ *
185
+ * @return string
186
+ */
187
+ public function getLastRequestId()
188
+ {
189
+ return $this->_lastRequestId;
190
+ }
191
+
192
+ /**
193
+ * Get base URL for creating requests
194
+ *
195
+ * @return string
196
+ */
197
+ public function getBaseUrl()
198
+ {
199
+ return self::URL_MANAGEMENT . '/' . $this->_subscriptionId;
200
+ }
201
+
202
+ /**
203
+ * Perform request using Microsoft_Http_Client channel
204
+ *
205
+ * @param string $path Path
206
+ * @param array $query Query parameters
207
+ * @param string $httpVerb HTTP verb the request will use
208
+ * @param array $headers x-ms headers to add
209
+ * @param mixed $rawData Optional RAW HTTP data to be sent over the wire
210
+ * @return Microsoft_Http_Response
211
+ */
212
+ protected function _performRequest(
213
+ $path = '/',
214
+ $query = array(),
215
+ $httpVerb = Microsoft_Http_Client::GET,
216
+ $headers = array(),
217
+ $rawData = null
218
+ ) {
219
+ // Clean path
220
+ if (strpos($path, '/') !== 0) {
221
+ $path = '/' . $path;
222
+ }
223
+
224
+ // Clean headers
225
+ if (is_null($headers)) {
226
+ $headers = array();
227
+ }
228
+
229
+ // Ensure cUrl will also work correctly:
230
+ // - disable Content-Type if required
231
+ // - disable Expect: 100 Continue
232
+ if (!isset($headers["Content-Type"])) {
233
+ $headers["Content-Type"] = '';
234
+ }
235
+ //$headers["Expect"] = '';
236
+
237
+ // Add version header
238
+ $headers['x-ms-version'] = $this->_apiVersion;
239
+
240
+ // Generate URL and sign request
241
+ $requestUrl = $this->getBaseUrl() . rawurlencode($path);
242
+ $requestHeaders = $headers;
243
+ if (count($query) > 0) {
244
+ $queryString = '';
245
+ foreach ($query as $key => $value) {
246
+ $queryString .= ($queryString ? '&' : '?') . rawurlencode($key) . '=' . rawurlencode($value);
247
+ }
248
+ $requestUrl .= $queryString;
249
+ }
250
+
251
+ // Prepare request
252
+ $this->_httpClientChannel->resetParameters(true);
253
+ $this->_httpClientChannel->setUri($requestUrl);
254
+ $this->_httpClientChannel->setHeaders($requestHeaders);
255
+ $this->_httpClientChannel->setRawData($rawData);
256
+
257
+ // Execute request
258
+ $response = $this->_retryPolicy->execute(
259
+ array($this->_httpClientChannel, 'request'),
260
+ array($httpVerb)
261
+ );
262
+
263
+ // Store request id
264
+ $this->_lastRequestId = $response->getHeader('x-ms-request-id');
265
+
266
+ return $response;
267
+ }
268
+
269
+ /**
270
+ * Parse result from Microsoft_Http_Response
271
+ *
272
+ * @param Microsoft_Http_Response $response Response from HTTP call
273
+ * @return object
274
+ * @throws Microsoft_WindowsAzure_Exception
275
+ */
276
+ protected function _parseResponse(Microsoft_Http_Response $response = null)
277
+ {
278
+ if (is_null($response)) {
279
+ throw new Microsoft_SqlAzure_Exception('Response should not be null.');
280
+ }
281
+
282
+ $xml = @simplexml_load_string($response->getBody());
283
+
284
+ if ($xml !== false) {
285
+ // Fetch all namespaces
286
+ $namespaces = array_merge($xml->getNamespaces(true), $xml->getDocNamespaces(true));
287
+
288
+ // Register all namespace prefixes
289
+ foreach ($namespaces as $prefix => $ns) {
290
+ if ($prefix != '') {
291
+ $xml->registerXPathNamespace($prefix, $ns);
292
+ }
293
+ }
294
+ }
295
+
296
+ return $xml;
297
+ }
298
+
299
+ /**
300
+ * Get error message from Microsoft_Http_Response
301
+ *
302
+ * @param Microsoft_Http_Response $response Repsonse
303
+ * @param string $alternativeError Alternative error message
304
+ * @return string
305
+ */
306
+ protected function _getErrorMessage(Microsoft_Http_Response $response, $alternativeError = 'Unknown error.')
307
+ {
308
+ $response = $this->_parseResponse($response);
309
+ if ($response && $response->Message) {
310
+ return (string)$response->Message;
311
+ } else {
312
+ return $alternativeError;
313
+ }
314
+ }
315
+
316
+ /**
317
+ * The Create Server operation adds a new SQL Azure server to a subscription.
318
+ *
319
+ * @param string $administratorLogin Administrator login.
320
+ * @param string $administratorPassword Administrator password.
321
+ * @param string $location Location of the server.
322
+ * @return Microsoft_SqlAzure_Management_ServerInstance Server information.
323
+ * @throws Microsoft_SqlAzure_Management_Exception
324
+ */
325
+ public function createServer($administratorLogin, $administratorPassword, $location)
326
+ {
327
+ if ($administratorLogin == '' || is_null($administratorLogin)) {
328
+ throw new Microsoft_SqlAzure_Management_Exception('Administrator login should be specified.');
329
+ }
330
+ if ($administratorPassword == '' || is_null($administratorPassword)) {
331
+ throw new Microsoft_SqlAzure_Management_Exception('Administrator password should be specified.');
332
+ }
333
+ if (is_null($location) && is_null($affinityGroup)) {
334
+ throw new Microsoft_SqlAzure_Management_Exception('Please specify a location for the server.');
335
+ }
336
+
337
+ $response = $this->_performRequest(self::OP_SERVERS, array(),
338
+ Microsoft_Http_Client::POST,
339
+ array('Content-Type' => 'application/xml; charset=utf-8'),
340
+ '<Server xmlns="http://schemas.microsoft.com/sqlazure/2010/12/"><AdministratorLogin>' . $administratorLogin . '</AdministratorLogin><AdministratorLoginPassword>' . $administratorPassword . '</AdministratorLoginPassword><Location>' . $location . '</Location></Server>');
341
+
342
+ if ($response->isSuccessful()) {
343
+ $xml = $this->_parseResponse($response);
344
+
345
+ return new Microsoft_SqlAzure_Management_ServerInstance(
346
+ (string)$xml,
347
+ $administratorLogin,
348
+ $location
349
+ );
350
+ } else {
351
+ throw new Microsoft_SqlAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
352
+ }
353
+ }
354
+
355
+ /**
356
+ * The Get Servers operation enumerates SQL Azure servers that are provisioned for a subscription.
357
+ *
358
+ * @return array An array of Microsoft_SqlAzure_Management_ServerInstance.
359
+ * @throws Microsoft_SqlAzure_Management_Exception
360
+ */
361
+ public function listServers()
362
+ {
363
+ $response = $this->_performRequest(self::OP_SERVERS);
364
+
365
+ if ($response->isSuccessful()) {
366
+ $xml = $this->_parseResponse($response);
367
+ $xmlServices = null;
368
+
369
+ if (!$xml->Server) {
370
+ return array();
371
+ }
372
+ if (count($xml->Server) > 1) {
373
+ $xmlServices = $xml->Server;
374
+ } else {
375
+ $xmlServices = array($xml->Server);
376
+ }
377
+
378
+ $services = array();
379
+ if (!is_null($xmlServices)) {
380
+ for ($i = 0; $i < count($xmlServices); $i++) {
381
+ $services[] = new Microsoft_SqlAzure_Management_ServerInstance(
382
+ (string)$xmlServices[$i]->Name,
383
+ (string)$xmlServices[$i]->AdministratorLogin,
384
+ (string)$xmlServices[$i]->Location
385
+ );
386
+ }
387
+ }
388
+ return $services;
389
+ } else {
390
+ throw new Microsoft_SqlAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
391
+ }
392
+ }
393
+
394
+ /**
395
+ * The Drop Server operation drops a SQL Azure server from a subscription.
396
+ *
397
+ * @param string $serverName Server to drop.
398
+ * @throws Microsoft_SqlAzure_Management_Exception
399
+ */
400
+ public function dropServer($serverName)
401
+ {
402
+ if ($serverName == '' || is_null($serverName)) {
403
+ throw new Microsoft_SqlAzure_Management_Exception('Server name should be specified.');
404
+ }
405
+
406
+ $response = $this->_performRequest(self::OP_SERVERS . '/' . $serverName, array(), Microsoft_Http_Client::DELETE);
407
+
408
+ if (!$response->isSuccessful()) {
409
+ throw new Microsoft_SqlAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
410
+ }
411
+ }
412
+
413
+ /**
414
+ * The Set Server Administrator Password operation sets the administrative password of a SQL Azure server for a subscription.
415
+ *
416
+ * @param string $serverName Server to set password for.
417
+ * @param string $administratorPassword Administrator password.
418
+ * @throws Microsoft_SqlAzure_Management_Exception
419
+ */
420
+ public function setAdministratorPassword($serverName, $administratorPassword)
421
+ {
422
+ if ($serverName == '' || is_null($serverName)) {
423
+ throw new Microsoft_SqlAzure_Management_Exception('Server name should be specified.');
424
+ }
425
+ if ($administratorPassword == '' || is_null($administratorPassword)) {
426
+ throw new Microsoft_SqlAzure_Management_Exception('Administrator password should be specified.');
427
+ }
428
+
429
+ $response = $this->_performRequest(self::OP_SERVERS . '/' . $serverName, array('op' => 'ResetPassword'),
430
+ Microsoft_Http_Client::POST,
431
+ array('Content-Type' => 'application/xml; charset=utf-8'),
432
+ '<AdministratorLoginPassword xmlns="http://schemas.microsoft.com/sqlazure/2010/12/">' . $administratorPassword . '</AdministratorLoginPassword>');
433
+
434
+ if (!$response->isSuccessful()) {
435
+ throw new Microsoft_SqlAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
436
+ }
437
+ }
438
+
439
+ /**
440
+ * The Set Server Firewall Rule operation updates an existing firewall rule or adds a new firewall rule for a SQL Azure server that belongs to a subscription.
441
+ *
442
+ * @param string $serverName Server name.
443
+ * @param string $ruleName Firewall rule name.
444
+ * @param string $startIpAddress Start IP address.
445
+ * @param string $endIpAddress End IP address.
446
+ * @return Microsoft_SqlAzure_Management_FirewallRuleInstance
447
+ * @throws Microsoft_SqlAzure_Management_Exception
448
+ */
449
+ public function createFirewallRule($serverName, $ruleName, $startIpAddress, $endIpAddress)
450
+ {
451
+ if ($serverName == '' || is_null($serverName)) {
452
+ throw new Microsoft_SqlAzure_Management_Exception('Server name should be specified.');
453
+ }
454
+ if ($ruleName == '' || is_null($ruleName)) {
455
+ throw new Microsoft_SqlAzure_Management_Exception('Rule name should be specified.');
456
+ }
457
+ if ($startIpAddress == '' || is_null($startIpAddress) || !filter_var($startIpAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
458
+ throw new Microsoft_SqlAzure_Management_Exception('Start IP address should be specified.');
459
+ }
460
+ if ($endIpAddress == '' || is_null($endIpAddress) || !filter_var($endIpAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
461
+ throw new Microsoft_SqlAzure_Management_Exception('End IP address should be specified.');
462
+ }
463
+
464
+ $response = $this->_performRequest(self::OP_SERVERS . '/' . $serverName . '/' . self::OP_FIREWALLRULES . '/' . $ruleName, array(),
465
+ Microsoft_Http_Client::PUT,
466
+ array('Content-Type' => 'application/xml; charset=utf-8'),
467
+ '<FirewallRule xmlns="http://schemas.microsoft.com/sqlazure/2010/12/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.microsoft.com/sqlazure/2010/12/ FirewallRule.xsd"><StartIpAddress>' . $startIpAddress . '</StartIpAddress><EndIpAddress>' . $endIpAddress . '</EndIpAddress></FirewallRule>');
468
+
469
+ if ($response->isSuccessful()) {
470
+ return new Microsoft_SqlAzure_Management_FirewallRuleInstance(
471
+ $ruleName,
472
+ $startIpAddress,
473
+ $endIpAddress
474
+ );
475
+ } else {
476
+ throw new Microsoft_SqlAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
477
+ }
478
+ }
479
+
480
+ /**
481
+ * The Get Server Firewall Rules operation retrieves a list of all the firewall rules for a SQL Azure server that belongs to a subscription.
482
+ *
483
+ * @param string $serverName Server name.
484
+ * @return Array of Microsoft_SqlAzure_Management_FirewallRuleInstance.
485
+ * @throws Microsoft_SqlAzure_Management_Exception
486
+ */
487
+ public function listFirewallRules($serverName)
488
+ {
489
+ if ($serverName == '' || is_null($serverName)) {
490
+ throw new Microsoft_SqlAzure_Management_Exception('Server name should be specified.');
491
+ }
492
+
493
+ $response = $this->_performRequest(self::OP_SERVERS . '/' . $serverName . '/' . self::OP_FIREWALLRULES);
494
+
495
+ if ($response->isSuccessful()) {
496
+ $xml = $this->_parseResponse($response);
497
+ $xmlServices = null;
498
+
499
+ if (!$xml->FirewallRule) {
500
+ return array();
501
+ }
502
+ if (count($xml->FirewallRule) > 1) {
503
+ $xmlServices = $xml->FirewallRule;
504
+ } else {
505
+ $xmlServices = array($xml->FirewallRule);
506
+ }
507
+
508
+ $services = array();
509
+ if (!is_null($xmlServices)) {
510
+ for ($i = 0; $i < count($xmlServices); $i++) {
511
+ $services[] = new Microsoft_SqlAzure_Management_FirewallRuleInstance(
512
+ (string)$xmlServices[$i]->Name,
513
+ (string)$xmlServices[$i]->StartIpAddress,
514
+ (string)$xmlServices[$i]->EndIpAddress
515
+ );
516
+ }
517
+ }
518
+ return $services;
519
+ } else {
520
+ throw new Microsoft_SqlAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
521
+ }
522
+ }
523
+
524
+ /**
525
+ * The Delete Server Firewall Rule operation deletes a firewall rule from a SQL Azure server that belongs to a subscription.
526
+ *
527
+ * @param string $serverName Server name.
528
+ * @param string $ruleName Rule name.
529
+ * @throws Microsoft_SqlAzure_Management_Exception
530
+ */
531
+ public function deleteFirewallRule($serverName, $ruleName)
532
+ {
533
+ if ($serverName == '' || is_null($serverName)) {
534
+ throw new Microsoft_SqlAzure_Management_Exception('Server name should be specified.');
535
+ }
536
+ if ($ruleName == '' || is_null($ruleName)) {
537
+ throw new Microsoft_SqlAzure_Management_Exception('Rule name should be specified.');
538
+ }
539
+
540
+ $response = $this->_performRequest(self::OP_SERVERS . '/' . $serverName . '/' . self::OP_FIREWALLRULES . '/' . $ruleName, array(),
541
+ Microsoft_Http_Client::DELETE);
542
+
543
+ if (!$response->isSuccessful()) {
544
+ throw new Microsoft_SqlAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
545
+ }
546
+ }
547
+
548
+ /**
549
+ * Creates a firewall rule for Microsoft Services. This is required if access to SQL Azure is required from other services like Windows Azure.
550
+ *
551
+ * @param string $serverName Server name.
552
+ * @param boolean $allowAccess Allow access from other Microsoft Services?
553
+ * @throws Microsoft_SqlAzure_Management_Exception
554
+ */
555
+ public function createFirewallRuleForMicrosoftServices($serverName, $allowAccess)
556
+ {
557
+ if ($allowAccess) {
558
+ $this->createFirewallRule($serverName, 'MicrosoftServices', '0.0.0.0', '0.0.0.0');
559
+ } else {
560
+ $this->deleteFirewallRule($serverName, 'MicrosoftServices');
561
+ }
562
+ }
563
+
564
+ }
libs/Microsoft/SqlAzure/Management/Exception.php CHANGED
@@ -1,51 +1,51 @@
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
- * @subpackage Management
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_SqlAzure
44
- * @subpackage Management
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- */
48
- class Microsoft_SqlAzure_Management_Exception
49
- extends Microsoft_SqlAzure_Exception
50
- {
51
  }
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
+ * @subpackage Management
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_SqlAzure
44
+ * @subpackage Management
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ */
48
+ class Microsoft_SqlAzure_Management_Exception
49
+ extends Microsoft_SqlAzure_Exception
50
+ {
51
  }
libs/Microsoft/SqlAzure/Management/FirewallRuleInstance.php CHANGED
@@ -1,70 +1,70 @@
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
- * @subpackage Management
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_SqlAzure
44
- * @subpackage Management
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property string $Name The name of the firewall rule.
49
- * @property string $StartIpAddress The start IP address.
50
- * @property string $EndIpAddress The end IP address.
51
- */
52
- class Microsoft_SqlAzure_Management_FirewallRuleInstance
53
- extends Microsoft_SqlAzure_Management_ServiceEntityAbstract
54
- {
55
- /**
56
- * Constructor
57
- *
58
- * @param string $name The name of the firewall rule.
59
- * @param string $startIpAddress The start IP address.
60
- * @param string $endIpAddress The end IP address.
61
- */
62
- public function __construct($name, $startIpAddress, $endIpAddress)
63
- {
64
- $this->_data = array(
65
- 'name' => $name,
66
- 'startipaddress' => $startIpAddress,
67
- 'endipaddress' => $endIpAddress
68
- );
69
- }
70
- }
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
+ * @subpackage Management
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_SqlAzure
44
+ * @subpackage Management
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property string $Name The name of the firewall rule.
49
+ * @property string $StartIpAddress The start IP address.
50
+ * @property string $EndIpAddress The end IP address.
51
+ */
52
+ class Microsoft_SqlAzure_Management_FirewallRuleInstance
53
+ extends Microsoft_SqlAzure_Management_ServiceEntityAbstract
54
+ {
55
+ /**
56
+ * Constructor
57
+ *
58
+ * @param string $name The name of the firewall rule.
59
+ * @param string $startIpAddress The start IP address.
60
+ * @param string $endIpAddress The end IP address.
61
+ */
62
+ public function __construct($name, $startIpAddress, $endIpAddress)
63
+ {
64
+ $this->_data = array(
65
+ 'name' => $name,
66
+ 'startipaddress' => $startIpAddress,
67
+ 'endipaddress' => $endIpAddress
68
+ );
69
+ }
70
+ }
libs/Microsoft/SqlAzure/Management/ServerInstance.php CHANGED
@@ -1,72 +1,72 @@
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
- * @subpackage Management
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_SqlAzure
44
- * @subpackage Management
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property string $Name The name of the server.
49
- * @property string $DnsName The DNS name of the server.
50
- * @property string $AdministratorLogin The administrator login.
51
- * @property string $Location The location of the server in Windows Azure.
52
- */
53
- class Microsoft_SqlAzure_Management_ServerInstance
54
- extends Microsoft_SqlAzure_Management_ServiceEntityAbstract
55
- {
56
- /**
57
- * Constructor
58
- *
59
- * @param string $name The name of the server.
60
- * @param string $administratorLogin The administrator login.
61
- * @param string $location The location of the server in Windows Azure.
62
- */
63
- public function __construct($name, $administratorLogin, $location)
64
- {
65
- $this->_data = array(
66
- 'name' => $name,
67
- 'dnsname' => $name . '.database.windows.net',
68
- 'administratorlogin' => $administratorLogin,
69
- 'location' => $location
70
- );
71
- }
72
- }
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
+ * @subpackage Management
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_SqlAzure
44
+ * @subpackage Management
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property string $Name The name of the server.
49
+ * @property string $DnsName The DNS name of the server.
50
+ * @property string $AdministratorLogin The administrator login.
51
+ * @property string $Location The location of the server in Windows Azure.
52
+ */
53
+ class Microsoft_SqlAzure_Management_ServerInstance
54
+ extends Microsoft_SqlAzure_Management_ServiceEntityAbstract
55
+ {
56
+ /**
57
+ * Constructor
58
+ *
59
+ * @param string $name The name of the server.
60
+ * @param string $administratorLogin The administrator login.
61
+ * @param string $location The location of the server in Windows Azure.
62
+ */
63
+ public function __construct($name, $administratorLogin, $location)
64
+ {
65
+ $this->_data = array(
66
+ 'name' => $name,
67
+ 'dnsname' => $name . '.database.windows.net',
68
+ 'administratorlogin' => $administratorLogin,
69
+ 'location' => $location
70
+ );
71
+ }
72
+ }
libs/Microsoft/SqlAzure/Management/ServiceEntityAbstract.php CHANGED
@@ -1,84 +1,84 @@
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
- * @subpackage Management
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_SqlAzure
44
- * @subpackage Management
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- */
48
- abstract class Microsoft_SqlAzure_Management_ServiceEntityAbstract
49
- {
50
- /**
51
- * Data
52
- *
53
- * @var array
54
- */
55
- protected $_data = null;
56
-
57
- /**
58
- * Magic overload for setting properties
59
- *
60
- * @param string $name Name of the property
61
- * @param string $value Value to set
62
- */
63
- public function __set($name, $value) {
64
- if (array_key_exists(strtolower($name), $this->_data)) {
65
- $this->_data[strtolower($name)] = $value;
66
- return;
67
- }
68
-
69
- throw new Microsoft_SqlAzure_Management_Exception("Unknown property: " . $name);
70
- }
71
-
72
- /**
73
- * Magic overload for getting properties
74
- *
75
- * @param string $name Name of the property
76
- */
77
- public function __get($name) {
78
- if (array_key_exists(strtolower($name), $this->_data)) {
79
- return $this->_data[strtolower($name)];
80
- }
81
-
82
- throw new Microsoft_SqlAzure_Management_Exception("Unknown property: " . $name);
83
- }
84
- }
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
+ * @subpackage Management
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_SqlAzure
44
+ * @subpackage Management
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ */
48
+ abstract class Microsoft_SqlAzure_Management_ServiceEntityAbstract
49
+ {
50
+ /**
51
+ * Data
52
+ *
53
+ * @var array
54
+ */
55
+ protected $_data = null;
56
+
57
+ /**
58
+ * Magic overload for setting properties
59
+ *
60
+ * @param string $name Name of the property
61
+ * @param string $value Value to set
62
+ */
63
+ public function __set($name, $value) {
64
+ if (array_key_exists(strtolower($name), $this->_data)) {
65
+ $this->_data[strtolower($name)] = $value;
66
+ return;
67
+ }
68
+
69
+ throw new Microsoft_SqlAzure_Management_Exception("Unknown property: " . $name);
70
+ }
71
+
72
+ /**
73
+ * Magic overload for getting properties
74
+ *
75
+ * @param string $name Name of the property
76
+ */
77
+ public function __get($name) {
78
+ if (array_key_exists(strtolower($name), $this->_data)) {
79
+ return $this->_data[strtolower($name)];
80
+ }
81
+
82
+ throw new Microsoft_SqlAzure_Management_Exception("Unknown property: " . $name);
83
+ }
84
+ }
libs/Microsoft/WindowsAzure/Credentials/Exception.php CHANGED
@@ -1,48 +1,48 @@
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
- * @subpackage Exception
31
- * @version $Id: Exception.php 28585 2009-09-07 12:12:56Z unknown $
32
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
- * @license http://phpazure.codeplex.com/license
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
- * @license http://phpazure.codeplex.com/license
46
- */
47
- class Microsoft_WindowsAzure_Credentials_Exception extends Microsoft_WindowsAzure_Exception
48
- {}
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
+ * @subpackage Exception
31
+ * @version $Id: Exception.php 28585 2009-09-07 12:12:56Z unknown $
32
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
+ * @license http://phpazure.codeplex.com/license
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
+ * @license http://phpazure.codeplex.com/license
46
+ */
47
+ class Microsoft_WindowsAzure_Credentials_Exception extends Microsoft_WindowsAzure_Exception
48
+ {}
libs/Microsoft/WindowsAzure/Diagnostics/ConfigurationDataSources.php CHANGED
@@ -1,74 +1,74 @@
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
- * @subpackage Diagnostics
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Diagnostics
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property int OverallQuotaInMB Overall quota in MB
49
- * @property Microsoft_WindowsAzure_Diagnostics_ConfigurationLogs Logs Logs
50
- * @property Microsoft_WindowsAzure_Diagnostics_ConfigurationDiagnosticInfrastructureLogs DiagnosticInfrastructureLogs Diagnostic infrastructure logs
51
- * @property Microsoft_WindowsAzure_Diagnostics_ConfigurationPerformanceCounters PerformanceCounters Performance counters
52
- * @property Microsoft_WindowsAzure_Diagnostics_ConfigurationWindowsEventLog WindowsEventLog Windows Event Log
53
- * @property Microsoft_WindowsAzure_Diagnostics_ConfigurationDirectories Directories Directories
54
- */
55
- class Microsoft_WindowsAzure_Diagnostics_ConfigurationDataSources
56
- extends Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
57
- {
58
- /**
59
- * Constructor
60
- *
61
- * @param int $overallQuotaInMB Overall quota in MB
62
- */
63
- public function __construct($overallQuotaInMB = 0)
64
- {
65
- $this->_data = array(
66
- 'overallquotainmb' => $overallQuotaInMB,
67
- 'logs' => new Microsoft_WindowsAzure_Diagnostics_ConfigurationLogs(),
68
- 'diagnosticinfrastructurelogs' => new Microsoft_WindowsAzure_Diagnostics_ConfigurationDiagnosticInfrastructureLogs(),
69
- 'performancecounters' => new Microsoft_WindowsAzure_Diagnostics_ConfigurationPerformanceCounters(),
70
- 'windowseventlog' => new Microsoft_WindowsAzure_Diagnostics_ConfigurationWindowsEventLog(),
71
- 'directories' => new Microsoft_WindowsAzure_Diagnostics_ConfigurationDirectories()
72
- );
73
- }
74
  }
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
+ * @subpackage Diagnostics
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Diagnostics
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property int OverallQuotaInMB Overall quota in MB
49
+ * @property Microsoft_WindowsAzure_Diagnostics_ConfigurationLogs Logs Logs
50
+ * @property Microsoft_WindowsAzure_Diagnostics_ConfigurationDiagnosticInfrastructureLogs DiagnosticInfrastructureLogs Diagnostic infrastructure logs
51
+ * @property Microsoft_WindowsAzure_Diagnostics_ConfigurationPerformanceCounters PerformanceCounters Performance counters
52
+ * @property Microsoft_WindowsAzure_Diagnostics_ConfigurationWindowsEventLog WindowsEventLog Windows Event Log
53
+ * @property Microsoft_WindowsAzure_Diagnostics_ConfigurationDirectories Directories Directories
54
+ */
55
+ class Microsoft_WindowsAzure_Diagnostics_ConfigurationDataSources
56
+ extends Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
57
+ {
58
+ /**
59
+ * Constructor
60
+ *
61
+ * @param int $overallQuotaInMB Overall quota in MB
62
+ */
63
+ public function __construct($overallQuotaInMB = 0)
64
+ {
65
+ $this->_data = array(
66
+ 'overallquotainmb' => $overallQuotaInMB,
67
+ 'logs' => new Microsoft_WindowsAzure_Diagnostics_ConfigurationLogs(),
68
+ 'diagnosticinfrastructurelogs' => new Microsoft_WindowsAzure_Diagnostics_ConfigurationDiagnosticInfrastructureLogs(),
69
+ 'performancecounters' => new Microsoft_WindowsAzure_Diagnostics_ConfigurationPerformanceCounters(),
70
+ 'windowseventlog' => new Microsoft_WindowsAzure_Diagnostics_ConfigurationWindowsEventLog(),
71
+ 'directories' => new Microsoft_WindowsAzure_Diagnostics_ConfigurationDirectories()
72
+ );
73
+ }
74
  }
libs/Microsoft/WindowsAzure/Diagnostics/ConfigurationDiagnosticInfrastructureLogs.php CHANGED
@@ -1,70 +1,70 @@
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
- * @subpackage Diagnostics
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Diagnostics
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property int BufferQuotaInMB Buffer quota in MB
49
- * @property int ScheduledTransferPeriodInMinutes Scheduled transfer period in minutes
50
- * @property string ScheduledTransferLogLevelFilter Scheduled transfer log level filter
51
- */
52
- class Microsoft_WindowsAzure_Diagnostics_ConfigurationDiagnosticInfrastructureLogs
53
- extends Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
54
- {
55
- /**
56
- * Constructor
57
- *
58
- * @param int $bufferQuotaInMB Buffer quota in MB
59
- * @param int $scheduledTransferPeriodInMinutes Scheduled transfer period in minutes
60
- * @param string $scheduledTransferLogLevelFilter Scheduled transfer log level filter
61
- */
62
- public function __construct($bufferQuotaInMB = 0, $scheduledTransferPeriodInMinutes = 0, $scheduledTransferLogLevelFilter = Microsoft_WindowsAzure_Diagnostics_LogLevel::UNDEFINED)
63
- {
64
- $this->_data = array(
65
- 'bufferquotainmb' => $bufferQuotaInMB,
66
- 'scheduledtransferperiodinminutes' => $scheduledTransferPeriodInMinutes,
67
- 'scheduledtransferloglevelfilter' => $scheduledTransferLogLevelFilter
68
- );
69
- }
70
  }
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
+ * @subpackage Diagnostics
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Diagnostics
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property int BufferQuotaInMB Buffer quota in MB
49
+ * @property int ScheduledTransferPeriodInMinutes Scheduled transfer period in minutes
50
+ * @property string ScheduledTransferLogLevelFilter Scheduled transfer log level filter
51
+ */
52
+ class Microsoft_WindowsAzure_Diagnostics_ConfigurationDiagnosticInfrastructureLogs
53
+ extends Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
54
+ {
55
+ /**
56
+ * Constructor
57
+ *
58
+ * @param int $bufferQuotaInMB Buffer quota in MB
59
+ * @param int $scheduledTransferPeriodInMinutes Scheduled transfer period in minutes
60
+ * @param string $scheduledTransferLogLevelFilter Scheduled transfer log level filter
61
+ */
62
+ public function __construct($bufferQuotaInMB = 0, $scheduledTransferPeriodInMinutes = 0, $scheduledTransferLogLevelFilter = Microsoft_WindowsAzure_Diagnostics_LogLevel::UNDEFINED)
63
+ {
64
+ $this->_data = array(
65
+ 'bufferquotainmb' => $bufferQuotaInMB,
66
+ 'scheduledtransferperiodinminutes' => $scheduledTransferPeriodInMinutes,
67
+ 'scheduledtransferloglevelfilter' => $scheduledTransferLogLevelFilter
68
+ );
69
+ }
70
  }
libs/Microsoft/WindowsAzure/Diagnostics/ConfigurationDirectories.php CHANGED
@@ -1,93 +1,93 @@
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
- * @subpackage Diagnostics
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Diagnostics
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property int BufferQuotaInMB Buffer quota in MB
49
- * @property int ScheduledTransferPeriodInMinutes Scheduled transfer period in minutes
50
- * @property array Subscriptions Subscriptions
51
- */
52
- class Microsoft_WindowsAzure_Diagnostics_ConfigurationDirectories
53
- extends Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
54
- {
55
- /**
56
- * Constructor
57
- *
58
- * @param int $bufferQuotaInMB Buffer quota in MB
59
- * @param int $scheduledTransferPeriodInMinutes Scheduled transfer period in minutes
60
- */
61
- public function __construct($bufferQuotaInMB = 0, $scheduledTransferPeriodInMinutes = 0)
62
- {
63
- $this->_data = array(
64
- 'bufferquotainmb' => $bufferQuotaInMB,
65
- 'scheduledtransferperiodinminutes' => $scheduledTransferPeriodInMinutes,
66
- 'subscriptions' => array()
67
- );
68
- }
69
-
70
- /**
71
- * Add subscription
72
- *
73
- * @param string $path Path
74
- * @param string $container Container
75
- * @param int $directoryQuotaInMB Directory quota in MB
76
- */
77
- public function addSubscription($path, $container, $directoryQuotaInMB = 1024)
78
- {
79
- $this->_data['subscriptions'][$path] = new Microsoft_WindowsAzure_Diagnostics_DirectoryConfigurationSubscription($path, $container, $directoryQuotaInMB);
80
- }
81
-
82
- /**
83
- * Remove subscription
84
- *
85
- * @param string $path Path
86
- */
87
- public function removeSubscription($path)
88
- {
89
- if (isset($this->_data['subscriptions'][$path])) {
90
- unset($this->_data['subscriptions'][$path]);
91
- }
92
- }
93
  }
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
+ * @subpackage Diagnostics
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Diagnostics
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property int BufferQuotaInMB Buffer quota in MB
49
+ * @property int ScheduledTransferPeriodInMinutes Scheduled transfer period in minutes
50
+ * @property array Subscriptions Subscriptions
51
+ */
52
+ class Microsoft_WindowsAzure_Diagnostics_ConfigurationDirectories
53
+ extends Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
54
+ {
55
+ /**
56
+ * Constructor
57
+ *
58
+ * @param int $bufferQuotaInMB Buffer quota in MB
59
+ * @param int $scheduledTransferPeriodInMinutes Scheduled transfer period in minutes
60
+ */
61
+ public function __construct($bufferQuotaInMB = 0, $scheduledTransferPeriodInMinutes = 0)
62
+ {
63
+ $this->_data = array(
64
+ 'bufferquotainmb' => $bufferQuotaInMB,
65
+ 'scheduledtransferperiodinminutes' => $scheduledTransferPeriodInMinutes,
66
+ 'subscriptions' => array()
67
+ );
68
+ }
69
+
70
+ /**
71
+ * Add subscription
72
+ *
73
+ * @param string $path Path
74
+ * @param string $container Container
75
+ * @param int $directoryQuotaInMB Directory quota in MB
76
+ */
77
+ public function addSubscription($path, $container, $directoryQuotaInMB = 1024)
78
+ {
79
+ $this->_data['subscriptions'][$path] = new Microsoft_WindowsAzure_Diagnostics_DirectoryConfigurationSubscription($path, $container, $directoryQuotaInMB);
80
+ }
81
+
82
+ /**
83
+ * Remove subscription
84
+ *
85
+ * @param string $path Path
86
+ */
87
+ public function removeSubscription($path)
88
+ {
89
+ if (isset($this->_data['subscriptions'][$path])) {
90
+ unset($this->_data['subscriptions'][$path]);
91
+ }
92
+ }
93
  }
libs/Microsoft/WindowsAzure/Diagnostics/ConfigurationInstance.php CHANGED
@@ -1,225 +1,225 @@
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
- * @subpackage Diagnostics
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Diagnostics
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property Microsoft_WindowsAzure_Diagnostics_ConfigurationDataSources DataSources Data sources
49
- */
50
- class Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance
51
- extends Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
52
- {
53
- /**
54
- * Constructor
55
- */
56
- public function __construct()
57
- {
58
- $this->_data = array(
59
- 'datasources' => new Microsoft_WindowsAzure_Diagnostics_ConfigurationDataSources()
60
- );
61
- }
62
-
63
- /**
64
- * Load configuration XML
65
- *
66
- * @param string $configurationXml Configuration XML
67
- */
68
- public function loadXml($configurationXml)
69
- {
70
- // Convert to SimpleXMLElement
71
- $configurationXml = simplexml_load_string($configurationXml);
72
-
73
- // Assign general settings
74
- $this->DataSources->OverallQuotaInMB = (int)$configurationXml->DataSources->OverallQuotaInMB;
75
-
76
- // Assign Logs settings
77
- $this->DataSources->Logs->BufferQuotaInMB = (int)$configurationXml->DataSources->Logs->BufferQuotaInMB;
78
- $this->DataSources->Logs->ScheduledTransferPeriodInMinutes = (int)$configurationXml->DataSources->Logs->ScheduledTransferPeriodInMinutes;
79
- $this->DataSources->Logs->ScheduledTransferLogLevelFilter = (string)$configurationXml->DataSources->Logs->ScheduledTransferLogLevelFilter;
80
-
81
- // Assign DiagnosticInfrastructureLogs settings
82
- $this->DataSources->DiagnosticInfrastructureLogs->BufferQuotaInMB = (int)$configurationXml->DataSources->DiagnosticInfrastructureLogs->BufferQuotaInMB;
83
- $this->DataSources->DiagnosticInfrastructureLogs->ScheduledTransferPeriodInMinutes = (int)$configurationXml->DataSources->DiagnosticInfrastructureLogs->ScheduledTransferPeriodInMinutes;
84
- $this->DataSources->DiagnosticInfrastructureLogs->ScheduledTransferLogLevelFilter = (string)$configurationXml->DataSources->DiagnosticInfrastructureLogs->ScheduledTransferLogLevelFilter;
85
-
86
- // Assign PerformanceCounters settings
87
- $this->DataSources->PerformanceCounters->BufferQuotaInMB = (int)$configurationXml->DataSources->PerformanceCounters->BufferQuotaInMB;
88
- $this->DataSources->PerformanceCounters->ScheduledTransferPeriodInMinutes = (int)$configurationXml->DataSources->PerformanceCounters->ScheduledTransferPeriodInMinutes;
89
- if ($configurationXml->DataSources->PerformanceCounters->Subscriptions
90
- && $configurationXml->DataSources->PerformanceCounters->Subscriptions->PerformanceCounterConfiguration) {
91
- $subscriptions = $configurationXml->DataSources->PerformanceCounters->Subscriptions;
92
- if (count($subscriptions->PerformanceCounterConfiguration) > 1) {
93
- $subscriptions = $subscriptions->PerformanceCounterConfiguration;
94
- } else {
95
- $subscriptions = array($subscriptions->PerformanceCounterConfiguration);
96
- }
97
- foreach ($subscriptions as $subscription) {
98
- $this->DataSources->PerformanceCounters->addSubscription((string)$subscription->CounterSpecifier, (int)$subscription->SampleRateInSeconds);
99
- }
100
- }
101
-
102
- // Assign WindowsEventLog settings
103
- $this->DataSources->WindowsEventLog->BufferQuotaInMB = (int)$configurationXml->DataSources->WindowsEventLog->BufferQuotaInMB;
104
- $this->DataSources->WindowsEventLog->ScheduledTransferPeriodInMinutes = (int)$configurationXml->DataSources->WindowsEventLog->ScheduledTransferPeriodInMinutes;
105
- $this->DataSources->WindowsEventLog->ScheduledTransferLogLevelFilter = (string)$configurationXml->DataSources->WindowsEventLog->ScheduledTransferLogLevelFilter;
106
- if ($configurationXml->DataSources->WindowsEventLog->Subscriptions
107
- && $configurationXml->DataSources->WindowsEventLog->Subscriptions->string) {
108
- $subscriptions = $configurationXml->DataSources->WindowsEventLog->Subscriptions;
109
- if (count($subscriptions->string) > 1) {
110
- $subscriptions = $subscriptions->string;
111
- } else {
112
- $subscriptions = array($subscriptions->string);
113
- }
114
- foreach ($subscriptions as $subscription) {
115
- $this->DataSources->WindowsEventLog->addSubscription((string)$subscription);
116
- }
117
- }
118
-
119
- // Assign Directories settings
120
- $this->DataSources->Directories->BufferQuotaInMB = (int)$configurationXml->DataSources->Directories->BufferQuotaInMB;
121
- $this->DataSources->Directories->ScheduledTransferPeriodInMinutes = (int)$configurationXml->DataSources->Directories->ScheduledTransferPeriodInMinutes;
122
-
123
- if ($configurationXml->DataSources->Directories->Subscriptions
124
- && $configurationXml->DataSources->Directories->Subscriptions->DirectoryConfiguration) {
125
- $subscriptions = $configurationXml->DataSources->Directories->Subscriptions;
126
- if (count($subscriptions->DirectoryConfiguration) > 1) {
127
- $subscriptions = $subscriptions->DirectoryConfiguration;
128
- } else {
129
- $subscriptions = array($subscriptions->DirectoryConfiguration);
130
- }
131
- foreach ($subscriptions as $subscription) {
132
- $this->DataSources->Directories->addSubscription((string)$subscription->Path, (string)$subscription->Container, (int)$subscription->DirectoryQuotaInMB);
133
- }
134
- }
135
- }
136
-
137
- /**
138
- * Create configuration XML
139
- *
140
- * @return string
141
- */
142
- public function toXml()
143
- {
144
- // Return value
145
- $returnValue = array();
146
-
147
- // Build XML
148
- $returnValue[] = '<?xml version="1.0"?>';
149
- $returnValue[] = '<ConfigRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">';
150
-
151
- // Add data sources
152
- $returnValue[] = ' <DataSources>';
153
-
154
- $returnValue[] = ' <OverallQuotaInMB>' . $this->DataSources->OverallQuotaInMB . '</OverallQuotaInMB>';
155
-
156
- $returnValue[] = ' <Logs>';
157
- $returnValue[] = ' <BufferQuotaInMB>' . $this->DataSources->Logs->BufferQuotaInMB . '</BufferQuotaInMB>';
158
- $returnValue[] = ' <ScheduledTransferPeriodInMinutes>' . $this->DataSources->Logs->ScheduledTransferPeriodInMinutes . '</ScheduledTransferPeriodInMinutes>';
159
- $returnValue[] = ' <ScheduledTransferLogLevelFilter>' . $this->DataSources->Logs->ScheduledTransferLogLevelFilter . '</ScheduledTransferLogLevelFilter>';
160
- $returnValue[] = ' </Logs>';
161
-
162
- $returnValue[] = ' <DiagnosticInfrastructureLogs>';
163
- $returnValue[] = ' <BufferQuotaInMB>' . $this->DataSources->DiagnosticInfrastructureLogs->BufferQuotaInMB . '</BufferQuotaInMB>';
164
- $returnValue[] = ' <ScheduledTransferPeriodInMinutes>' . $this->DataSources->DiagnosticInfrastructureLogs->ScheduledTransferPeriodInMinutes . '</ScheduledTransferPeriodInMinutes>';
165
- $returnValue[] = ' <ScheduledTransferLogLevelFilter>' . $this->DataSources->DiagnosticInfrastructureLogs->ScheduledTransferLogLevelFilter . '</ScheduledTransferLogLevelFilter>';
166
- $returnValue[] = ' </DiagnosticInfrastructureLogs>';
167
-
168
- $returnValue[] = ' <PerformanceCounters>';
169
- $returnValue[] = ' <BufferQuotaInMB>' . $this->DataSources->PerformanceCounters->BufferQuotaInMB . '</BufferQuotaInMB>';
170
- $returnValue[] = ' <ScheduledTransferPeriodInMinutes>' . $this->DataSources->PerformanceCounters->ScheduledTransferPeriodInMinutes . '</ScheduledTransferPeriodInMinutes>';
171
- if (count($this->DataSources->PerformanceCounters->Subscriptions) == 0) {
172
- $returnValue[] = ' <Subscriptions />';
173
- } else {
174
- $returnValue[] = ' <Subscriptions>';
175
- foreach ($this->DataSources->PerformanceCounters->Subscriptions as $subscription) {
176
- $returnValue[] = ' <PerformanceCounterConfiguration>';
177
- $returnValue[] = ' <CounterSpecifier>' . $subscription->CounterSpecifier . '</CounterSpecifier>';
178
- $returnValue[] = ' <SampleRateInSeconds>' . $subscription->SampleRateInSeconds . '</SampleRateInSeconds>';
179
- $returnValue[] = ' </PerformanceCounterConfiguration>';
180
- }
181
- $returnValue[] = ' </Subscriptions>';
182
- }
183
- $returnValue[] = ' </PerformanceCounters>';
184
-
185
- $returnValue[] = ' <WindowsEventLog>';
186
- $returnValue[] = ' <BufferQuotaInMB>' . $this->DataSources->WindowsEventLog->BufferQuotaInMB . '</BufferQuotaInMB>';
187
- $returnValue[] = ' <ScheduledTransferPeriodInMinutes>' . $this->DataSources->WindowsEventLog->ScheduledTransferPeriodInMinutes . '</ScheduledTransferPeriodInMinutes>';
188
- if (count($this->DataSources->WindowsEventLog->Subscriptions) == 0) {
189
- $returnValue[] = ' <Subscriptions />';
190
- } else {
191
- $returnValue[] = ' <Subscriptions>';
192
- foreach ($this->DataSources->WindowsEventLog->Subscriptions as $subscription) {
193
- $returnValue[] = ' <string>' . $subscription . '</string>';
194
- }
195
- $returnValue[] = ' </Subscriptions>';
196
- }
197
- $returnValue[] = ' <ScheduledTransferLogLevelFilter>' . $this->DataSources->WindowsEventLog->ScheduledTransferLogLevelFilter . '</ScheduledTransferLogLevelFilter>';
198
- $returnValue[] = ' </WindowsEventLog>';
199
-
200
- $returnValue[] = ' <Directories>';
201
- $returnValue[] = ' <BufferQuotaInMB>' . $this->DataSources->Directories->BufferQuotaInMB . '</BufferQuotaInMB>';
202
- $returnValue[] = ' <ScheduledTransferPeriodInMinutes>' . $this->DataSources->Directories->ScheduledTransferPeriodInMinutes . '</ScheduledTransferPeriodInMinutes>';
203
- if (count($this->DataSources->Directories->Subscriptions) == 0) {
204
- $returnValue[] = ' <Subscriptions />';
205
- } else {
206
- $returnValue[] = ' <Subscriptions>';
207
- foreach ($this->DataSources->Directories->Subscriptions as $subscription) {
208
- $returnValue[] = ' <DirectoryConfiguration>';
209
- $returnValue[] = ' <Path>' . $subscription->Path . '</Path>';
210
- $returnValue[] = ' <Container>' . $subscription->Container . '</Container>';
211
- $returnValue[] = ' <DirectoryQuotaInMB>' . $subscription->DirectoryQuotaInMB . '</DirectoryQuotaInMB>';
212
- $returnValue[] = ' </DirectoryConfiguration>';
213
- }
214
- $returnValue[] = ' </Subscriptions>';
215
- }
216
- $returnValue[] = ' </Directories>';
217
-
218
- $returnValue[] = ' </DataSources>';
219
- $returnValue[] = ' <IsDefault>false</IsDefault>';
220
- $returnValue[] = '</ConfigRequest>';
221
-
222
- // Return
223
- return implode("\r\n", $returnValue);
224
- }
225
  }
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
+ * @subpackage Diagnostics
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Diagnostics
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property Microsoft_WindowsAzure_Diagnostics_ConfigurationDataSources DataSources Data sources
49
+ */
50
+ class Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance
51
+ extends Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
52
+ {
53
+ /**
54
+ * Constructor
55
+ */
56
+ public function __construct()
57
+ {
58
+ $this->_data = array(
59
+ 'datasources' => new Microsoft_WindowsAzure_Diagnostics_ConfigurationDataSources()
60
+ );
61
+ }
62
+
63
+ /**
64
+ * Load configuration XML
65
+ *
66
+ * @param string $configurationXml Configuration XML
67
+ */
68
+ public function loadXml($configurationXml)
69
+ {
70
+ // Convert to SimpleXMLElement
71
+ $configurationXml = simplexml_load_string($configurationXml);
72
+
73
+ // Assign general settings
74
+ $this->DataSources->OverallQuotaInMB = (int)$configurationXml->DataSources->OverallQuotaInMB;
75
+
76
+ // Assign Logs settings
77
+ $this->DataSources->Logs->BufferQuotaInMB = (int)$configurationXml->DataSources->Logs->BufferQuotaInMB;
78
+ $this->DataSources->Logs->ScheduledTransferPeriodInMinutes = (int)$configurationXml->DataSources->Logs->ScheduledTransferPeriodInMinutes;
79
+ $this->DataSources->Logs->ScheduledTransferLogLevelFilter = (string)$configurationXml->DataSources->Logs->ScheduledTransferLogLevelFilter;
80
+
81
+ // Assign DiagnosticInfrastructureLogs settings
82
+ $this->DataSources->DiagnosticInfrastructureLogs->BufferQuotaInMB = (int)$configurationXml->DataSources->DiagnosticInfrastructureLogs->BufferQuotaInMB;
83
+ $this->DataSources->DiagnosticInfrastructureLogs->ScheduledTransferPeriodInMinutes = (int)$configurationXml->DataSources->DiagnosticInfrastructureLogs->ScheduledTransferPeriodInMinutes;
84
+ $this->DataSources->DiagnosticInfrastructureLogs->ScheduledTransferLogLevelFilter = (string)$configurationXml->DataSources->DiagnosticInfrastructureLogs->ScheduledTransferLogLevelFilter;
85
+
86
+ // Assign PerformanceCounters settings
87
+ $this->DataSources->PerformanceCounters->BufferQuotaInMB = (int)$configurationXml->DataSources->PerformanceCounters->BufferQuotaInMB;
88
+ $this->DataSources->PerformanceCounters->ScheduledTransferPeriodInMinutes = (int)$configurationXml->DataSources->PerformanceCounters->ScheduledTransferPeriodInMinutes;
89
+ if ($configurationXml->DataSources->PerformanceCounters->Subscriptions
90
+ && $configurationXml->DataSources->PerformanceCounters->Subscriptions->PerformanceCounterConfiguration) {
91
+ $subscriptions = $configurationXml->DataSources->PerformanceCounters->Subscriptions;
92
+ if (count($subscriptions->PerformanceCounterConfiguration) > 1) {
93
+ $subscriptions = $subscriptions->PerformanceCounterConfiguration;
94
+ } else {
95
+ $subscriptions = array($subscriptions->PerformanceCounterConfiguration);
96
+ }
97
+ foreach ($subscriptions as $subscription) {
98
+ $this->DataSources->PerformanceCounters->addSubscription((string)$subscription->CounterSpecifier, (int)$subscription->SampleRateInSeconds);
99
+ }
100
+ }
101
+
102
+ // Assign WindowsEventLog settings
103
+ $this->DataSources->WindowsEventLog->BufferQuotaInMB = (int)$configurationXml->DataSources->WindowsEventLog->BufferQuotaInMB;
104
+ $this->DataSources->WindowsEventLog->ScheduledTransferPeriodInMinutes = (int)$configurationXml->DataSources->WindowsEventLog->ScheduledTransferPeriodInMinutes;
105
+ $this->DataSources->WindowsEventLog->ScheduledTransferLogLevelFilter = (string)$configurationXml->DataSources->WindowsEventLog->ScheduledTransferLogLevelFilter;
106
+ if ($configurationXml->DataSources->WindowsEventLog->Subscriptions
107
+ && $configurationXml->DataSources->WindowsEventLog->Subscriptions->string) {
108
+ $subscriptions = $configurationXml->DataSources->WindowsEventLog->Subscriptions;
109
+ if (count($subscriptions->string) > 1) {
110
+ $subscriptions = $subscriptions->string;
111
+ } else {
112
+ $subscriptions = array($subscriptions->string);
113
+ }
114
+ foreach ($subscriptions as $subscription) {
115
+ $this->DataSources->WindowsEventLog->addSubscription((string)$subscription);
116
+ }
117
+ }
118
+
119
+ // Assign Directories settings
120
+ $this->DataSources->Directories->BufferQuotaInMB = (int)$configurationXml->DataSources->Directories->BufferQuotaInMB;
121
+ $this->DataSources->Directories->ScheduledTransferPeriodInMinutes = (int)$configurationXml->DataSources->Directories->ScheduledTransferPeriodInMinutes;
122
+
123
+ if ($configurationXml->DataSources->Directories->Subscriptions
124
+ && $configurationXml->DataSources->Directories->Subscriptions->DirectoryConfiguration) {
125
+ $subscriptions = $configurationXml->DataSources->Directories->Subscriptions;
126
+ if (count($subscriptions->DirectoryConfiguration) > 1) {
127
+ $subscriptions = $subscriptions->DirectoryConfiguration;
128
+ } else {
129
+ $subscriptions = array($subscriptions->DirectoryConfiguration);
130
+ }
131
+ foreach ($subscriptions as $subscription) {
132
+ $this->DataSources->Directories->addSubscription((string)$subscription->Path, (string)$subscription->Container, (int)$subscription->DirectoryQuotaInMB);
133
+ }
134
+ }
135
+ }
136
+
137
+ /**
138
+ * Create configuration XML
139
+ *
140
+ * @return string
141
+ */
142
+ public function toXml()
143
+ {
144
+ // Return value
145
+ $returnValue = array();
146
+
147
+ // Build XML
148
+ $returnValue[] = '<?xml version="1.0"?>';
149
+ $returnValue[] = '<ConfigRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">';
150
+
151
+ // Add data sources
152
+ $returnValue[] = ' <DataSources>';
153
+
154
+ $returnValue[] = ' <OverallQuotaInMB>' . $this->DataSources->OverallQuotaInMB . '</OverallQuotaInMB>';
155
+
156
+ $returnValue[] = ' <Logs>';
157
+ $returnValue[] = ' <BufferQuotaInMB>' . $this->DataSources->Logs->BufferQuotaInMB . '</BufferQuotaInMB>';
158
+ $returnValue[] = ' <ScheduledTransferPeriodInMinutes>' . $this->DataSources->Logs->ScheduledTransferPeriodInMinutes . '</ScheduledTransferPeriodInMinutes>';
159
+ $returnValue[] = ' <ScheduledTransferLogLevelFilter>' . $this->DataSources->Logs->ScheduledTransferLogLevelFilter . '</ScheduledTransferLogLevelFilter>';
160
+ $returnValue[] = ' </Logs>';
161
+
162
+ $returnValue[] = ' <DiagnosticInfrastructureLogs>';
163
+ $returnValue[] = ' <BufferQuotaInMB>' . $this->DataSources->DiagnosticInfrastructureLogs->BufferQuotaInMB . '</BufferQuotaInMB>';
164
+ $returnValue[] = ' <ScheduledTransferPeriodInMinutes>' . $this->DataSources->DiagnosticInfrastructureLogs->ScheduledTransferPeriodInMinutes . '</ScheduledTransferPeriodInMinutes>';
165
+ $returnValue[] = ' <ScheduledTransferLogLevelFilter>' . $this->DataSources->DiagnosticInfrastructureLogs->ScheduledTransferLogLevelFilter . '</ScheduledTransferLogLevelFilter>';
166
+ $returnValue[] = ' </DiagnosticInfrastructureLogs>';
167
+
168
+ $returnValue[] = ' <PerformanceCounters>';
169
+ $returnValue[] = ' <BufferQuotaInMB>' . $this->DataSources->PerformanceCounters->BufferQuotaInMB . '</BufferQuotaInMB>';
170
+ $returnValue[] = ' <ScheduledTransferPeriodInMinutes>' . $this->DataSources->PerformanceCounters->ScheduledTransferPeriodInMinutes . '</ScheduledTransferPeriodInMinutes>';
171
+ if (count($this->DataSources->PerformanceCounters->Subscriptions) == 0) {
172
+ $returnValue[] = ' <Subscriptions />';
173
+ } else {
174
+ $returnValue[] = ' <Subscriptions>';
175
+ foreach ($this->DataSources->PerformanceCounters->Subscriptions as $subscription) {
176
+ $returnValue[] = ' <PerformanceCounterConfiguration>';
177
+ $returnValue[] = ' <CounterSpecifier>' . $subscription->CounterSpecifier . '</CounterSpecifier>';
178
+ $returnValue[] = ' <SampleRateInSeconds>' . $subscription->SampleRateInSeconds . '</SampleRateInSeconds>';
179
+ $returnValue[] = ' </PerformanceCounterConfiguration>';
180
+ }
181
+ $returnValue[] = ' </Subscriptions>';
182
+ }
183
+ $returnValue[] = ' </PerformanceCounters>';
184
+
185
+ $returnValue[] = ' <WindowsEventLog>';
186
+ $returnValue[] = ' <BufferQuotaInMB>' . $this->DataSources->WindowsEventLog->BufferQuotaInMB . '</BufferQuotaInMB>';
187
+ $returnValue[] = ' <ScheduledTransferPeriodInMinutes>' . $this->DataSources->WindowsEventLog->ScheduledTransferPeriodInMinutes . '</ScheduledTransferPeriodInMinutes>';
188
+ if (count($this->DataSources->WindowsEventLog->Subscriptions) == 0) {
189
+ $returnValue[] = ' <Subscriptions />';
190
+ } else {
191
+ $returnValue[] = ' <Subscriptions>';
192
+ foreach ($this->DataSources->WindowsEventLog->Subscriptions as $subscription) {
193
+ $returnValue[] = ' <string>' . $subscription . '</string>';
194
+ }
195
+ $returnValue[] = ' </Subscriptions>';
196
+ }
197
+ $returnValue[] = ' <ScheduledTransferLogLevelFilter>' . $this->DataSources->WindowsEventLog->ScheduledTransferLogLevelFilter . '</ScheduledTransferLogLevelFilter>';
198
+ $returnValue[] = ' </WindowsEventLog>';
199
+
200
+ $returnValue[] = ' <Directories>';
201
+ $returnValue[] = ' <BufferQuotaInMB>' . $this->DataSources->Directories->BufferQuotaInMB . '</BufferQuotaInMB>';
202
+ $returnValue[] = ' <ScheduledTransferPeriodInMinutes>' . $this->DataSources->Directories->ScheduledTransferPeriodInMinutes . '</ScheduledTransferPeriodInMinutes>';
203
+ if (count($this->DataSources->Directories->Subscriptions) == 0) {
204
+ $returnValue[] = ' <Subscriptions />';
205
+ } else {
206
+ $returnValue[] = ' <Subscriptions>';
207
+ foreach ($this->DataSources->Directories->Subscriptions as $subscription) {
208
+ $returnValue[] = ' <DirectoryConfiguration>';
209
+ $returnValue[] = ' <Path>' . $subscription->Path . '</Path>';
210
+ $returnValue[] = ' <Container>' . $subscription->Container . '</Container>';
211
+ $returnValue[] = ' <DirectoryQuotaInMB>' . $subscription->DirectoryQuotaInMB . '</DirectoryQuotaInMB>';
212
+ $returnValue[] = ' </DirectoryConfiguration>';
213
+ }
214
+ $returnValue[] = ' </Subscriptions>';
215
+ }
216
+ $returnValue[] = ' </Directories>';
217
+
218
+ $returnValue[] = ' </DataSources>';
219
+ $returnValue[] = ' <IsDefault>false</IsDefault>';
220
+ $returnValue[] = '</ConfigRequest>';
221
+
222
+ // Return
223
+ return implode("\r\n", $returnValue);
224
+ }
225
  }
libs/Microsoft/WindowsAzure/Diagnostics/ConfigurationLogs.php CHANGED
@@ -1,70 +1,70 @@
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
- * @subpackage Diagnostics
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Diagnostics
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property int BufferQuotaInMB Buffer quota in MB
49
- * @property int ScheduledTransferPeriodInMinutes Scheduled transfer period in minutes
50
- * @property string ScheduledTransferLogLevelFilter Scheduled transfer log level filter
51
- */
52
- class Microsoft_WindowsAzure_Diagnostics_ConfigurationLogs
53
- extends Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
54
- {
55
- /**
56
- * Constructor
57
- *
58
- * @param int $bufferQuotaInMB Buffer quota in MB
59
- * @param int $scheduledTransferPeriodInMinutes Scheduled transfer period in minutes
60
- * @param string $scheduledTransferLogLevelFilter Scheduled transfer log level filter
61
- */
62
- public function __construct($bufferQuotaInMB = 0, $scheduledTransferPeriodInMinutes = 0, $scheduledTransferLogLevelFilter = Microsoft_WindowsAzure_Diagnostics_LogLevel::UNDEFINED)
63
- {
64
- $this->_data = array(
65
- 'bufferquotainmb' => $bufferQuotaInMB,
66
- 'scheduledtransferperiodinminutes' => $scheduledTransferPeriodInMinutes,
67
- 'scheduledtransferloglevelfilter' => $scheduledTransferLogLevelFilter
68
- );
69
- }
70
  }
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
+ * @subpackage Diagnostics
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Diagnostics
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property int BufferQuotaInMB Buffer quota in MB
49
+ * @property int ScheduledTransferPeriodInMinutes Scheduled transfer period in minutes
50
+ * @property string ScheduledTransferLogLevelFilter Scheduled transfer log level filter
51
+ */
52
+ class Microsoft_WindowsAzure_Diagnostics_ConfigurationLogs
53
+ extends Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
54
+ {
55
+ /**
56
+ * Constructor
57
+ *
58
+ * @param int $bufferQuotaInMB Buffer quota in MB
59
+ * @param int $scheduledTransferPeriodInMinutes Scheduled transfer period in minutes
60
+ * @param string $scheduledTransferLogLevelFilter Scheduled transfer log level filter
61
+ */
62
+ public function __construct($bufferQuotaInMB = 0, $scheduledTransferPeriodInMinutes = 0, $scheduledTransferLogLevelFilter = Microsoft_WindowsAzure_Diagnostics_LogLevel::UNDEFINED)
63
+ {
64
+ $this->_data = array(
65
+ 'bufferquotainmb' => $bufferQuotaInMB,
66
+ 'scheduledtransferperiodinminutes' => $scheduledTransferPeriodInMinutes,
67
+ 'scheduledtransferloglevelfilter' => $scheduledTransferLogLevelFilter
68
+ );
69
+ }
70
  }
libs/Microsoft/WindowsAzure/Diagnostics/ConfigurationObjectBaseAbstract.php CHANGED
@@ -1,84 +1,84 @@
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
- * @subpackage Diagnostics
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Diagnostics
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- */
48
- abstract class Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
49
- {
50
- /**
51
- * Data
52
- *
53
- * @var array
54
- */
55
- protected $_data = null;
56
-
57
- /**
58
- * Magic overload for setting properties
59
- *
60
- * @param string $name Name of the property
61
- * @param string $value Value to set
62
- */
63
- public function __set($name, $value) {
64
- if (array_key_exists(strtolower($name), $this->_data)) {
65
- $this->_data[strtolower($name)] = $value;
66
- return;
67
- }
68
-
69
- throw new Microsoft_WindowsAzure_Diagnostics_Exception("Unknown property: " . $name);
70
- }
71
-
72
- /**
73
- * Magic overload for getting properties
74
- *
75
- * @param string $name Name of the property
76
- */
77
- public function __get($name) {
78
- if (array_key_exists(strtolower($name), $this->_data)) {
79
- return $this->_data[strtolower($name)];
80
- }
81
-
82
- throw new Microsoft_WindowsAzure_Diagnostics_Exception("Unknown property: " . $name);
83
- }
84
  }
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
+ * @subpackage Diagnostics
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Diagnostics
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ */
48
+ abstract class Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
49
+ {
50
+ /**
51
+ * Data
52
+ *
53
+ * @var array
54
+ */
55
+ protected $_data = null;
56
+
57
+ /**
58
+ * Magic overload for setting properties
59
+ *
60
+ * @param string $name Name of the property
61
+ * @param string $value Value to set
62
+ */
63
+ public function __set($name, $value) {
64
+ if (array_key_exists(strtolower($name), $this->_data)) {
65
+ $this->_data[strtolower($name)] = $value;
66
+ return;
67
+ }
68
+
69
+ throw new Microsoft_WindowsAzure_Diagnostics_Exception("Unknown property: " . $name);
70
+ }
71
+
72
+ /**
73
+ * Magic overload for getting properties
74
+ *
75
+ * @param string $name Name of the property
76
+ */
77
+ public function __get($name) {
78
+ if (array_key_exists(strtolower($name), $this->_data)) {
79
+ return $this->_data[strtolower($name)];
80
+ }
81
+
82
+ throw new Microsoft_WindowsAzure_Diagnostics_Exception("Unknown property: " . $name);
83
+ }
84
  }
libs/Microsoft/WindowsAzure/Diagnostics/ConfigurationPerformanceCounters.php CHANGED
@@ -1,92 +1,92 @@
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
- * @subpackage Diagnostics
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Diagnostics
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property int BufferQuotaInMB Buffer quota in MB
49
- * @property int ScheduledTransferPeriodInMinutes Scheduled transfer period in minutes
50
- * @property array Subscriptions Subscriptions
51
- */
52
- class Microsoft_WindowsAzure_Diagnostics_ConfigurationPerformanceCounters
53
- extends Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
54
- {
55
- /**
56
- * Constructor
57
- *
58
- * @param int $bufferQuotaInMB Buffer quota in MB
59
- * @param int $scheduledTransferPeriodInMinutes Scheduled transfer period in minutes
60
- */
61
- public function __construct($bufferQuotaInMB = 0, $scheduledTransferPeriodInMinutes = 0)
62
- {
63
- $this->_data = array(
64
- 'bufferquotainmb' => $bufferQuotaInMB,
65
- 'scheduledtransferperiodinminutes' => $scheduledTransferPeriodInMinutes,
66
- 'subscriptions' => array()
67
- );
68
- }
69
-
70
- /**
71
- * Add subscription
72
- *
73
- * @param string $counterSpecifier Counter specifier
74
- * @param int $sampleRateInSeconds Sample rate in seconds
75
- */
76
- public function addSubscription($counterSpecifier, $sampleRateInSeconds = 1)
77
- {
78
- $this->_data['subscriptions'][$counterSpecifier] = new Microsoft_WindowsAzure_Diagnostics_PerformanceCounterSubscription($counterSpecifier, $sampleRateInSeconds);
79
- }
80
-
81
- /**
82
- * Remove subscription
83
- *
84
- * @param string $counterSpecifier Counter specifier
85
- */
86
- public function removeSubscription($counterSpecifier)
87
- {
88
- if (isset($this->_data['subscriptions'][$counterSpecifier])) {
89
- unset($this->_data['subscriptions'][$counterSpecifier]);
90
- }
91
- }
92
  }
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
+ * @subpackage Diagnostics
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Diagnostics
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property int BufferQuotaInMB Buffer quota in MB
49
+ * @property int ScheduledTransferPeriodInMinutes Scheduled transfer period in minutes
50
+ * @property array Subscriptions Subscriptions
51
+ */
52
+ class Microsoft_WindowsAzure_Diagnostics_ConfigurationPerformanceCounters
53
+ extends Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
54
+ {
55
+ /**
56
+ * Constructor
57
+ *
58
+ * @param int $bufferQuotaInMB Buffer quota in MB
59
+ * @param int $scheduledTransferPeriodInMinutes Scheduled transfer period in minutes
60
+ */
61
+ public function __construct($bufferQuotaInMB = 0, $scheduledTransferPeriodInMinutes = 0)
62
+ {
63
+ $this->_data = array(
64
+ 'bufferquotainmb' => $bufferQuotaInMB,
65
+ 'scheduledtransferperiodinminutes' => $scheduledTransferPeriodInMinutes,
66
+ 'subscriptions' => array()
67
+ );
68
+ }
69
+
70
+ /**
71
+ * Add subscription
72
+ *
73
+ * @param string $counterSpecifier Counter specifier
74
+ * @param int $sampleRateInSeconds Sample rate in seconds
75
+ */
76
+ public function addSubscription($counterSpecifier, $sampleRateInSeconds = 1)
77
+ {
78
+ $this->_data['subscriptions'][$counterSpecifier] = new Microsoft_WindowsAzure_Diagnostics_PerformanceCounterSubscription($counterSpecifier, $sampleRateInSeconds);
79
+ }
80
+
81
+ /**
82
+ * Remove subscription
83
+ *
84
+ * @param string $counterSpecifier Counter specifier
85
+ */
86
+ public function removeSubscription($counterSpecifier)
87
+ {
88
+ if (isset($this->_data['subscriptions'][$counterSpecifier])) {
89
+ unset($this->_data['subscriptions'][$counterSpecifier]);
90
+ }
91
+ }
92
  }
libs/Microsoft/WindowsAzure/Diagnostics/ConfigurationWindowsEventLog.php CHANGED
@@ -1,94 +1,94 @@
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
- * @subpackage Diagnostics
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Diagnostics
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property int BufferQuotaInMB Buffer quota in MB
49
- * @property int ScheduledTransferPeriodInMinutes Scheduled transfer period in minutes
50
- * @property string ScheduledTransferLogLevelFilter Scheduled transfer log level filter
51
- * @property array Subscriptions Subscriptions
52
- */
53
- class Microsoft_WindowsAzure_Diagnostics_ConfigurationWindowsEventLog
54
- extends Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
55
- {
56
- /**
57
- * Constructor
58
- *
59
- * @param int $bufferQuotaInMB Buffer quota in MB
60
- * @param int $scheduledTransferPeriodInMinutes Scheduled transfer period in minutes
61
- * @param string $scheduledTransferLogLevelFilter Scheduled transfer log level filter
62
- */
63
- public function __construct($bufferQuotaInMB = 0, $scheduledTransferPeriodInMinutes = 0, $scheduledTransferLogLevelFilter = Microsoft_WindowsAzure_Diagnostics_LogLevel::UNDEFINED)
64
- {
65
- $this->_data = array(
66
- 'bufferquotainmb' => $bufferQuotaInMB,
67
- 'scheduledtransferperiodinminutes' => $scheduledTransferPeriodInMinutes,
68
- 'scheduledtransferloglevelfilter' => $scheduledTransferLogLevelFilter,
69
- 'subscriptions' => array()
70
- );
71
- }
72
-
73
- /**
74
- * Add subscription
75
- *
76
- * @param string $filter Event log filter
77
- */
78
- public function addSubscription($filter)
79
- {
80
- $this->_data['subscriptions'][$filter] = $filter;
81
- }
82
-
83
- /**
84
- * Remove subscription
85
- *
86
- * @param string $filter Event log filter
87
- */
88
- public function removeSubscription($filter)
89
- {
90
- if (isset($this->_data['subscriptions'][$filter])) {
91
- unset($this->_data['subscriptions'][$filter]);
92
- }
93
- }
94
  }
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
+ * @subpackage Diagnostics
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Diagnostics
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property int BufferQuotaInMB Buffer quota in MB
49
+ * @property int ScheduledTransferPeriodInMinutes Scheduled transfer period in minutes
50
+ * @property string ScheduledTransferLogLevelFilter Scheduled transfer log level filter
51
+ * @property array Subscriptions Subscriptions
52
+ */
53
+ class Microsoft_WindowsAzure_Diagnostics_ConfigurationWindowsEventLog
54
+ extends Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
55
+ {
56
+ /**
57
+ * Constructor
58
+ *
59
+ * @param int $bufferQuotaInMB Buffer quota in MB
60
+ * @param int $scheduledTransferPeriodInMinutes Scheduled transfer period in minutes
61
+ * @param string $scheduledTransferLogLevelFilter Scheduled transfer log level filter
62
+ */
63
+ public function __construct($bufferQuotaInMB = 0, $scheduledTransferPeriodInMinutes = 0, $scheduledTransferLogLevelFilter = Microsoft_WindowsAzure_Diagnostics_LogLevel::UNDEFINED)
64
+ {
65
+ $this->_data = array(
66
+ 'bufferquotainmb' => $bufferQuotaInMB,
67
+ 'scheduledtransferperiodinminutes' => $scheduledTransferPeriodInMinutes,
68
+ 'scheduledtransferloglevelfilter' => $scheduledTransferLogLevelFilter,
69
+ 'subscriptions' => array()
70
+ );
71
+ }
72
+
73
+ /**
74
+ * Add subscription
75
+ *
76
+ * @param string $filter Event log filter
77
+ */
78
+ public function addSubscription($filter)
79
+ {
80
+ $this->_data['subscriptions'][$filter] = $filter;
81
+ }
82
+
83
+ /**
84
+ * Remove subscription
85
+ *
86
+ * @param string $filter Event log filter
87
+ */
88
+ public function removeSubscription($filter)
89
+ {
90
+ if (isset($this->_data['subscriptions'][$filter])) {
91
+ unset($this->_data['subscriptions'][$filter]);
92
+ }
93
+ }
94
  }
libs/Microsoft/WindowsAzure/Diagnostics/DirectoryConfigurationSubscription.php CHANGED
@@ -1,70 +1,70 @@
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
- * @subpackage Diagnostics
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Diagnostics
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property string Path Path
49
- * @property string Container Container
50
- * @property int DirectoryQuotaInMB Directory quota in MB
51
- */
52
- class Microsoft_WindowsAzure_Diagnostics_DirectoryConfigurationSubscription
53
- extends Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
54
- {
55
- /**
56
- * Constructor
57
- *
58
- * @param string $path Path
59
- * @param string $container Container
60
- * @param int $directoryQuotaInMB Directory quota in MB
61
- */
62
- public function __construct($path, $container, $directoryQuotaInMB = 1024)
63
- {
64
- $this->_data = array(
65
- 'path' => $path,
66
- 'container' => $container,
67
- 'directoryquotainmb' => $directoryQuotaInMB
68
- );
69
- }
70
  }
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
+ * @subpackage Diagnostics
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Diagnostics
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property string Path Path
49
+ * @property string Container Container
50
+ * @property int DirectoryQuotaInMB Directory quota in MB
51
+ */
52
+ class Microsoft_WindowsAzure_Diagnostics_DirectoryConfigurationSubscription
53
+ extends Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
54
+ {
55
+ /**
56
+ * Constructor
57
+ *
58
+ * @param string $path Path
59
+ * @param string $container Container
60
+ * @param int $directoryQuotaInMB Directory quota in MB
61
+ */
62
+ public function __construct($path, $container, $directoryQuotaInMB = 1024)
63
+ {
64
+ $this->_data = array(
65
+ 'path' => $path,
66
+ 'container' => $container,
67
+ 'directoryquotainmb' => $directoryQuotaInMB
68
+ );
69
+ }
70
  }
libs/Microsoft/WindowsAzure/Diagnostics/Exception.php CHANGED
@@ -1,51 +1,51 @@
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
- * @subpackage Diagnostics
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Diagnostics
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- */
48
- class Microsoft_WindowsAzure_Diagnostics_Exception
49
- extends Microsoft_WindowsAzure_Exception
50
- {
51
  }
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
+ * @subpackage Diagnostics
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Diagnostics
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ */
48
+ class Microsoft_WindowsAzure_Diagnostics_Exception
49
+ extends Microsoft_WindowsAzure_Exception
50
+ {
51
  }
libs/Microsoft/WindowsAzure/Diagnostics/LogLevel.php CHANGED
@@ -1,52 +1,52 @@
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
- * @subpackage Diagnostics
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
- */
35
-
36
-
37
- /**
38
- * @category Microsoft
39
- * @package Microsoft_WindowsAzure
40
- * @subpackage Diagnostics
41
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
42
- * @license http://phpazure.codeplex.com/license
43
- */
44
- class Microsoft_WindowsAzure_Diagnostics_LogLevel
45
- {
46
- const UNDEFINED = 'Undefined';
47
- const CRITICAL = 'Critical';
48
- const ERROR = 'Error';
49
- const WARNING = 'Warning';
50
- const INFORMATION = 'Information';
51
- const VERBOSE = 'Verbose';
52
  }
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
+ * @subpackage Diagnostics
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
+ */
35
+
36
+
37
+ /**
38
+ * @category Microsoft
39
+ * @package Microsoft_WindowsAzure
40
+ * @subpackage Diagnostics
41
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
42
+ * @license http://phpazure.codeplex.com/license
43
+ */
44
+ class Microsoft_WindowsAzure_Diagnostics_LogLevel
45
+ {
46
+ const UNDEFINED = 'Undefined';
47
+ const CRITICAL = 'Critical';
48
+ const ERROR = 'Error';
49
+ const WARNING = 'Warning';
50
+ const INFORMATION = 'Information';
51
+ const VERBOSE = 'Verbose';
52
  }
libs/Microsoft/WindowsAzure/Diagnostics/Manager.php CHANGED
@@ -1,225 +1,225 @@
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
- * @subpackage Diagnostics
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Diagnostics
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- */
48
- class Microsoft_WindowsAzure_Diagnostics_Manager
49
- {
50
- /**
51
- * Blob storage client
52
- *
53
- * @var Microsoft_WindowsAzure_Storage_Blob
54
- */
55
- protected $_blobStorageClient = null;
56
-
57
- /**
58
- * Control container name
59
- *
60
- * @var string
61
- */
62
- protected $_controlContainer = '';
63
-
64
- /**
65
- * Create a new instance of Microsoft_WindowsAzure_Diagnostics_Manager
66
- *
67
- * @param Microsoft_WindowsAzure_Storage_Blob $blobStorageClient Blob storage client
68
- * @param string $controlContainer Control container name
69
- */
70
- public function __construct(Microsoft_WindowsAzure_Storage_Blob $blobStorageClient = null, $controlContainer = 'wad-control-container')
71
- {
72
- $this->_blobStorageClient = $blobStorageClient;
73
- $this->_controlContainer = $controlContainer;
74
-
75
- $this->_ensureStorageInitialized();
76
- }
77
-
78
- /**
79
- * Ensure storage has been initialized
80
- */
81
- protected function _ensureStorageInitialized()
82
- {
83
- if (!$this->_blobStorageClient->containerExists($this->_controlContainer)) {
84
- $this->_blobStorageClient->createContainer($this->_controlContainer);
85
- }
86
- }
87
-
88
- /**
89
- * Get default configuration values
90
- *
91
- * @return Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance
92
- */
93
- public function getDefaultConfiguration()
94
- {
95
- return new Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance();
96
- }
97
-
98
- /**
99
- * Checks if a configuration for a specific role instance exists.
100
- *
101
- * @param string $roleInstance Role instance name, can be found in $_SERVER['RdRoleId'] when hosted on Windows Azure.
102
- * @return boolean
103
- * @throws Microsoft_WindowsAzure_Diagnostics_Exception
104
- */
105
- public function configurationForRoleInstanceExists($roleInstance = null)
106
- {
107
- if (is_null($roleInstance)) {
108
- throw new Microsoft_WindowsAzure_Diagnostics_Exception('Role instance should be specified. Try reading $_SERVER[\'RdRoleId\'] for this information if the application is hosted on Windows Azure Fabric or Development Fabric.');
109
- }
110
-
111
- return $this->_blobStorageClient->blobExists($this->_controlContainer, $roleInstance);
112
- }
113
-
114
- /**
115
- * Checks if a configuration for current role instance exists. Only works on Development Fabric or Windows Azure Fabric.
116
- *
117
- * @return boolean
118
- * @throws Microsoft_WindowsAzure_Diagnostics_Exception
119
- */
120
- public function configurationForCurrentRoleInstanceExists()
121
- {
122
- if (!isset($_SERVER['RdRoleId'])) {
123
- throw new Microsoft_WindowsAzure_Diagnostics_Exception('Server variable \'RdRoleId\' is unknown. Please verify the application is running in Development Fabric or Windows Azure Fabric.');
124
- }
125
-
126
- return $this->_blobStorageClient->blobExists($this->_controlContainer, $this->_getCurrentRoleInstanceId());
127
- }
128
-
129
- /**
130
- * Get configuration for current role instance. Only works on Development Fabric or Windows Azure Fabric.
131
- *
132
- * @return Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance
133
- * @throws Microsoft_WindowsAzure_Diagnostics_Exception
134
- */
135
- public function getConfigurationForCurrentRoleInstance()
136
- {
137
- if (!isset($_SERVER['RdRoleId'])) {
138
- throw new Microsoft_WindowsAzure_Diagnostics_Exception('Server variable \'RdRoleId\' is unknown. Please verify the application is running in Development Fabric or Windows Azure Fabric.');
139
- }
140
- return $this->getConfigurationForRoleInstance($this->_getCurrentRoleInstanceId());
141
- }
142
-
143
- /**
144
- * Get the current role instance ID. Only works on Development Fabric or Windows Azure Fabric.
145
- *
146
- * @return string
147
- * @throws Microsoft_WindowsAzure_Diagnostics_Exception
148
- */
149
- protected function _getCurrentRoleInstanceId()
150
- {
151
- if (!isset($_SERVER['RdRoleId'])) {
152
- throw new Microsoft_WindowsAzure_Diagnostics_Exception('Server variable \'RdRoleId\' is unknown. Please verify the application is running in Development Fabric or Windows Azure Fabric.');
153
- }
154
-
155
- if (strpos($_SERVER['RdRoleId'], 'deployment(') === false) {
156
- return $_SERVER['RdRoleId'];
157
- } else {
158
- $roleIdParts = explode('.', $_SERVER['RdRoleId']);
159
- return $roleIdParts[0] . '/' . $roleIdParts[2] . '/' . $_SERVER['RdRoleId'];
160
- }
161
-
162
- if (!isset($_SERVER['RoleDeploymentID']) && !isset($_SERVER['RoleInstanceID']) && !isset($_SERVER['RoleName'])) {
163
- throw new Exception('Server variables \'RoleDeploymentID\', \'RoleInstanceID\' and \'RoleName\' are unknown. Please verify the application is running in Development Fabric or Windows Azure Fabric.');
164
- }
165
-
166
- if (strpos($_SERVER['RdRoleId'], 'deployment(') === false) {
167
- return $_SERVER['RdRoleId'];
168
- } else {
169
- return $_SERVER['RoleDeploymentID'] . '/' . $_SERVER['RoleInstanceID'] . '/' . $_SERVER['RoleName'];
170
- }
171
- }
172
-
173
- /**
174
- * Set configuration for current role instance. Only works on Development Fabric or Windows Azure Fabric.
175
- *
176
- * @param Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance $configuration Configuration to apply
177
- * @throws Microsoft_WindowsAzure_Diagnostics_Exception
178
- */
179
- public function setConfigurationForCurrentRoleInstance(Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance $configuration)
180
- {
181
- if (!isset($_SERVER['RdRoleId'])) {
182
- throw new Microsoft_WindowsAzure_Diagnostics_Exception('Server variable \'RdRoleId\' is unknown. Please verify the application is running in Development Fabric or Windows Azure Fabric.');
183
- }
184
-
185
- $this->setConfigurationForRoleInstance($this->_getCurrentRoleInstanceId(), $configuration);
186
- }
187
-
188
- /**
189
- * Get configuration for a specific role instance
190
- *
191
- * @param string $roleInstance Role instance name, can be found in $_SERVER['RdRoleId'] when hosted on Windows Azure.
192
- * @return Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance
193
- * @throws Microsoft_WindowsAzure_Diagnostics_Exception
194
- */
195
- public function getConfigurationForRoleInstance($roleInstance = null)
196
- {
197
- if (is_null($roleInstance)) {
198
- throw new Microsoft_WindowsAzure_Diagnostics_Exception('Role instance should be specified. Try reading $_SERVER[\'RdRoleId\'] for this information if the application is hosted on Windows Azure Fabric or Development Fabric.');
199
- }
200
-
201
- if ($this->_blobStorageClient->blobExists($this->_controlContainer, $roleInstance)) {
202
- $configurationInstance = new Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance();
203
- $configurationInstance->loadXml( $this->_blobStorageClient->getBlobData($this->_controlContainer, $roleInstance) );
204
- return $configurationInstance;
205
- }
206
-
207
- return new Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance();
208
- }
209
-
210
- /**
211
- * Set configuration for a specific role instance
212
- *
213
- * @param string $roleInstance Role instance name, can be found in $_SERVER['RdRoleId'] when hosted on Windows Azure.
214
- * @param Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance $configuration Configuration to apply
215
- * @throws Microsoft_WindowsAzure_Diagnostics_Exception
216
- */
217
- public function setConfigurationForRoleInstance($roleInstance = null, Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance $configuration)
218
- {
219
- if (is_null($roleInstance)) {
220
- throw new Microsoft_WindowsAzure_Diagnostics_Exception('Role instance should be specified. Try reading $_SERVER[\'RdRoleId\'] for this information if the application is hosted on Windows Azure Fabric or Development Fabric.');
221
- }
222
-
223
- $this->_blobStorageClient->putBlobData($this->_controlContainer, $roleInstance, $configuration->toXml(), array(), null, array('Content-Type' => 'text/xml'));
224
- }
225
  }
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
+ * @subpackage Diagnostics
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Diagnostics
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ */
48
+ class Microsoft_WindowsAzure_Diagnostics_Manager
49
+ {
50
+ /**
51
+ * Blob storage client
52
+ *
53
+ * @var Microsoft_WindowsAzure_Storage_Blob
54
+ */
55
+ protected $_blobStorageClient = null;
56
+
57
+ /**
58
+ * Control container name
59
+ *
60
+ * @var string
61
+ */
62
+ protected $_controlContainer = '';
63
+
64
+ /**
65
+ * Create a new instance of Microsoft_WindowsAzure_Diagnostics_Manager
66
+ *
67
+ * @param Microsoft_WindowsAzure_Storage_Blob $blobStorageClient Blob storage client
68
+ * @param string $controlContainer Control container name
69
+ */
70
+ public function __construct(Microsoft_WindowsAzure_Storage_Blob $blobStorageClient = null, $controlContainer = 'wad-control-container')
71
+ {
72
+ $this->_blobStorageClient = $blobStorageClient;
73
+ $this->_controlContainer = $controlContainer;
74
+
75
+ $this->_ensureStorageInitialized();
76
+ }
77
+
78
+ /**
79
+ * Ensure storage has been initialized
80
+ */
81
+ protected function _ensureStorageInitialized()
82
+ {
83
+ if (!$this->_blobStorageClient->containerExists($this->_controlContainer)) {
84
+ $this->_blobStorageClient->createContainer($this->_controlContainer);
85
+ }
86
+ }
87
+
88
+ /**
89
+ * Get default configuration values
90
+ *
91
+ * @return Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance
92
+ */
93
+ public function getDefaultConfiguration()
94
+ {
95
+ return new Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance();
96
+ }
97
+
98
+ /**
99
+ * Checks if a configuration for a specific role instance exists.
100
+ *
101
+ * @param string $roleInstance Role instance name, can be found in $_SERVER['RdRoleId'] when hosted on Windows Azure.
102
+ * @return boolean
103
+ * @throws Microsoft_WindowsAzure_Diagnostics_Exception
104
+ */
105
+ public function configurationForRoleInstanceExists($roleInstance = null)
106
+ {
107
+ if (is_null($roleInstance)) {
108
+ throw new Microsoft_WindowsAzure_Diagnostics_Exception('Role instance should be specified. Try reading $_SERVER[\'RdRoleId\'] for this information if the application is hosted on Windows Azure Fabric or Development Fabric.');
109
+ }
110
+
111
+ return $this->_blobStorageClient->blobExists($this->_controlContainer, $roleInstance);
112
+ }
113
+
114
+ /**
115
+ * Checks if a configuration for current role instance exists. Only works on Development Fabric or Windows Azure Fabric.
116
+ *
117
+ * @return boolean
118
+ * @throws Microsoft_WindowsAzure_Diagnostics_Exception
119
+ */
120
+ public function configurationForCurrentRoleInstanceExists()
121
+ {
122
+ if (!isset($_SERVER['RdRoleId'])) {
123
+ throw new Microsoft_WindowsAzure_Diagnostics_Exception('Server variable \'RdRoleId\' is unknown. Please verify the application is running in Development Fabric or Windows Azure Fabric.');
124
+ }
125
+
126
+ return $this->_blobStorageClient->blobExists($this->_controlContainer, $this->_getCurrentRoleInstanceId());
127
+ }
128
+
129
+ /**
130
+ * Get configuration for current role instance. Only works on Development Fabric or Windows Azure Fabric.
131
+ *
132
+ * @return Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance
133
+ * @throws Microsoft_WindowsAzure_Diagnostics_Exception
134
+ */
135
+ public function getConfigurationForCurrentRoleInstance()
136
+ {
137
+ if (!isset($_SERVER['RdRoleId'])) {
138
+ throw new Microsoft_WindowsAzure_Diagnostics_Exception('Server variable \'RdRoleId\' is unknown. Please verify the application is running in Development Fabric or Windows Azure Fabric.');
139
+ }
140
+ return $this->getConfigurationForRoleInstance($this->_getCurrentRoleInstanceId());
141
+ }
142
+
143
+ /**
144
+ * Get the current role instance ID. Only works on Development Fabric or Windows Azure Fabric.
145
+ *
146
+ * @return string
147
+ * @throws Microsoft_WindowsAzure_Diagnostics_Exception
148
+ */
149
+ protected function _getCurrentRoleInstanceId()
150
+ {
151
+ if (!isset($_SERVER['RdRoleId'])) {
152
+ throw new Microsoft_WindowsAzure_Diagnostics_Exception('Server variable \'RdRoleId\' is unknown. Please verify the application is running in Development Fabric or Windows Azure Fabric.');
153
+ }
154
+
155
+ if (strpos($_SERVER['RdRoleId'], 'deployment(') === false) {
156
+ return $_SERVER['RdRoleId'];
157
+ } else {
158
+ $roleIdParts = explode('.', $_SERVER['RdRoleId']);
159
+ return $roleIdParts[0] . '/' . $roleIdParts[2] . '/' . $_SERVER['RdRoleId'];
160
+ }
161
+
162
+ if (!isset($_SERVER['RoleDeploymentID']) && !isset($_SERVER['RoleInstanceID']) && !isset($_SERVER['RoleName'])) {
163
+ throw new Exception('Server variables \'RoleDeploymentID\', \'RoleInstanceID\' and \'RoleName\' are unknown. Please verify the application is running in Development Fabric or Windows Azure Fabric.');
164
+ }
165
+
166
+ if (strpos($_SERVER['RdRoleId'], 'deployment(') === false) {
167
+ return $_SERVER['RdRoleId'];
168
+ } else {
169
+ return $_SERVER['RoleDeploymentID'] . '/' . $_SERVER['RoleInstanceID'] . '/' . $_SERVER['RoleName'];
170
+ }
171
+ }
172
+
173
+ /**
174
+ * Set configuration for current role instance. Only works on Development Fabric or Windows Azure Fabric.
175
+ *
176
+ * @param Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance $configuration Configuration to apply
177
+ * @throws Microsoft_WindowsAzure_Diagnostics_Exception
178
+ */
179
+ public function setConfigurationForCurrentRoleInstance(Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance $configuration)
180
+ {
181
+ if (!isset($_SERVER['RdRoleId'])) {
182
+ throw new Microsoft_WindowsAzure_Diagnostics_Exception('Server variable \'RdRoleId\' is unknown. Please verify the application is running in Development Fabric or Windows Azure Fabric.');
183
+ }
184
+
185
+ $this->setConfigurationForRoleInstance($this->_getCurrentRoleInstanceId(), $configuration);
186
+ }
187
+
188
+ /**
189
+ * Get configuration for a specific role instance
190
+ *
191
+ * @param string $roleInstance Role instance name, can be found in $_SERVER['RdRoleId'] when hosted on Windows Azure.
192
+ * @return Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance
193
+ * @throws Microsoft_WindowsAzure_Diagnostics_Exception
194
+ */
195
+ public function getConfigurationForRoleInstance($roleInstance = null)
196
+ {
197
+ if (is_null($roleInstance)) {
198
+ throw new Microsoft_WindowsAzure_Diagnostics_Exception('Role instance should be specified. Try reading $_SERVER[\'RdRoleId\'] for this information if the application is hosted on Windows Azure Fabric or Development Fabric.');
199
+ }
200
+
201
+ if ($this->_blobStorageClient->blobExists($this->_controlContainer, $roleInstance)) {
202
+ $configurationInstance = new Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance();
203
+ $configurationInstance->loadXml( $this->_blobStorageClient->getBlobData($this->_controlContainer, $roleInstance) );
204
+ return $configurationInstance;
205
+ }
206
+
207
+ return new Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance();
208
+ }
209
+
210
+ /**
211
+ * Set configuration for a specific role instance
212
+ *
213
+ * @param string $roleInstance Role instance name, can be found in $_SERVER['RdRoleId'] when hosted on Windows Azure.
214
+ * @param Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance $configuration Configuration to apply
215
+ * @throws Microsoft_WindowsAzure_Diagnostics_Exception
216
+ */
217
+ public function setConfigurationForRoleInstance($roleInstance = null, Microsoft_WindowsAzure_Diagnostics_ConfigurationInstance $configuration)
218
+ {
219
+ if (is_null($roleInstance)) {
220
+ throw new Microsoft_WindowsAzure_Diagnostics_Exception('Role instance should be specified. Try reading $_SERVER[\'RdRoleId\'] for this information if the application is hosted on Windows Azure Fabric or Development Fabric.');
221
+ }
222
+
223
+ $this->_blobStorageClient->putBlobData($this->_controlContainer, $roleInstance, $configuration->toXml(), array(), null, array('Content-Type' => 'text/xml'));
224
+ }
225
  }
libs/Microsoft/WindowsAzure/Diagnostics/PerformanceCounterSubscription.php CHANGED
@@ -1,67 +1,67 @@
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
- * @subpackage Diagnostics
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Diagnostics
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property string CounterSpecifier Counter specifier
49
- * @property int SampleRateInSeconds Sample rate in seconds
50
- */
51
- class Microsoft_WindowsAzure_Diagnostics_PerformanceCounterSubscription
52
- extends Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
53
- {
54
- /**
55
- * Constructor
56
- *
57
- * @param string $counterSpecifier Counter specifier
58
- * @param int $sampleRateInSeconds Sample rate in seconds
59
- */
60
- public function __construct($counterSpecifier, $sampleRateInSeconds = 1)
61
- {
62
- $this->_data = array(
63
- 'counterspecifier' => $counterSpecifier,
64
- 'samplerateinseconds' => $sampleRateInSeconds
65
- );
66
- }
67
  }
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
+ * @subpackage Diagnostics
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Diagnostics
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property string CounterSpecifier Counter specifier
49
+ * @property int SampleRateInSeconds Sample rate in seconds
50
+ */
51
+ class Microsoft_WindowsAzure_Diagnostics_PerformanceCounterSubscription
52
+ extends Microsoft_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
53
+ {
54
+ /**
55
+ * Constructor
56
+ *
57
+ * @param string $counterSpecifier Counter specifier
58
+ * @param int $sampleRateInSeconds Sample rate in seconds
59
+ */
60
+ public function __construct($counterSpecifier, $sampleRateInSeconds = 1)
61
+ {
62
+ $this->_data = array(
63
+ 'counterspecifier' => $counterSpecifier,
64
+ 'samplerateinseconds' => $sampleRateInSeconds
65
+ );
66
+ }
67
  }
libs/Microsoft/WindowsAzure/Exception.php CHANGED
@@ -1,48 +1,48 @@
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
- * @subpackage Exception
31
- * @version $Id: Exception.php 61042 2011-04-19 10:03:39Z unknown $
32
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
- * @license http://phpazure.codeplex.com/license
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
- * @license http://phpazure.codeplex.com/license
46
- */
47
- class Microsoft_WindowsAzure_Exception extends Microsoft_Exception
48
- {}
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
+ * @subpackage Exception
31
+ * @version $Id: Exception.php 61042 2011-04-19 10:03:39Z unknown $
32
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
+ * @license http://phpazure.codeplex.com/license
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
45
+ * @license http://phpazure.codeplex.com/license
46
+ */
47
+ class Microsoft_WindowsAzure_Exception extends Microsoft_Exception
48
+ {}
libs/Microsoft/WindowsAzure/Management/AffinityGroupInstance.php CHANGED
@@ -1,79 +1,79 @@
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
- * @subpackage Management
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Management
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property string $Name The affinity group name.
49
- * @property string $Label A label for the affinity group.
50
- * @property string $Description A description for the affinity group.
51
- * @property string $Location The location of the affinity group.
52
- * @property array $HostedServices A list of hosted services in this affinity gtoup.
53
- * @property array $StorageServices A list of storage services in this affinity gtoup.
54
- */
55
- class Microsoft_WindowsAzure_Management_AffinityGroupInstance
56
- extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
57
- {
58
- /**
59
- * Constructor
60
- *
61
- * @property string $name The affinity group name.
62
- * @property string $label A label for the affinity group.
63
- * @property string $description A description for the affinity group.
64
- * @property string $location The location of the affinity group.
65
- * @property array $hostedServices A list of hosted services in this affinity gtoup.
66
- * @property array $storageServices A list of storage services in this affinity gtoup.
67
- */
68
- public function __construct($name, $label, $description, $location, $hostedServices = array(), $storageServices = array())
69
- {
70
- $this->_data = array(
71
- 'name' => $name,
72
- 'label' => base64_decode($label),
73
- 'description' => $description,
74
- 'location' => $location,
75
- 'hostedservices' => $hostedServices,
76
- 'storageservices' => $storageServices
77
- );
78
- }
79
- }
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
+ * @subpackage Management
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Management
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property string $Name The affinity group name.
49
+ * @property string $Label A label for the affinity group.
50
+ * @property string $Description A description for the affinity group.
51
+ * @property string $Location The location of the affinity group.
52
+ * @property array $HostedServices A list of hosted services in this affinity gtoup.
53
+ * @property array $StorageServices A list of storage services in this affinity gtoup.
54
+ */
55
+ class Microsoft_WindowsAzure_Management_AffinityGroupInstance
56
+ extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
57
+ {
58
+ /**
59
+ * Constructor
60
+ *
61
+ * @property string $name The affinity group name.
62
+ * @property string $label A label for the affinity group.
63
+ * @property string $description A description for the affinity group.
64
+ * @property string $location The location of the affinity group.
65
+ * @property array $hostedServices A list of hosted services in this affinity gtoup.
66
+ * @property array $storageServices A list of storage services in this affinity gtoup.
67
+ */
68
+ public function __construct($name, $label, $description, $location, $hostedServices = array(), $storageServices = array())
69
+ {
70
+ $this->_data = array(
71
+ 'name' => $name,
72
+ 'label' => base64_decode($label),
73
+ 'description' => $description,
74
+ 'location' => $location,
75
+ 'hostedservices' => $hostedServices,
76
+ 'storageservices' => $storageServices
77
+ );
78
+ }
79
+ }
libs/Microsoft/WindowsAzure/Management/CertificateInstance.php CHANGED
@@ -1,73 +1,73 @@
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
- * @subpackage Management
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Management
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property string $CertificateUrl Certificate thumbprint address.
49
- * @property string $Thumbprint Certificate thumbprint.
50
- * @property string $ThumbprintAlgorithm Certificate thumbprint algorithm.
51
- * @property string $Data Certificate data.
52
- */
53
- class Microsoft_WindowsAzure_Management_CertificateInstance
54
- extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
55
- {
56
- /**
57
- * Constructor
58
- *
59
- * @param string $certificateUrl Certificate thumbprint address.
60
- * @param string $thumbprint Certificate thumbprint.
61
- * @param string $thumbprintAlgorithm Certificate thumbprint algorithm.
62
- * @param string $data Certificate data.
63
- */
64
- public function __construct($certificateUrl, $thumbprint, $thumbprintAlgorithm, $data)
65
- {
66
- $this->_data = array(
67
- 'certificateurl' => $certificateUrl,
68
- 'thumbprint' => $thumbprint,
69
- 'thumbprintalgorithm' => $thumbprintAlgorithm,
70
- 'data' => base64_decode($data)
71
- );
72
- }
73
- }
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
+ * @subpackage Management
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Management
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property string $CertificateUrl Certificate thumbprint address.
49
+ * @property string $Thumbprint Certificate thumbprint.
50
+ * @property string $ThumbprintAlgorithm Certificate thumbprint algorithm.
51
+ * @property string $Data Certificate data.
52
+ */
53
+ class Microsoft_WindowsAzure_Management_CertificateInstance
54
+ extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
55
+ {
56
+ /**
57
+ * Constructor
58
+ *
59
+ * @param string $certificateUrl Certificate thumbprint address.
60
+ * @param string $thumbprint Certificate thumbprint.
61
+ * @param string $thumbprintAlgorithm Certificate thumbprint algorithm.
62
+ * @param string $data Certificate data.
63
+ */
64
+ public function __construct($certificateUrl, $thumbprint, $thumbprintAlgorithm, $data)
65
+ {
66
+ $this->_data = array(
67
+ 'certificateurl' => $certificateUrl,
68
+ 'thumbprint' => $thumbprint,
69
+ 'thumbprintalgorithm' => $thumbprintAlgorithm,
70
+ 'data' => base64_decode($data)
71
+ );
72
+ }
73
+ }
libs/Microsoft/WindowsAzure/Management/Client.php CHANGED
@@ -1,2400 +1,2400 @@
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
- * @subpackage Management
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 51671 2010-09-30 08:33:45Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Management
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- */
48
- class Microsoft_WindowsAzure_Management_Client
49
- {
50
- /**
51
- * Management service URL
52
- */
53
- const URL_MANAGEMENT = "https://management.core.windows.net";
54
-
55
- /**
56
- * Operations
57
- */
58
- const OP_OPERATIONS = "operations";
59
- const OP_STORAGE_ACCOUNTS = "services/storageservices";
60
- const OP_HOSTED_SERVICES = "services/hostedservices";
61
- const OP_AFFINITYGROUPS = "affinitygroups";
62
- const OP_LOCATIONS = "locations";
63
- const OP_OPERATINGSYSTEMS = "operatingsystems";
64
- const OP_OPERATINGSYSTEMFAMILIES = "operatingsystemfamilies";
65
-
66
- /**
67
- * Current API version
68
- *
69
- * @var string
70
- */
71
- protected $_apiVersion = '2011-06-01';
72
-
73
- /**
74
- * Subscription ID
75
- *
76
- * @var string
77
- */
78
- protected $_subscriptionId = '';
79
-
80
- /**
81
- * Management certificate path (.PEM)
82
- *
83
- * @var string
84
- */
85
- protected $_certificatePath = '';
86
-
87
- /**
88
- * Management certificate passphrase
89
- *
90
- * @var string
91
- */
92
- protected $_certificatePassphrase = '';
93
-
94
- /**
95
- * Microsoft_Http_Client channel used for communication with REST services
96
- *
97
- * @var Microsoft_Http_Client
98
- */
99
- protected $_httpClientChannel = null;
100
-
101
- /**
102
- * Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract instance
103
- *
104
- * @var Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract
105
- */
106
- protected $_retryPolicy = null;
107
-
108
- /**
109
- * Returns the last request ID
110
- *
111
- * @var string
112
- */
113
- protected $_lastRequestId = null;
114
-
115
- /**
116
- * Creates a new Microsoft_WindowsAzure_Management_Client instance
117
- *
118
- * @param string $subscriptionId Subscription ID
119
- * @param string $certificatePath Management certificate path (.PEM)
120
- * @param string $certificatePassphrase Management certificate passphrase
121
- * @param Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy Retry policy to use when making requests
122
- */
123
- public function __construct(
124
- $subscriptionId,
125
- $certificatePath,
126
- $certificatePassphrase,
127
- Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null
128
- ) {
129
- $this->_subscriptionId = $subscriptionId;
130
- $this->_certificatePath = $certificatePath;
131
- $this->_certificatePassphrase = $certificatePassphrase;
132
-
133
- $this->_retryPolicy = $retryPolicy;
134
- if (is_null($this->_retryPolicy)) {
135
- $this->_retryPolicy = Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract::noRetry();
136
- }
137
-
138
- // Setup default Microsoft_Http_Client channel
139
- $options = array(
140
- 'adapter' => 'Microsoft_Http_Client_Adapter_Socket',
141
- 'ssltransport' => 'ssl',
142
- 'sslcert' => $this->_certificatePath,
143
- 'sslpassphrase' => $this->_certificatePassphrase,
144
- 'sslusecontext' => true,
145
- );
146
- if (function_exists('curl_init')) {
147
- // Set cURL options if cURL is used afterwards
148
- $options['curloptions'] = array(
149
- CURLOPT_FOLLOWLOCATION => true,
150
- CURLOPT_TIMEOUT => 120,
151
- );
152
- }
153
- $this->_httpClientChannel = new Microsoft_Http_Client(null, $options);
154
- }
155
-
156
- /**
157
- * Set the HTTP client channel to use
158
- *
159
- * @param Microsoft_Http_Client_Adapter_Interface|string $adapterInstance Adapter instance or adapter class name.
160
- */
161
- public function setHttpClientChannel($adapterInstance = 'Microsoft_Http_Client_Adapter_Socket')
162
- {
163
- $this->_httpClientChannel->setAdapter($adapterInstance);
164
- }
165
-
166
- /**
167
- * Retrieve HTTP client channel
168
- *
169
- * @return Microsoft_Http_Client_Adapter_Interface
170
- */
171
- public function getHttpClientChannel()
172
- {
173
- return $this->_httpClientChannel;
174
- }
175
-
176
- /**
177
- * Returns the Windows Azure subscription ID
178
- *
179
- * @return string
180
- */
181
- public function getSubscriptionId()
182
- {
183
- return $this->_subscriptionId;
184
- }
185
-
186
- /**
187
- * Returns the last request ID.
188
- *
189
- * @return string
190
- */
191
- public function getLastRequestId()
192
- {
193
- return $this->_lastRequestId;
194
- }
195
-
196
- /**
197
- * Get base URL for creating requests
198
- *
199
- * @return string
200
- */
201
- public function getBaseUrl()
202
- {
203
- return self::URL_MANAGEMENT . '/' . $this->_subscriptionId;
204
- }
205
-
206
- /**
207
- * Perform request using Microsoft_Http_Client channel
208
- *
209
- * @param string $path Path
210
- * @param array $query Query arguments
211
- * @param string $httpVerb HTTP verb the request will use
212
- * @param array $headers x-ms headers to add
213
- * @param mixed $rawData Optional RAW HTTP data to be sent over the wire
214
- * @return Microsoft_Http_Response
215
- */
216
- protected function _performRequest(
217
- $path = '/',
218
- $query = array(),
219
- $httpVerb = Microsoft_Http_Client::GET,
220
- $headers = array(),
221
- $rawData = null
222
- ) {
223
- // Clean path
224
- if (strpos($path, '/') !== 0) {
225
- $path = '/' . $path;
226
- }
227
-
228
- // Clean headers
229
- if (is_null($headers)) {
230
- $headers = array();
231
- }
232
-
233
- // Ensure cUrl will also work correctly:
234
- // - disable Content-Type if required
235
- // - disable Expect: 100 Continue
236
- if (!isset($headers["Content-Type"])) {
237
- $headers["Content-Type"] = '';
238
- }
239
- //$headers["Expect"] = '';
240
-
241
- // Add version header
242
- $headers['x-ms-version'] = $this->_apiVersion;
243
-
244
- // Generate URL and sign request
245
- $requestUrl = $this->getBaseUrl() . rawurlencode($path);
246
- $requestHeaders = $headers;
247
- if (count($query) > 0) {
248
- $queryString = '';
249
- foreach ($query as $key => $value) {
250
- $queryString .= ($queryString ? '&' : '?') . rawurlencode($key) . '=' . rawurlencode($value);
251
- }
252
- $requestUrl .= $queryString;
253
- }
254
-
255
- // Prepare request
256
- $this->_httpClientChannel->resetParameters(true);
257
- $this->_httpClientChannel->setUri($requestUrl);
258
- $this->_httpClientChannel->setHeaders($requestHeaders);
259
- $this->_httpClientChannel->setRawData($rawData);
260
-
261
- // Execute request
262
- $response = $this->_retryPolicy->execute(
263
- array($this->_httpClientChannel, 'request'),
264
- array($httpVerb)
265
- );
266
-
267
- // Store request id
268
- $this->_lastRequestId = $response->getHeader('x-ms-request-id');
269
-
270
- return $response;
271
- }
272
-
273
- /**
274
- * Parse result from Microsoft_Http_Response
275
- *
276
- * @param Microsoft_Http_Response $response Response from HTTP call
277
- * @return object
278
- * @throws Microsoft_WindowsAzure_Exception
279
- */
280
- protected function _parseResponse(Microsoft_Http_Response $response = null)
281
- {
282
- if (is_null($response)) {
283
- throw new Microsoft_WindowsAzure_Exception('Response should not be null.');
284
- }
285
-
286
- $xml = @simplexml_load_string($response->getBody());
287
-
288
- if ($xml !== false) {
289
- // Fetch all namespaces
290
- $namespaces = array_merge($xml->getNamespaces(true), $xml->getDocNamespaces(true));
291
-
292
- // Register all namespace prefixes
293
- foreach ($namespaces as $prefix => $ns) {
294
- if ($prefix != '') {
295
- $xml->registerXPathNamespace($prefix, $ns);
296
- }
297
- }
298
- }
299
-
300
- return $xml;
301
- }
302
-
303
- /**
304
- * Get error message from Microsoft_Http_Response
305
- *
306
- * @param Microsoft_Http_Response $response Repsonse
307
- * @param string $alternativeError Alternative error message
308
- * @return string
309
- */
310
- protected function _getErrorMessage(Microsoft_Http_Response $response, $alternativeError = 'Unknown error.')
311
- {
312
- $response = $this->_parseResponse($response);
313
- if ($response && $response->Message) {
314
- return (string)$response->Message;
315
- } else {
316
- return $alternativeError;
317
- }
318
- }
319
-
320
- /**
321
- * The Get Operation Status operation returns the status of the specified operation.
322
- * After calling an asynchronous operation, you can call Get Operation Status to
323
- * determine whether the operation has succeed, failed, or is still in progress.
324
- *
325
- * @param string $requestId The request ID. If omitted, the last request ID will be used.
326
- * @return Microsoft_WindowsAzure_Management_OperationStatusInstance
327
- * @throws Microsoft_WindowsAzure_Management_Exception
328
- */
329
- public function getOperationStatus($requestId = '')
330
- {
331
- if ($requestId == '') {
332
- $requestId = $this->getLastRequestId();
333
- }
334
-
335
- $response = $this->_performRequest(self::OP_OPERATIONS . '/' . $requestId);
336
-
337
- if ($response->isSuccessful()) {
338
- $result = $this->_parseResponse($response);
339
-
340
- if (!is_null($result)) {
341
- return new Microsoft_WindowsAzure_Management_OperationStatusInstance(
342
- (string)$result->ID,
343
- (string)$result->Status,
344
- ($result->Error ? (string)$result->Error->Code : ''),
345
- ($result->Error ? (string)$result->Error->Message : '')
346
- );
347
- }
348
- return null;
349
- } else {
350
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
351
- }
352
- }
353
-
354
-
355
-
356
- /**
357
- * The List Subscription Operations operation returns a list of create, update,
358
- * and delete operations that were performed on a subscription during the specified timeframe.
359
- * Documentation on the parameters can be found at http://msdn.microsoft.com/en-us/library/gg715318.aspx.
360
- *
361
- * @param string $startTime The start of the timeframe to begin listing subscription operations in UTC format. This parameter and the $endTime parameter indicate the timeframe to retrieve subscription operations. This parameter cannot indicate a start date of more than 90 days in the past.
362
- * @param string $endTime The end of the timeframe to begin listing subscription operations in UTC format. This parameter and the $startTime parameter indicate the timeframe to retrieve subscription operations.
363
- * @param string $objectIdFilter Returns subscription operations only for the specified object type and object ID.
364
- * @param string $operationResultFilter Returns subscription operations only for the specified result status, either Succeeded, Failed, or InProgress.
365
- * @param string $continuationToken Internal usage.
366
- * @return array Array of Microsoft_WindowsAzure_Management_SubscriptionOperationInstance
367
- * @throws Microsoft_WindowsAzure_Management_Exception
368
- */
369
- public function listSubscriptionOperations($startTime, $endTime, $objectIdFilter = null, $operationResultFilter = null, $continuationToken = null)
370
- {
371
- if ($startTime == '' || is_null($startTime)) {
372
- throw new Microsoft_WindowsAzure_Management_Exception('Start time should be specified.');
373
- }
374
- if ($endTime == '' || is_null($endTime)) {
375
- throw new Microsoft_WindowsAzure_Management_Exception('End time should be specified.');
376
- }
377
- if ($operationResultFilter != '' && !is_null($operationResultFilter)) {
378
- $operationResultFilter = strtolower($operationResultFilter);
379
- if ($operationResultFilter != 'succeeded' && $operationResultFilter != 'failed' && $operationResultFilter != 'inprogress') {
380
- throw new Microsoft_WindowsAzure_Management_Exception('OperationResultFilter should be succeeded|failed|inprogress.');
381
- }
382
- }
383
-
384
- $parameters = array();
385
- $parameters['StartTime'] = $startTime;
386
- $parameters['EndTime'] = $endTime;
387
- if ($objectIdFilter != '' && !is_null($objectIdFilter)) {
388
- $parameters['ObjectIdFilter'] = $objectIdFilter;
389
- }
390
- if ($operationResultFilter != '' && !is_null($operationResultFilter)) {
391
- $parameters['OperationResultFilter'] = ucfirst($operationResultFilter);
392
- }
393
- if ($continuationToken != '' && !is_null($continuationToken)) {
394
- $parameters['ContinuationToken'] = $continuationToken;
395
- }
396
-
397
- $response = $this->_performRequest(self::OP_OPERATIONS, $parameters);
398
-
399
- if ($response->isSuccessful()) {
400
- $result = $this->_parseResponse($response);
401
- $namespaces = $result->getDocNamespaces();
402
- $result->registerXPathNamespace('__empty_ns', $namespaces['']);
403
-
404
- $xmlOperations = $result->xpath('//__empty_ns:SubscriptionOperation');
405
-
406
- // Create return value
407
- $returnValue = array();
408
- foreach ($xmlOperations as $xmlOperation) {
409
- // Create operation instance
410
- $operation = new Microsoft_WindowsAzure_Management_SubscriptionOperationInstance(
411
- $xmlOperation->OperationId,
412
- $xmlOperation->OperationObjectId,
413
- $xmlOperation->OperationName,
414
- array(),
415
- (array)$xmlOperation->OperationCaller,
416
- (array)$xmlOperation->OperationStatus,
417
- (string)$xmlOperation->OperationStartedTime,
418
- (string)$xmlOperation->OperationCompletedTime
419
- );
420
-
421
- // Parse parameters
422
- $xmlOperation->registerXPathNamespace('__empty_ns', $namespaces['']);
423
- $xmlParameters = $xmlOperation->xpath('.//__empty_ns:OperationParameter');
424
- foreach ($xmlParameters as $xmlParameter) {
425
- $xmlParameterDetails = $xmlParameter->children('http://schemas.datacontract.org/2004/07/Microsoft.Samples.WindowsAzure.ServiceManagement');
426
- $operation->addOperationParameter((string)$xmlParameterDetails->Name, (string)$xmlParameterDetails->Value);
427
- }
428
-
429
- // Add to result
430
- $returnValue[] = $operation;
431
- }
432
-
433
- // More data?
434
- if (!is_null($result->ContinuationToken) && $result->ContinuationToken != '') {
435
- $returnValue = array_merge($returnValue, $this->listSubscriptionOperations($startTime, $endTime, $objectIdFilter, $operationResultFilter, (string)$result->ContinuationToken));
436
- }
437
-
438
- // Return
439
- return $returnValue;
440
- } else {
441
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
442
- }
443
- }
444
-
445
- /**
446
- * Wait for an operation to complete
447
- *
448
- * @param string $requestId The request ID. If omitted, the last request ID will be used.
449
- * @param int $sleepInterval Sleep interval in milliseconds.
450
- * @return Microsoft_WindowsAzure_Management_OperationStatusInstance
451
- * @throws Microsoft_WindowsAzure_Management_Exception
452
- */
453
- public function waitForOperation($requestId = '', $sleepInterval = 250)
454
- {
455
- if ($requestId == '') {
456
- $requestId = $this->getLastRequestId();
457
- }
458
- if ($requestId == '' || is_null($requestId)) {
459
- return null;
460
- }
461
-
462
- $status = $this->getOperationStatus($requestId);
463
- while ($status->Status == 'InProgress') {
464
- $status = $this->getOperationStatus($requestId);
465
- usleep($sleepInterval);
466
- }
467
-
468
- return $status;
469
- }
470
-
471
- /**
472
- * Creates a new Microsoft_WindowsAzure_Storage_Blob instance for the current account
473
- *
474
- * @param string $serviceName the service name to create a storage client for.
475
- * @param Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy Retry policy to use when making requests
476
- * @return Microsoft_WindowsAzure_Storage_Blob
477
- */
478
- public function createBlobClientForService($serviceName, Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null)
479
- {
480
- if ($serviceName == '' || is_null($serviceName)) {
481
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
482
- }
483
-
484
- $storageKeys = $this->getStorageAccountKeys($serviceName);
485
-
486
- return new Microsoft_WindowsAzure_Storage_Blob(
487
- Microsoft_WindowsAzure_Storage::URL_CLOUD_BLOB,
488
- $serviceName,
489
- $storageKeys[0],
490
- false,
491
- $retryPolicy
492
- );
493
- }
494
-
495
- /**
496
- * Creates a new Microsoft_WindowsAzure_Storage_Table instance for the current account
497
- *
498
- * @param string $serviceName the service name to create a storage client for.
499
- * @param Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy Retry policy to use when making requests
500
- * @return Microsoft_WindowsAzure_Storage_Table
501
- */
502
- public function createTableClientForService($serviceName, Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null)
503
- {
504
- if ($serviceName == '' || is_null($serviceName)) {
505
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
506
- }
507
-
508
- $storageKeys = $this->getStorageAccountKeys($serviceName);
509
-
510
- return new Microsoft_WindowsAzure_Storage_Table(
511
- Microsoft_WindowsAzure_Storage::URL_CLOUD_TABLE,
512
- $serviceName,
513
- $storageKeys[0],
514
- false,
515
- $retryPolicy
516
- );
517
- }
518
-
519
- /**
520
- * Creates a new Microsoft_WindowsAzure_Storage_Queue instance for the current account
521
- *
522
- * @param string $serviceName the service name to create a storage client for.
523
- * @param Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy Retry policy to use when making requests
524
- * @return Microsoft_WindowsAzure_Storage_Queue
525
- */
526
- public function createQueueClientForService($serviceName, Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null)
527
- {
528
- if ($serviceName == '' || is_null($serviceName)) {
529
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
530
- }
531
-
532
- $storageKeys = $this->getStorageAccountKeys($serviceName);
533
-
534
- return new Microsoft_WindowsAzure_Storage_Queue(
535
- Microsoft_WindowsAzure_Storage::URL_CLOUD_QUEUE,
536
- $serviceName,
537
- $storageKeys[0],
538
- false,
539
- $retryPolicy
540
- );
541
- }
542
-
543
- /**
544
- * The List Storage Accounts operation lists the storage accounts available under
545
- * the current subscription.
546
- *
547
- * @return array An array of Microsoft_WindowsAzure_Management_StorageServiceInstance
548
- */
549
- public function listStorageAccounts()
550
- {
551
- $response = $this->_performRequest(self::OP_STORAGE_ACCOUNTS);
552
-
553
- if ($response->isSuccessful()) {
554
- $result = $this->_parseResponse($response);
555
-
556
- if (!$result->StorageService) {
557
- return array();
558
- }
559
- if (count($result->StorageService) > 1) {
560
- $xmlServices = $result->StorageService;
561
- } else {
562
- $xmlServices = array($result->StorageService);
563
- }
564
-
565
- $services = array();
566
- if (!is_null($xmlServices)) {
567
- for ($i = 0; $i < count($xmlServices); $i++) {
568
- $services[] = new Microsoft_WindowsAzure_Management_StorageServiceInstance(
569
- (string)$xmlServices[$i]->Url,
570
- (string)$xmlServices[$i]->ServiceName
571
- );
572
- }
573
- }
574
- return $services;
575
- } else {
576
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
577
- }
578
- }
579
-
580
- /**
581
- * The Get Storage Account Properties operation returns the system properties for the
582
- * specified storage account. These properties include: the address, description, and
583
- * label of the storage account; and the name of the affinity group to which the service
584
- * belongs, or its geo-location if it is not part of an affinity group.
585
- *
586
- * @param string $serviceName The name of your service.
587
- * @return Microsoft_WindowsAzure_Management_StorageServiceInstance
588
- * @throws Microsoft_WindowsAzure_Management_Exception
589
- */
590
- public function getStorageAccountProperties($serviceName)
591
- {
592
- if ($serviceName == '' || is_null($serviceName)) {
593
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
594
- }
595
-
596
- $response = $this->_performRequest(self::OP_STORAGE_ACCOUNTS . '/' . $serviceName);
597
-
598
- if ($response->isSuccessful()) {
599
- $xmlService = $this->_parseResponse($response);
600
-
601
- if (!is_null($xmlService)) {
602
- return new Microsoft_WindowsAzure_Management_StorageServiceInstance(
603
- (string)$xmlService->Url,
604
- (string)$xmlService->ServiceName,
605
- (string)$xmlService->StorageServiceProperties->Description,
606
- (string)$xmlService->StorageServiceProperties->AffinityGroup,
607
- (string)$xmlService->StorageServiceProperties->Location,
608
- (string)$xmlService->StorageServiceProperties->Label
609
- );
610
- }
611
- return null;
612
- } else {
613
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
614
- }
615
- }
616
-
617
- /**
618
- * The Get Storage Keys operation returns the primary
619
- * and secondary access keys for the specified storage account.
620
- *
621
- * @param string $serviceName The name of your service.
622
- * @return array An array of strings
623
- * @throws Microsoft_WindowsAzure_Management_Exception
624
- */
625
- public function getStorageAccountKeys($serviceName)
626
- {
627
- if ($serviceName == '' || is_null($serviceName)) {
628
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
629
- }
630
-
631
- $response = $this->_performRequest(self::OP_STORAGE_ACCOUNTS . '/' . $serviceName . '/keys');
632
-
633
- if ($response->isSuccessful()) {
634
- $xmlService = $this->_parseResponse($response);
635
-
636
- if (!is_null($xmlService)) {
637
- return array(
638
- (string)$xmlService->StorageServiceKeys->Primary,
639
- (string)$xmlService->StorageServiceKeys->Secondary
640
- );
641
- }
642
- return array();
643
- } else {
644
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
645
- }
646
- }
647
-
648
- /**
649
- * The Regenerate Keys operation regenerates the primary
650
- * or secondary access key for the specified storage account.
651
- *
652
- * @param string $serviceName The name of your service.
653
- * @param string $key The key to regenerate (primary or secondary)
654
- * @return array An array of strings
655
- * @throws Microsoft_WindowsAzure_Management_Exception
656
- */
657
- public function regenerateStorageAccountKey($serviceName, $key = 'primary')
658
- {
659
- if ($serviceName == '' || is_null($serviceName)) {
660
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
661
- }
662
- $key = strtolower($key);
663
- if ($key != 'primary' && $key != 'secondary') {
664
- throw new Microsoft_WindowsAzure_Management_Exception('Key identifier should be primary|secondary.');
665
- }
666
-
667
- $response = $this->_performRequest(
668
- self::OP_STORAGE_ACCOUNTS . '/' . $serviceName . '/keys', array('action' => 'regenerate'),
669
- Microsoft_Http_Client::POST,
670
- array('Content-Type' => 'application/xml'),
671
- '<?xml version="1.0" encoding="utf-8"?>
672
- <RegenerateKeys xmlns="http://schemas.microsoft.com/windowsazure">
673
- <KeyType>' . ucfirst($key) . '</KeyType>
674
- </RegenerateKeys>');
675
-
676
- if ($response->isSuccessful()) {
677
- $xmlService = $this->_parseResponse($response);
678
-
679
- if (!is_null($xmlService)) {
680
- return array(
681
- (string)$xmlService->StorageServiceKeys->Primary,
682
- (string)$xmlService->StorageServiceKeys->Secondary
683
- );
684
- }
685
- return array();
686
- } else {
687
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
688
- }
689
- }
690
-
691
- /**
692
- * The Create Storage Account operation creates a new storage account in Windows Azure.
693
- *
694
- * @param string $serviceName Required. A name for the storage account that is unique to the subscription.
695
- * @param string $label Required. A label for the storage account that is Base64-encoded. The label may be up to 100 characters in length.
696
- * @param string $description Optional. A description for the storage account. The description may be up to 1024 characters in length.
697
- * @param string $location Required if AffinityGroup is not specified. The location where the storage account is created.
698
- * @param string $affinityGroup Required if Location is not specified. The name of an existing affinity group in the specified subscription.
699
- * @return Microsoft_WindowsAzure_Management_StorageServiceInstance
700
- * @throws Microsoft_WindowsAzure_Management_Exception
701
- */
702
- public function createStorageAccount($serviceName, $label, $description, $location = null, $affinityGroup = null)
703
- {
704
- if ($serviceName == '' || is_null($serviceName)) {
705
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
706
- }
707
- if ($label == '' || is_null($label)) {
708
- throw new Microsoft_WindowsAzure_Management_Exception('Label should be specified.');
709
- }
710
- if (strlen($label) > 100) {
711
- throw new Microsoft_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');
712
- }
713
- if ($description == '' || is_null($description)) {
714
- throw new Microsoft_WindowsAzure_Management_Exception('Descritpion should be specified.');
715
- }
716
- if (strlen($description) > 1024) {
717
- throw new Microsoft_WindowsAzure_Management_Exception('Description is too long. The maximum length is 1024 characters.');
718
- }
719
- if ( (is_null($location) && is_null($affinityGroup)) || (!is_null($location) && !is_null($affinityGroup)) ) {
720
- throw new Microsoft_WindowsAzure_Management_Exception('Please specify a location -or- an affinity group for the service.');
721
- }
722
-
723
- $locationOrAffinityGroup = is_null($location)
724
- ? '<AffinityGroup>' . $affinityGroup . '</AffinityGroup>'
725
- : '<Location>' . $location . '</Location>';
726
-
727
- $response = $this->_performRequest(self::OP_STORAGE_ACCOUNTS, array(),
728
- Microsoft_Http_Client::POST,
729
- array('Content-Type' => 'application/xml; charset=utf-8'),
730
- '<CreateStorageServiceInput xmlns="http://schemas.microsoft.com/windowsazure"><ServiceName>' . $serviceName . '</ServiceName><Description>' . $serviceName . '</Description><Label>' . base64_encode($label) . '</Label>' . $locationOrAffinityGroup . '</CreateStorageServiceInput>');
731
-
732
- if ($response->isSuccessful()) {
733
- return new Microsoft_WindowsAzure_Management_StorageServiceInstance(
734
- 'https://management.core.windows.net/' . $this->getSubscriptionId() . '/services/storageservices/' . $serviceName,
735
- $serviceName,
736
- $description,
737
- $affinityGroup,
738
- $location,
739
- base64_encode($label)
740
- );
741
- } else {
742
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
743
- }
744
- }
745
-
746
- /**
747
- * The Update Storage Account operation updates the label and/or the description for a storage account in Windows Azure.
748
- *
749
- * @param string $serviceName Required. The name of the storage account to update.
750
- * @param string $label Required. A label for the storage account that is Base64-encoded. The label may be up to 100 characters in length.
751
- * @param string $description Optional. A description for the storage account. The description may be up to 1024 characters in length.
752
- * @throws Microsoft_WindowsAzure_Management_Exception
753
- */
754
- public function updateStorageAccount($serviceName, $label, $description)
755
- {
756
- if ($serviceName == '' || is_null($serviceName)) {
757
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
758
- }
759
- if ($label == '' || is_null($label)) {
760
- throw new Microsoft_WindowsAzure_Management_Exception('Label should be specified.');
761
- }
762
- if (strlen($label) > 100) {
763
- throw new Microsoft_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');
764
- }
765
- if ($description == '' || is_null($description)) {
766
- throw new Microsoft_WindowsAzure_Management_Exception('Descritpion should be specified.');
767
- }
768
- if (strlen($description) > 1024) {
769
- throw new Microsoft_WindowsAzure_Management_Exception('Description is too long. The maximum length is 1024 characters.');
770
- }
771
-
772
- $response = $this->_performRequest(self::OP_STORAGE_ACCOUNTS . '/' . $serviceName, array(),
773
- Microsoft_Http_Client::PUT,
774
- array('Content-Type' => 'application/xml; charset=utf-8'),
775
- '<UpdateStorageServiceInput xmlns="http://schemas.microsoft.com/windowsazure"><Description>' . $description . '</Description><Label>' . base64_encode($label) . '</Label></UpdateStorageServiceInput>');
776
-
777
- if (!$response->isSuccessful()) {
778
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
779
- }
780
- }
781
-
782
- /**
783
- * The Delete Storage Account operation deletes the specified storage account from Windows Azure.
784
- *
785
- * @param string $serviceName Required. The name of the storage account to delete.
786
- * @throws Microsoft_WindowsAzure_Management_Exception
787
- */
788
- public function deleteStorageAccount($serviceName)
789
- {
790
- if ($serviceName == '' || is_null($serviceName)) {
791
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
792
- }
793
-
794
- $response = $this->_performRequest(self::OP_STORAGE_ACCOUNTS . '/' . $serviceName, array(), Microsoft_Http_Client::DELETE);
795
-
796
- if (!$response->isSuccessful()) {
797
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
798
- }
799
- }
800
-
801
- /**
802
- * The List Hosted Services operation lists the hosted services available
803
- * under the current subscription.
804
- *
805
- * @return array An array of Microsoft_WindowsAzure_Management_HostedServiceInstance
806
- * @throws Microsoft_WindowsAzure_Management_Exception
807
- */
808
- public function listHostedServices()
809
- {
810
- $response = $this->_performRequest(self::OP_HOSTED_SERVICES);
811
-
812
- if ($response->isSuccessful()) {
813
- $result = $this->_parseResponse($response);
814
-
815
- if (!$result->HostedService) {
816
- return array();
817
- }
818
- if (count($result->HostedService) > 1) {
819
- $xmlServices = $result->HostedService;
820
- } else {
821
- $xmlServices = array($result->HostedService);
822
- }
823
-
824
- $services = array();
825
- if (!is_null($xmlServices)) {
826
- for ($i = 0; $i < count($xmlServices); $i++) {
827
- $services[] = new Microsoft_WindowsAzure_Management_HostedServiceInstance(
828
- (string)$xmlServices[$i]->Url,
829
- (string)$xmlServices[$i]->ServiceName
830
- );
831
- }
832
- }
833
- return $services;
834
- } else {
835
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
836
- }
837
- }
838
-
839
- /**
840
- * The Create Hosted Service operation creates a new hosted service in Windows Azure.
841
- *
842
- * @param string $serviceName A name for the hosted service that is unique to the subscription. This is the DNS name used for production deployments.
843
- * @param string $label A label for the hosted service. The label may be up to 100 characters in length.
844
- * @param string $description A description for the hosted service. The description may be up to 1024 characters in length.
845
- * @param string $location Required if AffinityGroup is not specified. The location where the hosted service will be created.
846
- * @param string $affinityGroup Required if Location is not specified. The name of an existing affinity group associated with this subscription.
847
- */
848
- public function createHostedService($serviceName, $label, $description = '', $location = null, $affinityGroup = null)
849
- {
850
- if ($serviceName == '' || is_null($serviceName)) {
851
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
852
- }
853
- if ($label == '' || is_null($label)) {
854
- throw new Microsoft_WindowsAzure_Management_Exception('Label should be specified.');
855
- }
856
- if (strlen($label) > 100) {
857
- throw new Microsoft_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');
858
- }
859
- if (strlen($description) > 1024) {
860
- throw new Microsoft_WindowsAzure_Management_Exception('Description is too long. The maximum length is 1024 characters.');
861
- }
862
- if ( (is_null($location) && is_null($affinityGroup)) || (!is_null($location) && !is_null($affinityGroup)) ) {
863
- throw new Microsoft_WindowsAzure_Management_Exception('Please specify a location -or- an affinity group for the service.');
864
- }
865
-
866
- $locationOrAffinityGroup = is_null($location)
867
- ? '<AffinityGroup>' . $affinityGroup . '</AffinityGroup>'
868
- : '<Location>' . $location . '</Location>';
869
-
870
- $response = $this->_performRequest(self::OP_HOSTED_SERVICES, array(),
871
- Microsoft_Http_Client::POST,
872
- array('Content-Type' => 'application/xml; charset=utf-8'),
873
- '<CreateHostedService xmlns="http://schemas.microsoft.com/windowsazure"><ServiceName>' . $serviceName . '</ServiceName><Label>' . base64_encode($label) . '</Label><Description>' . $description . '</Description>' . $locationOrAffinityGroup . '</CreateHostedService>');
874
-
875
- if (!$response->isSuccessful()) {
876
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
877
- }
878
- }
879
-
880
- /**
881
- * The Update Hosted Service operation updates the label and/or the description for a hosted service in Windows Azure.
882
- *
883
- * @param string $serviceName A name for the hosted service that is unique to the subscription. This is the DNS name used for production deployments.
884
- * @param string $label A label for the hosted service. The label may be up to 100 characters in length.
885
- * @param string $description A description for the hosted service. The description may be up to 1024 characters in length.
886
- */
887
- public function updateHostedService($serviceName, $label, $description = '')
888
- {
889
- if ($serviceName == '' || is_null($serviceName)) {
890
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
891
- }
892
- if ($label == '' || is_null($label)) {
893
- throw new Microsoft_WindowsAzure_Management_Exception('Label should be specified.');
894
- }
895
- if (strlen($label) > 100) {
896
- throw new Microsoft_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');
897
- }
898
-
899
- $response = $this->_performRequest(self::OP_HOSTED_SERVICES . '/' . $serviceName, array(),
900
- Microsoft_Http_Client::PUT,
901
- array('Content-Type' => 'application/xml; charset=utf-8'),
902
- '<UpdateHostedService xmlns="http://schemas.microsoft.com/windowsazure"><Label>' . base64_encode($label) . '</Label><Description>' . $description . '</Description></UpdateHostedService>');
903
-
904
- if (!$response->isSuccessful()) {
905
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
906
- }
907
- }
908
-
909
- /**
910
- * The Delete Hosted Service operation deletes the specified hosted service in Windows Azure.
911
- *
912
- * @param string $serviceName A name for the hosted service that is unique to the subscription. This is the DNS name used for production deployments.
913
- */
914
- public function deleteHostedService($serviceName)
915
- {
916
- if ($serviceName == '' || is_null($serviceName)) {
917
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
918
- }
919
-
920
- $response = $this->_performRequest(self::OP_HOSTED_SERVICES . '/' . $serviceName, array(), Microsoft_Http_Client::DELETE);
921
-
922
- if (!$response->isSuccessful()) {
923
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
924
- }
925
- }
926
-
927
- /**
928
- * The Get Hosted Service Properties operation retrieves system properties
929
- * for the specified hosted service. These properties include the service
930
- * name and service type; the name of the affinity group to which the service
931
- * belongs, or its location if it is not part of an affinity group; and
932
- * optionally, information on the service's deployments.
933
- *
934
- * @param string $serviceName The name of your service. This is the DNS name used for production deployments.
935
- * @return Microsoft_WindowsAzure_Management_HostedServiceInstance
936
- * @throws Microsoft_WindowsAzure_Management_Exception
937
- */
938
- public function getHostedServiceProperties($serviceName)
939
- {
940
- if ($serviceName == '' || is_null($serviceName)) {
941
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
942
- }
943
-
944
- $response = $this->_performRequest(self::OP_HOSTED_SERVICES . '/' . $serviceName, array('embed-detail' => 'true'));
945
-
946
- if ($response->isSuccessful()) {
947
- $xmlService = $this->_parseResponse($response);
948
-
949
- if (!is_null($xmlService)) {
950
- $returnValue = new Microsoft_WindowsAzure_Management_HostedServiceInstance(
951
- (string)$xmlService->Url,
952
- (string)$xmlService->ServiceName,
953
- (string)$xmlService->HostedServiceProperties->Description,
954
- (string)$xmlService->HostedServiceProperties->AffinityGroup,
955
- (string)$xmlService->HostedServiceProperties->Location,
956
- (string)$xmlService->HostedServiceProperties->Label
957
- );
958
-
959
- // Deployments
960
- if (count($xmlService->Deployments->Deployment) > 1) {
961
- $xmlServices = $xmlService->Deployments->Deployment;
962
- } else {
963
- $xmlServices = array($xmlService->Deployments->Deployment);
964
- }
965
-
966
- $deployments = array();
967
- foreach ($xmlServices as $xmlDeployment) {
968
- $deployments[] = $this->_convertXmlElementToDeploymentInstance($xmlDeployment);
969
- }
970
- $returnValue->Deployments = $deployments;
971
-
972
- return $returnValue;
973
- }
974
- return null;
975
- } else {
976
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
977
- }
978
- }
979
-
980
- /**
981
- * The Create Deployment operation uploads a new service package
982
- * and creates a new deployment on staging or production.
983
- *
984
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
985
- * @param string $deploymentSlot The deployment slot (production or staging)
986
- * @param string $name The name for the deployment. The deployment ID as listed on the Windows Azure management portal must be unique among other deployments for the hosted service.
987
- * @param string $label A URL that refers to the location of the service package in the Blob service. The service package must be located in a storage account beneath the same subscription.
988
- * @param string $packageUrl The service configuration file for the deployment.
989
- * @param string $configuration A label for this deployment, up to 100 characters in length.
990
- * @param boolean $startDeployment Indicates whether to start the deployment immediately after it is created.
991
- * @param boolean $treatWarningsAsErrors Indicates whether to treat package validation warnings as errors.
992
- * @throws Microsoft_WindowsAzure_Management_Exception
993
- */
994
- public function createDeployment($serviceName, $deploymentSlot, $name, $label, $packageUrl, $configuration, $startDeployment = false, $treatWarningsAsErrors = false)
995
- {
996
- if ($serviceName == '' || is_null($serviceName)) {
997
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
998
- }
999
- $deploymentSlot = strtolower($deploymentSlot);
1000
- if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1001
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1002
- }
1003
- if ($name == '' || is_null($name)) {
1004
- throw new Microsoft_WindowsAzure_Management_Exception('Name should be specified.');
1005
- }
1006
- if ($label == '' || is_null($label)) {
1007
- throw new Microsoft_WindowsAzure_Management_Exception('Label should be specified.');
1008
- }
1009
- if (strlen($label) > 100) {
1010
- throw new Microsoft_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');
1011
- }
1012
- if ($packageUrl == '' || is_null($packageUrl)) {
1013
- throw new Microsoft_WindowsAzure_Management_Exception('Package URL should be specified.');
1014
- }
1015
- if ($configuration == '' || is_null($configuration)) {
1016
- throw new Microsoft_WindowsAzure_Management_Exception('Configuration should be specified.');
1017
- }
1018
-
1019
- if (@file_exists($configuration)) {
1020
- $configuration = utf8_decode(file_get_contents($configuration));
1021
- }
1022
-
1023
- // Clean up the configuration
1024
- $conformingConfiguration = $this->_cleanConfiguration($configuration);
1025
-
1026
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot;
1027
- $response = $this->_performRequest($operationUrl, array(),
1028
- Microsoft_Http_Client::POST,
1029
- array('Content-Type' => 'application/xml; charset=utf-8'),
1030
- '<CreateDeployment xmlns="http://schemas.microsoft.com/windowsazure"><Name>' . $name . '</Name><PackageUrl>' . $packageUrl . '</PackageUrl><Label>' . base64_encode($label) . '</Label><Configuration>' . base64_encode($conformingConfiguration) . '</Configuration><StartDeployment>' . ($startDeployment ? 'true' : 'false') . '</StartDeployment><TreatWarningsAsError>' . ($treatWarningsAsErrors ? 'true' : 'false') . '</TreatWarningsAsError></CreateDeployment>');
1031
-
1032
- if (!$response->isSuccessful()) {
1033
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1034
- }
1035
- }
1036
-
1037
- /**
1038
- * The Get Deployment operation returns configuration information, status,
1039
- * and system properties for the specified deployment.
1040
- *
1041
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1042
- * @param string $deploymentSlot The deployment slot (production or staging)
1043
- * @return Microsoft_WindowsAzure_Management_DeploymentInstance
1044
- * @throws Microsoft_WindowsAzure_Management_Exception
1045
- */
1046
- public function getDeploymentBySlot($serviceName, $deploymentSlot)
1047
- {
1048
- if ($serviceName == '' || is_null($serviceName)) {
1049
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1050
- }
1051
- $deploymentSlot = strtolower($deploymentSlot);
1052
- if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1053
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1054
- }
1055
-
1056
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot;
1057
- return $this->_getDeployment($operationUrl);
1058
- }
1059
-
1060
- /**
1061
- * The Get Deployment operation returns configuration information, status,
1062
- * and system properties for the specified deployment.
1063
- *
1064
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1065
- * @param string $deploymentId The deployment ID as listed on the Windows Azure management portal
1066
- * @return Microsoft_WindowsAzure_Management_DeploymentInstance
1067
- * @throws Microsoft_WindowsAzure_Management_Exception
1068
- */
1069
- public function getDeploymentByDeploymentId($serviceName, $deploymentId)
1070
- {
1071
- if ($serviceName == '' || is_null($serviceName)) {
1072
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1073
- }
1074
- if ($deploymentId == '' || is_null($deploymentId)) {
1075
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1076
- }
1077
-
1078
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deployments/' . $deploymentId;
1079
- return $this->_getDeployment($operationUrl);
1080
- }
1081
-
1082
- /**
1083
- * The Get Role Instances by Deployment Slot operation returns an array of arrays containing role instance information
1084
- * for each role instance associated with the deployment specified by slot (staging or production).
1085
- *
1086
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1087
- * @param string $deploymentSlot The deployment slot (production or staging)
1088
- * @return Array
1089
- * @throws Microsoft_WindowsAzure_Management_Exception
1090
- */
1091
- public function getRoleInstancesByDeploymentSlot($serviceName, $deploymentSlot)
1092
- {
1093
- if ($serviceName == '' || is_null($serviceName)) {
1094
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1095
- }
1096
- $deploymentSlot = strtolower($deploymentSlot);
1097
- if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1098
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1099
- }
1100
-
1101
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot;
1102
- $deployment = $this->_getDeployment($operationUrl);
1103
- return $deployment->roleInstanceList;
1104
- }
1105
-
1106
- /**
1107
- * The Get Role Instances by Deployment Slot operation returns an array of arrays containing role instance information
1108
- * for each role instance associated with the deployment specified by Id.
1109
- *
1110
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1111
- * @param string $deploymentId The deployment ID as listed on the Windows Azure management portal
1112
- * @return Array
1113
- * @throws Microsoft_WindowsAzure_Management_Exception
1114
- */
1115
- public function getRoleInstancesByDeploymentId($serviceName, $deploymentId)
1116
- {
1117
- if ($serviceName == '' || is_null($serviceName)) {
1118
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1119
- }
1120
- if ($deploymentId == '' || is_null($deploymentId)) {
1121
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1122
- }
1123
-
1124
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deployments/' . $deploymentId;
1125
- $deployment = $this->_getDeployment($operationUrl);
1126
- return $deployment->roleInstanceList;
1127
- }
1128
-
1129
- /**
1130
- * The Get Deployment operation returns configuration information, status,
1131
- * and system properties for the specified deployment.
1132
- *
1133
- * @param string $operationUrl The operation url
1134
- * @return Microsoft_WindowsAzure_Management_DeploymentInstance
1135
- * @throws Microsoft_WindowsAzure_Management_Exception
1136
- */
1137
- protected function _getDeployment($operationUrl)
1138
- {
1139
- $response = $this->_performRequest($operationUrl);
1140
-
1141
- if ($response->isSuccessful()) {
1142
- $xmlService = $this->_parseResponse($response);
1143
-
1144
- return $this->_convertXmlElementToDeploymentInstance($xmlService);
1145
- } else {
1146
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1147
- }
1148
- }
1149
-
1150
- /**
1151
- * The Swap Deployment operation initiates a virtual IP swap between
1152
- * the staging and production deployment environments for a service.
1153
- * If the service is currently running in the staging environment,
1154
- * it will be swapped to the production environment. If it is running
1155
- * in the production environment, it will be swapped to staging.
1156
- *
1157
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1158
- * @param string $productionDeploymentName The name of the production deployment.
1159
- * @param string $sourceDeploymentName The name of the source deployment.
1160
- * @throws Microsoft_WindowsAzure_Management_Exception
1161
- */
1162
- public function swapDeployment($serviceName, $productionDeploymentName, $sourceDeploymentName)
1163
- {
1164
- if ($serviceName == '' || is_null($serviceName)) {
1165
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1166
- }
1167
- if ($productionDeploymentName == '' || is_null($productionDeploymentName)) {
1168
- throw new Microsoft_WindowsAzure_Management_Exception('Production Deployment ID should be specified.');
1169
- }
1170
- if ($sourceDeploymentName == '' || is_null($sourceDeploymentName)) {
1171
- throw new Microsoft_WindowsAzure_Management_Exception('Source Deployment ID should be specified.');
1172
- }
1173
-
1174
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName;
1175
- $response = $this->_performRequest($operationUrl, array(),
1176
- Microsoft_Http_Client::POST,
1177
- array('Content-Type' => 'application/xml; charset=utf-8'),
1178
- '<Swap xmlns="http://schemas.microsoft.com/windowsazure"><Production>' . $productionDeploymentName . '</Production><SourceDeployment>' . $sourceDeploymentName . '</SourceDeployment></Swap>');
1179
-
1180
- if (!$response->isSuccessful()) {
1181
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1182
- }
1183
- }
1184
-
1185
- /**
1186
- * The Delete Deployment operation deletes the specified deployment.
1187
- *
1188
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1189
- * @param string $deploymentSlot The deployment slot (production or staging)
1190
- * @throws Microsoft_WindowsAzure_Management_Exception
1191
- */
1192
- public function deleteDeploymentBySlot($serviceName, $deploymentSlot)
1193
- {
1194
- if ($serviceName == '' || is_null($serviceName)) {
1195
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1196
- }
1197
- $deploymentSlot = strtolower($deploymentSlot);
1198
- if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1199
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1200
- }
1201
-
1202
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot;
1203
- return $this->_deleteDeployment($operationUrl);
1204
- }
1205
-
1206
- /**
1207
- * The Delete Deployment operation deletes the specified deployment.
1208
- *
1209
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1210
- * @param string $deploymentId The deployment ID as listed on the Windows Azure management portal
1211
- * @throws Microsoft_WindowsAzure_Management_Exception
1212
- */
1213
- public function deleteDeploymentByDeploymentId($serviceName, $deploymentId)
1214
- {
1215
- if ($serviceName == '' || is_null($serviceName)) {
1216
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1217
- }
1218
- if ($deploymentId == '' || is_null($deploymentId)) {
1219
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1220
- }
1221
-
1222
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deployments/' . $deploymentId;
1223
- return $this->_deleteDeployment($operationUrl);
1224
- }
1225
-
1226
- /**
1227
- * The Delete Deployment operation deletes the specified deployment.
1228
- *
1229
- * @param string $operationUrl The operation url
1230
- * @throws Microsoft_WindowsAzure_Management_Exception
1231
- */
1232
- protected function _deleteDeployment($operationUrl)
1233
- {
1234
- $response = $this->_performRequest($operationUrl, array(), Microsoft_Http_Client::DELETE);
1235
-
1236
- if (!$response->isSuccessful()) {
1237
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1238
- }
1239
- }
1240
-
1241
- /**
1242
- * The Update Deployment Status operation initiates a change in deployment status.
1243
- *
1244
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1245
- * @param string $deploymentSlot The deployment slot (production or staging)
1246
- * @param string $status The deployment status (running|suspended)
1247
- * @throws Microsoft_WindowsAzure_Management_Exception
1248
- */
1249
- public function updateDeploymentStatusBySlot($serviceName, $deploymentSlot, $status = 'running')
1250
- {
1251
- if ($serviceName == '' || is_null($serviceName)) {
1252
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1253
- }
1254
- $deploymentSlot = strtolower($deploymentSlot);
1255
- if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1256
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1257
- }
1258
- $status = strtolower($status);
1259
- if ($status != 'running' && $status != 'suspended') {
1260
- throw new Microsoft_WindowsAzure_Management_Exception('Status should be running|suspended.');
1261
- }
1262
-
1263
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot;
1264
- return $this->_updateDeploymentStatus($operationUrl, $status);
1265
- }
1266
-
1267
- /**
1268
- * The Update Deployment Status operation initiates a change in deployment status.
1269
- *
1270
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1271
- * @param string $deploymentId The deployment ID as listed on the Windows Azure management portal
1272
- * @param string $status The deployment status (running|suspended)
1273
- * @throws Microsoft_WindowsAzure_Management_Exception
1274
- */
1275
- public function updateDeploymentStatusByDeploymentId($serviceName, $deploymentId, $status = 'running')
1276
- {
1277
- if ($serviceName == '' || is_null($serviceName)) {
1278
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1279
- }
1280
- if ($deploymentId == '' || is_null($deploymentId)) {
1281
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1282
- }
1283
- $status = strtolower($status);
1284
- if ($status != 'running' && $status != 'suspended') {
1285
- throw new Microsoft_WindowsAzure_Management_Exception('Status should be running|suspended.');
1286
- }
1287
-
1288
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deployments/' . $deploymentId;
1289
- return $this->_updateDeploymentStatus($operationUrl, $status);
1290
- }
1291
-
1292
- /**
1293
- * The Update Deployment Status operation initiates a change in deployment status.
1294
- *
1295
- * @param string $operationUrl The operation url
1296
- * @param string $status The deployment status (running|suspended)
1297
- * @throws Microsoft_WindowsAzure_Management_Exception
1298
- */
1299
- protected function _updateDeploymentStatus($operationUrl, $status = 'running')
1300
- {
1301
- $response = $this->_performRequest($operationUrl . '/', array('comp' => 'status'),
1302
- Microsoft_Http_Client::POST,
1303
- array('Content-Type' => 'application/xml; charset=utf-8'),
1304
- '<UpdateDeploymentStatus xmlns="http://schemas.microsoft.com/windowsazure"><Status>' . ucfirst($status) . '</Status></UpdateDeploymentStatus>');
1305
-
1306
- if (!$response->isSuccessful()) {
1307
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1308
- }
1309
- }
1310
-
1311
- /**
1312
- * Converts an XmlElement into a Microsoft_WindowsAzure_Management_DeploymentInstance
1313
- *
1314
- * @param object $xmlService The XML Element
1315
- * @return Microsoft_WindowsAzure_Management_DeploymentInstance
1316
- * @throws Microsoft_WindowsAzure_Management_Exception
1317
- */
1318
- protected function _convertXmlElementToDeploymentInstance($xmlService)
1319
- {
1320
- if (!is_null($xmlService)) {
1321
- $returnValue = new Microsoft_WindowsAzure_Management_DeploymentInstance(
1322
- (string)$xmlService->Name,
1323
- (string)$xmlService->DeploymentSlot,
1324
- (string)$xmlService->PrivateID,
1325
- (string)$xmlService->Label,
1326
- (string)$xmlService->Url,
1327
- (string)$xmlService->Configuration,
1328
- (string)$xmlService->Status,
1329
- (string)$xmlService->UpgradeStatus,
1330
- (string)$xmlService->UpgradeType,
1331
- (string)$xmlService->CurrentUpgradeDomainState,
1332
- (string)$xmlService->CurrentUpgradeDomain,
1333
- (string)$xmlService->UpgradeDomainCount,
1334
- (string)$xmlService->SdkVersion
1335
- );
1336
-
1337
- // Append role instances
1338
- if ($xmlService->RoleInstanceList && $xmlService->RoleInstanceList->RoleInstance) {
1339
- $xmlRoleInstances = $xmlService->RoleInstanceList->RoleInstance;
1340
- if (count($xmlService->RoleInstanceList->RoleInstance) == 1) {
1341
- $xmlRoleInstances = array($xmlService->RoleInstanceList->RoleInstance);
1342
- }
1343
-
1344
- $roleInstances = array();
1345
- if (!is_null($xmlRoleInstances)) {
1346
- for ($i = 0; $i < count($xmlRoleInstances); $i++) {
1347
- $roleInstances[] = array(
1348
- 'rolename' => (string)$xmlRoleInstances[$i]->RoleName,
1349
- 'instancename' => (string)$xmlRoleInstances[$i]->InstanceName,
1350
- 'instancestatus' => (string)$xmlRoleInstances[$i]->InstanceStatus,
1351
- 'instanceupgradedomain' => (string)$xmlRoleInstances[$i]->InstanceUpgradeDomain,
1352
- 'instancefaultdomain' => (string)$xmlRoleInstances[$i]->InstanceFaultDomain,
1353
- 'instancesize' => (string)$xmlRoleInstances[$i]->InstanceSize
1354
- );
1355
- }
1356
- }
1357
-
1358
- $returnValue->RoleInstanceList = $roleInstances;
1359
- }
1360
-
1361
- // Append roles
1362
- if ($xmlService->RoleList && $xmlService->RoleList->Role) {
1363
- $xmlRoles = $xmlService->RoleList->Role;
1364
- if (count($xmlService->RoleList->Role) == 1) {
1365
- $xmlRoles = array($xmlService->RoleList->Role);
1366
- }
1367
-
1368
- $roles = array();
1369
- if (!is_null($xmlRoles)) {
1370
- for ($i = 0; $i < count($xmlRoles); $i++) {
1371
- $roles[] = array(
1372
- 'rolename' => (string)$xmlRoles[$i]->RoleName,
1373
- 'osversion' => (!is_null($xmlRoles[$i]->OsVersion) ? (string)$xmlRoles[$i]->OsVersion : (string)$xmlRoles[$i]->OperatingSystemVersion)
1374
- );
1375
- }
1376
- }
1377
- $returnValue->RoleList = $roles;
1378
- }
1379
-
1380
- // Append InputEndpointList
1381
- if ($xmlService->InputEndpointList && $xmlService->InputEndpointList->InputEndpoint) {
1382
- $xmlInputEndpoints = $xmlService->InputEndpointList->InputEndpoint;
1383
- if (count($xmlService->InputEndpointList->InputEndpoint) == 1) {
1384
- $xmlInputEndpoints = array($xmlService->InputEndpointList->InputEndpoint);
1385
- }
1386
-
1387
- $inputEndpoints = array();
1388
- if (!is_null($xmlInputEndpoints)) {
1389
- for ($i = 0; $i < count($xmlInputEndpoints); $i++) {
1390
- $inputEndpoints[] = array(
1391
- 'rolename' => (string)$xmlInputEndpoints[$i]->RoleName,
1392
- 'vip' => (string)$xmlInputEndpoints[$i]->Vip,
1393
- 'port' => (string)$xmlInputEndpoints[$i]->Port
1394
- );
1395
- }
1396
- }
1397
-
1398
- $returnValue->InputEndpoints = $inputEndpoints;
1399
- }
1400
-
1401
- return $returnValue;
1402
- }
1403
- return null;
1404
- }
1405
-
1406
- /**
1407
- * Updates a deployment's role instance count.
1408
- *
1409
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1410
- * @param string $deploymentSlot The deployment slot (production or staging)
1411
- * @param string|array $roleName The role name
1412
- * @param string|array $instanceCount The instance count
1413
- * @throws Microsoft_WindowsAzure_Management_Exception
1414
- */
1415
- public function setInstanceCountBySlot($serviceName, $deploymentSlot, $roleName, $instanceCount) {
1416
- if ($serviceName == '' || is_null($serviceName)) {
1417
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1418
- }
1419
- $deploymentSlot = strtolower($deploymentSlot);
1420
- if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1421
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1422
- }
1423
- if ($roleName == '' || is_null($roleName)) {
1424
- throw new Microsoft_WindowsAzure_Management_Exception('Role name name should be specified.');
1425
- }
1426
-
1427
- // Get configuration
1428
- $deployment = $this->getDeploymentBySlot($serviceName, $deploymentSlot);
1429
- $configuration = $deployment->Configuration;
1430
- $configuration = $this->_updateInstanceCountInConfiguration($roleName, $instanceCount, $configuration);
1431
-
1432
- // Update configuration
1433
- $this->configureDeploymentBySlot($serviceName, $deploymentSlot, $configuration);
1434
- }
1435
-
1436
- /**
1437
- * Updates a deployment's role instance count.
1438
- *
1439
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1440
- * @param string $deploymentSlot The deployment slot (production or staging)
1441
- * @param string|array $roleName The role name
1442
- * @param string|array $instanceCount The instance count
1443
- * @throws Microsoft_WindowsAzure_Management_Exception
1444
- */
1445
- public function setInstanceCountByDeploymentId($serviceName, $deploymentId, $roleName, $instanceCount)
1446
- {
1447
- if ($serviceName == '' || is_null($serviceName)) {
1448
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1449
- }
1450
- if ($deploymentId == '' || is_null($deploymentId)) {
1451
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1452
- }
1453
- if ($roleName == '' || is_null($roleName)) {
1454
- throw new Microsoft_WindowsAzure_Management_Exception('Role name name should be specified.');
1455
- }
1456
-
1457
- // Get configuration
1458
- $deployment = $this->getDeploymentByDeploymentId($serviceName, $deploymentId);
1459
- $configuration = $deployment->Configuration;
1460
- $configuration = $this->_updateInstanceCountInConfiguration($roleName, $instanceCount, $configuration);
1461
-
1462
- // Update configuration
1463
- $this->configureDeploymentByDeploymentId($serviceName, $deploymentId, $configuration);
1464
- }
1465
-
1466
- /**
1467
- * Updates instance count in configuration XML.
1468
- *
1469
- * @param string|array $roleName The role name
1470
- * @param string|array $instanceCount The instance count
1471
- * @param string $configuration XML configuration represented as a string
1472
- * @throws Microsoft_WindowsAzure_Management_Exception
1473
- */
1474
- protected function _updateInstanceCountInConfiguration($roleName, $instanceCount, $configuration) {
1475
- // Change variables
1476
- if (!is_array($roleName)) {
1477
- $roleName = array($roleName);
1478
- }
1479
- if (!is_array($instanceCount)) {
1480
- $instanceCount = array($instanceCount);
1481
- }
1482
-
1483
- $configuration = preg_replace('/(<\?xml[^?]+?)utf-16/i', '$1utf-8', $configuration);
1484
- //$configuration = '<?xml version="1.0">' . substr($configuration, strpos($configuration, '>') + 2);
1485
-
1486
- $xml = simplexml_load_string($configuration);
1487
-
1488
- // http://www.php.net/manual/en/simplexmlelement.xpath.php#97818
1489
- $namespaces = $xml->getDocNamespaces();
1490
- $xml->registerXPathNamespace('__empty_ns', $namespaces['']);
1491
-
1492
- for ($i = 0; $i < count($roleName); $i++) {
1493
- $elements = $xml->xpath('//__empty_ns:Role[@name="' . $roleName[$i] . '"]/__empty_ns:Instances');
1494
-
1495
- if (count($elements) == 1) {
1496
- $element = $elements[0];
1497
- $element['count'] = $instanceCount[$i];
1498
- }
1499
- }
1500
-
1501
- $configuration = $xml->asXML();
1502
- //$configuration = preg_replace('/(<\?xml[^?]+?)utf-8/i', '$1utf-16', $configuration);
1503
-
1504
- return $configuration;
1505
- }
1506
-
1507
- /**
1508
- * The Change Deployment Configuration request may be specified as follows.
1509
- * Note that you can change a deployment's configuration either by specifying the deployment
1510
- * environment (staging or production), or by specifying the deployment's unique name.
1511
- *
1512
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1513
- * @param string $deploymentSlot The deployment slot (production or staging)
1514
- * @param string $configuration XML configuration represented as a string
1515
- * @throws Microsoft_WindowsAzure_Management_Exception
1516
- */
1517
- public function configureDeploymentBySlot($serviceName, $deploymentSlot, $configuration)
1518
- {
1519
- if ($serviceName == '' || is_null($serviceName)) {
1520
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1521
- }
1522
- $deploymentSlot = strtolower($deploymentSlot);
1523
- if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1524
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1525
- }
1526
- if ($configuration == '' || is_null($configuration)) {
1527
- throw new Microsoft_WindowsAzure_Management_Exception('Configuration name should be specified.');
1528
- }
1529
-
1530
- if (@file_exists($configuration)) {
1531
- $configuration = utf8_decode(file_get_contents($configuration));
1532
- }
1533
-
1534
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot;
1535
- return $this->_configureDeployment($operationUrl, $configuration);
1536
- }
1537
-
1538
- /**
1539
- * The Change Deployment Configuration request may be specified as follows.
1540
- * Note that you can change a deployment's configuration either by specifying the deployment
1541
- * environment (staging or production), or by specifying the deployment's unique name.
1542
- *
1543
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1544
- * @param string $deploymentId The deployment ID as listed on the Windows Azure management portal
1545
- * @param string $configuration XML configuration represented as a string
1546
- * @throws Microsoft_WindowsAzure_Management_Exception
1547
- */
1548
- public function configureDeploymentByDeploymentId($serviceName, $deploymentId, $configuration)
1549
- {
1550
- if ($serviceName == '' || is_null($serviceName)) {
1551
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1552
- }
1553
- if ($deploymentId == '' || is_null($deploymentId)) {
1554
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1555
- }
1556
- if ($configuration == '' || is_null($configuration)) {
1557
- throw new Microsoft_WindowsAzure_Management_Exception('Configuration name should be specified.');
1558
- }
1559
-
1560
- if (@file_exists($configuration)) {
1561
- $configuration = utf8_decode(file_get_contents($configuration));
1562
- }
1563
-
1564
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deployments/' . $deploymentId;
1565
- return $this->_configureDeployment($operationUrl, $configuration);
1566
- }
1567
-
1568
- /**
1569
- * The Change Deployment Configuration request may be specified as follows.
1570
- * Note that you can change a deployment's configuration either by specifying the deployment
1571
- * environment (staging or production), or by specifying the deployment's unique name.
1572
- *
1573
- * @param string $operationUrl The operation url
1574
- * @param string $configuration XML configuration represented as a string
1575
- * @throws Microsoft_WindowsAzure_Management_Exception
1576
- */
1577
- protected function _configureDeployment($operationUrl, $configuration)
1578
- {
1579
- // Clean up the configuration
1580
- $conformingConfiguration = $this->_cleanConfiguration($configuration);
1581
-
1582
- $response = $this->_performRequest($operationUrl . '/', array('comp' => 'config'),
1583
- Microsoft_Http_Client::POST,
1584
- array('Content-Type' => 'application/xml; charset=utf-8'),
1585
- '<ChangeConfiguration xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Configuration>' . base64_encode($conformingConfiguration) . '</Configuration></ChangeConfiguration>');
1586
-
1587
- if (!$response->isSuccessful()) {
1588
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1589
- }
1590
- }
1591
-
1592
- /**
1593
- * The Upgrade Deployment operation initiates an upgrade.
1594
- *
1595
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1596
- * @param string $deploymentSlot The deployment slot (production or staging)
1597
- * @param string $label A URL that refers to the location of the service package in the Blob service. The service package must be located in a storage account beneath the same subscription.
1598
- * @param string $packageUrl The service configuration file for the deployment.
1599
- * @param string $configuration A label for this deployment, up to 100 characters in length.
1600
- * @param string $mode The type of upgrade to initiate. Possible values are Auto or Manual.
1601
- * @param string $roleToUpgrade The name of the specific role to upgrade.
1602
- * @throws Microsoft_WindowsAzure_Management_Exception
1603
- */
1604
- public function upgradeDeploymentBySlot($serviceName, $deploymentSlot, $label, $packageUrl, $configuration, $mode = 'auto', $roleToUpgrade = null)
1605
- {
1606
- if ($serviceName == '' || is_null($serviceName)) {
1607
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1608
- }
1609
- $deploymentSlot = strtolower($deploymentSlot);
1610
- if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1611
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1612
- }
1613
- if ($label == '' || is_null($label)) {
1614
- throw new Microsoft_WindowsAzure_Management_Exception('Label should be specified.');
1615
- }
1616
- if (strlen($label) > 100) {
1617
- throw new Microsoft_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');
1618
- }
1619
- if ($packageUrl == '' || is_null($packageUrl)) {
1620
- throw new Microsoft_WindowsAzure_Management_Exception('Package URL should be specified.');
1621
- }
1622
- if ($configuration == '' || is_null($configuration)) {
1623
- throw new Microsoft_WindowsAzure_Management_Exception('Configuration should be specified.');
1624
- }
1625
- $mode = strtolower($mode);
1626
- if ($mode != 'auto' && $mode != 'manual') {
1627
- throw new Microsoft_WindowsAzure_Management_Exception('Mode should be auto|manual.');
1628
- }
1629
-
1630
- if (@file_exists($configuration)) {
1631
- $configuration = utf8_decode(file_get_contents($configuration));
1632
- }
1633
-
1634
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot;
1635
- return $this->_upgradeDeployment($operationUrl, $label, $packageUrl, $configuration, $mode, $roleToUpgrade);
1636
- }
1637
-
1638
- /**
1639
- * The Upgrade Deployment operation initiates an upgrade.
1640
- *
1641
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1642
- * @param string $deploymentId The deployment ID as listed on the Windows Azure management portal
1643
- * @param string $label A URL that refers to the location of the service package in the Blob service. The service package must be located in a storage account beneath the same subscription.
1644
- * @param string $packageUrl The service configuration file for the deployment.
1645
- * @param string $configuration A label for this deployment, up to 100 characters in length.
1646
- * @param string $mode The type of upgrade to initiate. Possible values are Auto or Manual.
1647
- * @param string $roleToUpgrade The name of the specific role to upgrade.
1648
- * @throws Microsoft_WindowsAzure_Management_Exception
1649
- */
1650
- public function upgradeDeploymentByDeploymentId($serviceName, $deploymentId, $label, $packageUrl, $configuration, $mode = 'auto', $roleToUpgrade = null)
1651
- {
1652
- if ($serviceName == '' || is_null($serviceName)) {
1653
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1654
- }
1655
- if ($deploymentId == '' || is_null($deploymentId)) {
1656
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1657
- }
1658
- if ($label == '' || is_null($label)) {
1659
- throw new Microsoft_WindowsAzure_Management_Exception('Label should be specified.');
1660
- }
1661
- if (strlen($label) > 100) {
1662
- throw new Microsoft_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');
1663
- }
1664
- if ($packageUrl == '' || is_null($packageUrl)) {
1665
- throw new Microsoft_WindowsAzure_Management_Exception('Package URL should be specified.');
1666
- }
1667
- if ($configuration == '' || is_null($configuration)) {
1668
- throw new Microsoft_WindowsAzure_Management_Exception('Configuration should be specified.');
1669
- }
1670
- $mode = strtolower($mode);
1671
- if ($mode != 'auto' && $mode != 'manual') {
1672
- throw new Microsoft_WindowsAzure_Management_Exception('Mode should be auto|manual.');
1673
- }
1674
-
1675
- if (@file_exists($configuration)) {
1676
- $configuration = utf8_decode(file_get_contents($configuration));
1677
- }
1678
-
1679
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deployments/' . $deploymentId;
1680
- return $this->_upgradeDeployment($operationUrl, $label, $packageUrl, $configuration, $mode, $roleToUpgrade);
1681
- }
1682
-
1683
-
1684
- /**
1685
- * The Upgrade Deployment operation initiates an upgrade.
1686
- *
1687
- * @param string $operationUrl The operation url
1688
- * @param string $label A URL that refers to the location of the service package in the Blob service. The service package must be located in a storage account beneath the same subscription.
1689
- * @param string $packageUrl The service configuration file for the deployment.
1690
- * @param string $configuration A label for this deployment, up to 100 characters in length.
1691
- * @param string $mode The type of upgrade to initiate. Possible values are Auto or Manual.
1692
- * @param string $roleToUpgrade The name of the specific role to upgrade.
1693
- * @throws Microsoft_WindowsAzure_Management_Exception
1694
- */
1695
- protected function _upgradeDeployment($operationUrl, $label, $packageUrl, $configuration, $mode, $roleToUpgrade)
1696
- {
1697
- // Clean up the configuration
1698
- $conformingConfiguration = $this->_cleanConfiguration($configuration);
1699
-
1700
- $response = $this->_performRequest($operationUrl . '/', array('comp' => 'upgrade'),
1701
- Microsoft_Http_Client::POST,
1702
- array('Content-Type' => 'application/xml; charset=utf-8'),
1703
- '<UpgradeDeployment xmlns="http://schemas.microsoft.com/windowsazure"><Mode>' . ucfirst($mode) . '</Mode><PackageUrl>' . $packageUrl . '</PackageUrl><Configuration>' . base64_encode($conformingConfiguration) . '</Configuration><Label>' . base64_encode($label) . '</Label>' . (!is_null($roleToUpgrade) ? '<RoleToUpgrade>' . $roleToUpgrade . '</RoleToUpgrade>' : '') . '</UpgradeDeployment>');
1704
-
1705
- if (!$response->isSuccessful()) {
1706
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1707
- }
1708
- }
1709
-
1710
- /**
1711
- * The Walk Upgrade Domain operation specifies the next upgrade domain to be walked during an in-place upgrade.
1712
- *
1713
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1714
- * @param string $deploymentSlot The deployment slot (production or staging)
1715
- * @param int $upgradeDomain An integer value that identifies the upgrade domain to walk. Upgrade domains are identified with a zero-based index: the first upgrade domain has an ID of 0, the second has an ID of 1, and so on.
1716
- * @throws Microsoft_WindowsAzure_Management_Exception
1717
- */
1718
- public function walkUpgradeDomainBySlot($serviceName, $deploymentSlot, $upgradeDomain = 0)
1719
- {
1720
- if ($serviceName == '' || is_null($serviceName)) {
1721
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1722
- }
1723
- $deploymentSlot = strtolower($deploymentSlot);
1724
- if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1725
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1726
- }
1727
-
1728
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot;
1729
- return $this->_walkUpgradeDomain($operationUrl, $upgradeDomain);
1730
- }
1731
-
1732
- /**
1733
- * The Walk Upgrade Domain operation specifies the next upgrade domain to be walked during an in-place upgrade.
1734
- *
1735
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1736
- * @param string $deploymentId The deployment ID as listed on the Windows Azure management portal
1737
- * @param int $upgradeDomain An integer value that identifies the upgrade domain to walk. Upgrade domains are identified with a zero-based index: the first upgrade domain has an ID of 0, the second has an ID of 1, and so on.
1738
- * @throws Microsoft_WindowsAzure_Management_Exception
1739
- */
1740
- public function walkUpgradeDomainByDeploymentId($serviceName, $deploymentId, $upgradeDomain = 0)
1741
- {
1742
- if ($serviceName == '' || is_null($serviceName)) {
1743
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1744
- }
1745
- if ($deploymentId == '' || is_null($deploymentId)) {
1746
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1747
- }
1748
-
1749
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deployments/' . $deploymentId;
1750
- return $this->_walkUpgradeDomain($operationUrl, $upgradeDomain);
1751
- }
1752
-
1753
-
1754
- /**
1755
- * The Walk Upgrade Domain operation specifies the next upgrade domain to be walked during an in-place upgrade.
1756
- *
1757
- * @param string $operationUrl The operation url
1758
- * @param int $upgradeDomain An integer value that identifies the upgrade domain to walk. Upgrade domains are identified with a zero-based index: the first upgrade domain has an ID of 0, the second has an ID of 1, and so on.
1759
- * @throws Microsoft_WindowsAzure_Management_Exception
1760
- */
1761
- protected function _walkUpgradeDomain($operationUrl, $upgradeDomain = 0)
1762
- {
1763
- $response = $this->_performRequest($operationUrl . '/', array('comp' => 'walkupgradedomain'),
1764
- Microsoft_Http_Client::POST,
1765
- array('Content-Type' => 'application/xml; charset=utf-8'),
1766
- '<WalkUpgradeDomain xmlns="http://schemas.microsoft.com/windowsazure"><UpgradeDomain>' . $upgradeDomain . '</UpgradeDomain></WalkUpgradeDomain>');
1767
-
1768
- if (!$response->isSuccessful()) {
1769
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1770
- }
1771
- }
1772
-
1773
- /**
1774
- * The Reboot Role Instance operation requests a reboot of a role instance
1775
- * that is running in a deployment.
1776
- *
1777
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1778
- * @param string $deploymentSlot The deployment slot (production or staging)
1779
- * @param string $roleInstanceName The role instance name
1780
- * @throws Microsoft_WindowsAzure_Management_Exception
1781
- */
1782
- public function rebootRoleInstanceBySlot($serviceName, $deploymentSlot, $roleInstanceName)
1783
- {
1784
- if ($serviceName == '' || is_null($serviceName)) {
1785
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1786
- }
1787
- $deploymentSlot = strtolower($deploymentSlot);
1788
- if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1789
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1790
- }
1791
- if ($roleInstanceName == '' || is_null($roleInstanceName)) {
1792
- throw new Microsoft_WindowsAzure_Management_Exception('Role instance name should be specified.');
1793
- }
1794
-
1795
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot . '/roleinstances/' . $roleInstanceName;
1796
- return $this->_rebootOrReimageRoleInstance($operationUrl, 'reboot');
1797
- }
1798
-
1799
- /**
1800
- * The Reboot Role Instance operation requests a reboot of a role instance
1801
- * that is running in a deployment.
1802
- *
1803
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1804
- * @param string $deploymentId The deployment ID as listed on the Windows Azure management portal
1805
- * @param string $roleInstanceName The role instance name
1806
- * @throws Microsoft_WindowsAzure_Management_Exception
1807
- */
1808
- public function rebootRoleInstanceByDeploymentId($serviceName, $deploymentId, $roleInstanceName)
1809
- {
1810
- if ($serviceName == '' || is_null($serviceName)) {
1811
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1812
- }
1813
- if ($deploymentId == '' || is_null($deploymentId)) {
1814
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1815
- }
1816
- if ($roleInstanceName == '' || is_null($roleInstanceName)) {
1817
- throw new Microsoft_WindowsAzure_Management_Exception('Role instance name should be specified.');
1818
- }
1819
-
1820
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deployments/' . $deploymentId . '/roleinstances/' . $roleInstanceName;
1821
- return $this->_rebootOrReimageRoleInstance($operationUrl, 'reboot');
1822
- }
1823
-
1824
- /**
1825
- * The Reimage Role Instance operation requests a reimage of a role instance
1826
- * that is running in a deployment.
1827
- *
1828
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1829
- * @param string $deploymentSlot The deployment slot (production or staging)
1830
- * @param string $roleInstanceName The role instance name
1831
- * @throws Microsoft_WindowsAzure_Management_Exception
1832
- */
1833
- public function reimageRoleInstanceBySlot($serviceName, $deploymentSlot, $roleInstanceName)
1834
- {
1835
- if ($serviceName == '' || is_null($serviceName)) {
1836
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1837
- }
1838
- $deploymentSlot = strtolower($deploymentSlot);
1839
- if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1840
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1841
- }
1842
- if ($roleInstanceName == '' || is_null($roleInstanceName)) {
1843
- throw new Microsoft_WindowsAzure_Management_Exception('Role instance name should be specified.');
1844
- }
1845
-
1846
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot . '/roleinstances/' . $roleInstanceName;
1847
- return $this->_rebootOrReimageRoleInstance($operationUrl, 'reimage');
1848
- }
1849
-
1850
- /**
1851
- * The Reimage Role Instance operation requests a reimage of a role instance
1852
- * that is running in a deployment.
1853
- *
1854
- * @param string $serviceName The service name. This is the DNS name used for production deployments.
1855
- * @param string $deploymentId The deployment ID as listed on the Windows Azure management portal
1856
- * @param string $roleInstanceName The role instance name
1857
- * @throws Microsoft_WindowsAzure_Management_Exception
1858
- */
1859
- public function reimageRoleInstanceByDeploymentId($serviceName, $deploymentId, $roleInstanceName)
1860
- {
1861
- if ($serviceName == '' || is_null($serviceName)) {
1862
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1863
- }
1864
- if ($deploymentId == '' || is_null($deploymentId)) {
1865
- throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1866
- }
1867
- if ($roleInstanceName == '' || is_null($roleInstanceName)) {
1868
- throw new Microsoft_WindowsAzure_Management_Exception('Role instance name should be specified.');
1869
- }
1870
-
1871
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deployments/' . $deploymentId . '/roleinstances/' . $roleInstanceName;
1872
- return $this->_rebootOrReimageRoleInstance($operationUrl, 'reimage');
1873
- }
1874
-
1875
- /**
1876
- * Reboots or reimages a role instance.
1877
- *
1878
- * @param string $operationUrl The operation url
1879
- * @param string $operation The operation (reboot|reimage)
1880
- * @throws Microsoft_WindowsAzure_Management_Exception
1881
- */
1882
- protected function _rebootOrReimageRoleInstance($operationUrl, $operation = 'reboot')
1883
- {
1884
- $response = $this->_performRequest($operationUrl, array('comp' => $operation), Microsoft_Http_Client::POST);
1885
-
1886
- if (!$response->isSuccessful()) {
1887
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1888
- }
1889
- }
1890
-
1891
- /**
1892
- * The List Certificates operation lists all certificates associated with
1893
- * the specified hosted service.
1894
- *
1895
- * @param string $serviceName The service name
1896
- * @return array Array of Microsoft_WindowsAzure_Management_CertificateInstance
1897
- * @throws Microsoft_WindowsAzure_Management_Exception
1898
- */
1899
- public function listCertificates($serviceName)
1900
- {
1901
- if ($serviceName == '' || is_null($serviceName)) {
1902
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1903
- }
1904
-
1905
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/certificates';
1906
- $response = $this->_performRequest($operationUrl);
1907
-
1908
- if ($response->isSuccessful()) {
1909
- $result = $this->_parseResponse($response);
1910
-
1911
- if (!$result->Certificate) {
1912
- return array();
1913
- }
1914
- if (count($result->Certificate) > 1) {
1915
- $xmlServices = $result->Certificate;
1916
- } else {
1917
- $xmlServices = array($result->Certificate);
1918
- }
1919
-
1920
- $services = array();
1921
- if (!is_null($xmlServices)) {
1922
- for ($i = 0; $i < count($xmlServices); $i++) {
1923
- $services[] = new Microsoft_WindowsAzure_Management_CertificateInstance(
1924
- (string)$xmlServices[$i]->CertificateUrl,
1925
- (string)$xmlServices[$i]->Thumbprint,
1926
- (string)$xmlServices[$i]->ThumbprintAlgorithm,
1927
- (string)$xmlServices[$i]->Data
1928
- );
1929
- }
1930
- }
1931
- return $services;
1932
- } else {
1933
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1934
- }
1935
- }
1936
-
1937
- /**
1938
- * The Get Certificate operation returns the public data for the specified certificate.
1939
- *
1940
- * @param string $serviceName|$certificateUrl The service name -or- the certificate URL
1941
- * @param string $algorithm Algorithm
1942
- * @param string $thumbprint Thumbprint
1943
- * @return Microsoft_WindowsAzure_Management_CertificateInstance
1944
- * @throws Microsoft_WindowsAzure_Management_Exception
1945
- */
1946
- public function getCertificate($serviceName, $algorithm = '', $thumbprint = '')
1947
- {
1948
- if ($serviceName == '' || is_null($serviceName)) {
1949
- throw new Microsoft_WindowsAzure_Management_Exception('Service name or certificate URL should be specified.');
1950
- }
1951
- if (strpos($serviceName, 'https') === false && ($algorithm == '' || is_null($algorithm)) && ($thumbprint == '' || is_null($thumbprint))) {
1952
- throw new Microsoft_WindowsAzure_Management_Exception('Algorithm and thumbprint should be specified.');
1953
- }
1954
-
1955
- $operationUrl = str_replace($this->getBaseUrl(), '', $serviceName);
1956
- if (strpos($serviceName, 'https') === false) {
1957
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/certificates/' . $algorithm . '-' . strtoupper($thumbprint);
1958
- }
1959
-
1960
- $response = $this->_performRequest($operationUrl);
1961
-
1962
- if ($response->isSuccessful()) {
1963
- $result = $this->_parseResponse($response);
1964
-
1965
- return new Microsoft_WindowsAzure_Management_CertificateInstance(
1966
- $this->getBaseUrl() . $operationUrl,
1967
- $thumbprint,
1968
- $algorithm,
1969
- (string)$result->Data
1970
- );
1971
- } else {
1972
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1973
- }
1974
- }
1975
-
1976
- /**
1977
- * The Add Certificate operation adds a certificate to the subscription.
1978
- *
1979
- * @param string $serviceName The service name
1980
- * @param string $certificateData Certificate data
1981
- * @param string $certificatePassword The certificate password
1982
- * @param string $certificateFormat The certificate format. Currently, only 'pfx' is supported.
1983
- * @throws Microsoft_WindowsAzure_Management_Exception
1984
- */
1985
- public function addCertificate($serviceName, $certificateData, $certificatePassword, $certificateFormat = 'pfx')
1986
- {
1987
- if ($serviceName == '' || is_null($serviceName)) {
1988
- throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1989
- }
1990
- if ($certificateData == '' || is_null($certificateData)) {
1991
- throw new Microsoft_WindowsAzure_Management_Exception('Certificate data should be specified.');
1992
- }
1993
- if ($certificatePassword == '' || is_null($certificatePassword)) {
1994
- throw new Microsoft_WindowsAzure_Management_Exception('Certificate password should be specified.');
1995
- }
1996
- if ($certificateFormat != 'pfx') {
1997
- throw new Microsoft_WindowsAzure_Management_Exception('Certificate format should be "pfx".');
1998
- }
1999
-
2000
- if (@file_exists($certificateData)) {
2001
- $certificateData = file_get_contents($certificateData);
2002
- }
2003
-
2004
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/certificates';
2005
- $response = $this->_performRequest($operationUrl, array(),
2006
- Microsoft_Http_Client::POST,
2007
- array('Content-Type' => 'application/xml; charset=utf-8'),
2008
- '<CertificateFile xmlns="http://schemas.microsoft.com/windowsazure"><Data>' . base64_encode($certificateData) . '</Data><CertificateFormat>' . $certificateFormat . '</CertificateFormat><Password>' . $certificatePassword . '</Password></CertificateFile>');
2009
-
2010
- if (!$response->isSuccessful()) {
2011
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2012
- }
2013
- }
2014
-
2015
- /**
2016
- * The Delete Certificate operation deletes a certificate from the subscription's certificate store.
2017
- *
2018
- * @param string $serviceName|$certificateUrl The service name -or- the certificate URL
2019
- * @param string $algorithm Algorithm
2020
- * @param string $thumbprint Thumbprint
2021
- * @throws Microsoft_WindowsAzure_Management_Exception
2022
- */
2023
- public function deleteCertificate($serviceName, $algorithm = '', $thumbprint = '')
2024
- {
2025
- if ($serviceName == '' || is_null($serviceName)) {
2026
- throw new Microsoft_WindowsAzure_Management_Exception('Service name or certificate URL should be specified.');
2027
- }
2028
- if (strpos($serviceName, 'https') === false && ($algorithm == '' || is_null($algorithm)) && ($thumbprint == '' || is_null($thumbprint))) {
2029
- throw new Microsoft_WindowsAzure_Management_Exception('Algorithm and thumbprint should be specified.');
2030
- }
2031
-
2032
- $operationUrl = str_replace($this->getBaseUrl(), '', $serviceName);
2033
- if (strpos($serviceName, 'https') === false) {
2034
- $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/certificates/' . $algorithm . '-' . strtoupper($thumbprint);
2035
- }
2036
-
2037
- $response = $this->_performRequest($operationUrl, array(), Microsoft_Http_Client::DELETE);
2038
-
2039
- if (!$response->isSuccessful()) {
2040
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2041
- }
2042
- }
2043
-
2044
- /**
2045
- * The List Affinity Groups operation lists the affinity groups associated with
2046
- * the specified subscription.
2047
- *
2048
- * @return array Array of Microsoft_WindowsAzure_Management_AffinityGroupInstance
2049
- * @throws Microsoft_WindowsAzure_Management_Exception
2050
- */
2051
- public function listAffinityGroups()
2052
- {
2053
- $response = $this->_performRequest(self::OP_AFFINITYGROUPS);
2054
-
2055
- if ($response->isSuccessful()) {
2056
- $result = $this->_parseResponse($response);
2057
-
2058
- if (!$result->AffinityGroup) {
2059
- return array();
2060
- }
2061
- if (count($result->AffinityGroup) > 1) {
2062
- $xmlServices = $result->AffinityGroup;
2063
- } else {
2064
- $xmlServices = array($result->AffinityGroup);
2065
- }
2066
-
2067
- $services = array();
2068
- if (!is_null($xmlServices)) {
2069
- for ($i = 0; $i < count($xmlServices); $i++) {
2070
- $services[] = new Microsoft_WindowsAzure_Management_AffinityGroupInstance(
2071
- (string)$xmlServices[$i]->Name,
2072
- (string)$xmlServices[$i]->Label,
2073
- (string)$xmlServices[$i]->Description,
2074
- (string)$xmlServices[$i]->Location
2075
- );
2076
- }
2077
- }
2078
- return $services;
2079
- } else {
2080
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2081
- }
2082
- }
2083
-
2084
- /**
2085
- * The Create Affinity Group operation creates a new affinity group for the specified subscription.
2086
- *
2087
- * @param string $name A name for the affinity group that is unique to the subscription.
2088
- * @param string $label A label for the affinity group. The label may be up to 100 characters in length.
2089
- * @param string $description A description for the affinity group. The description may be up to 1024 characters in length.
2090
- * @param string $location The location where the affinity group will be created. To list available locations, use the List Locations operation.
2091
- */
2092
- public function createAffinityGroup($name, $label, $description = '', $location = '')
2093
- {
2094
- if ($name == '' || is_null($name)) {
2095
- throw new Microsoft_WindowsAzure_Management_Exception('Affinity group name should be specified.');
2096
- }
2097
- if ($label == '' || is_null($label)) {
2098
- throw new Microsoft_WindowsAzure_Management_Exception('Label should be specified.');
2099
- }
2100
- if (strlen($label) > 100) {
2101
- throw new Microsoft_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');
2102
- }
2103
- if (strlen($description) > 1024) {
2104
- throw new Microsoft_WindowsAzure_Management_Exception('Description is too long. The maximum length is 1024 characters.');
2105
- }
2106
- if ($location == '' || is_null($location)) {
2107
- throw new Microsoft_WindowsAzure_Management_Exception('Location should be specified.');
2108
- }
2109
-
2110
- $response = $this->_performRequest(self::OP_AFFINITYGROUPS, array(),
2111
- Microsoft_Http_Client::POST,
2112
- array('Content-Type' => 'application/xml; charset=utf-8'),
2113
- '<CreateAffinityGroup xmlns="http://schemas.microsoft.com/windowsazure"><Name>' . $name . '</Name><Label>' . base64_encode($label) . '</Label><Description>' . $description . '</Description><Location>' . $location . '</Location></CreateAffinityGroup>');
2114
-
2115
- if (!$response->isSuccessful()) {
2116
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2117
- }
2118
- }
2119
-
2120
- /**
2121
- * The Update Affinity Group operation updates the label and/or the description for an affinity group for the specified subscription.
2122
- *
2123
- * @param string $name The name for the affinity group that should be updated.
2124
- * @param string $label A label for the affinity group. The label may be up to 100 characters in length.
2125
- * @param string $description A description for the affinity group. The description may be up to 1024 characters in length.
2126
- */
2127
- public function updateAffinityGroup($name, $label, $description = '')
2128
- {
2129
- if ($name == '' || is_null($name)) {
2130
- throw new Microsoft_WindowsAzure_Management_Exception('Affinity group name should be specified.');
2131
- }
2132
- if ($label == '' || is_null($label)) {
2133
- throw new Microsoft_WindowsAzure_Management_Exception('Label should be specified.');
2134
- }
2135
- if (strlen($label) > 100) {
2136
- throw new Microsoft_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');
2137
- }
2138
- if (strlen($description) > 1024) {
2139
- throw new Microsoft_WindowsAzure_Management_Exception('Description is too long. The maximum length is 1024 characters.');
2140
- }
2141
-
2142
- $response = $this->_performRequest(self::OP_AFFINITYGROUPS . '/' . $name, array(),
2143
- Microsoft_Http_Client::PUT,
2144
- array('Content-Type' => 'application/xml; charset=utf-8'),
2145
- '<UpdateAffinityGroup xmlns="http://schemas.microsoft.com/windowsazure"><Label>' . base64_encode($label) . '</Label><Description>' . $description . '</Description></UpdateAffinityGroup>');
2146
-
2147
- if (!$response->isSuccessful()) {
2148
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2149
- }
2150
- }
2151
-
2152
- /**
2153
- * The Delete Affinity Group operation deletes an affinity group in the specified subscription.
2154
- *
2155
- * @param string $name The name for the affinity group that should be deleted.
2156
- */
2157
- public function deleteAffinityGroup($name)
2158
- {
2159
- if ($name == '' || is_null($name)) {
2160
- throw new Microsoft_WindowsAzure_Management_Exception('Affinity group name should be specified.');
2161
- }
2162
-
2163
- $response = $this->_performRequest(self::OP_AFFINITYGROUPS . '/' . $name, array(),
2164
- Microsoft_Http_Client::DELETE);
2165
-
2166
- if (!$response->isSuccessful()) {
2167
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2168
- }
2169
- }
2170
-
2171
- /**
2172
- * The Get Affinity Group Properties operation returns the
2173
- * system properties associated with the specified affinity group.
2174
- *
2175
- * @param string $affinityGroupName The affinity group name.
2176
- * @return Microsoft_WindowsAzure_Management_AffinityGroupInstance
2177
- * @throws Microsoft_WindowsAzure_Management_Exception
2178
- */
2179
- public function getAffinityGroupProperties($affinityGroupName)
2180
- {
2181
- if ($affinityGroupName == '' || is_null($affinityGroupName)) {
2182
- throw new Microsoft_WindowsAzure_Management_Exception('Affinity group name should be specified.');
2183
- }
2184
-
2185
- $response = $this->_performRequest(self::OP_AFFINITYGROUPS . '/' . $affinityGroupName);
2186
-
2187
- if ($response->isSuccessful()) {
2188
- $result = $this->_parseResponse($response);
2189
-
2190
- $affinityGroup = new Microsoft_WindowsAzure_Management_AffinityGroupInstance(
2191
- $affinityGroupName,
2192
- (string)$result->Label,
2193
- (string)$result->Description,
2194
- (string)$result->Location
2195
- );
2196
-
2197
- // Hosted services
2198
- if (count($result->HostedServices->HostedService) > 1) {
2199
- $xmlService = $result->HostedServices->HostedService;
2200
- } else {
2201
- $xmlService = array($result->HostedServices->HostedService);
2202
- }
2203
-
2204
- $services = array();
2205
- if (!is_null($xmlService)) {
2206
- for ($i = 0; $i < count($xmlService); $i++) {
2207
- $services[] = array(
2208
- 'url' => (string)$xmlService[$i]->Url,
2209
- 'name' => (string)$xmlService[$i]->ServiceName
2210
- );
2211
- }
2212
- }
2213
- $affinityGroup->HostedServices = $services;
2214
-
2215
- // Storage services
2216
- if (count($result->StorageServices->StorageService) > 1) {
2217
- $xmlService = $result->StorageServices->StorageService;
2218
- } else {
2219
- $xmlService = array($result->StorageServices->StorageService);
2220
- }
2221
-
2222
- $services = array();
2223
- if (!is_null($xmlService)) {
2224
- for ($i = 0; $i < count($xmlService); $i++) {
2225
- $services[] = array(
2226
- 'url' => (string)$xmlService[$i]->Url,
2227
- 'name' => (string)$xmlService[$i]->ServiceName
2228
- );
2229
- }
2230
- }
2231
- $affinityGroup->StorageServices = $services;
2232
-
2233
- return $affinityGroup;
2234
- } else {
2235
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2236
- }
2237
- }
2238
-
2239
- /**
2240
- * The List Locations operation lists all of the data center locations
2241
- * that are valid for your subscription.
2242
- *
2243
- * @return array Array of Microsoft_WindowsAzure_Management_LocationInstance
2244
- * @throws Microsoft_WindowsAzure_Management_Exception
2245
- */
2246
- public function listLocations()
2247
- {
2248
- $response = $this->_performRequest(self::OP_LOCATIONS);
2249
-
2250
- if ($response->isSuccessful()) {
2251
- $result = $this->_parseResponse($response);
2252
-
2253
- if (!$result->Location) {
2254
- return array();
2255
- }
2256
- if (count($result->Location) > 1) {
2257
- $xmlServices = $result->Location;
2258
- } else {
2259
- $xmlServices = array($result->Location);
2260
- }
2261
-
2262
- $services = array();
2263
- if (!is_null($xmlServices)) {
2264
- for ($i = 0; $i < count($xmlServices); $i++) {
2265
- $services[] = new Microsoft_WindowsAzure_Management_LocationInstance(
2266
- (string)$xmlServices[$i]->Name
2267
- );
2268
- }
2269
- }
2270
- return $services;
2271
- } else {
2272
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2273
- }
2274
- }
2275
-
2276
- /**
2277
- * The List Operating Systems operation lists the versions of the guest operating system
2278
- * that are currently available in Windows Azure. The 2010-10-28 version of List Operating
2279
- * Systems also indicates what family an operating system version belongs to.
2280
- * Currently Windows Azure supports two operating system families: the Windows Azure guest
2281
- * operating system that is substantially compatible with Windows Server 2008 SP2,
2282
- * and the Windows Azure guest operating system that is substantially compatible with
2283
- * Windows Server 2008 R2.
2284
- *
2285
- * @return array Array of Microsoft_WindowsAzure_Management_OperatingSystemInstance
2286
- * @throws Microsoft_WindowsAzure_Management_Exception
2287
- */
2288
- public function listOperatingSystems()
2289
- {
2290
- $response = $this->_performRequest(self::OP_OPERATINGSYSTEMS);
2291
-
2292
- if ($response->isSuccessful()) {
2293
- $result = $this->_parseResponse($response);
2294
-
2295
- if (!$result->OperatingSystem) {
2296
- return array();
2297
- }
2298
- if (count($result->OperatingSystem) > 1) {
2299
- $xmlServices = $result->OperatingSystem;
2300
- } else {
2301
- $xmlServices = array($result->OperatingSystem);
2302
- }
2303
-
2304
- $services = array();
2305
- if (!is_null($xmlServices)) {
2306
- for ($i = 0; $i < count($xmlServices); $i++) {
2307
- $services[] = new Microsoft_WindowsAzure_Management_OperatingSystemInstance(
2308
- (string)$xmlServices[$i]->Version,
2309
- (string)$xmlServices[$i]->Label,
2310
- ((string)$xmlServices[$i]->IsDefault == 'true'),
2311
- ((string)$xmlServices[$i]->IsActive == 'true'),
2312
- (string)$xmlServices[$i]->Family,
2313
- (string)$xmlServices[$i]->FamilyLabel
2314
- );
2315
- }
2316
- }
2317
- return $services;
2318
- } else {
2319
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2320
- }
2321
- }
2322
-
2323
- /**
2324
- * The List OS Families operation lists the guest operating system families
2325
- * available in Windows Azure, and also lists the operating system versions
2326
- * available for each family. Currently Windows Azure supports two operating
2327
- * system families: the Windows Azure guest operating system that is
2328
- * substantially compatible with Windows Server 2008 SP2, and the Windows
2329
- * Azure guest operating system that is substantially compatible with
2330
- * Windows Server 2008 R2.
2331
- *
2332
- * @return array Array of Microsoft_WindowsAzure_Management_OperatingSystemFamilyInstance
2333
- * @throws Microsoft_WindowsAzure_Management_Exception
2334
- */
2335
- public function listOperatingSystemFamilies()
2336
- {
2337
- $response = $this->_performRequest(self::OP_OPERATINGSYSTEMFAMILIES);
2338
-
2339
- if ($response->isSuccessful()) {
2340
- $result = $this->_parseResponse($response);
2341
-
2342
- if (!$result->OperatingSystemFamily) {
2343
- return array();
2344
- }
2345
- if (count($result->OperatingSystemFamily) > 1) {
2346
- $xmlServices = $result->OperatingSystemFamily;
2347
- } else {
2348
- $xmlServices = array($result->OperatingSystemFamily);
2349
- }
2350
-
2351
- $services = array();
2352
- if (!is_null($xmlServices)) {
2353
- for ($i = 0; $i < count($xmlServices); $i++) {
2354
- $services[] = new Microsoft_WindowsAzure_Management_OperatingSystemFamilyInstance(
2355
- (string)$xmlServices[$i]->Name,
2356
- (string)$xmlServices[$i]->Label
2357
- );
2358
-
2359
- if (count($xmlServices[$i]->OperatingSystems->OperatingSystem) > 1) {
2360
- $xmlOperatingSystems = $xmlServices[$i]->OperatingSystems->OperatingSystem;
2361
- } else {
2362
- $xmlOperatingSystems = array($xmlServices[$i]->OperatingSystems->OperatingSystem);
2363
- }
2364
-
2365
- $operatingSystems = array();
2366
- if (!is_null($xmlOperatingSystems)) {
2367
- for ($i = 0; $i < count($xmlOperatingSystems); $i++) {
2368
- $operatingSystems[] = new Microsoft_WindowsAzure_Management_OperatingSystemInstance(
2369
- (string)$xmlOperatingSystems[$i]->Version,
2370
- (string)$xmlOperatingSystems[$i]->Label,
2371
- ((string)$xmlOperatingSystems[$i]->IsDefault == 'true'),
2372
- ((string)$xmlOperatingSystems[$i]->IsActive == 'true'),
2373
- (string)$xmlServices[$i]->Name,
2374
- (string)$xmlServices[$i]->Label
2375
- );
2376
- }
2377
- }
2378
- $services[ count($services) - 1 ]->OperatingSystems = $operatingSystems;
2379
- }
2380
- }
2381
- return $services;
2382
- } else {
2383
- throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2384
- }
2385
- }
2386
-
2387
- /**
2388
- * Clean configuration
2389
- *
2390
- * @param string $configuration Configuration to clean.
2391
- * @return string
2392
- */
2393
- public function _cleanConfiguration($configuration) {
2394
- $configuration = str_replace('?<?', '<?', $configuration);
2395
- $configuration = str_replace("\r", "", $configuration);
2396
- $configuration = str_replace("\n", "", $configuration);
2397
-
2398
- return $configuration;
2399
- }
2400
- }
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
+ * @subpackage Management
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 51671 2010-09-30 08:33:45Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Management
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ */
48
+ class Microsoft_WindowsAzure_Management_Client
49
+ {
50
+ /**
51
+ * Management service URL
52
+ */
53
+ const URL_MANAGEMENT = "https://management.core.windows.net";
54
+
55
+ /**
56
+ * Operations
57
+ */
58
+ const OP_OPERATIONS = "operations";
59
+ const OP_STORAGE_ACCOUNTS = "services/storageservices";
60
+ const OP_HOSTED_SERVICES = "services/hostedservices";
61
+ const OP_AFFINITYGROUPS = "affinitygroups";
62
+ const OP_LOCATIONS = "locations";
63
+ const OP_OPERATINGSYSTEMS = "operatingsystems";
64
+ const OP_OPERATINGSYSTEMFAMILIES = "operatingsystemfamilies";
65
+
66
+ /**
67
+ * Current API version
68
+ *
69
+ * @var string
70
+ */
71
+ protected $_apiVersion = '2011-06-01';
72
+
73
+ /**
74
+ * Subscription ID
75
+ *
76
+ * @var string
77
+ */
78
+ protected $_subscriptionId = '';
79
+
80
+ /**
81
+ * Management certificate path (.PEM)
82
+ *
83
+ * @var string
84
+ */
85
+ protected $_certificatePath = '';
86
+
87
+ /**
88
+ * Management certificate passphrase
89
+ *
90
+ * @var string
91
+ */
92
+ protected $_certificatePassphrase = '';
93
+
94
+ /**
95
+ * Microsoft_Http_Client channel used for communication with REST services
96
+ *
97
+ * @var Microsoft_Http_Client
98
+ */
99
+ protected $_httpClientChannel = null;
100
+
101
+ /**
102
+ * Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract instance
103
+ *
104
+ * @var Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract
105
+ */
106
+ protected $_retryPolicy = null;
107
+
108
+ /**
109
+ * Returns the last request ID
110
+ *
111
+ * @var string
112
+ */
113
+ protected $_lastRequestId = null;
114
+
115
+ /**
116
+ * Creates a new Microsoft_WindowsAzure_Management_Client instance
117
+ *
118
+ * @param string $subscriptionId Subscription ID
119
+ * @param string $certificatePath Management certificate path (.PEM)
120
+ * @param string $certificatePassphrase Management certificate passphrase
121
+ * @param Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy Retry policy to use when making requests
122
+ */
123
+ public function __construct(
124
+ $subscriptionId,
125
+ $certificatePath,
126
+ $certificatePassphrase,
127
+ Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null
128
+ ) {
129
+ $this->_subscriptionId = $subscriptionId;
130
+ $this->_certificatePath = $certificatePath;
131
+ $this->_certificatePassphrase = $certificatePassphrase;
132
+
133
+ $this->_retryPolicy = $retryPolicy;
134
+ if (is_null($this->_retryPolicy)) {
135
+ $this->_retryPolicy = Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract::noRetry();
136
+ }
137
+
138
+ // Setup default Microsoft_Http_Client channel
139
+ $options = array(
140
+ 'adapter' => 'Microsoft_Http_Client_Adapter_Socket',
141
+ 'ssltransport' => 'ssl',
142
+ 'sslcert' => $this->_certificatePath,
143
+ 'sslpassphrase' => $this->_certificatePassphrase,
144
+ 'sslusecontext' => true,
145
+ );
146
+ if (function_exists('curl_init')) {
147
+ // Set cURL options if cURL is used afterwards
148
+ $options['curloptions'] = array(
149
+ CURLOPT_FOLLOWLOCATION => true,
150
+ CURLOPT_TIMEOUT => 120,
151
+ );
152
+ }
153
+ $this->_httpClientChannel = new Microsoft_Http_Client(null, $options);
154
+ }
155
+
156
+ /**
157
+ * Set the HTTP client channel to use
158
+ *
159
+ * @param Microsoft_Http_Client_Adapter_Interface|string $adapterInstance Adapter instance or adapter class name.
160
+ */
161
+ public function setHttpClientChannel($adapterInstance = 'Microsoft_Http_Client_Adapter_Socket')
162
+ {
163
+ $this->_httpClientChannel->setAdapter($adapterInstance);
164
+ }
165
+
166
+ /**
167
+ * Retrieve HTTP client channel
168
+ *
169
+ * @return Microsoft_Http_Client_Adapter_Interface
170
+ */
171
+ public function getHttpClientChannel()
172
+ {
173
+ return $this->_httpClientChannel;
174
+ }
175
+
176
+ /**
177
+ * Returns the Windows Azure subscription ID
178
+ *
179
+ * @return string
180
+ */
181
+ public function getSubscriptionId()
182
+ {
183
+ return $this->_subscriptionId;
184
+ }
185
+
186
+ /**
187
+ * Returns the last request ID.
188
+ *
189
+ * @return string
190
+ */
191
+ public function getLastRequestId()
192
+ {
193
+ return $this->_lastRequestId;
194
+ }
195
+
196
+ /**
197
+ * Get base URL for creating requests
198
+ *
199
+ * @return string
200
+ */
201
+ public function getBaseUrl()
202
+ {
203
+ return self::URL_MANAGEMENT . '/' . $this->_subscriptionId;
204
+ }
205
+
206
+ /**
207
+ * Perform request using Microsoft_Http_Client channel
208
+ *
209
+ * @param string $path Path
210
+ * @param array $query Query arguments
211
+ * @param string $httpVerb HTTP verb the request will use
212
+ * @param array $headers x-ms headers to add
213
+ * @param mixed $rawData Optional RAW HTTP data to be sent over the wire
214
+ * @return Microsoft_Http_Response
215
+ */
216
+ protected function _performRequest(
217
+ $path = '/',
218
+ $query = array(),
219
+ $httpVerb = Microsoft_Http_Client::GET,
220
+ $headers = array(),
221
+ $rawData = null
222
+ ) {
223
+ // Clean path
224
+ if (strpos($path, '/') !== 0) {
225
+ $path = '/' . $path;
226
+ }
227
+
228
+ // Clean headers
229
+ if (is_null($headers)) {
230
+ $headers = array();
231
+ }
232
+
233
+ // Ensure cUrl will also work correctly:
234
+ // - disable Content-Type if required
235
+ // - disable Expect: 100 Continue
236
+ if (!isset($headers["Content-Type"])) {
237
+ $headers["Content-Type"] = '';
238
+ }
239
+ //$headers["Expect"] = '';
240
+
241
+ // Add version header
242
+ $headers['x-ms-version'] = $this->_apiVersion;
243
+
244
+ // Generate URL and sign request
245
+ $requestUrl = $this->getBaseUrl() . rawurlencode($path);
246
+ $requestHeaders = $headers;
247
+ if (count($query) > 0) {
248
+ $queryString = '';
249
+ foreach ($query as $key => $value) {
250
+ $queryString .= ($queryString ? '&' : '?') . rawurlencode($key) . '=' . rawurlencode($value);
251
+ }
252
+ $requestUrl .= $queryString;
253
+ }
254
+
255
+ // Prepare request
256
+ $this->_httpClientChannel->resetParameters(true);
257
+ $this->_httpClientChannel->setUri($requestUrl);
258
+ $this->_httpClientChannel->setHeaders($requestHeaders);
259
+ $this->_httpClientChannel->setRawData($rawData);
260
+
261
+ // Execute request
262
+ $response = $this->_retryPolicy->execute(
263
+ array($this->_httpClientChannel, 'request'),
264
+ array($httpVerb)
265
+ );
266
+
267
+ // Store request id
268
+ $this->_lastRequestId = $response->getHeader('x-ms-request-id');
269
+
270
+ return $response;
271
+ }
272
+
273
+ /**
274
+ * Parse result from Microsoft_Http_Response
275
+ *
276
+ * @param Microsoft_Http_Response $response Response from HTTP call
277
+ * @return object
278
+ * @throws Microsoft_WindowsAzure_Exception
279
+ */
280
+ protected function _parseResponse(Microsoft_Http_Response $response = null)
281
+ {
282
+ if (is_null($response)) {
283
+ throw new Microsoft_WindowsAzure_Exception('Response should not be null.');
284
+ }
285
+
286
+ $xml = @simplexml_load_string($response->getBody());
287
+
288
+ if ($xml !== false) {
289
+ // Fetch all namespaces
290
+ $namespaces = array_merge($xml->getNamespaces(true), $xml->getDocNamespaces(true));
291
+
292
+ // Register all namespace prefixes
293
+ foreach ($namespaces as $prefix => $ns) {
294
+ if ($prefix != '') {
295
+ $xml->registerXPathNamespace($prefix, $ns);
296
+ }
297
+ }
298
+ }
299
+
300
+ return $xml;
301
+ }
302
+
303
+ /**
304
+ * Get error message from Microsoft_Http_Response
305
+ *
306
+ * @param Microsoft_Http_Response $response Repsonse
307
+ * @param string $alternativeError Alternative error message
308
+ * @return string
309
+ */
310
+ protected function _getErrorMessage(Microsoft_Http_Response $response, $alternativeError = 'Unknown error.')
311
+ {
312
+ $response = $this->_parseResponse($response);
313
+ if ($response && $response->Message) {
314
+ return (string)$response->Message;
315
+ } else {
316
+ return $alternativeError;
317
+ }
318
+ }
319
+
320
+ /**
321
+ * The Get Operation Status operation returns the status of the specified operation.
322
+ * After calling an asynchronous operation, you can call Get Operation Status to
323
+ * determine whether the operation has succeed, failed, or is still in progress.
324
+ *
325
+ * @param string $requestId The request ID. If omitted, the last request ID will be used.
326
+ * @return Microsoft_WindowsAzure_Management_OperationStatusInstance
327
+ * @throws Microsoft_WindowsAzure_Management_Exception
328
+ */
329
+ public function getOperationStatus($requestId = '')
330
+ {
331
+ if ($requestId == '') {
332
+ $requestId = $this->getLastRequestId();
333
+ }
334
+
335
+ $response = $this->_performRequest(self::OP_OPERATIONS . '/' . $requestId);
336
+
337
+ if ($response->isSuccessful()) {
338
+ $result = $this->_parseResponse($response);
339
+
340
+ if (!is_null($result)) {
341
+ return new Microsoft_WindowsAzure_Management_OperationStatusInstance(
342
+ (string)$result->ID,
343
+ (string)$result->Status,
344
+ ($result->Error ? (string)$result->Error->Code : ''),
345
+ ($result->Error ? (string)$result->Error->Message : '')
346
+ );
347
+ }
348
+ return null;
349
+ } else {
350
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
351
+ }
352
+ }
353
+
354
+
355
+
356
+ /**
357
+ * The List Subscription Operations operation returns a list of create, update,
358
+ * and delete operations that were performed on a subscription during the specified timeframe.
359
+ * Documentation on the parameters can be found at http://msdn.microsoft.com/en-us/library/gg715318.aspx.
360
+ *
361
+ * @param string $startTime The start of the timeframe to begin listing subscription operations in UTC format. This parameter and the $endTime parameter indicate the timeframe to retrieve subscription operations. This parameter cannot indicate a start date of more than 90 days in the past.
362
+ * @param string $endTime The end of the timeframe to begin listing subscription operations in UTC format. This parameter and the $startTime parameter indicate the timeframe to retrieve subscription operations.
363
+ * @param string $objectIdFilter Returns subscription operations only for the specified object type and object ID.
364
+ * @param string $operationResultFilter Returns subscription operations only for the specified result status, either Succeeded, Failed, or InProgress.
365
+ * @param string $continuationToken Internal usage.
366
+ * @return array Array of Microsoft_WindowsAzure_Management_SubscriptionOperationInstance
367
+ * @throws Microsoft_WindowsAzure_Management_Exception
368
+ */
369
+ public function listSubscriptionOperations($startTime, $endTime, $objectIdFilter = null, $operationResultFilter = null, $continuationToken = null)
370
+ {
371
+ if ($startTime == '' || is_null($startTime)) {
372
+ throw new Microsoft_WindowsAzure_Management_Exception('Start time should be specified.');
373
+ }
374
+ if ($endTime == '' || is_null($endTime)) {
375
+ throw new Microsoft_WindowsAzure_Management_Exception('End time should be specified.');
376
+ }
377
+ if ($operationResultFilter != '' && !is_null($operationResultFilter)) {
378
+ $operationResultFilter = strtolower($operationResultFilter);
379
+ if ($operationResultFilter != 'succeeded' && $operationResultFilter != 'failed' && $operationResultFilter != 'inprogress') {
380
+ throw new Microsoft_WindowsAzure_Management_Exception('OperationResultFilter should be succeeded|failed|inprogress.');
381
+ }
382
+ }
383
+
384
+ $parameters = array();
385
+ $parameters['StartTime'] = $startTime;
386
+ $parameters['EndTime'] = $endTime;
387
+ if ($objectIdFilter != '' && !is_null($objectIdFilter)) {
388
+ $parameters['ObjectIdFilter'] = $objectIdFilter;
389
+ }
390
+ if ($operationResultFilter != '' && !is_null($operationResultFilter)) {
391
+ $parameters['OperationResultFilter'] = ucfirst($operationResultFilter);
392
+ }
393
+ if ($continuationToken != '' && !is_null($continuationToken)) {
394
+ $parameters['ContinuationToken'] = $continuationToken;
395
+ }
396
+
397
+ $response = $this->_performRequest(self::OP_OPERATIONS, $parameters);
398
+
399
+ if ($response->isSuccessful()) {
400
+ $result = $this->_parseResponse($response);
401
+ $namespaces = $result->getDocNamespaces();
402
+ $result->registerXPathNamespace('__empty_ns', $namespaces['']);
403
+
404
+ $xmlOperations = $result->xpath('//__empty_ns:SubscriptionOperation');
405
+
406
+ // Create return value
407
+ $returnValue = array();
408
+ foreach ($xmlOperations as $xmlOperation) {
409
+ // Create operation instance
410
+ $operation = new Microsoft_WindowsAzure_Management_SubscriptionOperationInstance(
411
+ $xmlOperation->OperationId,
412
+ $xmlOperation->OperationObjectId,
413
+ $xmlOperation->OperationName,
414
+ array(),
415
+ (array)$xmlOperation->OperationCaller,
416
+ (array)$xmlOperation->OperationStatus,
417
+ (string)$xmlOperation->OperationStartedTime,
418
+ (string)$xmlOperation->OperationCompletedTime
419
+ );
420
+
421
+ // Parse parameters
422
+ $xmlOperation->registerXPathNamespace('__empty_ns', $namespaces['']);
423
+ $xmlParameters = $xmlOperation->xpath('.//__empty_ns:OperationParameter');
424
+ foreach ($xmlParameters as $xmlParameter) {
425
+ $xmlParameterDetails = $xmlParameter->children('http://schemas.datacontract.org/2004/07/Microsoft.Samples.WindowsAzure.ServiceManagement');
426
+ $operation->addOperationParameter((string)$xmlParameterDetails->Name, (string)$xmlParameterDetails->Value);
427
+ }
428
+
429
+ // Add to result
430
+ $returnValue[] = $operation;
431
+ }
432
+
433
+ // More data?
434
+ if (!is_null($result->ContinuationToken) && $result->ContinuationToken != '') {
435
+ $returnValue = array_merge($returnValue, $this->listSubscriptionOperations($startTime, $endTime, $objectIdFilter, $operationResultFilter, (string)$result->ContinuationToken));
436
+ }
437
+
438
+ // Return
439
+ return $returnValue;
440
+ } else {
441
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
442
+ }
443
+ }
444
+
445
+ /**
446
+ * Wait for an operation to complete
447
+ *
448
+ * @param string $requestId The request ID. If omitted, the last request ID will be used.
449
+ * @param int $sleepInterval Sleep interval in milliseconds.
450
+ * @return Microsoft_WindowsAzure_Management_OperationStatusInstance
451
+ * @throws Microsoft_WindowsAzure_Management_Exception
452
+ */
453
+ public function waitForOperation($requestId = '', $sleepInterval = 250)
454
+ {
455
+ if ($requestId == '') {
456
+ $requestId = $this->getLastRequestId();
457
+ }
458
+ if ($requestId == '' || is_null($requestId)) {
459
+ return null;
460
+ }
461
+
462
+ $status = $this->getOperationStatus($requestId);
463
+ while ($status->Status == 'InProgress') {
464
+ $status = $this->getOperationStatus($requestId);
465
+ usleep($sleepInterval);
466
+ }
467
+
468
+ return $status;
469
+ }
470
+
471
+ /**
472
+ * Creates a new Microsoft_WindowsAzure_Storage_Blob instance for the current account
473
+ *
474
+ * @param string $serviceName the service name to create a storage client for.
475
+ * @param Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy Retry policy to use when making requests
476
+ * @return Microsoft_WindowsAzure_Storage_Blob
477
+ */
478
+ public function createBlobClientForService($serviceName, Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null)
479
+ {
480
+ if ($serviceName == '' || is_null($serviceName)) {
481
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
482
+ }
483
+
484
+ $storageKeys = $this->getStorageAccountKeys($serviceName);
485
+
486
+ return new Microsoft_WindowsAzure_Storage_Blob(
487
+ Microsoft_WindowsAzure_Storage::URL_CLOUD_BLOB,
488
+ $serviceName,
489
+ $storageKeys[0],
490
+ false,
491
+ $retryPolicy
492
+ );
493
+ }
494
+
495
+ /**
496
+ * Creates a new Microsoft_WindowsAzure_Storage_Table instance for the current account
497
+ *
498
+ * @param string $serviceName the service name to create a storage client for.
499
+ * @param Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy Retry policy to use when making requests
500
+ * @return Microsoft_WindowsAzure_Storage_Table
501
+ */
502
+ public function createTableClientForService($serviceName, Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null)
503
+ {
504
+ if ($serviceName == '' || is_null($serviceName)) {
505
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
506
+ }
507
+
508
+ $storageKeys = $this->getStorageAccountKeys($serviceName);
509
+
510
+ return new Microsoft_WindowsAzure_Storage_Table(
511
+ Microsoft_WindowsAzure_Storage::URL_CLOUD_TABLE,
512
+ $serviceName,
513
+ $storageKeys[0],
514
+ false,
515
+ $retryPolicy
516
+ );
517
+ }
518
+
519
+ /**
520
+ * Creates a new Microsoft_WindowsAzure_Storage_Queue instance for the current account
521
+ *
522
+ * @param string $serviceName the service name to create a storage client for.
523
+ * @param Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy Retry policy to use when making requests
524
+ * @return Microsoft_WindowsAzure_Storage_Queue
525
+ */
526
+ public function createQueueClientForService($serviceName, Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null)
527
+ {
528
+ if ($serviceName == '' || is_null($serviceName)) {
529
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
530
+ }
531
+
532
+ $storageKeys = $this->getStorageAccountKeys($serviceName);
533
+
534
+ return new Microsoft_WindowsAzure_Storage_Queue(
535
+ Microsoft_WindowsAzure_Storage::URL_CLOUD_QUEUE,
536
+ $serviceName,
537
+ $storageKeys[0],
538
+ false,
539
+ $retryPolicy
540
+ );
541
+ }
542
+
543
+ /**
544
+ * The List Storage Accounts operation lists the storage accounts available under
545
+ * the current subscription.
546
+ *
547
+ * @return array An array of Microsoft_WindowsAzure_Management_StorageServiceInstance
548
+ */
549
+ public function listStorageAccounts()
550
+ {
551
+ $response = $this->_performRequest(self::OP_STORAGE_ACCOUNTS);
552
+
553
+ if ($response->isSuccessful()) {
554
+ $result = $this->_parseResponse($response);
555
+
556
+ if (!$result->StorageService) {
557
+ return array();
558
+ }
559
+ if (count($result->StorageService) > 1) {
560
+ $xmlServices = $result->StorageService;
561
+ } else {
562
+ $xmlServices = array($result->StorageService);
563
+ }
564
+
565
+ $services = array();
566
+ if (!is_null($xmlServices)) {
567
+ for ($i = 0; $i < count($xmlServices); $i++) {
568
+ $services[] = new Microsoft_WindowsAzure_Management_StorageServiceInstance(
569
+ (string)$xmlServices[$i]->Url,
570
+ (string)$xmlServices[$i]->ServiceName
571
+ );
572
+ }
573
+ }
574
+ return $services;
575
+ } else {
576
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
577
+ }
578
+ }
579
+
580
+ /**
581
+ * The Get Storage Account Properties operation returns the system properties for the
582
+ * specified storage account. These properties include: the address, description, and
583
+ * label of the storage account; and the name of the affinity group to which the service
584
+ * belongs, or its geo-location if it is not part of an affinity group.
585
+ *
586
+ * @param string $serviceName The name of your service.
587
+ * @return Microsoft_WindowsAzure_Management_StorageServiceInstance
588
+ * @throws Microsoft_WindowsAzure_Management_Exception
589
+ */
590
+ public function getStorageAccountProperties($serviceName)
591
+ {
592
+ if ($serviceName == '' || is_null($serviceName)) {
593
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
594
+ }
595
+
596
+ $response = $this->_performRequest(self::OP_STORAGE_ACCOUNTS . '/' . $serviceName);
597
+
598
+ if ($response->isSuccessful()) {
599
+ $xmlService = $this->_parseResponse($response);
600
+
601
+ if (!is_null($xmlService)) {
602
+ return new Microsoft_WindowsAzure_Management_StorageServiceInstance(
603
+ (string)$xmlService->Url,
604
+ (string)$xmlService->ServiceName,
605
+ (string)$xmlService->StorageServiceProperties->Description,
606
+ (string)$xmlService->StorageServiceProperties->AffinityGroup,
607
+ (string)$xmlService->StorageServiceProperties->Location,
608
+ (string)$xmlService->StorageServiceProperties->Label
609
+ );
610
+ }
611
+ return null;
612
+ } else {
613
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
614
+ }
615
+ }
616
+
617
+ /**
618
+ * The Get Storage Keys operation returns the primary
619
+ * and secondary access keys for the specified storage account.
620
+ *
621
+ * @param string $serviceName The name of your service.
622
+ * @return array An array of strings
623
+ * @throws Microsoft_WindowsAzure_Management_Exception
624
+ */
625
+ public function getStorageAccountKeys($serviceName)
626
+ {
627
+ if ($serviceName == '' || is_null($serviceName)) {
628
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
629
+ }
630
+
631
+ $response = $this->_performRequest(self::OP_STORAGE_ACCOUNTS . '/' . $serviceName . '/keys');
632
+
633
+ if ($response->isSuccessful()) {
634
+ $xmlService = $this->_parseResponse($response);
635
+
636
+ if (!is_null($xmlService)) {
637
+ return array(
638
+ (string)$xmlService->StorageServiceKeys->Primary,
639
+ (string)$xmlService->StorageServiceKeys->Secondary
640
+ );
641
+ }
642
+ return array();
643
+ } else {
644
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
645
+ }
646
+ }
647
+
648
+ /**
649
+ * The Regenerate Keys operation regenerates the primary
650
+ * or secondary access key for the specified storage account.
651
+ *
652
+ * @param string $serviceName The name of your service.
653
+ * @param string $key The key to regenerate (primary or secondary)
654
+ * @return array An array of strings
655
+ * @throws Microsoft_WindowsAzure_Management_Exception
656
+ */
657
+ public function regenerateStorageAccountKey($serviceName, $key = 'primary')
658
+ {
659
+ if ($serviceName == '' || is_null($serviceName)) {
660
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
661
+ }
662
+ $key = strtolower($key);
663
+ if ($key != 'primary' && $key != 'secondary') {
664
+ throw new Microsoft_WindowsAzure_Management_Exception('Key identifier should be primary|secondary.');
665
+ }
666
+
667
+ $response = $this->_performRequest(
668
+ self::OP_STORAGE_ACCOUNTS . '/' . $serviceName . '/keys', array('action' => 'regenerate'),
669
+ Microsoft_Http_Client::POST,
670
+ array('Content-Type' => 'application/xml'),
671
+ '<?xml version="1.0" encoding="utf-8"?>
672
+ <RegenerateKeys xmlns="http://schemas.microsoft.com/windowsazure">
673
+ <KeyType>' . ucfirst($key) . '</KeyType>
674
+ </RegenerateKeys>');
675
+
676
+ if ($response->isSuccessful()) {
677
+ $xmlService = $this->_parseResponse($response);
678
+
679
+ if (!is_null($xmlService)) {
680
+ return array(
681
+ (string)$xmlService->StorageServiceKeys->Primary,
682
+ (string)$xmlService->StorageServiceKeys->Secondary
683
+ );
684
+ }
685
+ return array();
686
+ } else {
687
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
688
+ }
689
+ }
690
+
691
+ /**
692
+ * The Create Storage Account operation creates a new storage account in Windows Azure.
693
+ *
694
+ * @param string $serviceName Required. A name for the storage account that is unique to the subscription.
695
+ * @param string $label Required. A label for the storage account that is Base64-encoded. The label may be up to 100 characters in length.
696
+ * @param string $description Optional. A description for the storage account. The description may be up to 1024 characters in length.
697
+ * @param string $location Required if AffinityGroup is not specified. The location where the storage account is created.
698
+ * @param string $affinityGroup Required if Location is not specified. The name of an existing affinity group in the specified subscription.
699
+ * @return Microsoft_WindowsAzure_Management_StorageServiceInstance
700
+ * @throws Microsoft_WindowsAzure_Management_Exception
701
+ */
702
+ public function createStorageAccount($serviceName, $label, $description, $location = null, $affinityGroup = null)
703
+ {
704
+ if ($serviceName == '' || is_null($serviceName)) {
705
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
706
+ }
707
+ if ($label == '' || is_null($label)) {
708
+ throw new Microsoft_WindowsAzure_Management_Exception('Label should be specified.');
709
+ }
710
+ if (strlen($label) > 100) {
711
+ throw new Microsoft_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');
712
+ }
713
+ if ($description == '' || is_null($description)) {
714
+ throw new Microsoft_WindowsAzure_Management_Exception('Descritpion should be specified.');
715
+ }
716
+ if (strlen($description) > 1024) {
717
+ throw new Microsoft_WindowsAzure_Management_Exception('Description is too long. The maximum length is 1024 characters.');
718
+ }
719
+ if ( (is_null($location) && is_null($affinityGroup)) || (!is_null($location) && !is_null($affinityGroup)) ) {
720
+ throw new Microsoft_WindowsAzure_Management_Exception('Please specify a location -or- an affinity group for the service.');
721
+ }
722
+
723
+ $locationOrAffinityGroup = is_null($location)
724
+ ? '<AffinityGroup>' . $affinityGroup . '</AffinityGroup>'
725
+ : '<Location>' . $location . '</Location>';
726
+
727
+ $response = $this->_performRequest(self::OP_STORAGE_ACCOUNTS, array(),
728
+ Microsoft_Http_Client::POST,
729
+ array('Content-Type' => 'application/xml; charset=utf-8'),
730
+ '<CreateStorageServiceInput xmlns="http://schemas.microsoft.com/windowsazure"><ServiceName>' . $serviceName . '</ServiceName><Description>' . $serviceName . '</Description><Label>' . base64_encode($label) . '</Label>' . $locationOrAffinityGroup . '</CreateStorageServiceInput>');
731
+
732
+ if ($response->isSuccessful()) {
733
+ return new Microsoft_WindowsAzure_Management_StorageServiceInstance(
734
+ 'https://management.core.windows.net/' . $this->getSubscriptionId() . '/services/storageservices/' . $serviceName,
735
+ $serviceName,
736
+ $description,
737
+ $affinityGroup,
738
+ $location,
739
+ base64_encode($label)
740
+ );
741
+ } else {
742
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
743
+ }
744
+ }
745
+
746
+ /**
747
+ * The Update Storage Account operation updates the label and/or the description for a storage account in Windows Azure.
748
+ *
749
+ * @param string $serviceName Required. The name of the storage account to update.
750
+ * @param string $label Required. A label for the storage account that is Base64-encoded. The label may be up to 100 characters in length.
751
+ * @param string $description Optional. A description for the storage account. The description may be up to 1024 characters in length.
752
+ * @throws Microsoft_WindowsAzure_Management_Exception
753
+ */
754
+ public function updateStorageAccount($serviceName, $label, $description)
755
+ {
756
+ if ($serviceName == '' || is_null($serviceName)) {
757
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
758
+ }
759
+ if ($label == '' || is_null($label)) {
760
+ throw new Microsoft_WindowsAzure_Management_Exception('Label should be specified.');
761
+ }
762
+ if (strlen($label) > 100) {
763
+ throw new Microsoft_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');
764
+ }
765
+ if ($description == '' || is_null($description)) {
766
+ throw new Microsoft_WindowsAzure_Management_Exception('Descritpion should be specified.');
767
+ }
768
+ if (strlen($description) > 1024) {
769
+ throw new Microsoft_WindowsAzure_Management_Exception('Description is too long. The maximum length is 1024 characters.');
770
+ }
771
+
772
+ $response = $this->_performRequest(self::OP_STORAGE_ACCOUNTS . '/' . $serviceName, array(),
773
+ Microsoft_Http_Client::PUT,
774
+ array('Content-Type' => 'application/xml; charset=utf-8'),
775
+ '<UpdateStorageServiceInput xmlns="http://schemas.microsoft.com/windowsazure"><Description>' . $description . '</Description><Label>' . base64_encode($label) . '</Label></UpdateStorageServiceInput>');
776
+
777
+ if (!$response->isSuccessful()) {
778
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
779
+ }
780
+ }
781
+
782
+ /**
783
+ * The Delete Storage Account operation deletes the specified storage account from Windows Azure.
784
+ *
785
+ * @param string $serviceName Required. The name of the storage account to delete.
786
+ * @throws Microsoft_WindowsAzure_Management_Exception
787
+ */
788
+ public function deleteStorageAccount($serviceName)
789
+ {
790
+ if ($serviceName == '' || is_null($serviceName)) {
791
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
792
+ }
793
+
794
+ $response = $this->_performRequest(self::OP_STORAGE_ACCOUNTS . '/' . $serviceName, array(), Microsoft_Http_Client::DELETE);
795
+
796
+ if (!$response->isSuccessful()) {
797
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
798
+ }
799
+ }
800
+
801
+ /**
802
+ * The List Hosted Services operation lists the hosted services available
803
+ * under the current subscription.
804
+ *
805
+ * @return array An array of Microsoft_WindowsAzure_Management_HostedServiceInstance
806
+ * @throws Microsoft_WindowsAzure_Management_Exception
807
+ */
808
+ public function listHostedServices()
809
+ {
810
+ $response = $this->_performRequest(self::OP_HOSTED_SERVICES);
811
+
812
+ if ($response->isSuccessful()) {
813
+ $result = $this->_parseResponse($response);
814
+
815
+ if (!$result->HostedService) {
816
+ return array();
817
+ }
818
+ if (count($result->HostedService) > 1) {
819
+ $xmlServices = $result->HostedService;
820
+ } else {
821
+ $xmlServices = array($result->HostedService);
822
+ }
823
+
824
+ $services = array();
825
+ if (!is_null($xmlServices)) {
826
+ for ($i = 0; $i < count($xmlServices); $i++) {
827
+ $services[] = new Microsoft_WindowsAzure_Management_HostedServiceInstance(
828
+ (string)$xmlServices[$i]->Url,
829
+ (string)$xmlServices[$i]->ServiceName
830
+ );
831
+ }
832
+ }
833
+ return $services;
834
+ } else {
835
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
836
+ }
837
+ }
838
+
839
+ /**
840
+ * The Create Hosted Service operation creates a new hosted service in Windows Azure.
841
+ *
842
+ * @param string $serviceName A name for the hosted service that is unique to the subscription. This is the DNS name used for production deployments.
843
+ * @param string $label A label for the hosted service. The label may be up to 100 characters in length.
844
+ * @param string $description A description for the hosted service. The description may be up to 1024 characters in length.
845
+ * @param string $location Required if AffinityGroup is not specified. The location where the hosted service will be created.
846
+ * @param string $affinityGroup Required if Location is not specified. The name of an existing affinity group associated with this subscription.
847
+ */
848
+ public function createHostedService($serviceName, $label, $description = '', $location = null, $affinityGroup = null)
849
+ {
850
+ if ($serviceName == '' || is_null($serviceName)) {
851
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
852
+ }
853
+ if ($label == '' || is_null($label)) {
854
+ throw new Microsoft_WindowsAzure_Management_Exception('Label should be specified.');
855
+ }
856
+ if (strlen($label) > 100) {
857
+ throw new Microsoft_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');
858
+ }
859
+ if (strlen($description) > 1024) {
860
+ throw new Microsoft_WindowsAzure_Management_Exception('Description is too long. The maximum length is 1024 characters.');
861
+ }
862
+ if ( (is_null($location) && is_null($affinityGroup)) || (!is_null($location) && !is_null($affinityGroup)) ) {
863
+ throw new Microsoft_WindowsAzure_Management_Exception('Please specify a location -or- an affinity group for the service.');
864
+ }
865
+
866
+ $locationOrAffinityGroup = is_null($location)
867
+ ? '<AffinityGroup>' . $affinityGroup . '</AffinityGroup>'
868
+ : '<Location>' . $location . '</Location>';
869
+
870
+ $response = $this->_performRequest(self::OP_HOSTED_SERVICES, array(),
871
+ Microsoft_Http_Client::POST,
872
+ array('Content-Type' => 'application/xml; charset=utf-8'),
873
+ '<CreateHostedService xmlns="http://schemas.microsoft.com/windowsazure"><ServiceName>' . $serviceName . '</ServiceName><Label>' . base64_encode($label) . '</Label><Description>' . $description . '</Description>' . $locationOrAffinityGroup . '</CreateHostedService>');
874
+
875
+ if (!$response->isSuccessful()) {
876
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
877
+ }
878
+ }
879
+
880
+ /**
881
+ * The Update Hosted Service operation updates the label and/or the description for a hosted service in Windows Azure.
882
+ *
883
+ * @param string $serviceName A name for the hosted service that is unique to the subscription. This is the DNS name used for production deployments.
884
+ * @param string $label A label for the hosted service. The label may be up to 100 characters in length.
885
+ * @param string $description A description for the hosted service. The description may be up to 1024 characters in length.
886
+ */
887
+ public function updateHostedService($serviceName, $label, $description = '')
888
+ {
889
+ if ($serviceName == '' || is_null($serviceName)) {
890
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
891
+ }
892
+ if ($label == '' || is_null($label)) {
893
+ throw new Microsoft_WindowsAzure_Management_Exception('Label should be specified.');
894
+ }
895
+ if (strlen($label) > 100) {
896
+ throw new Microsoft_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');
897
+ }
898
+
899
+ $response = $this->_performRequest(self::OP_HOSTED_SERVICES . '/' . $serviceName, array(),
900
+ Microsoft_Http_Client::PUT,
901
+ array('Content-Type' => 'application/xml; charset=utf-8'),
902
+ '<UpdateHostedService xmlns="http://schemas.microsoft.com/windowsazure"><Label>' . base64_encode($label) . '</Label><Description>' . $description . '</Description></UpdateHostedService>');
903
+
904
+ if (!$response->isSuccessful()) {
905
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
906
+ }
907
+ }
908
+
909
+ /**
910
+ * The Delete Hosted Service operation deletes the specified hosted service in Windows Azure.
911
+ *
912
+ * @param string $serviceName A name for the hosted service that is unique to the subscription. This is the DNS name used for production deployments.
913
+ */
914
+ public function deleteHostedService($serviceName)
915
+ {
916
+ if ($serviceName == '' || is_null($serviceName)) {
917
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
918
+ }
919
+
920
+ $response = $this->_performRequest(self::OP_HOSTED_SERVICES . '/' . $serviceName, array(), Microsoft_Http_Client::DELETE);
921
+
922
+ if (!$response->isSuccessful()) {
923
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
924
+ }
925
+ }
926
+
927
+ /**
928
+ * The Get Hosted Service Properties operation retrieves system properties
929
+ * for the specified hosted service. These properties include the service
930
+ * name and service type; the name of the affinity group to which the service
931
+ * belongs, or its location if it is not part of an affinity group; and
932
+ * optionally, information on the service's deployments.
933
+ *
934
+ * @param string $serviceName The name of your service. This is the DNS name used for production deployments.
935
+ * @return Microsoft_WindowsAzure_Management_HostedServiceInstance
936
+ * @throws Microsoft_WindowsAzure_Management_Exception
937
+ */
938
+ public function getHostedServiceProperties($serviceName)
939
+ {
940
+ if ($serviceName == '' || is_null($serviceName)) {
941
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
942
+ }
943
+
944
+ $response = $this->_performRequest(self::OP_HOSTED_SERVICES . '/' . $serviceName, array('embed-detail' => 'true'));
945
+
946
+ if ($response->isSuccessful()) {
947
+ $xmlService = $this->_parseResponse($response);
948
+
949
+ if (!is_null($xmlService)) {
950
+ $returnValue = new Microsoft_WindowsAzure_Management_HostedServiceInstance(
951
+ (string)$xmlService->Url,
952
+ (string)$xmlService->ServiceName,
953
+ (string)$xmlService->HostedServiceProperties->Description,
954
+ (string)$xmlService->HostedServiceProperties->AffinityGroup,
955
+ (string)$xmlService->HostedServiceProperties->Location,
956
+ (string)$xmlService->HostedServiceProperties->Label
957
+ );
958
+
959
+ // Deployments
960
+ if (count($xmlService->Deployments->Deployment) > 1) {
961
+ $xmlServices = $xmlService->Deployments->Deployment;
962
+ } else {
963
+ $xmlServices = array($xmlService->Deployments->Deployment);
964
+ }
965
+
966
+ $deployments = array();
967
+ foreach ($xmlServices as $xmlDeployment) {
968
+ $deployments[] = $this->_convertXmlElementToDeploymentInstance($xmlDeployment);
969
+ }
970
+ $returnValue->Deployments = $deployments;
971
+
972
+ return $returnValue;
973
+ }
974
+ return null;
975
+ } else {
976
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
977
+ }
978
+ }
979
+
980
+ /**
981
+ * The Create Deployment operation uploads a new service package
982
+ * and creates a new deployment on staging or production.
983
+ *
984
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
985
+ * @param string $deploymentSlot The deployment slot (production or staging)
986
+ * @param string $name The name for the deployment. The deployment ID as listed on the Windows Azure management portal must be unique among other deployments for the hosted service.
987
+ * @param string $label A URL that refers to the location of the service package in the Blob service. The service package must be located in a storage account beneath the same subscription.
988
+ * @param string $packageUrl The service configuration file for the deployment.
989
+ * @param string $configuration A label for this deployment, up to 100 characters in length.
990
+ * @param boolean $startDeployment Indicates whether to start the deployment immediately after it is created.
991
+ * @param boolean $treatWarningsAsErrors Indicates whether to treat package validation warnings as errors.
992
+ * @throws Microsoft_WindowsAzure_Management_Exception
993
+ */
994
+ public function createDeployment($serviceName, $deploymentSlot, $name, $label, $packageUrl, $configuration, $startDeployment = false, $treatWarningsAsErrors = false)
995
+ {
996
+ if ($serviceName == '' || is_null($serviceName)) {
997
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
998
+ }
999
+ $deploymentSlot = strtolower($deploymentSlot);
1000
+ if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1001
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1002
+ }
1003
+ if ($name == '' || is_null($name)) {
1004
+ throw new Microsoft_WindowsAzure_Management_Exception('Name should be specified.');
1005
+ }
1006
+ if ($label == '' || is_null($label)) {
1007
+ throw new Microsoft_WindowsAzure_Management_Exception('Label should be specified.');
1008
+ }
1009
+ if (strlen($label) > 100) {
1010
+ throw new Microsoft_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');
1011
+ }
1012
+ if ($packageUrl == '' || is_null($packageUrl)) {
1013
+ throw new Microsoft_WindowsAzure_Management_Exception('Package URL should be specified.');
1014
+ }
1015
+ if ($configuration == '' || is_null($configuration)) {
1016
+ throw new Microsoft_WindowsAzure_Management_Exception('Configuration should be specified.');
1017
+ }
1018
+
1019
+ if (@file_exists($configuration)) {
1020
+ $configuration = utf8_decode(file_get_contents($configuration));
1021
+ }
1022
+
1023
+ // Clean up the configuration
1024
+ $conformingConfiguration = $this->_cleanConfiguration($configuration);
1025
+
1026
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot;
1027
+ $response = $this->_performRequest($operationUrl, array(),
1028
+ Microsoft_Http_Client::POST,
1029
+ array('Content-Type' => 'application/xml; charset=utf-8'),
1030
+ '<CreateDeployment xmlns="http://schemas.microsoft.com/windowsazure"><Name>' . $name . '</Name><PackageUrl>' . $packageUrl . '</PackageUrl><Label>' . base64_encode($label) . '</Label><Configuration>' . base64_encode($conformingConfiguration) . '</Configuration><StartDeployment>' . ($startDeployment ? 'true' : 'false') . '</StartDeployment><TreatWarningsAsError>' . ($treatWarningsAsErrors ? 'true' : 'false') . '</TreatWarningsAsError></CreateDeployment>');
1031
+
1032
+ if (!$response->isSuccessful()) {
1033
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1034
+ }
1035
+ }
1036
+
1037
+ /**
1038
+ * The Get Deployment operation returns configuration information, status,
1039
+ * and system properties for the specified deployment.
1040
+ *
1041
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1042
+ * @param string $deploymentSlot The deployment slot (production or staging)
1043
+ * @return Microsoft_WindowsAzure_Management_DeploymentInstance
1044
+ * @throws Microsoft_WindowsAzure_Management_Exception
1045
+ */
1046
+ public function getDeploymentBySlot($serviceName, $deploymentSlot)
1047
+ {
1048
+ if ($serviceName == '' || is_null($serviceName)) {
1049
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1050
+ }
1051
+ $deploymentSlot = strtolower($deploymentSlot);
1052
+ if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1053
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1054
+ }
1055
+
1056
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot;
1057
+ return $this->_getDeployment($operationUrl);
1058
+ }
1059
+
1060
+ /**
1061
+ * The Get Deployment operation returns configuration information, status,
1062
+ * and system properties for the specified deployment.
1063
+ *
1064
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1065
+ * @param string $deploymentId The deployment ID as listed on the Windows Azure management portal
1066
+ * @return Microsoft_WindowsAzure_Management_DeploymentInstance
1067
+ * @throws Microsoft_WindowsAzure_Management_Exception
1068
+ */
1069
+ public function getDeploymentByDeploymentId($serviceName, $deploymentId)
1070
+ {
1071
+ if ($serviceName == '' || is_null($serviceName)) {
1072
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1073
+ }
1074
+ if ($deploymentId == '' || is_null($deploymentId)) {
1075
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1076
+ }
1077
+
1078
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deployments/' . $deploymentId;
1079
+ return $this->_getDeployment($operationUrl);
1080
+ }
1081
+
1082
+ /**
1083
+ * The Get Role Instances by Deployment Slot operation returns an array of arrays containing role instance information
1084
+ * for each role instance associated with the deployment specified by slot (staging or production).
1085
+ *
1086
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1087
+ * @param string $deploymentSlot The deployment slot (production or staging)
1088
+ * @return Array
1089
+ * @throws Microsoft_WindowsAzure_Management_Exception
1090
+ */
1091
+ public function getRoleInstancesByDeploymentSlot($serviceName, $deploymentSlot)
1092
+ {
1093
+ if ($serviceName == '' || is_null($serviceName)) {
1094
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1095
+ }
1096
+ $deploymentSlot = strtolower($deploymentSlot);
1097
+ if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1098
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1099
+ }
1100
+
1101
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot;
1102
+ $deployment = $this->_getDeployment($operationUrl);
1103
+ return $deployment->roleInstanceList;
1104
+ }
1105
+
1106
+ /**
1107
+ * The Get Role Instances by Deployment Slot operation returns an array of arrays containing role instance information
1108
+ * for each role instance associated with the deployment specified by Id.
1109
+ *
1110
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1111
+ * @param string $deploymentId The deployment ID as listed on the Windows Azure management portal
1112
+ * @return Array
1113
+ * @throws Microsoft_WindowsAzure_Management_Exception
1114
+ */
1115
+ public function getRoleInstancesByDeploymentId($serviceName, $deploymentId)
1116
+ {
1117
+ if ($serviceName == '' || is_null($serviceName)) {
1118
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1119
+ }
1120
+ if ($deploymentId == '' || is_null($deploymentId)) {
1121
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1122
+ }
1123
+
1124
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deployments/' . $deploymentId;
1125
+ $deployment = $this->_getDeployment($operationUrl);
1126
+ return $deployment->roleInstanceList;
1127
+ }
1128
+
1129
+ /**
1130
+ * The Get Deployment operation returns configuration information, status,
1131
+ * and system properties for the specified deployment.
1132
+ *
1133
+ * @param string $operationUrl The operation url
1134
+ * @return Microsoft_WindowsAzure_Management_DeploymentInstance
1135
+ * @throws Microsoft_WindowsAzure_Management_Exception
1136
+ */
1137
+ protected function _getDeployment($operationUrl)
1138
+ {
1139
+ $response = $this->_performRequest($operationUrl);
1140
+
1141
+ if ($response->isSuccessful()) {
1142
+ $xmlService = $this->_parseResponse($response);
1143
+
1144
+ return $this->_convertXmlElementToDeploymentInstance($xmlService);
1145
+ } else {
1146
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1147
+ }
1148
+ }
1149
+
1150
+ /**
1151
+ * The Swap Deployment operation initiates a virtual IP swap between
1152
+ * the staging and production deployment environments for a service.
1153
+ * If the service is currently running in the staging environment,
1154
+ * it will be swapped to the production environment. If it is running
1155
+ * in the production environment, it will be swapped to staging.
1156
+ *
1157
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1158
+ * @param string $productionDeploymentName The name of the production deployment.
1159
+ * @param string $sourceDeploymentName The name of the source deployment.
1160
+ * @throws Microsoft_WindowsAzure_Management_Exception
1161
+ */
1162
+ public function swapDeployment($serviceName, $productionDeploymentName, $sourceDeploymentName)
1163
+ {
1164
+ if ($serviceName == '' || is_null($serviceName)) {
1165
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1166
+ }
1167
+ if ($productionDeploymentName == '' || is_null($productionDeploymentName)) {
1168
+ throw new Microsoft_WindowsAzure_Management_Exception('Production Deployment ID should be specified.');
1169
+ }
1170
+ if ($sourceDeploymentName == '' || is_null($sourceDeploymentName)) {
1171
+ throw new Microsoft_WindowsAzure_Management_Exception('Source Deployment ID should be specified.');
1172
+ }
1173
+
1174
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName;
1175
+ $response = $this->_performRequest($operationUrl, array(),
1176
+ Microsoft_Http_Client::POST,
1177
+ array('Content-Type' => 'application/xml; charset=utf-8'),
1178
+ '<Swap xmlns="http://schemas.microsoft.com/windowsazure"><Production>' . $productionDeploymentName . '</Production><SourceDeployment>' . $sourceDeploymentName . '</SourceDeployment></Swap>');
1179
+
1180
+ if (!$response->isSuccessful()) {
1181
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1182
+ }
1183
+ }
1184
+
1185
+ /**
1186
+ * The Delete Deployment operation deletes the specified deployment.
1187
+ *
1188
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1189
+ * @param string $deploymentSlot The deployment slot (production or staging)
1190
+ * @throws Microsoft_WindowsAzure_Management_Exception
1191
+ */
1192
+ public function deleteDeploymentBySlot($serviceName, $deploymentSlot)
1193
+ {
1194
+ if ($serviceName == '' || is_null($serviceName)) {
1195
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1196
+ }
1197
+ $deploymentSlot = strtolower($deploymentSlot);
1198
+ if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1199
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1200
+ }
1201
+
1202
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot;
1203
+ return $this->_deleteDeployment($operationUrl);
1204
+ }
1205
+
1206
+ /**
1207
+ * The Delete Deployment operation deletes the specified deployment.
1208
+ *
1209
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1210
+ * @param string $deploymentId The deployment ID as listed on the Windows Azure management portal
1211
+ * @throws Microsoft_WindowsAzure_Management_Exception
1212
+ */
1213
+ public function deleteDeploymentByDeploymentId($serviceName, $deploymentId)
1214
+ {
1215
+ if ($serviceName == '' || is_null($serviceName)) {
1216
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1217
+ }
1218
+ if ($deploymentId == '' || is_null($deploymentId)) {
1219
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1220
+ }
1221
+
1222
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deployments/' . $deploymentId;
1223
+ return $this->_deleteDeployment($operationUrl);
1224
+ }
1225
+
1226
+ /**
1227
+ * The Delete Deployment operation deletes the specified deployment.
1228
+ *
1229
+ * @param string $operationUrl The operation url
1230
+ * @throws Microsoft_WindowsAzure_Management_Exception
1231
+ */
1232
+ protected function _deleteDeployment($operationUrl)
1233
+ {
1234
+ $response = $this->_performRequest($operationUrl, array(), Microsoft_Http_Client::DELETE);
1235
+
1236
+ if (!$response->isSuccessful()) {
1237
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1238
+ }
1239
+ }
1240
+
1241
+ /**
1242
+ * The Update Deployment Status operation initiates a change in deployment status.
1243
+ *
1244
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1245
+ * @param string $deploymentSlot The deployment slot (production or staging)
1246
+ * @param string $status The deployment status (running|suspended)
1247
+ * @throws Microsoft_WindowsAzure_Management_Exception
1248
+ */
1249
+ public function updateDeploymentStatusBySlot($serviceName, $deploymentSlot, $status = 'running')
1250
+ {
1251
+ if ($serviceName == '' || is_null($serviceName)) {
1252
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1253
+ }
1254
+ $deploymentSlot = strtolower($deploymentSlot);
1255
+ if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1256
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1257
+ }
1258
+ $status = strtolower($status);
1259
+ if ($status != 'running' && $status != 'suspended') {
1260
+ throw new Microsoft_WindowsAzure_Management_Exception('Status should be running|suspended.');
1261
+ }
1262
+
1263
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot;
1264
+ return $this->_updateDeploymentStatus($operationUrl, $status);
1265
+ }
1266
+
1267
+ /**
1268
+ * The Update Deployment Status operation initiates a change in deployment status.
1269
+ *
1270
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1271
+ * @param string $deploymentId The deployment ID as listed on the Windows Azure management portal
1272
+ * @param string $status The deployment status (running|suspended)
1273
+ * @throws Microsoft_WindowsAzure_Management_Exception
1274
+ */
1275
+ public function updateDeploymentStatusByDeploymentId($serviceName, $deploymentId, $status = 'running')
1276
+ {
1277
+ if ($serviceName == '' || is_null($serviceName)) {
1278
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1279
+ }
1280
+ if ($deploymentId == '' || is_null($deploymentId)) {
1281
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1282
+ }
1283
+ $status = strtolower($status);
1284
+ if ($status != 'running' && $status != 'suspended') {
1285
+ throw new Microsoft_WindowsAzure_Management_Exception('Status should be running|suspended.');
1286
+ }
1287
+
1288
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deployments/' . $deploymentId;
1289
+ return $this->_updateDeploymentStatus($operationUrl, $status);
1290
+ }
1291
+
1292
+ /**
1293
+ * The Update Deployment Status operation initiates a change in deployment status.
1294
+ *
1295
+ * @param string $operationUrl The operation url
1296
+ * @param string $status The deployment status (running|suspended)
1297
+ * @throws Microsoft_WindowsAzure_Management_Exception
1298
+ */
1299
+ protected function _updateDeploymentStatus($operationUrl, $status = 'running')
1300
+ {
1301
+ $response = $this->_performRequest($operationUrl . '/', array('comp' => 'status'),
1302
+ Microsoft_Http_Client::POST,
1303
+ array('Content-Type' => 'application/xml; charset=utf-8'),
1304
+ '<UpdateDeploymentStatus xmlns="http://schemas.microsoft.com/windowsazure"><Status>' . ucfirst($status) . '</Status></UpdateDeploymentStatus>');
1305
+
1306
+ if (!$response->isSuccessful()) {
1307
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1308
+ }
1309
+ }
1310
+
1311
+ /**
1312
+ * Converts an XmlElement into a Microsoft_WindowsAzure_Management_DeploymentInstance
1313
+ *
1314
+ * @param object $xmlService The XML Element
1315
+ * @return Microsoft_WindowsAzure_Management_DeploymentInstance
1316
+ * @throws Microsoft_WindowsAzure_Management_Exception
1317
+ */
1318
+ protected function _convertXmlElementToDeploymentInstance($xmlService)
1319
+ {
1320
+ if (!is_null($xmlService)) {
1321
+ $returnValue = new Microsoft_WindowsAzure_Management_DeploymentInstance(
1322
+ (string)$xmlService->Name,
1323
+ (string)$xmlService->DeploymentSlot,
1324
+ (string)$xmlService->PrivateID,
1325
+ (string)$xmlService->Label,
1326
+ (string)$xmlService->Url,
1327
+ (string)$xmlService->Configuration,
1328
+ (string)$xmlService->Status,
1329
+ (string)$xmlService->UpgradeStatus,
1330
+ (string)$xmlService->UpgradeType,
1331
+ (string)$xmlService->CurrentUpgradeDomainState,
1332
+ (string)$xmlService->CurrentUpgradeDomain,
1333
+ (string)$xmlService->UpgradeDomainCount,
1334
+ (string)$xmlService->SdkVersion
1335
+ );
1336
+
1337
+ // Append role instances
1338
+ if ($xmlService->RoleInstanceList && $xmlService->RoleInstanceList->RoleInstance) {
1339
+ $xmlRoleInstances = $xmlService->RoleInstanceList->RoleInstance;
1340
+ if (count($xmlService->RoleInstanceList->RoleInstance) == 1) {
1341
+ $xmlRoleInstances = array($xmlService->RoleInstanceList->RoleInstance);
1342
+ }
1343
+
1344
+ $roleInstances = array();
1345
+ if (!is_null($xmlRoleInstances)) {
1346
+ for ($i = 0; $i < count($xmlRoleInstances); $i++) {
1347
+ $roleInstances[] = array(
1348
+ 'rolename' => (string)$xmlRoleInstances[$i]->RoleName,
1349
+ 'instancename' => (string)$xmlRoleInstances[$i]->InstanceName,
1350
+ 'instancestatus' => (string)$xmlRoleInstances[$i]->InstanceStatus,
1351
+ 'instanceupgradedomain' => (string)$xmlRoleInstances[$i]->InstanceUpgradeDomain,
1352
+ 'instancefaultdomain' => (string)$xmlRoleInstances[$i]->InstanceFaultDomain,
1353
+ 'instancesize' => (string)$xmlRoleInstances[$i]->InstanceSize
1354
+ );
1355
+ }
1356
+ }
1357
+
1358
+ $returnValue->RoleInstanceList = $roleInstances;
1359
+ }
1360
+
1361
+ // Append roles
1362
+ if ($xmlService->RoleList && $xmlService->RoleList->Role) {
1363
+ $xmlRoles = $xmlService->RoleList->Role;
1364
+ if (count($xmlService->RoleList->Role) == 1) {
1365
+ $xmlRoles = array($xmlService->RoleList->Role);
1366
+ }
1367
+
1368
+ $roles = array();
1369
+ if (!is_null($xmlRoles)) {
1370
+ for ($i = 0; $i < count($xmlRoles); $i++) {
1371
+ $roles[] = array(
1372
+ 'rolename' => (string)$xmlRoles[$i]->RoleName,
1373
+ 'osversion' => (!is_null($xmlRoles[$i]->OsVersion) ? (string)$xmlRoles[$i]->OsVersion : (string)$xmlRoles[$i]->OperatingSystemVersion)
1374
+ );
1375
+ }
1376
+ }
1377
+ $returnValue->RoleList = $roles;
1378
+ }
1379
+
1380
+ // Append InputEndpointList
1381
+ if ($xmlService->InputEndpointList && $xmlService->InputEndpointList->InputEndpoint) {
1382
+ $xmlInputEndpoints = $xmlService->InputEndpointList->InputEndpoint;
1383
+ if (count($xmlService->InputEndpointList->InputEndpoint) == 1) {
1384
+ $xmlInputEndpoints = array($xmlService->InputEndpointList->InputEndpoint);
1385
+ }
1386
+
1387
+ $inputEndpoints = array();
1388
+ if (!is_null($xmlInputEndpoints)) {
1389
+ for ($i = 0; $i < count($xmlInputEndpoints); $i++) {
1390
+ $inputEndpoints[] = array(
1391
+ 'rolename' => (string)$xmlInputEndpoints[$i]->RoleName,
1392
+ 'vip' => (string)$xmlInputEndpoints[$i]->Vip,
1393
+ 'port' => (string)$xmlInputEndpoints[$i]->Port
1394
+ );
1395
+ }
1396
+ }
1397
+
1398
+ $returnValue->InputEndpoints = $inputEndpoints;
1399
+ }
1400
+
1401
+ return $returnValue;
1402
+ }
1403
+ return null;
1404
+ }
1405
+
1406
+ /**
1407
+ * Updates a deployment's role instance count.
1408
+ *
1409
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1410
+ * @param string $deploymentSlot The deployment slot (production or staging)
1411
+ * @param string|array $roleName The role name
1412
+ * @param string|array $instanceCount The instance count
1413
+ * @throws Microsoft_WindowsAzure_Management_Exception
1414
+ */
1415
+ public function setInstanceCountBySlot($serviceName, $deploymentSlot, $roleName, $instanceCount) {
1416
+ if ($serviceName == '' || is_null($serviceName)) {
1417
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1418
+ }
1419
+ $deploymentSlot = strtolower($deploymentSlot);
1420
+ if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1421
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1422
+ }
1423
+ if ($roleName == '' || is_null($roleName)) {
1424
+ throw new Microsoft_WindowsAzure_Management_Exception('Role name name should be specified.');
1425
+ }
1426
+
1427
+ // Get configuration
1428
+ $deployment = $this->getDeploymentBySlot($serviceName, $deploymentSlot);
1429
+ $configuration = $deployment->Configuration;
1430
+ $configuration = $this->_updateInstanceCountInConfiguration($roleName, $instanceCount, $configuration);
1431
+
1432
+ // Update configuration
1433
+ $this->configureDeploymentBySlot($serviceName, $deploymentSlot, $configuration);
1434
+ }
1435
+
1436
+ /**
1437
+ * Updates a deployment's role instance count.
1438
+ *
1439
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1440
+ * @param string $deploymentSlot The deployment slot (production or staging)
1441
+ * @param string|array $roleName The role name
1442
+ * @param string|array $instanceCount The instance count
1443
+ * @throws Microsoft_WindowsAzure_Management_Exception
1444
+ */
1445
+ public function setInstanceCountByDeploymentId($serviceName, $deploymentId, $roleName, $instanceCount)
1446
+ {
1447
+ if ($serviceName == '' || is_null($serviceName)) {
1448
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1449
+ }
1450
+ if ($deploymentId == '' || is_null($deploymentId)) {
1451
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1452
+ }
1453
+ if ($roleName == '' || is_null($roleName)) {
1454
+ throw new Microsoft_WindowsAzure_Management_Exception('Role name name should be specified.');
1455
+ }
1456
+
1457
+ // Get configuration
1458
+ $deployment = $this->getDeploymentByDeploymentId($serviceName, $deploymentId);
1459
+ $configuration = $deployment->Configuration;
1460
+ $configuration = $this->_updateInstanceCountInConfiguration($roleName, $instanceCount, $configuration);
1461
+
1462
+ // Update configuration
1463
+ $this->configureDeploymentByDeploymentId($serviceName, $deploymentId, $configuration);
1464
+ }
1465
+
1466
+ /**
1467
+ * Updates instance count in configuration XML.
1468
+ *
1469
+ * @param string|array $roleName The role name
1470
+ * @param string|array $instanceCount The instance count
1471
+ * @param string $configuration XML configuration represented as a string
1472
+ * @throws Microsoft_WindowsAzure_Management_Exception
1473
+ */
1474
+ protected function _updateInstanceCountInConfiguration($roleName, $instanceCount, $configuration) {
1475
+ // Change variables
1476
+ if (!is_array($roleName)) {
1477
+ $roleName = array($roleName);
1478
+ }
1479
+ if (!is_array($instanceCount)) {
1480
+ $instanceCount = array($instanceCount);
1481
+ }
1482
+
1483
+ $configuration = preg_replace('/(<\?xml[^?]+?)utf-16/i', '$1utf-8', $configuration);
1484
+ //$configuration = '<?xml version="1.0">' . substr($configuration, strpos($configuration, '>') + 2);
1485
+
1486
+ $xml = simplexml_load_string($configuration);
1487
+
1488
+ // http://www.php.net/manual/en/simplexmlelement.xpath.php#97818
1489
+ $namespaces = $xml->getDocNamespaces();
1490
+ $xml->registerXPathNamespace('__empty_ns', $namespaces['']);
1491
+
1492
+ for ($i = 0; $i < count($roleName); $i++) {
1493
+ $elements = $xml->xpath('//__empty_ns:Role[@name="' . $roleName[$i] . '"]/__empty_ns:Instances');
1494
+
1495
+ if (count($elements) == 1) {
1496
+ $element = $elements[0];
1497
+ $element['count'] = $instanceCount[$i];
1498
+ }
1499
+ }
1500
+
1501
+ $configuration = $xml->asXML();
1502
+ //$configuration = preg_replace('/(<\?xml[^?]+?)utf-8/i', '$1utf-16', $configuration);
1503
+
1504
+ return $configuration;
1505
+ }
1506
+
1507
+ /**
1508
+ * The Change Deployment Configuration request may be specified as follows.
1509
+ * Note that you can change a deployment's configuration either by specifying the deployment
1510
+ * environment (staging or production), or by specifying the deployment's unique name.
1511
+ *
1512
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1513
+ * @param string $deploymentSlot The deployment slot (production or staging)
1514
+ * @param string $configuration XML configuration represented as a string
1515
+ * @throws Microsoft_WindowsAzure_Management_Exception
1516
+ */
1517
+ public function configureDeploymentBySlot($serviceName, $deploymentSlot, $configuration)
1518
+ {
1519
+ if ($serviceName == '' || is_null($serviceName)) {
1520
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1521
+ }
1522
+ $deploymentSlot = strtolower($deploymentSlot);
1523
+ if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1524
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1525
+ }
1526
+ if ($configuration == '' || is_null($configuration)) {
1527
+ throw new Microsoft_WindowsAzure_Management_Exception('Configuration name should be specified.');
1528
+ }
1529
+
1530
+ if (@file_exists($configuration)) {
1531
+ $configuration = utf8_decode(file_get_contents($configuration));
1532
+ }
1533
+
1534
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot;
1535
+ return $this->_configureDeployment($operationUrl, $configuration);
1536
+ }
1537
+
1538
+ /**
1539
+ * The Change Deployment Configuration request may be specified as follows.
1540
+ * Note that you can change a deployment's configuration either by specifying the deployment
1541
+ * environment (staging or production), or by specifying the deployment's unique name.
1542
+ *
1543
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1544
+ * @param string $deploymentId The deployment ID as listed on the Windows Azure management portal
1545
+ * @param string $configuration XML configuration represented as a string
1546
+ * @throws Microsoft_WindowsAzure_Management_Exception
1547
+ */
1548
+ public function configureDeploymentByDeploymentId($serviceName, $deploymentId, $configuration)
1549
+ {
1550
+ if ($serviceName == '' || is_null($serviceName)) {
1551
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1552
+ }
1553
+ if ($deploymentId == '' || is_null($deploymentId)) {
1554
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1555
+ }
1556
+ if ($configuration == '' || is_null($configuration)) {
1557
+ throw new Microsoft_WindowsAzure_Management_Exception('Configuration name should be specified.');
1558
+ }
1559
+
1560
+ if (@file_exists($configuration)) {
1561
+ $configuration = utf8_decode(file_get_contents($configuration));
1562
+ }
1563
+
1564
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deployments/' . $deploymentId;
1565
+ return $this->_configureDeployment($operationUrl, $configuration);
1566
+ }
1567
+
1568
+ /**
1569
+ * The Change Deployment Configuration request may be specified as follows.
1570
+ * Note that you can change a deployment's configuration either by specifying the deployment
1571
+ * environment (staging or production), or by specifying the deployment's unique name.
1572
+ *
1573
+ * @param string $operationUrl The operation url
1574
+ * @param string $configuration XML configuration represented as a string
1575
+ * @throws Microsoft_WindowsAzure_Management_Exception
1576
+ */
1577
+ protected function _configureDeployment($operationUrl, $configuration)
1578
+ {
1579
+ // Clean up the configuration
1580
+ $conformingConfiguration = $this->_cleanConfiguration($configuration);
1581
+
1582
+ $response = $this->_performRequest($operationUrl . '/', array('comp' => 'config'),
1583
+ Microsoft_Http_Client::POST,
1584
+ array('Content-Type' => 'application/xml; charset=utf-8'),
1585
+ '<ChangeConfiguration xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Configuration>' . base64_encode($conformingConfiguration) . '</Configuration></ChangeConfiguration>');
1586
+
1587
+ if (!$response->isSuccessful()) {
1588
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1589
+ }
1590
+ }
1591
+
1592
+ /**
1593
+ * The Upgrade Deployment operation initiates an upgrade.
1594
+ *
1595
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1596
+ * @param string $deploymentSlot The deployment slot (production or staging)
1597
+ * @param string $label A URL that refers to the location of the service package in the Blob service. The service package must be located in a storage account beneath the same subscription.
1598
+ * @param string $packageUrl The service configuration file for the deployment.
1599
+ * @param string $configuration A label for this deployment, up to 100 characters in length.
1600
+ * @param string $mode The type of upgrade to initiate. Possible values are Auto or Manual.
1601
+ * @param string $roleToUpgrade The name of the specific role to upgrade.
1602
+ * @throws Microsoft_WindowsAzure_Management_Exception
1603
+ */
1604
+ public function upgradeDeploymentBySlot($serviceName, $deploymentSlot, $label, $packageUrl, $configuration, $mode = 'auto', $roleToUpgrade = null)
1605
+ {
1606
+ if ($serviceName == '' || is_null($serviceName)) {
1607
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1608
+ }
1609
+ $deploymentSlot = strtolower($deploymentSlot);
1610
+ if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1611
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1612
+ }
1613
+ if ($label == '' || is_null($label)) {
1614
+ throw new Microsoft_WindowsAzure_Management_Exception('Label should be specified.');
1615
+ }
1616
+ if (strlen($label) > 100) {
1617
+ throw new Microsoft_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');
1618
+ }
1619
+ if ($packageUrl == '' || is_null($packageUrl)) {
1620
+ throw new Microsoft_WindowsAzure_Management_Exception('Package URL should be specified.');
1621
+ }
1622
+ if ($configuration == '' || is_null($configuration)) {
1623
+ throw new Microsoft_WindowsAzure_Management_Exception('Configuration should be specified.');
1624
+ }
1625
+ $mode = strtolower($mode);
1626
+ if ($mode != 'auto' && $mode != 'manual') {
1627
+ throw new Microsoft_WindowsAzure_Management_Exception('Mode should be auto|manual.');
1628
+ }
1629
+
1630
+ if (@file_exists($configuration)) {
1631
+ $configuration = utf8_decode(file_get_contents($configuration));
1632
+ }
1633
+
1634
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot;
1635
+ return $this->_upgradeDeployment($operationUrl, $label, $packageUrl, $configuration, $mode, $roleToUpgrade);
1636
+ }
1637
+
1638
+ /**
1639
+ * The Upgrade Deployment operation initiates an upgrade.
1640
+ *
1641
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1642
+ * @param string $deploymentId The deployment ID as listed on the Windows Azure management portal
1643
+ * @param string $label A URL that refers to the location of the service package in the Blob service. The service package must be located in a storage account beneath the same subscription.
1644
+ * @param string $packageUrl The service configuration file for the deployment.
1645
+ * @param string $configuration A label for this deployment, up to 100 characters in length.
1646
+ * @param string $mode The type of upgrade to initiate. Possible values are Auto or Manual.
1647
+ * @param string $roleToUpgrade The name of the specific role to upgrade.
1648
+ * @throws Microsoft_WindowsAzure_Management_Exception
1649
+ */
1650
+ public function upgradeDeploymentByDeploymentId($serviceName, $deploymentId, $label, $packageUrl, $configuration, $mode = 'auto', $roleToUpgrade = null)
1651
+ {
1652
+ if ($serviceName == '' || is_null($serviceName)) {
1653
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1654
+ }
1655
+ if ($deploymentId == '' || is_null($deploymentId)) {
1656
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1657
+ }
1658
+ if ($label == '' || is_null($label)) {
1659
+ throw new Microsoft_WindowsAzure_Management_Exception('Label should be specified.');
1660
+ }
1661
+ if (strlen($label) > 100) {
1662
+ throw new Microsoft_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');
1663
+ }
1664
+ if ($packageUrl == '' || is_null($packageUrl)) {
1665
+ throw new Microsoft_WindowsAzure_Management_Exception('Package URL should be specified.');
1666
+ }
1667
+ if ($configuration == '' || is_null($configuration)) {
1668
+ throw new Microsoft_WindowsAzure_Management_Exception('Configuration should be specified.');
1669
+ }
1670
+ $mode = strtolower($mode);
1671
+ if ($mode != 'auto' && $mode != 'manual') {
1672
+ throw new Microsoft_WindowsAzure_Management_Exception('Mode should be auto|manual.');
1673
+ }
1674
+
1675
+ if (@file_exists($configuration)) {
1676
+ $configuration = utf8_decode(file_get_contents($configuration));
1677
+ }
1678
+
1679
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deployments/' . $deploymentId;
1680
+ return $this->_upgradeDeployment($operationUrl, $label, $packageUrl, $configuration, $mode, $roleToUpgrade);
1681
+ }
1682
+
1683
+
1684
+ /**
1685
+ * The Upgrade Deployment operation initiates an upgrade.
1686
+ *
1687
+ * @param string $operationUrl The operation url
1688
+ * @param string $label A URL that refers to the location of the service package in the Blob service. The service package must be located in a storage account beneath the same subscription.
1689
+ * @param string $packageUrl The service configuration file for the deployment.
1690
+ * @param string $configuration A label for this deployment, up to 100 characters in length.
1691
+ * @param string $mode The type of upgrade to initiate. Possible values are Auto or Manual.
1692
+ * @param string $roleToUpgrade The name of the specific role to upgrade.
1693
+ * @throws Microsoft_WindowsAzure_Management_Exception
1694
+ */
1695
+ protected function _upgradeDeployment($operationUrl, $label, $packageUrl, $configuration, $mode, $roleToUpgrade)
1696
+ {
1697
+ // Clean up the configuration
1698
+ $conformingConfiguration = $this->_cleanConfiguration($configuration);
1699
+
1700
+ $response = $this->_performRequest($operationUrl . '/', array('comp' => 'upgrade'),
1701
+ Microsoft_Http_Client::POST,
1702
+ array('Content-Type' => 'application/xml; charset=utf-8'),
1703
+ '<UpgradeDeployment xmlns="http://schemas.microsoft.com/windowsazure"><Mode>' . ucfirst($mode) . '</Mode><PackageUrl>' . $packageUrl . '</PackageUrl><Configuration>' . base64_encode($conformingConfiguration) . '</Configuration><Label>' . base64_encode($label) . '</Label>' . (!is_null($roleToUpgrade) ? '<RoleToUpgrade>' . $roleToUpgrade . '</RoleToUpgrade>' : '') . '</UpgradeDeployment>');
1704
+
1705
+ if (!$response->isSuccessful()) {
1706
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1707
+ }
1708
+ }
1709
+
1710
+ /**
1711
+ * The Walk Upgrade Domain operation specifies the next upgrade domain to be walked during an in-place upgrade.
1712
+ *
1713
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1714
+ * @param string $deploymentSlot The deployment slot (production or staging)
1715
+ * @param int $upgradeDomain An integer value that identifies the upgrade domain to walk. Upgrade domains are identified with a zero-based index: the first upgrade domain has an ID of 0, the second has an ID of 1, and so on.
1716
+ * @throws Microsoft_WindowsAzure_Management_Exception
1717
+ */
1718
+ public function walkUpgradeDomainBySlot($serviceName, $deploymentSlot, $upgradeDomain = 0)
1719
+ {
1720
+ if ($serviceName == '' || is_null($serviceName)) {
1721
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1722
+ }
1723
+ $deploymentSlot = strtolower($deploymentSlot);
1724
+ if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1725
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1726
+ }
1727
+
1728
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot;
1729
+ return $this->_walkUpgradeDomain($operationUrl, $upgradeDomain);
1730
+ }
1731
+
1732
+ /**
1733
+ * The Walk Upgrade Domain operation specifies the next upgrade domain to be walked during an in-place upgrade.
1734
+ *
1735
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1736
+ * @param string $deploymentId The deployment ID as listed on the Windows Azure management portal
1737
+ * @param int $upgradeDomain An integer value that identifies the upgrade domain to walk. Upgrade domains are identified with a zero-based index: the first upgrade domain has an ID of 0, the second has an ID of 1, and so on.
1738
+ * @throws Microsoft_WindowsAzure_Management_Exception
1739
+ */
1740
+ public function walkUpgradeDomainByDeploymentId($serviceName, $deploymentId, $upgradeDomain = 0)
1741
+ {
1742
+ if ($serviceName == '' || is_null($serviceName)) {
1743
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1744
+ }
1745
+ if ($deploymentId == '' || is_null($deploymentId)) {
1746
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1747
+ }
1748
+
1749
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deployments/' . $deploymentId;
1750
+ return $this->_walkUpgradeDomain($operationUrl, $upgradeDomain);
1751
+ }
1752
+
1753
+
1754
+ /**
1755
+ * The Walk Upgrade Domain operation specifies the next upgrade domain to be walked during an in-place upgrade.
1756
+ *
1757
+ * @param string $operationUrl The operation url
1758
+ * @param int $upgradeDomain An integer value that identifies the upgrade domain to walk. Upgrade domains are identified with a zero-based index: the first upgrade domain has an ID of 0, the second has an ID of 1, and so on.
1759
+ * @throws Microsoft_WindowsAzure_Management_Exception
1760
+ */
1761
+ protected function _walkUpgradeDomain($operationUrl, $upgradeDomain = 0)
1762
+ {
1763
+ $response = $this->_performRequest($operationUrl . '/', array('comp' => 'walkupgradedomain'),
1764
+ Microsoft_Http_Client::POST,
1765
+ array('Content-Type' => 'application/xml; charset=utf-8'),
1766
+ '<WalkUpgradeDomain xmlns="http://schemas.microsoft.com/windowsazure"><UpgradeDomain>' . $upgradeDomain . '</UpgradeDomain></WalkUpgradeDomain>');
1767
+
1768
+ if (!$response->isSuccessful()) {
1769
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1770
+ }
1771
+ }
1772
+
1773
+ /**
1774
+ * The Reboot Role Instance operation requests a reboot of a role instance
1775
+ * that is running in a deployment.
1776
+ *
1777
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1778
+ * @param string $deploymentSlot The deployment slot (production or staging)
1779
+ * @param string $roleInstanceName The role instance name
1780
+ * @throws Microsoft_WindowsAzure_Management_Exception
1781
+ */
1782
+ public function rebootRoleInstanceBySlot($serviceName, $deploymentSlot, $roleInstanceName)
1783
+ {
1784
+ if ($serviceName == '' || is_null($serviceName)) {
1785
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1786
+ }
1787
+ $deploymentSlot = strtolower($deploymentSlot);
1788
+ if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1789
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1790
+ }
1791
+ if ($roleInstanceName == '' || is_null($roleInstanceName)) {
1792
+ throw new Microsoft_WindowsAzure_Management_Exception('Role instance name should be specified.');
1793
+ }
1794
+
1795
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot . '/roleinstances/' . $roleInstanceName;
1796
+ return $this->_rebootOrReimageRoleInstance($operationUrl, 'reboot');
1797
+ }
1798
+
1799
+ /**
1800
+ * The Reboot Role Instance operation requests a reboot of a role instance
1801
+ * that is running in a deployment.
1802
+ *
1803
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1804
+ * @param string $deploymentId The deployment ID as listed on the Windows Azure management portal
1805
+ * @param string $roleInstanceName The role instance name
1806
+ * @throws Microsoft_WindowsAzure_Management_Exception
1807
+ */
1808
+ public function rebootRoleInstanceByDeploymentId($serviceName, $deploymentId, $roleInstanceName)
1809
+ {
1810
+ if ($serviceName == '' || is_null($serviceName)) {
1811
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1812
+ }
1813
+ if ($deploymentId == '' || is_null($deploymentId)) {
1814
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1815
+ }
1816
+ if ($roleInstanceName == '' || is_null($roleInstanceName)) {
1817
+ throw new Microsoft_WindowsAzure_Management_Exception('Role instance name should be specified.');
1818
+ }
1819
+
1820
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deployments/' . $deploymentId . '/roleinstances/' . $roleInstanceName;
1821
+ return $this->_rebootOrReimageRoleInstance($operationUrl, 'reboot');
1822
+ }
1823
+
1824
+ /**
1825
+ * The Reimage Role Instance operation requests a reimage of a role instance
1826
+ * that is running in a deployment.
1827
+ *
1828
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1829
+ * @param string $deploymentSlot The deployment slot (production or staging)
1830
+ * @param string $roleInstanceName The role instance name
1831
+ * @throws Microsoft_WindowsAzure_Management_Exception
1832
+ */
1833
+ public function reimageRoleInstanceBySlot($serviceName, $deploymentSlot, $roleInstanceName)
1834
+ {
1835
+ if ($serviceName == '' || is_null($serviceName)) {
1836
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1837
+ }
1838
+ $deploymentSlot = strtolower($deploymentSlot);
1839
+ if ($deploymentSlot != 'production' && $deploymentSlot != 'staging') {
1840
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment slot should be production|staging.');
1841
+ }
1842
+ if ($roleInstanceName == '' || is_null($roleInstanceName)) {
1843
+ throw new Microsoft_WindowsAzure_Management_Exception('Role instance name should be specified.');
1844
+ }
1845
+
1846
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deploymentslots/' . $deploymentSlot . '/roleinstances/' . $roleInstanceName;
1847
+ return $this->_rebootOrReimageRoleInstance($operationUrl, 'reimage');
1848
+ }
1849
+
1850
+ /**
1851
+ * The Reimage Role Instance operation requests a reimage of a role instance
1852
+ * that is running in a deployment.
1853
+ *
1854
+ * @param string $serviceName The service name. This is the DNS name used for production deployments.
1855
+ * @param string $deploymentId The deployment ID as listed on the Windows Azure management portal
1856
+ * @param string $roleInstanceName The role instance name
1857
+ * @throws Microsoft_WindowsAzure_Management_Exception
1858
+ */
1859
+ public function reimageRoleInstanceByDeploymentId($serviceName, $deploymentId, $roleInstanceName)
1860
+ {
1861
+ if ($serviceName == '' || is_null($serviceName)) {
1862
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1863
+ }
1864
+ if ($deploymentId == '' || is_null($deploymentId)) {
1865
+ throw new Microsoft_WindowsAzure_Management_Exception('Deployment ID should be specified.');
1866
+ }
1867
+ if ($roleInstanceName == '' || is_null($roleInstanceName)) {
1868
+ throw new Microsoft_WindowsAzure_Management_Exception('Role instance name should be specified.');
1869
+ }
1870
+
1871
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/deployments/' . $deploymentId . '/roleinstances/' . $roleInstanceName;
1872
+ return $this->_rebootOrReimageRoleInstance($operationUrl, 'reimage');
1873
+ }
1874
+
1875
+ /**
1876
+ * Reboots or reimages a role instance.
1877
+ *
1878
+ * @param string $operationUrl The operation url
1879
+ * @param string $operation The operation (reboot|reimage)
1880
+ * @throws Microsoft_WindowsAzure_Management_Exception
1881
+ */
1882
+ protected function _rebootOrReimageRoleInstance($operationUrl, $operation = 'reboot')
1883
+ {
1884
+ $response = $this->_performRequest($operationUrl, array('comp' => $operation), Microsoft_Http_Client::POST);
1885
+
1886
+ if (!$response->isSuccessful()) {
1887
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1888
+ }
1889
+ }
1890
+
1891
+ /**
1892
+ * The List Certificates operation lists all certificates associated with
1893
+ * the specified hosted service.
1894
+ *
1895
+ * @param string $serviceName The service name
1896
+ * @return array Array of Microsoft_WindowsAzure_Management_CertificateInstance
1897
+ * @throws Microsoft_WindowsAzure_Management_Exception
1898
+ */
1899
+ public function listCertificates($serviceName)
1900
+ {
1901
+ if ($serviceName == '' || is_null($serviceName)) {
1902
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1903
+ }
1904
+
1905
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/certificates';
1906
+ $response = $this->_performRequest($operationUrl);
1907
+
1908
+ if ($response->isSuccessful()) {
1909
+ $result = $this->_parseResponse($response);
1910
+
1911
+ if (!$result->Certificate) {
1912
+ return array();
1913
+ }
1914
+ if (count($result->Certificate) > 1) {
1915
+ $xmlServices = $result->Certificate;
1916
+ } else {
1917
+ $xmlServices = array($result->Certificate);
1918
+ }
1919
+
1920
+ $services = array();
1921
+ if (!is_null($xmlServices)) {
1922
+ for ($i = 0; $i < count($xmlServices); $i++) {
1923
+ $services[] = new Microsoft_WindowsAzure_Management_CertificateInstance(
1924
+ (string)$xmlServices[$i]->CertificateUrl,
1925
+ (string)$xmlServices[$i]->Thumbprint,
1926
+ (string)$xmlServices[$i]->ThumbprintAlgorithm,
1927
+ (string)$xmlServices[$i]->Data
1928
+ );
1929
+ }
1930
+ }
1931
+ return $services;
1932
+ } else {
1933
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1934
+ }
1935
+ }
1936
+
1937
+ /**
1938
+ * The Get Certificate operation returns the public data for the specified certificate.
1939
+ *
1940
+ * @param string $serviceName|$certificateUrl The service name -or- the certificate URL
1941
+ * @param string $algorithm Algorithm
1942
+ * @param string $thumbprint Thumbprint
1943
+ * @return Microsoft_WindowsAzure_Management_CertificateInstance
1944
+ * @throws Microsoft_WindowsAzure_Management_Exception
1945
+ */
1946
+ public function getCertificate($serviceName, $algorithm = '', $thumbprint = '')
1947
+ {
1948
+ if ($serviceName == '' || is_null($serviceName)) {
1949
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name or certificate URL should be specified.');
1950
+ }
1951
+ if (strpos($serviceName, 'https') === false && ($algorithm == '' || is_null($algorithm)) && ($thumbprint == '' || is_null($thumbprint))) {
1952
+ throw new Microsoft_WindowsAzure_Management_Exception('Algorithm and thumbprint should be specified.');
1953
+ }
1954
+
1955
+ $operationUrl = str_replace($this->getBaseUrl(), '', $serviceName);
1956
+ if (strpos($serviceName, 'https') === false) {
1957
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/certificates/' . $algorithm . '-' . strtoupper($thumbprint);
1958
+ }
1959
+
1960
+ $response = $this->_performRequest($operationUrl);
1961
+
1962
+ if ($response->isSuccessful()) {
1963
+ $result = $this->_parseResponse($response);
1964
+
1965
+ return new Microsoft_WindowsAzure_Management_CertificateInstance(
1966
+ $this->getBaseUrl() . $operationUrl,
1967
+ $thumbprint,
1968
+ $algorithm,
1969
+ (string)$result->Data
1970
+ );
1971
+ } else {
1972
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1973
+ }
1974
+ }
1975
+
1976
+ /**
1977
+ * The Add Certificate operation adds a certificate to the subscription.
1978
+ *
1979
+ * @param string $serviceName The service name
1980
+ * @param string $certificateData Certificate data
1981
+ * @param string $certificatePassword The certificate password
1982
+ * @param string $certificateFormat The certificate format. Currently, only 'pfx' is supported.
1983
+ * @throws Microsoft_WindowsAzure_Management_Exception
1984
+ */
1985
+ public function addCertificate($serviceName, $certificateData, $certificatePassword, $certificateFormat = 'pfx')
1986
+ {
1987
+ if ($serviceName == '' || is_null($serviceName)) {
1988
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name should be specified.');
1989
+ }
1990
+ if ($certificateData == '' || is_null($certificateData)) {
1991
+ throw new Microsoft_WindowsAzure_Management_Exception('Certificate data should be specified.');
1992
+ }
1993
+ if ($certificatePassword == '' || is_null($certificatePassword)) {
1994
+ throw new Microsoft_WindowsAzure_Management_Exception('Certificate password should be specified.');
1995
+ }
1996
+ if ($certificateFormat != 'pfx') {
1997
+ throw new Microsoft_WindowsAzure_Management_Exception('Certificate format should be "pfx".');
1998
+ }
1999
+
2000
+ if (@file_exists($certificateData)) {
2001
+ $certificateData = file_get_contents($certificateData);
2002
+ }
2003
+
2004
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/certificates';
2005
+ $response = $this->_performRequest($operationUrl, array(),
2006
+ Microsoft_Http_Client::POST,
2007
+ array('Content-Type' => 'application/xml; charset=utf-8'),
2008
+ '<CertificateFile xmlns="http://schemas.microsoft.com/windowsazure"><Data>' . base64_encode($certificateData) . '</Data><CertificateFormat>' . $certificateFormat . '</CertificateFormat><Password>' . $certificatePassword . '</Password></CertificateFile>');
2009
+
2010
+ if (!$response->isSuccessful()) {
2011
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2012
+ }
2013
+ }
2014
+
2015
+ /**
2016
+ * The Delete Certificate operation deletes a certificate from the subscription's certificate store.
2017
+ *
2018
+ * @param string $serviceName|$certificateUrl The service name -or- the certificate URL
2019
+ * @param string $algorithm Algorithm
2020
+ * @param string $thumbprint Thumbprint
2021
+ * @throws Microsoft_WindowsAzure_Management_Exception
2022
+ */
2023
+ public function deleteCertificate($serviceName, $algorithm = '', $thumbprint = '')
2024
+ {
2025
+ if ($serviceName == '' || is_null($serviceName)) {
2026
+ throw new Microsoft_WindowsAzure_Management_Exception('Service name or certificate URL should be specified.');
2027
+ }
2028
+ if (strpos($serviceName, 'https') === false && ($algorithm == '' || is_null($algorithm)) && ($thumbprint == '' || is_null($thumbprint))) {
2029
+ throw new Microsoft_WindowsAzure_Management_Exception('Algorithm and thumbprint should be specified.');
2030
+ }
2031
+
2032
+ $operationUrl = str_replace($this->getBaseUrl(), '', $serviceName);
2033
+ if (strpos($serviceName, 'https') === false) {
2034
+ $operationUrl = self::OP_HOSTED_SERVICES . '/' . $serviceName . '/certificates/' . $algorithm . '-' . strtoupper($thumbprint);
2035
+ }
2036
+
2037
+ $response = $this->_performRequest($operationUrl, array(), Microsoft_Http_Client::DELETE);
2038
+
2039
+ if (!$response->isSuccessful()) {
2040
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2041
+ }
2042
+ }
2043
+
2044
+ /**
2045
+ * The List Affinity Groups operation lists the affinity groups associated with
2046
+ * the specified subscription.
2047
+ *
2048
+ * @return array Array of Microsoft_WindowsAzure_Management_AffinityGroupInstance
2049
+ * @throws Microsoft_WindowsAzure_Management_Exception
2050
+ */
2051
+ public function listAffinityGroups()
2052
+ {
2053
+ $response = $this->_performRequest(self::OP_AFFINITYGROUPS);
2054
+
2055
+ if ($response->isSuccessful()) {
2056
+ $result = $this->_parseResponse($response);
2057
+
2058
+ if (!$result->AffinityGroup) {
2059
+ return array();
2060
+ }
2061
+ if (count($result->AffinityGroup) > 1) {
2062
+ $xmlServices = $result->AffinityGroup;
2063
+ } else {
2064
+ $xmlServices = array($result->AffinityGroup);
2065
+ }
2066
+
2067
+ $services = array();
2068
+ if (!is_null($xmlServices)) {
2069
+ for ($i = 0; $i < count($xmlServices); $i++) {
2070
+ $services[] = new Microsoft_WindowsAzure_Management_AffinityGroupInstance(
2071
+ (string)$xmlServices[$i]->Name,
2072
+ (string)$xmlServices[$i]->Label,
2073
+ (string)$xmlServices[$i]->Description,
2074
+ (string)$xmlServices[$i]->Location
2075
+ );
2076
+ }
2077
+ }
2078
+ return $services;
2079
+ } else {
2080
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2081
+ }
2082
+ }
2083
+
2084
+ /**
2085
+ * The Create Affinity Group operation creates a new affinity group for the specified subscription.
2086
+ *
2087
+ * @param string $name A name for the affinity group that is unique to the subscription.
2088
+ * @param string $label A label for the affinity group. The label may be up to 100 characters in length.
2089
+ * @param string $description A description for the affinity group. The description may be up to 1024 characters in length.
2090
+ * @param string $location The location where the affinity group will be created. To list available locations, use the List Locations operation.
2091
+ */
2092
+ public function createAffinityGroup($name, $label, $description = '', $location = '')
2093
+ {
2094
+ if ($name == '' || is_null($name)) {
2095
+ throw new Microsoft_WindowsAzure_Management_Exception('Affinity group name should be specified.');
2096
+ }
2097
+ if ($label == '' || is_null($label)) {
2098
+ throw new Microsoft_WindowsAzure_Management_Exception('Label should be specified.');
2099
+ }
2100
+ if (strlen($label) > 100) {
2101
+ throw new Microsoft_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');
2102
+ }
2103
+ if (strlen($description) > 1024) {
2104
+ throw new Microsoft_WindowsAzure_Management_Exception('Description is too long. The maximum length is 1024 characters.');
2105
+ }
2106
+ if ($location == '' || is_null($location)) {
2107
+ throw new Microsoft_WindowsAzure_Management_Exception('Location should be specified.');
2108
+ }
2109
+
2110
+ $response = $this->_performRequest(self::OP_AFFINITYGROUPS, array(),
2111
+ Microsoft_Http_Client::POST,
2112
+ array('Content-Type' => 'application/xml; charset=utf-8'),
2113
+ '<CreateAffinityGroup xmlns="http://schemas.microsoft.com/windowsazure"><Name>' . $name . '</Name><Label>' . base64_encode($label) . '</Label><Description>' . $description . '</Description><Location>' . $location . '</Location></CreateAffinityGroup>');
2114
+
2115
+ if (!$response->isSuccessful()) {
2116
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2117
+ }
2118
+ }
2119
+
2120
+ /**
2121
+ * The Update Affinity Group operation updates the label and/or the description for an affinity group for the specified subscription.
2122
+ *
2123
+ * @param string $name The name for the affinity group that should be updated.
2124
+ * @param string $label A label for the affinity group. The label may be up to 100 characters in length.
2125
+ * @param string $description A description for the affinity group. The description may be up to 1024 characters in length.
2126
+ */
2127
+ public function updateAffinityGroup($name, $label, $description = '')
2128
+ {
2129
+ if ($name == '' || is_null($name)) {
2130
+ throw new Microsoft_WindowsAzure_Management_Exception('Affinity group name should be specified.');
2131
+ }
2132
+ if ($label == '' || is_null($label)) {
2133
+ throw new Microsoft_WindowsAzure_Management_Exception('Label should be specified.');
2134
+ }
2135
+ if (strlen($label) > 100) {
2136
+ throw new Microsoft_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');
2137
+ }
2138
+ if (strlen($description) > 1024) {
2139
+ throw new Microsoft_WindowsAzure_Management_Exception('Description is too long. The maximum length is 1024 characters.');
2140
+ }
2141
+
2142
+ $response = $this->_performRequest(self::OP_AFFINITYGROUPS . '/' . $name, array(),
2143
+ Microsoft_Http_Client::PUT,
2144
+ array('Content-Type' => 'application/xml; charset=utf-8'),
2145
+ '<UpdateAffinityGroup xmlns="http://schemas.microsoft.com/windowsazure"><Label>' . base64_encode($label) . '</Label><Description>' . $description . '</Description></UpdateAffinityGroup>');
2146
+
2147
+ if (!$response->isSuccessful()) {
2148
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2149
+ }
2150
+ }
2151
+
2152
+ /**
2153
+ * The Delete Affinity Group operation deletes an affinity group in the specified subscription.
2154
+ *
2155
+ * @param string $name The name for the affinity group that should be deleted.
2156
+ */
2157
+ public function deleteAffinityGroup($name)
2158
+ {
2159
+ if ($name == '' || is_null($name)) {
2160
+ throw new Microsoft_WindowsAzure_Management_Exception('Affinity group name should be specified.');
2161
+ }
2162
+
2163
+ $response = $this->_performRequest(self::OP_AFFINITYGROUPS . '/' . $name, array(),
2164
+ Microsoft_Http_Client::DELETE);
2165
+
2166
+ if (!$response->isSuccessful()) {
2167
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2168
+ }
2169
+ }
2170
+
2171
+ /**
2172
+ * The Get Affinity Group Properties operation returns the
2173
+ * system properties associated with the specified affinity group.
2174
+ *
2175
+ * @param string $affinityGroupName The affinity group name.
2176
+ * @return Microsoft_WindowsAzure_Management_AffinityGroupInstance
2177
+ * @throws Microsoft_WindowsAzure_Management_Exception
2178
+ */
2179
+ public function getAffinityGroupProperties($affinityGroupName)
2180
+ {
2181
+ if ($affinityGroupName == '' || is_null($affinityGroupName)) {
2182
+ throw new Microsoft_WindowsAzure_Management_Exception('Affinity group name should be specified.');
2183
+ }
2184
+
2185
+ $response = $this->_performRequest(self::OP_AFFINITYGROUPS . '/' . $affinityGroupName);
2186
+
2187
+ if ($response->isSuccessful()) {
2188
+ $result = $this->_parseResponse($response);
2189
+
2190
+ $affinityGroup = new Microsoft_WindowsAzure_Management_AffinityGroupInstance(
2191
+ $affinityGroupName,
2192
+ (string)$result->Label,
2193
+ (string)$result->Description,
2194
+ (string)$result->Location
2195
+ );
2196
+
2197
+ // Hosted services
2198
+ if (count($result->HostedServices->HostedService) > 1) {
2199
+ $xmlService = $result->HostedServices->HostedService;
2200
+ } else {
2201
+ $xmlService = array($result->HostedServices->HostedService);
2202
+ }
2203
+
2204
+ $services = array();
2205
+ if (!is_null($xmlService)) {
2206
+ for ($i = 0; $i < count($xmlService); $i++) {
2207
+ $services[] = array(
2208
+ 'url' => (string)$xmlService[$i]->Url,
2209
+ 'name' => (string)$xmlService[$i]->ServiceName
2210
+ );
2211
+ }
2212
+ }
2213
+ $affinityGroup->HostedServices = $services;
2214
+
2215
+ // Storage services
2216
+ if (count($result->StorageServices->StorageService) > 1) {
2217
+ $xmlService = $result->StorageServices->StorageService;
2218
+ } else {
2219
+ $xmlService = array($result->StorageServices->StorageService);
2220
+ }
2221
+
2222
+ $services = array();
2223
+ if (!is_null($xmlService)) {
2224
+ for ($i = 0; $i < count($xmlService); $i++) {
2225
+ $services[] = array(
2226
+ 'url' => (string)$xmlService[$i]->Url,
2227
+ 'name' => (string)$xmlService[$i]->ServiceName
2228
+ );
2229
+ }
2230
+ }
2231
+ $affinityGroup->StorageServices = $services;
2232
+
2233
+ return $affinityGroup;
2234
+ } else {
2235
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2236
+ }
2237
+ }
2238
+
2239
+ /**
2240
+ * The List Locations operation lists all of the data center locations
2241
+ * that are valid for your subscription.
2242
+ *
2243
+ * @return array Array of Microsoft_WindowsAzure_Management_LocationInstance
2244
+ * @throws Microsoft_WindowsAzure_Management_Exception
2245
+ */
2246
+ public function listLocations()
2247
+ {
2248
+ $response = $this->_performRequest(self::OP_LOCATIONS);
2249
+
2250
+ if ($response->isSuccessful()) {
2251
+ $result = $this->_parseResponse($response);
2252
+
2253
+ if (!$result->Location) {
2254
+ return array();
2255
+ }
2256
+ if (count($result->Location) > 1) {
2257
+ $xmlServices = $result->Location;
2258
+ } else {
2259
+ $xmlServices = array($result->Location);
2260
+ }
2261
+
2262
+ $services = array();
2263
+ if (!is_null($xmlServices)) {
2264
+ for ($i = 0; $i < count($xmlServices); $i++) {
2265
+ $services[] = new Microsoft_WindowsAzure_Management_LocationInstance(
2266
+ (string)$xmlServices[$i]->Name
2267
+ );
2268
+ }
2269
+ }
2270
+ return $services;
2271
+ } else {
2272
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2273
+ }
2274
+ }
2275
+
2276
+ /**
2277
+ * The List Operating Systems operation lists the versions of the guest operating system
2278
+ * that are currently available in Windows Azure. The 2010-10-28 version of List Operating
2279
+ * Systems also indicates what family an operating system version belongs to.
2280
+ * Currently Windows Azure supports two operating system families: the Windows Azure guest
2281
+ * operating system that is substantially compatible with Windows Server 2008 SP2,
2282
+ * and the Windows Azure guest operating system that is substantially compatible with
2283
+ * Windows Server 2008 R2.
2284
+ *
2285
+ * @return array Array of Microsoft_WindowsAzure_Management_OperatingSystemInstance
2286
+ * @throws Microsoft_WindowsAzure_Management_Exception
2287
+ */
2288
+ public function listOperatingSystems()
2289
+ {
2290
+ $response = $this->_performRequest(self::OP_OPERATINGSYSTEMS);
2291
+
2292
+ if ($response->isSuccessful()) {
2293
+ $result = $this->_parseResponse($response);
2294
+
2295
+ if (!$result->OperatingSystem) {
2296
+ return array();
2297
+ }
2298
+ if (count($result->OperatingSystem) > 1) {
2299
+ $xmlServices = $result->OperatingSystem;
2300
+ } else {
2301
+ $xmlServices = array($result->OperatingSystem);
2302
+ }
2303
+
2304
+ $services = array();
2305
+ if (!is_null($xmlServices)) {
2306
+ for ($i = 0; $i < count($xmlServices); $i++) {
2307
+ $services[] = new Microsoft_WindowsAzure_Management_OperatingSystemInstance(
2308
+ (string)$xmlServices[$i]->Version,
2309
+ (string)$xmlServices[$i]->Label,
2310
+ ((string)$xmlServices[$i]->IsDefault == 'true'),
2311
+ ((string)$xmlServices[$i]->IsActive == 'true'),
2312
+ (string)$xmlServices[$i]->Family,
2313
+ (string)$xmlServices[$i]->FamilyLabel
2314
+ );
2315
+ }
2316
+ }
2317
+ return $services;
2318
+ } else {
2319
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2320
+ }
2321
+ }
2322
+
2323
+ /**
2324
+ * The List OS Families operation lists the guest operating system families
2325
+ * available in Windows Azure, and also lists the operating system versions
2326
+ * available for each family. Currently Windows Azure supports two operating
2327
+ * system families: the Windows Azure guest operating system that is
2328
+ * substantially compatible with Windows Server 2008 SP2, and the Windows
2329
+ * Azure guest operating system that is substantially compatible with
2330
+ * Windows Server 2008 R2.
2331
+ *
2332
+ * @return array Array of Microsoft_WindowsAzure_Management_OperatingSystemFamilyInstance
2333
+ * @throws Microsoft_WindowsAzure_Management_Exception
2334
+ */
2335
+ public function listOperatingSystemFamilies()
2336
+ {
2337
+ $response = $this->_performRequest(self::OP_OPERATINGSYSTEMFAMILIES);
2338
+
2339
+ if ($response->isSuccessful()) {
2340
+ $result = $this->_parseResponse($response);
2341
+
2342
+ if (!$result->OperatingSystemFamily) {
2343
+ return array();
2344
+ }
2345
+ if (count($result->OperatingSystemFamily) > 1) {
2346
+ $xmlServices = $result->OperatingSystemFamily;
2347
+ } else {
2348
+ $xmlServices = array($result->OperatingSystemFamily);
2349
+ }
2350
+
2351
+ $services = array();
2352
+ if (!is_null($xmlServices)) {
2353
+ for ($i = 0; $i < count($xmlServices); $i++) {
2354
+ $services[] = new Microsoft_WindowsAzure_Management_OperatingSystemFamilyInstance(
2355
+ (string)$xmlServices[$i]->Name,
2356
+ (string)$xmlServices[$i]->Label
2357
+ );
2358
+
2359
+ if (count($xmlServices[$i]->OperatingSystems->OperatingSystem) > 1) {
2360
+ $xmlOperatingSystems = $xmlServices[$i]->OperatingSystems->OperatingSystem;
2361
+ } else {
2362
+ $xmlOperatingSystems = array($xmlServices[$i]->OperatingSystems->OperatingSystem);
2363
+ }
2364
+
2365
+ $operatingSystems = array();
2366
+ if (!is_null($xmlOperatingSystems)) {
2367
+ for ($i = 0; $i < count($xmlOperatingSystems); $i++) {
2368
+ $operatingSystems[] = new Microsoft_WindowsAzure_Management_OperatingSystemInstance(
2369
+ (string)$xmlOperatingSystems[$i]->Version,
2370
+ (string)$xmlOperatingSystems[$i]->Label,
2371
+ ((string)$xmlOperatingSystems[$i]->IsDefault == 'true'),
2372
+ ((string)$xmlOperatingSystems[$i]->IsActive == 'true'),
2373
+ (string)$xmlServices[$i]->Name,
2374
+ (string)$xmlServices[$i]->Label
2375
+ );
2376
+ }
2377
+ }
2378
+ $services[ count($services) - 1 ]->OperatingSystems = $operatingSystems;
2379
+ }
2380
+ }
2381
+ return $services;
2382
+ } else {
2383
+ throw new Microsoft_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
2384
+ }
2385
+ }
2386
+
2387
+ /**
2388
+ * Clean configuration
2389
+ *
2390
+ * @param string $configuration Configuration to clean.
2391
+ * @return string
2392
+ */
2393
+ public function _cleanConfiguration($configuration) {
2394
+ $configuration = str_replace('?<?', '<?', $configuration);
2395
+ $configuration = str_replace("\r", "", $configuration);
2396
+ $configuration = str_replace("\n", "", $configuration);
2397
+
2398
+ return $configuration;
2399
+ }
2400
+ }
libs/Microsoft/WindowsAzure/Management/DeploymentInstance.php CHANGED
@@ -1,109 +1,109 @@
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
- * @subpackage Management
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Management
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property string $Name The name for the deployment. This name must be unique among other deployments for the specified hosted service.
49
- * @property string $DeploymentSlot The environment to which the hosted service is deployed, either staging or production.
50
- * @property string $PrivateID The unique identifier for this deployment.
51
- * @property string $Label The label for the deployment.
52
- * @property string $Url The URL for the deployment.
53
- * @property string $Configuration The configuration file (XML, represented as string).
54
- * @property string $Status The status of the deployment. Running, Suspended, RunningTransitioning, SuspendedTransitioning, Starting, Suspending, Deploying, Deleting.
55
- * @property string $UpgradeStatus Parent node for elements describing an upgrade that is currently underway.
56
- * @property string $UpgradeType The upgrade type designated for this deployment. Possible values are Auto and Manual.
57
- * @property string $CurrentUpgradeDomainState The state of the current upgrade domain. Possible values are Before and During.
58
- * @property string $CurrentUpgradeDomain An integer value that identifies the current upgrade domain. Upgrade domains are identified with a zero-based index: the first upgrade domain has an ID of 0, the second has an ID of 1, and so on.
59
- * @property string $UpgradeDomainCount An integer value that indicates the number of upgrade domains in the deployment.
60
- * @property string $sdkVersion Version of SDK used to create the deployment
61
- * @property array $RoleInstanceList The list of role instances.
62
- * @property array $RoleList The list of roles.
63
- * @property array $InputEndpoints The list of input endpoints.
64
- */
65
- class Microsoft_WindowsAzure_Management_DeploymentInstance
66
- extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
67
- {
68
- /**
69
- * Constructor
70
- *
71
- * @param string $name The name for the deployment. This name must be unique among other deployments for the specified hosted service.
72
- * @param string $deploymentSlot The environment to which the hosted service is deployed, either staging or production.
73
- * @param string $privateID The unique identifier for this deployment.
74
- * @param string $label The label for the deployment.
75
- * @param string $url The URL for the deployment.
76
- * @param string $configuration The configuration file (XML, represented as string).
77
- * @param string $status The status of the deployment. Running, Suspended, RunningTransitioning, SuspendedTransitioning, Starting, Suspending, Deploying, Deleting.
78
- * @param string $upgradeStatus Parent node for elements describing an upgrade that is currently underway.
79
- * @param string $upgradeType The upgrade type designated for this deployment. Possible values are Auto and Manual.
80
- * @param string $currentUpgradeDomainState The state of the current upgrade domain. Possible values are Before and During.
81
- * @param string $currentUpgradeDomain An integer value that identifies the current upgrade domain. Upgrade domains are identified with a zero-based index: the first upgrade domain has an ID of 0, the second has an ID of 1, and so on.
82
- * @param string $upgradeDomainCount An integer value that indicates the number of upgrade domains in the deployment.
83
- * @param string $sdkVersion Version of SDK used to create the deployment
84
- * @param array $roleInstanceList The list of role instances.
85
- * @param array $roleList The list of roles.
86
- * @param array $inputEndpoints The list of input endpoints.
87
- */
88
- public function __construct($name, $deploymentSlot, $privateID, $label, $url, $configuration, $status, $upgradeStatus, $upgradeType, $currentUpgradeDomainState, $currentUpgradeDomain, $upgradeDomainCount, $sdkVersion, $roleInstanceList = array(), $roleList = array(), $inputEndpoints = array())
89
- {
90
- $this->_data = array(
91
- 'name' => $name,
92
- 'deploymentslot' => $deploymentSlot,
93
- 'privateid' => $privateID,
94
- 'label' => base64_decode($label),
95
- 'url' => $url,
96
- 'configuration' => base64_decode($configuration),
97
- 'status' => $status,
98
- 'upgradestatus' => $upgradeStatus,
99
- 'upgradetype' => $upgradeType,
100
- 'currentupgradedomainstate' => $currentUpgradeDomainState,
101
- 'currentupgradedomain' => $currentUpgradeDomain,
102
- 'upgradedomaincount' => $upgradeDomainCount,
103
- 'sdkversion' => $sdkVersion,
104
- 'roleinstancelist' => $roleInstanceList,
105
- 'rolelist' => $roleList,
106
- 'inputendpoints' => $inputEndpoints
107
- );
108
- }
109
- }
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
+ * @subpackage Management
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Management
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property string $Name The name for the deployment. This name must be unique among other deployments for the specified hosted service.
49
+ * @property string $DeploymentSlot The environment to which the hosted service is deployed, either staging or production.
50
+ * @property string $PrivateID The unique identifier for this deployment.
51
+ * @property string $Label The label for the deployment.
52
+ * @property string $Url The URL for the deployment.
53
+ * @property string $Configuration The configuration file (XML, represented as string).
54
+ * @property string $Status The status of the deployment. Running, Suspended, RunningTransitioning, SuspendedTransitioning, Starting, Suspending, Deploying, Deleting.
55
+ * @property string $UpgradeStatus Parent node for elements describing an upgrade that is currently underway.
56
+ * @property string $UpgradeType The upgrade type designated for this deployment. Possible values are Auto and Manual.
57
+ * @property string $CurrentUpgradeDomainState The state of the current upgrade domain. Possible values are Before and During.
58
+ * @property string $CurrentUpgradeDomain An integer value that identifies the current upgrade domain. Upgrade domains are identified with a zero-based index: the first upgrade domain has an ID of 0, the second has an ID of 1, and so on.
59
+ * @property string $UpgradeDomainCount An integer value that indicates the number of upgrade domains in the deployment.
60
+ * @property string $sdkVersion Version of SDK used to create the deployment
61
+ * @property array $RoleInstanceList The list of role instances.
62
+ * @property array $RoleList The list of roles.
63
+ * @property array $InputEndpoints The list of input endpoints.
64
+ */
65
+ class Microsoft_WindowsAzure_Management_DeploymentInstance
66
+ extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
67
+ {
68
+ /**
69
+ * Constructor
70
+ *
71
+ * @param string $name The name for the deployment. This name must be unique among other deployments for the specified hosted service.
72
+ * @param string $deploymentSlot The environment to which the hosted service is deployed, either staging or production.
73
+ * @param string $privateID The unique identifier for this deployment.
74
+ * @param string $label The label for the deployment.
75
+ * @param string $url The URL for the deployment.
76
+ * @param string $configuration The configuration file (XML, represented as string).
77
+ * @param string $status The status of the deployment. Running, Suspended, RunningTransitioning, SuspendedTransitioning, Starting, Suspending, Deploying, Deleting.
78
+ * @param string $upgradeStatus Parent node for elements describing an upgrade that is currently underway.
79
+ * @param string $upgradeType The upgrade type designated for this deployment. Possible values are Auto and Manual.
80
+ * @param string $currentUpgradeDomainState The state of the current upgrade domain. Possible values are Before and During.
81
+ * @param string $currentUpgradeDomain An integer value that identifies the current upgrade domain. Upgrade domains are identified with a zero-based index: the first upgrade domain has an ID of 0, the second has an ID of 1, and so on.
82
+ * @param string $upgradeDomainCount An integer value that indicates the number of upgrade domains in the deployment.
83
+ * @param string $sdkVersion Version of SDK used to create the deployment
84
+ * @param array $roleInstanceList The list of role instances.
85
+ * @param array $roleList The list of roles.
86
+ * @param array $inputEndpoints The list of input endpoints.
87
+ */
88
+ public function __construct($name, $deploymentSlot, $privateID, $label, $url, $configuration, $status, $upgradeStatus, $upgradeType, $currentUpgradeDomainState, $currentUpgradeDomain, $upgradeDomainCount, $sdkVersion, $roleInstanceList = array(), $roleList = array(), $inputEndpoints = array())
89
+ {
90
+ $this->_data = array(
91
+ 'name' => $name,
92
+ 'deploymentslot' => $deploymentSlot,
93
+ 'privateid' => $privateID,
94
+ 'label' => base64_decode($label),
95
+ 'url' => $url,
96
+ 'configuration' => base64_decode($configuration),
97
+ 'status' => $status,
98
+ 'upgradestatus' => $upgradeStatus,
99
+ 'upgradetype' => $upgradeType,
100
+ 'currentupgradedomainstate' => $currentUpgradeDomainState,
101
+ 'currentupgradedomain' => $currentUpgradeDomain,
102
+ 'upgradedomaincount' => $upgradeDomainCount,
103
+ 'sdkversion' => $sdkVersion,
104
+ 'roleinstancelist' => $roleInstanceList,
105
+ 'rolelist' => $roleList,
106
+ 'inputendpoints' => $inputEndpoints
107
+ );
108
+ }
109
+ }
libs/Microsoft/WindowsAzure/Management/Exception.php CHANGED
@@ -1,51 +1,51 @@
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
- * @subpackage Management
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Management
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- */
48
- class Microsoft_WindowsAzure_Management_Exception
49
- extends Microsoft_WindowsAzure_Exception
50
- {
51
  }
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
+ * @subpackage Management
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 45989 2010-05-03 12:19:10Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Management
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ */
48
+ class Microsoft_WindowsAzure_Management_Exception
49
+ extends Microsoft_WindowsAzure_Exception
50
+ {
51
  }
libs/Microsoft/WindowsAzure/Management/HostedServiceInstance.php CHANGED
@@ -1,82 +1,82 @@
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
- * @subpackage Management
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Management
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property string $Url The address of the hosted service.
49
- * @property string $ServiceName The name of the hosted service.
50
- * @property string $Description A description of the hosted service.
51
- * @property string $AffinityGroup The affinity group with which this hosted service is associated.
52
- * @property string $Location The geo-location of the hosted service in Windows Azure, if your hosted service is not associated with an affinity group.
53
- * @property string $Label The label for the hosted service.
54
- * @property array $Deployments Deployments for the hosted service.
55
- */
56
- class Microsoft_WindowsAzure_Management_HostedServiceInstance
57
- extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
58
- {
59
- /**
60
- * Constructor
61
- *
62
- * @param string $url The address of the hosted service.
63
- * @param string $serviceName The name of the hosted service.
64
- * @param string $description A description of the storage account.
65
- * @param string $affinityGroup The affinity group with which this hosted service is associated.
66
- * @param string $location The geo-location of the hosted service in Windows Azure, if your hosted service is not associated with an affinity group.
67
- * @param string $label The label for the hosted service.
68
- * @param array $deployments Deployments for the hosted service.
69
- */
70
- public function __construct($url, $serviceName, $description = '', $affinityGroup = '', $location = '', $label = '', $deployments = array())
71
- {
72
- $this->_data = array(
73
- 'url' => $url,
74
- 'servicename' => $serviceName,
75
- 'description' => $description,
76
- 'affinitygroup' => $affinityGroup,
77
- 'location' => $location,
78
- 'label' => base64_decode($label),
79
- 'deployments' => $deployments
80
- );
81
- }
82
- }
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
+ * @subpackage Management
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Management
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property string $Url The address of the hosted service.
49
+ * @property string $ServiceName The name of the hosted service.
50
+ * @property string $Description A description of the hosted service.
51
+ * @property string $AffinityGroup The affinity group with which this hosted service is associated.
52
+ * @property string $Location The geo-location of the hosted service in Windows Azure, if your hosted service is not associated with an affinity group.
53
+ * @property string $Label The label for the hosted service.
54
+ * @property array $Deployments Deployments for the hosted service.
55
+ */
56
+ class Microsoft_WindowsAzure_Management_HostedServiceInstance
57
+ extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
58
+ {
59
+ /**
60
+ * Constructor
61
+ *
62
+ * @param string $url The address of the hosted service.
63
+ * @param string $serviceName The name of the hosted service.
64
+ * @param string $description A description of the storage account.
65
+ * @param string $affinityGroup The affinity group with which this hosted service is associated.
66
+ * @param string $location The geo-location of the hosted service in Windows Azure, if your hosted service is not associated with an affinity group.
67
+ * @param string $label The label for the hosted service.
68
+ * @param array $deployments Deployments for the hosted service.
69
+ */
70
+ public function __construct($url, $serviceName, $description = '', $affinityGroup = '', $location = '', $label = '', $deployments = array())
71
+ {
72
+ $this->_data = array(
73
+ 'url' => $url,
74
+ 'servicename' => $serviceName,
75
+ 'description' => $description,
76
+ 'affinitygroup' => $affinityGroup,
77
+ 'location' => $location,
78
+ 'label' => base64_decode($label),
79
+ 'deployments' => $deployments
80
+ );
81
+ }
82
+ }
libs/Microsoft/WindowsAzure/Management/LocationInstance.php CHANGED
@@ -1,64 +1,64 @@
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
- * @subpackage Management
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Management
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property string $Name The location name.
49
- */
50
- class Microsoft_WindowsAzure_Management_LocationInstance
51
- extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
52
- {
53
- /**
54
- * Constructor
55
- *
56
- * @param string $name The location name.
57
- */
58
- public function __construct($name)
59
- {
60
- $this->_data = array(
61
- 'name' => $name
62
- );
63
- }
64
- }
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
+ * @subpackage Management
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Management
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property string $Name The location name.
49
+ */
50
+ class Microsoft_WindowsAzure_Management_LocationInstance
51
+ extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
52
+ {
53
+ /**
54
+ * Constructor
55
+ *
56
+ * @param string $name The location name.
57
+ */
58
+ public function __construct($name)
59
+ {
60
+ $this->_data = array(
61
+ 'name' => $name
62
+ );
63
+ }
64
+ }
libs/Microsoft/WindowsAzure/Management/OperatingSystemFamilyInstance.php CHANGED
@@ -1,70 +1,70 @@
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
- * @subpackage Management
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Management
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property string $Name Indicates which operating system family this version belongs to. A value of 1 corresponds to the Windows Azure guest operating system that is substantially compatible with Windows Server 2008 SP2. A value of 2 corresponds to the Windows Azure guest operating system that is substantially compatible with Windows Server 2008 R2.
49
- * @property string $Label A label for the operating system version.
50
- * @property array $OperatingSystems A list of operating systems available under this operating system family.
51
- */
52
- class Microsoft_WindowsAzure_Management_OperatingSystemFamilyInstance
53
- extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
54
- {
55
- /**
56
- * Constructor
57
- *
58
- * @param string $name Indicates which operating system family this version belongs to. A value of 1 corresponds to the Windows Azure guest operating system that is substantially compatible with Windows Server 2008 SP2. A value of 2 corresponds to the Windows Azure guest operating system that is substantially compatible with Windows Server 2008 R2.
59
- * @param string $label A label for the operating system version.
60
- * @param array $operatingSystems A list of operating systems available under this operating system family.
61
- */
62
- public function __construct($name, $label, $operatingSystems = array())
63
- {
64
- $this->_data = array(
65
- 'name' => $name,
66
- 'label' => base64_decode($label),
67
- 'operatingsystems' => $operatingSystems
68
- );
69
- }
70
- }
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
+ * @subpackage Management
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Management
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property string $Name Indicates which operating system family this version belongs to. A value of 1 corresponds to the Windows Azure guest operating system that is substantially compatible with Windows Server 2008 SP2. A value of 2 corresponds to the Windows Azure guest operating system that is substantially compatible with Windows Server 2008 R2.
49
+ * @property string $Label A label for the operating system version.
50
+ * @property array $OperatingSystems A list of operating systems available under this operating system family.
51
+ */
52
+ class Microsoft_WindowsAzure_Management_OperatingSystemFamilyInstance
53
+ extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
54
+ {
55
+ /**
56
+ * Constructor
57
+ *
58
+ * @param string $name Indicates which operating system family this version belongs to. A value of 1 corresponds to the Windows Azure guest operating system that is substantially compatible with Windows Server 2008 SP2. A value of 2 corresponds to the Windows Azure guest operating system that is substantially compatible with Windows Server 2008 R2.
59
+ * @param string $label A label for the operating system version.
60
+ * @param array $operatingSystems A list of operating systems available under this operating system family.
61
+ */
62
+ public function __construct($name, $label, $operatingSystems = array())
63
+ {
64
+ $this->_data = array(
65
+ 'name' => $name,
66
+ 'label' => base64_decode($label),
67
+ 'operatingsystems' => $operatingSystems
68
+ );
69
+ }
70
+ }
libs/Microsoft/WindowsAzure/Management/OperatingSystemInstance.php CHANGED
@@ -1,79 +1,79 @@
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
- * @subpackage Management
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Management
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property string $Version The operating system version. This value corresponds to the configuration value for specifying that your service is to run on a particular version of the Windows Azure guest operating system.
49
- * @property string $Label A label for the operating system version.
50
- * @property string $IsDefault Indicates whether this operating system version is the default version for a service that has not otherwise specified a particular version. The default operating system version is applied to services that are configured for auto-upgrade. An operating system family has exactly one default operating system version at any given time, for which the IsDefault element is set to true; for all other versions, IsDefault is set to false.
51
- * @property string $IsActive Indicates whether this operating system version is currently active for running a service. If an operating system version is active, you can manually configure your service to run on that version.
52
- * @property string $Family Indicates which operating system family this version belongs to. A value of 1 corresponds to the Windows Azure guest operating system that is substantially compatible with Windows Server 2008 SP2. A value of 2 corresponds to the Windows Azure guest operating system that is substantially compatible with Windows Server 2008 R2.
53
- * @property string $FamilyLabel A label for the operating system family.
54
- */
55
- class Microsoft_WindowsAzure_Management_OperatingSystemInstance
56
- extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
57
- {
58
- /**
59
- * Constructor
60
- *
61
- * @param string $version The operating system version. This value corresponds to the configuration value for specifying that your service is to run on a particular version of the Windows Azure guest operating system.
62
- * @param string $label A label for the operating system version.
63
- * @param string $isDefault Indicates whether this operating system version is the default version for a service that has not otherwise specified a particular version. The default operating system version is applied to services that are configured for auto-upgrade. An operating system family has exactly one default operating system version at any given time, for which the IsDefault element is set to true; for all other versions, IsDefault is set to false.
64
- * @param string $isActive Indicates whether this operating system version is currently active for running a service. If an operating system version is active, you can manually configure your service to run on that version.
65
- * @param string $family Indicates which operating system family this version belongs to. A value of 1 corresponds to the Windows Azure guest operating system that is substantially compatible with Windows Server 2008 SP2. A value of 2 corresponds to the Windows Azure guest operating system that is substantially compatible with Windows Server 2008 R2.
66
- * @param string $familyLabel A label for the operating system family.
67
- */
68
- public function __construct($version, $label, $isDefault, $isActive, $family, $familyLabel)
69
- {
70
- $this->_data = array(
71
- 'version' => $version,
72
- 'label' => base64_decode($label),
73
- 'isdefault' => $isDefault,
74
- 'isactive' => $isActive,
75
- 'family' => $family,
76
- 'familylabel' => base64_decode($familyLabel)
77
- );
78
- }
79
- }
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
+ * @subpackage Management
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Management
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property string $Version The operating system version. This value corresponds to the configuration value for specifying that your service is to run on a particular version of the Windows Azure guest operating system.
49
+ * @property string $Label A label for the operating system version.
50
+ * @property string $IsDefault Indicates whether this operating system version is the default version for a service that has not otherwise specified a particular version. The default operating system version is applied to services that are configured for auto-upgrade. An operating system family has exactly one default operating system version at any given time, for which the IsDefault element is set to true; for all other versions, IsDefault is set to false.
51
+ * @property string $IsActive Indicates whether this operating system version is currently active for running a service. If an operating system version is active, you can manually configure your service to run on that version.
52
+ * @property string $Family Indicates which operating system family this version belongs to. A value of 1 corresponds to the Windows Azure guest operating system that is substantially compatible with Windows Server 2008 SP2. A value of 2 corresponds to the Windows Azure guest operating system that is substantially compatible with Windows Server 2008 R2.
53
+ * @property string $FamilyLabel A label for the operating system family.
54
+ */
55
+ class Microsoft_WindowsAzure_Management_OperatingSystemInstance
56
+ extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
57
+ {
58
+ /**
59
+ * Constructor
60
+ *
61
+ * @param string $version The operating system version. This value corresponds to the configuration value for specifying that your service is to run on a particular version of the Windows Azure guest operating system.
62
+ * @param string $label A label for the operating system version.
63
+ * @param string $isDefault Indicates whether this operating system version is the default version for a service that has not otherwise specified a particular version. The default operating system version is applied to services that are configured for auto-upgrade. An operating system family has exactly one default operating system version at any given time, for which the IsDefault element is set to true; for all other versions, IsDefault is set to false.
64
+ * @param string $isActive Indicates whether this operating system version is currently active for running a service. If an operating system version is active, you can manually configure your service to run on that version.
65
+ * @param string $family Indicates which operating system family this version belongs to. A value of 1 corresponds to the Windows Azure guest operating system that is substantially compatible with Windows Server 2008 SP2. A value of 2 corresponds to the Windows Azure guest operating system that is substantially compatible with Windows Server 2008 R2.
66
+ * @param string $familyLabel A label for the operating system family.
67
+ */
68
+ public function __construct($version, $label, $isDefault, $isActive, $family, $familyLabel)
69
+ {
70
+ $this->_data = array(
71
+ 'version' => $version,
72
+ 'label' => base64_decode($label),
73
+ 'isdefault' => $isDefault,
74
+ 'isactive' => $isActive,
75
+ 'family' => $family,
76
+ 'familylabel' => base64_decode($familyLabel)
77
+ );
78
+ }
79
+ }
libs/Microsoft/WindowsAzure/Management/OperationStatusInstance.php CHANGED
@@ -1,73 +1,73 @@
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
- * @subpackage Management
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Management
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property string $Id The request ID of the asynchronous request.
49
- * @property string $Status The status of the asynchronous request. Possible values include InProgress, Succeeded, or Failed.
50
- * @property string $ErrorCode The management service error code returned if the asynchronous request failed.
51
- * @property string $ErrorMessage The management service error message returned if the asynchronous request failed.
52
- */
53
- class Microsoft_WindowsAzure_Management_OperationStatusInstance
54
- extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
55
- {
56
- /**
57
- * Constructor
58
- *
59
- * @param string $id The request ID of the asynchronous request.
60
- * @param string $status The status of the asynchronous request. Possible values include InProgress, Succeeded, or Failed.
61
- * @param string $errorCode The management service error code returned if the asynchronous request failed.
62
- * @param string $errorMessage The management service error message returned if the asynchronous request failed.
63
- */
64
- public function __construct($id, $status, $errorCode, $errorMessage)
65
- {
66
- $this->_data = array(
67
- 'id' => $id,
68
- 'status' => $status,
69
- 'errorcode' => $errorCode,
70
- 'errormessage' => $errorMessage
71
- );
72
- }
73
- }
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
+ * @subpackage Management
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Management
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property string $Id The request ID of the asynchronous request.
49
+ * @property string $Status The status of the asynchronous request. Possible values include InProgress, Succeeded, or Failed.
50
+ * @property string $ErrorCode The management service error code returned if the asynchronous request failed.
51
+ * @property string $ErrorMessage The management service error message returned if the asynchronous request failed.
52
+ */
53
+ class Microsoft_WindowsAzure_Management_OperationStatusInstance
54
+ extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
55
+ {
56
+ /**
57
+ * Constructor
58
+ *
59
+ * @param string $id The request ID of the asynchronous request.
60
+ * @param string $status The status of the asynchronous request. Possible values include InProgress, Succeeded, or Failed.
61
+ * @param string $errorCode The management service error code returned if the asynchronous request failed.
62
+ * @param string $errorMessage The management service error message returned if the asynchronous request failed.
63
+ */
64
+ public function __construct($id, $status, $errorCode, $errorMessage)
65
+ {
66
+ $this->_data = array(
67
+ 'id' => $id,
68
+ 'status' => $status,
69
+ 'errorcode' => $errorCode,
70
+ 'errormessage' => $errorMessage
71
+ );
72
+ }
73
+ }
libs/Microsoft/WindowsAzure/Management/ServiceEntityAbstract.php CHANGED
@@ -1,84 +1,84 @@
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
- * @subpackage Management
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Management
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- */
48
- abstract class Microsoft_WindowsAzure_Management_ServiceEntityAbstract
49
- {
50
- /**
51
- * Data
52
- *
53
- * @var array
54
- */
55
- protected $_data = null;
56
-
57
- /**
58
- * Magic overload for setting properties
59
- *
60
- * @param string $name Name of the property
61
- * @param string $value Value to set
62
- */
63
- public function __set($name, $value) {
64
- if (array_key_exists(strtolower($name), $this->_data)) {
65
- $this->_data[strtolower($name)] = $value;
66
- return;
67
- }
68
-
69
- throw new Microsoft_WindowsAzure_Management_Exception("Unknown property: " . $name);
70
- }
71
-
72
- /**
73
- * Magic overload for getting properties
74
- *
75
- * @param string $name Name of the property
76
- */
77
- public function __get($name) {
78
- if (array_key_exists(strtolower($name), $this->_data)) {
79
- return $this->_data[strtolower($name)];
80
- }
81
-
82
- throw new Microsoft_WindowsAzure_Management_Exception("Unknown property: " . $name);
83
- }
84
- }
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
+ * @subpackage Management
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Management
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ */
48
+ abstract class Microsoft_WindowsAzure_Management_ServiceEntityAbstract
49
+ {
50
+ /**
51
+ * Data
52
+ *
53
+ * @var array
54
+ */
55
+ protected $_data = null;
56
+
57
+ /**
58
+ * Magic overload for setting properties
59
+ *
60
+ * @param string $name Name of the property
61
+ * @param string $value Value to set
62
+ */
63
+ public function __set($name, $value) {
64
+ if (array_key_exists(strtolower($name), $this->_data)) {
65
+ $this->_data[strtolower($name)] = $value;
66
+ return;
67
+ }
68
+
69
+ throw new Microsoft_WindowsAzure_Management_Exception("Unknown property: " . $name);
70
+ }
71
+
72
+ /**
73
+ * Magic overload for getting properties
74
+ *
75
+ * @param string $name Name of the property
76
+ */
77
+ public function __get($name) {
78
+ if (array_key_exists(strtolower($name), $this->_data)) {
79
+ return $this->_data[strtolower($name)];
80
+ }
81
+
82
+ throw new Microsoft_WindowsAzure_Management_Exception("Unknown property: " . $name);
83
+ }
84
+ }
libs/Microsoft/WindowsAzure/Management/StorageServiceInstance.php CHANGED
@@ -1,79 +1,79 @@
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
- * @subpackage Management
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Management
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property string $Url The address of the storage account.
49
- * @property string $ServiceName The name of the storage account.
50
- * @property string $Description A description of the storage account.
51
- * @property string $AffinityGroup The affinity group with which this storage account is associated.
52
- * @property string $Location The geo-location of the storage account in Windows Azure, if your storage account is not associated with an affinity group.
53
- * @property string $Label The label for the storage account.
54
- */
55
- class Microsoft_WindowsAzure_Management_StorageServiceInstance
56
- extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
57
- {
58
- /**
59
- * Constructor
60
- *
61
- * @param string $url The address of the storage account.
62
- * @param string $serviceName The name of the storage account.
63
- * @param string $description A description of the storage account.
64
- * @param string $affinityGroup The affinity group with which this storage account is associated.
65
- * @param string $location The geo-location of the storage account in Windows Azure, if your storage account is not associated with an affinity group.
66
- * @param string $label The label for the storage account.
67
- */
68
- public function __construct($url, $serviceName, $description = '', $affinityGroup = '', $location = '', $label = '')
69
- {
70
- $this->_data = array(
71
- 'url' => $url,
72
- 'servicename' => $serviceName,
73
- 'description' => $description,
74
- 'affinitygroup' => $affinityGroup,
75
- 'location' => $location,
76
- 'label' => base64_decode($label)
77
- );
78
- }
79
- }
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
+ * @subpackage Management
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Management
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property string $Url The address of the storage account.
49
+ * @property string $ServiceName The name of the storage account.
50
+ * @property string $Description A description of the storage account.
51
+ * @property string $AffinityGroup The affinity group with which this storage account is associated.
52
+ * @property string $Location The geo-location of the storage account in Windows Azure, if your storage account is not associated with an affinity group.
53
+ * @property string $Label The label for the storage account.
54
+ */
55
+ class Microsoft_WindowsAzure_Management_StorageServiceInstance
56
+ extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
57
+ {
58
+ /**
59
+ * Constructor
60
+ *
61
+ * @param string $url The address of the storage account.
62
+ * @param string $serviceName The name of the storage account.
63
+ * @param string $description A description of the storage account.
64
+ * @param string $affinityGroup The affinity group with which this storage account is associated.
65
+ * @param string $location The geo-location of the storage account in Windows Azure, if your storage account is not associated with an affinity group.
66
+ * @param string $label The label for the storage account.
67
+ */
68
+ public function __construct($url, $serviceName, $description = '', $affinityGroup = '', $location = '', $label = '')
69
+ {
70
+ $this->_data = array(
71
+ 'url' => $url,
72
+ 'servicename' => $serviceName,
73
+ 'description' => $description,
74
+ 'affinitygroup' => $affinityGroup,
75
+ 'location' => $location,
76
+ 'label' => base64_decode($label)
77
+ );
78
+ }
79
+ }
libs/Microsoft/WindowsAzure/Management/SubscriptionOperationInstance.php CHANGED
@@ -1,96 +1,96 @@
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
- * @subpackage Management
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Management
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- *
48
- * @property string $OperationId The globally unique identifier (GUID) of the operation.
49
- * @property string $OperationObjectId The target object for the operation.
50
- * @property string $OperationName The name of the performed operation.
51
- * @property array $OperationParameters The collection of parameters for the performed operation.
52
- * @property array $OperationCaller A collection of attributes that identifies the source of the operation.
53
- * @property array $OperationStatus The current status of the operation.
54
- * @property string $OperationStartedTime The time that the operation started to execute.
55
- * @property string $OperationCompletedTime The time that the operation finished executing.
56
- */
57
- class Microsoft_WindowsAzure_Management_SubscriptionOperationInstance
58
- extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
59
- {
60
- /**
61
- * Constructor
62
- *
63
- * @param string $operationId The globally unique identifier (GUID) of the operation.
64
- * @param string $operationObjectId The target object for the operation.
65
- * @param string $operationName The name of the performed operation.
66
- * @param array $operationParameters The collection of parameters for the performed operation.
67
- * @param array $operationCaller A collection of attributes that identifies the source of the operation.
68
- * @param array $operationStatus The current status of the operation.
69
- * @param string $operationStartedTime The time that the operation started to execute.
70
- * @param string $operationCompletedTime The time that the operation finished executing.
71
- */
72
- public function __construct($operationId, $operationObjectId, $operationName, $operationParameters = array(), $operationCaller = array(), $operationStatus = array(), $operationStartedTime = '', $operationCompletedTime = '')
73
- {
74
- $this->_data = array(
75
- 'operationid' => $operationId,
76
- 'operationobjectid' => $operationObjectId,
77
- 'operationname' => $operationName,
78
- 'operationparameters' => $operationParameters,
79
- 'operationcaller' => $operationCaller,
80
- 'operationstatus' => $operationStatus,
81
- 'operationstartedtime' => $operationStartedTime,
82
- 'operationcompletedtime' => $operationCompletedTime
83
- );
84
- }
85
-
86
- /**
87
- * Add operation parameter
88
- *
89
- * @param string $name Name
90
- * @param string $value Value
91
- */
92
- public function addOperationParameter($name, $value)
93
- {
94
- $this->_data['operationparameters'][$name] = $value;
95
- }
96
- }
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
+ * @subpackage Management
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: BlobInstance.php 53615 2010-11-16 20:45:11Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Management
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ *
48
+ * @property string $OperationId The globally unique identifier (GUID) of the operation.
49
+ * @property string $OperationObjectId The target object for the operation.
50
+ * @property string $OperationName The name of the performed operation.
51
+ * @property array $OperationParameters The collection of parameters for the performed operation.
52
+ * @property array $OperationCaller A collection of attributes that identifies the source of the operation.
53
+ * @property array $OperationStatus The current status of the operation.
54
+ * @property string $OperationStartedTime The time that the operation started to execute.
55
+ * @property string $OperationCompletedTime The time that the operation finished executing.
56
+ */
57
+ class Microsoft_WindowsAzure_Management_SubscriptionOperationInstance
58
+ extends Microsoft_WindowsAzure_Management_ServiceEntityAbstract
59
+ {
60
+ /**
61
+ * Constructor
62
+ *
63
+ * @param string $operationId The globally unique identifier (GUID) of the operation.
64
+ * @param string $operationObjectId The target object for the operation.
65
+ * @param string $operationName The name of the performed operation.
66
+ * @param array $operationParameters The collection of parameters for the performed operation.
67
+ * @param array $operationCaller A collection of attributes that identifies the source of the operation.
68
+ * @param array $operationStatus The current status of the operation.
69
+ * @param string $operationStartedTime The time that the operation started to execute.
70
+ * @param string $operationCompletedTime The time that the operation finished executing.
71
+ */
72
+ public function __construct($operationId, $operationObjectId, $operationName, $operationParameters = array(), $operationCaller = array(), $operationStatus = array(), $operationStartedTime = '', $operationCompletedTime = '')
73
+ {
74
+ $this->_data = array(
75
+ 'operationid' => $operationId,
76
+ 'operationobjectid' => $operationObjectId,
77
+ 'operationname' => $operationName,
78
+ 'operationparameters' => $operationParameters,
79
+ 'operationcaller' => $operationCaller,
80
+ 'operationstatus' => $operationStatus,
81
+ 'operationstartedtime' => $operationStartedTime,
82
+ 'operationcompletedtime' => $operationCompletedTime
83
+ );
84
+ }
85
+
86
+ /**
87
+ * Add operation parameter
88
+ *
89
+ * @param string $name Name
90
+ * @param string $value Value
91
+ */
92
+ public function addOperationParameter($name, $value)
93
+ {
94
+ $this->_data['operationparameters'][$name] = $value;
95
+ }
96
+ }
libs/Microsoft/WindowsAzure/RetryPolicy/Exception.php CHANGED
@@ -1,49 +1,49 @@
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
- * @subpackage Exception
31
- * @version $Id: Exception.php 61042 2011-04-19 10:03:39Z unknown $
32
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
- * @license http://phpazure.codeplex.com/license
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage RetryPolicy
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- */
48
- class Microsoft_WindowsAzure_RetryPolicy_Exception extends Microsoft_WindowsAzure_Exception
49
- {}
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
+ * @subpackage Exception
31
+ * @version $Id: Exception.php 61042 2011-04-19 10:03:39Z unknown $
32
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
+ * @license http://phpazure.codeplex.com/license
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage RetryPolicy
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ */
48
+ class Microsoft_WindowsAzure_RetryPolicy_Exception extends Microsoft_WindowsAzure_Exception
49
+ {}
libs/Microsoft/WindowsAzure/RetryPolicy/NoRetry.php CHANGED
@@ -1,71 +1,71 @@
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
- * @subpackage RetryPolicy
31
- * @version $Id: NoRetry.php 61042 2011-04-19 10:03:39Z unknown $
32
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
- * @license http://phpazure.codeplex.com/license
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage RetryPolicy
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- */
48
- class Microsoft_WindowsAzure_RetryPolicy_NoRetry extends Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract
49
- {
50
- /**
51
- * Execute function under retry policy
52
- *
53
- * @param string|array $function Function to execute
54
- * @param array $parameters Parameters for function call
55
- * @return mixed
56
- */
57
- public function execute($function, $parameters = array())
58
- {
59
- $returnValue = null;
60
-
61
- try
62
- {
63
- $returnValue = call_user_func_array($function, $parameters);
64
- return $returnValue;
65
- }
66
- catch (Exception $ex)
67
- {
68
- throw $ex;
69
- }
70
- }
71
  }
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
+ * @subpackage RetryPolicy
31
+ * @version $Id: NoRetry.php 61042 2011-04-19 10:03:39Z unknown $
32
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
+ * @license http://phpazure.codeplex.com/license
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage RetryPolicy
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ */
48
+ class Microsoft_WindowsAzure_RetryPolicy_NoRetry extends Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract
49
+ {
50
+ /**
51
+ * Execute function under retry policy
52
+ *
53
+ * @param string|array $function Function to execute
54
+ * @param array $parameters Parameters for function call
55
+ * @return mixed
56
+ */
57
+ public function execute($function, $parameters = array())
58
+ {
59
+ $returnValue = null;
60
+
61
+ try
62
+ {
63
+ $returnValue = call_user_func_array($function, $parameters);
64
+ return $returnValue;
65
+ }
66
+ catch (Exception $ex)
67
+ {
68
+ throw $ex;
69
+ }
70
+ }
71
  }
libs/Microsoft/WindowsAzure/RetryPolicy/RetryN.php CHANGED
@@ -1,100 +1,100 @@
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
- * @subpackage RetryPolicy
31
- * @version $Id: RetryN.php 61042 2011-04-19 10:03:39Z unknown $
32
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
- * @license http://phpazure.codeplex.com/license
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage RetryPolicy
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- */
48
- class Microsoft_WindowsAzure_RetryPolicy_RetryN extends Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract
49
- {
50
- /**
51
- * Number of retries
52
- *
53
- * @var int
54
- */
55
- protected $_retryCount = 1;
56
-
57
- /**
58
- * Interval between retries (in milliseconds)
59
- *
60
- * @var int
61
- */
62
- protected $_retryInterval = 0;
63
-
64
- /**
65
- * Constructor
66
- *
67
- * @param int $count Number of retries
68
- * @param int $intervalBetweenRetries Interval between retries (in milliseconds)
69
- */
70
- public function __construct($count = 1, $intervalBetweenRetries = 0)
71
- {
72
- $this->_retryCount = $count;
73
- $this->_retryInterval = $intervalBetweenRetries;
74
- }
75
-
76
- /**
77
- * Execute function under retry policy
78
- *
79
- * @param string|array $function Function to execute
80
- * @param array $parameters Parameters for function call
81
- * @return mixed
82
- */
83
- public function execute($function, $parameters = array())
84
- {
85
- $returnValue = null;
86
-
87
- for ($retriesLeft = $this->_retryCount; $retriesLeft >= 0; --$retriesLeft) {
88
- try {
89
- $returnValue = call_user_func_array($function, $parameters);
90
- return $returnValue;
91
- } catch (Exception $ex) {
92
- if ($retriesLeft == 1) {
93
- throw new Microsoft_WindowsAzure_RetryPolicy_Exception("Exceeded retry count of " . $this->_retryCount . ". " . $ex->getMessage());
94
- }
95
-
96
- usleep($this->_retryInterval * 1000);
97
- }
98
- }
99
- }
100
  }
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
+ * @subpackage RetryPolicy
31
+ * @version $Id: RetryN.php 61042 2011-04-19 10:03:39Z unknown $
32
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
+ * @license http://phpazure.codeplex.com/license
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage RetryPolicy
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ */
48
+ class Microsoft_WindowsAzure_RetryPolicy_RetryN extends Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract
49
+ {
50
+ /**
51
+ * Number of retries
52
+ *
53
+ * @var int
54
+ */
55
+ protected $_retryCount = 1;
56
+
57
+ /**
58
+ * Interval between retries (in milliseconds)
59
+ *
60
+ * @var int
61
+ */
62
+ protected $_retryInterval = 0;
63
+
64
+ /**
65
+ * Constructor
66
+ *
67
+ * @param int $count Number of retries
68
+ * @param int $intervalBetweenRetries Interval between retries (in milliseconds)
69
+ */
70
+ public function __construct($count = 1, $intervalBetweenRetries = 0)
71
+ {
72
+ $this->_retryCount = $count;
73
+ $this->_retryInterval = $intervalBetweenRetries;
74
+ }
75
+
76
+ /**
77
+ * Execute function under retry policy
78
+ *
79
+ * @param string|array $function Function to execute
80
+ * @param array $parameters Parameters for function call
81
+ * @return mixed
82
+ */
83
+ public function execute($function, $parameters = array())
84
+ {
85
+ $returnValue = null;
86
+
87
+ for ($retriesLeft = $this->_retryCount; $retriesLeft >= 0; --$retriesLeft) {
88
+ try {
89
+ $returnValue = call_user_func_array($function, $parameters);
90
+ return $returnValue;
91
+ } catch (Exception $ex) {
92
+ if ($retriesLeft == 1) {
93
+ throw new Microsoft_WindowsAzure_RetryPolicy_Exception("Exceeded retry count of " . $this->_retryCount . ". " . $ex->getMessage());
94
+ }
95
+
96
+ usleep($this->_retryInterval * 1000);
97
+ }
98
+ }
99
+ }
100
  }
libs/Microsoft/WindowsAzure/RetryPolicy/RetryPolicyAbstract.php CHANGED
@@ -1,80 +1,80 @@
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
- * @subpackage RetryPolicy
31
- * @version $Id: RetryPolicy.php 28585 2009-09-07 12:12:56Z unknown $
32
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
- * @license http://phpazure.codeplex.com/license
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage RetryPolicy
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- */
48
- abstract class Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract
49
- {
50
- /**
51
- * Execute function under retry policy
52
- *
53
- * @param string|array $function Function to execute
54
- * @param array $parameters Parameters for function call
55
- * @return mixed
56
- */
57
- public abstract function execute($function, $parameters = array());
58
-
59
- /**
60
- * Create a Microsoft_WindowsAzure_RetryPolicy_NoRetry instance
61
- *
62
- * @return Microsoft_WindowsAzure_RetryPolicy_NoRetry
63
- */
64
- public static function noRetry()
65
- {
66
- return new Microsoft_WindowsAzure_RetryPolicy_NoRetry();
67
- }
68
-
69
- /**
70
- * Create a Microsoft_WindowsAzure_RetryPolicy_RetryN instance
71
- *
72
- * @param int $count Number of retries
73
- * @param int $intervalBetweenRetries Interval between retries (in milliseconds)
74
- * @return Microsoft_WindowsAzure_RetryPolicy_RetryN
75
- */
76
- public static function retryN($count = 1, $intervalBetweenRetries = 0)
77
- {
78
- return new Microsoft_WindowsAzure_RetryPolicy_RetryN($count, $intervalBetweenRetries);
79
- }
80
  }
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
+ * @subpackage RetryPolicy
31
+ * @version $Id: RetryPolicy.php 28585 2009-09-07 12:12:56Z unknown $
32
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
33
+ * @license http://phpazure.codeplex.com/license
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage RetryPolicy
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ */
48
+ abstract class Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract
49
+ {
50
+ /**
51
+ * Execute function under retry policy
52
+ *
53
+ * @param string|array $function Function to execute
54
+ * @param array $parameters Parameters for function call
55
+ * @return mixed
56
+ */
57
+ public abstract function execute($function, $parameters = array());
58
+
59
+ /**
60
+ * Create a Microsoft_WindowsAzure_RetryPolicy_NoRetry instance
61
+ *
62
+ * @return Microsoft_WindowsAzure_RetryPolicy_NoRetry
63
+ */
64
+ public static function noRetry()
65
+ {
66
+ return new Microsoft_WindowsAzure_RetryPolicy_NoRetry();
67
+ }
68
+
69
+ /**
70
+ * Create a Microsoft_WindowsAzure_RetryPolicy_RetryN instance
71
+ *
72
+ * @param int $count Number of retries
73
+ * @param int $intervalBetweenRetries Interval between retries (in milliseconds)
74
+ * @return Microsoft_WindowsAzure_RetryPolicy_RetryN
75
+ */
76
+ public static function retryN($count = 1, $intervalBetweenRetries = 0)
77
+ {
78
+ return new Microsoft_WindowsAzure_RetryPolicy_RetryN($count, $intervalBetweenRetries);
79
+ }
80
  }
libs/Microsoft/WindowsAzure/RoleEnvironment.php CHANGED
@@ -1,190 +1,190 @@
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: Storage.php 61042 2011-04-19 10:03:39Z unknown $
33
- */
34
-
35
- /**
36
- * @see Microsoft_AutoLoader
37
- */
38
- require_once dirname(__FILE__) . '/../AutoLoader.php';
39
-
40
- /**
41
- * @category Microsoft
42
- * @package Microsoft_WindowsAzure
43
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
44
- * @license http://phpazure.codeplex.com/license
45
- */
46
- class Microsoft_WindowsAzure_RoleEnvironment
47
- {
48
- /**
49
- * First-level command cache
50
- *
51
- * @var array
52
- */
53
- private static $_commandCache = array();
54
- // TODO: may be interesting to cache commands for subsequent requests as well
55
-
56
- /**
57
- * Is the Windows Azure role environment available? Will return true on Windows Azure and Development Fabric, false when run in any other environment.
58
- *
59
- * @return boolean
60
- */
61
- public static function isAvailable()
62
- {
63
- $value = strtolower(self::_runCommand('IsAvailable'));
64
- return $value == 'true';
65
- }
66
-
67
- /**
68
- * Is the application running in the development fabric?
69
- *
70
- * @return boolean
71
- */
72
- public static function isDevFabric()
73
- {
74
- $value = strtolower(self::_runCommand('IsEmulated'));
75
- return $value == 'true';
76
- }
77
-
78
- /**
79
- * Gets the current role instance ID. Note that this method will return null when not hosted on Windows Azure.
80
- *
81
- * @return string
82
- */
83
- public static function getCurrentRoleInstanceId()
84
- {
85
- if (!self::isAvailable()) {
86
- return null;
87
- }
88
-
89
- $value = self::_runCommand('GetCurrentRoleInstanceId');
90
- return $value;
91
- }
92
-
93
- /**
94
- * Gets the current role name. Note that this method will return null when not hosted on Windows Azure.
95
- *
96
- * @return string
97
- */
98
- public static function getCurrentRoleName()
99
- {
100
- if (!self::isAvailable()) {
101
- return null;
102
- }
103
-
104
- $value = self::_runCommand('GetCurrentRoleName');
105
- return $value;
106
- }
107
-
108
- /**
109
- * Gets the current deployment ID. Note that this method will return null when not hosted on Windows Azure.
110
- *
111
- * @return string
112
- */
113
- public static function getDeploymentId()
114
- {
115
- if (!self::isAvailable()) {
116
- return null;
117
- }
118
-
119
- $value = self::_runCommand('GetDeploymentId');
120
- return $value;
121
- }
122
-
123
- /**
124
- * Get configuration setting value from ServiceConfiguration.cscfg. Note that this method will return null when not hosted on Windows Azure.
125
- *
126
- * @param string $configurationKey Configuration key.
127
- * @return string
128
- */
129
- public static function getConfigurationSettingValue($configurationKey)
130
- {
131
- if (!self::isAvailable()) {
132
- return null;
133
- }
134
-
135
- $value = self::_runCommand('GetConfigurationSettingValue', array($configurationKey));
136
- return $value;
137
- }
138
-
139
- /**
140
- * Get local resource root path from ServiceDefinition.csdef. Note that this method will return null when not hosted on Windows Azure.
141
- *
142
- * @param string $localResourceKey Local resource key.
143
- * @return string
144
- */
145
- public static function getLocalResource($localResourceKey)
146
- {
147
- if (!self::isAvailable()) {
148
- return null;
149
- }
150
-
151
- $value = self::_runCommand('GetLocalResource', array($localResourceKey));
152
- return $value;
153
- }
154
-
155
- /**
156
- * Run a command through RoleEnvironmentProxy.exe.
157
- *
158
- * @param string $command Command to run.
159
- * @param array $parameters Command parameters.
160
- * @return mixed
161
- */
162
- protected static function _runCommand($command, $parameters = array())
163
- {
164
- for ($i = 0; $i < count($parameters); $i++) {
165
- $parameters[$i] = escapeshellarg($parameters[$i]);
166
- }
167
- $parameters = implode(' ', $parameters);
168
- $command = escapeshellarg($command) . ' ' . $parameters;
169
-
170
- // Check for cached result
171
- if (array_key_exists($command, self::$_commandCache)) {
172
- return self::$_commandCache[$command];
173
- }
174
-
175
- // Run command
176
- $h = popen(dirname(__FILE__) . '/bin/RoleEnvironmentProxy.exe ' . $command . ' 2>&1', 'r');
177
- $value = '';
178
- while (!feof($h)) {
179
- $value .= fread($h, 8192);
180
- }
181
- pclose($h);
182
-
183
- // Parse value
184
- if ($value == 'null') {
185
- $value = null;
186
- }
187
- self::$_commandCache[$command] = $value;
188
- return $value;
189
- }
190
- }
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: Storage.php 61042 2011-04-19 10:03:39Z unknown $
33
+ */
34
+
35
+ /**
36
+ * @see Microsoft_AutoLoader
37
+ */
38
+ require_once dirname(__FILE__) . '/../AutoLoader.php';
39
+
40
+ /**
41
+ * @category Microsoft
42
+ * @package Microsoft_WindowsAzure
43
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
44
+ * @license http://phpazure.codeplex.com/license
45
+ */
46
+ class Microsoft_WindowsAzure_RoleEnvironment
47
+ {
48
+ /**
49
+ * First-level command cache
50
+ *
51
+ * @var array
52
+ */
53
+ private static $_commandCache = array();
54
+ // TODO: may be interesting to cache commands for subsequent requests as well
55
+
56
+ /**
57
+ * Is the Windows Azure role environment available? Will return true on Windows Azure and Development Fabric, false when run in any other environment.
58
+ *
59
+ * @return boolean
60
+ */
61
+ public static function isAvailable()
62
+ {
63
+ $value = strtolower(self::_runCommand('IsAvailable'));
64
+ return $value == 'true';
65
+ }
66
+
67
+ /**
68
+ * Is the application running in the development fabric?
69
+ *
70
+ * @return boolean
71
+ */
72
+ public static function isDevFabric()
73
+ {
74
+ $value = strtolower(self::_runCommand('IsEmulated'));
75
+ return $value == 'true';
76
+ }
77
+
78
+ /**
79
+ * Gets the current role instance ID. Note that this method will return null when not hosted on Windows Azure.
80
+ *
81
+ * @return string
82
+ */
83
+ public static function getCurrentRoleInstanceId()
84
+ {
85
+ if (!self::isAvailable()) {
86
+ return null;
87
+ }
88
+
89
+ $value = self::_runCommand('GetCurrentRoleInstanceId');
90
+ return $value;
91
+ }
92
+
93
+ /**
94
+ * Gets the current role name. Note that this method will return null when not hosted on Windows Azure.
95
+ *
96
+ * @return string
97
+ */
98
+ public static function getCurrentRoleName()
99
+ {
100
+ if (!self::isAvailable()) {
101
+ return null;
102
+ }
103
+
104
+ $value = self::_runCommand('GetCurrentRoleName');
105
+ return $value;
106
+ }
107
+
108
+ /**
109
+ * Gets the current deployment ID. Note that this method will return null when not hosted on Windows Azure.
110
+ *
111
+ * @return string
112
+ */
113
+ public static function getDeploymentId()
114
+ {
115
+ if (!self::isAvailable()) {
116
+ return null;
117
+ }
118
+
119
+ $value = self::_runCommand('GetDeploymentId');
120
+ return $value;
121
+ }
122
+
123
+ /**
124
+ * Get configuration setting value from ServiceConfiguration.cscfg. Note that this method will return null when not hosted on Windows Azure.
125
+ *
126
+ * @param string $configurationKey Configuration key.
127
+ * @return string
128
+ */
129
+ public static function getConfigurationSettingValue($configurationKey)
130
+ {
131
+ if (!self::isAvailable()) {
132
+ return null;
133
+ }
134
+
135
+ $value = self::_runCommand('GetConfigurationSettingValue', array($configurationKey));
136
+ return $value;
137
+ }
138
+
139
+ /**
140
+ * Get local resource root path from ServiceDefinition.csdef. Note that this method will return null when not hosted on Windows Azure.
141
+ *
142
+ * @param string $localResourceKey Local resource key.
143
+ * @return string
144
+ */
145
+ public static function getLocalResource($localResourceKey)
146
+ {
147
+ if (!self::isAvailable()) {
148
+ return null;
149
+ }
150
+
151
+ $value = self::_runCommand('GetLocalResource', array($localResourceKey));
152
+ return $value;
153
+ }
154
+
155
+ /**
156
+ * Run a command through RoleEnvironmentProxy.exe.
157
+ *
158
+ * @param string $command Command to run.
159
+ * @param array $parameters Command parameters.
160
+ * @return mixed
161
+ */
162
+ protected static function _runCommand($command, $parameters = array())
163
+ {
164
+ for ($i = 0; $i < count($parameters); $i++) {
165
+ $parameters[$i] = escapeshellarg($parameters[$i]);
166
+ }
167
+ $parameters = implode(' ', $parameters);
168
+ $command = escapeshellarg($command) . ' ' . $parameters;
169
+
170
+ // Check for cached result
171
+ if (array_key_exists($command, self::$_commandCache)) {
172
+ return self::$_commandCache[$command];
173
+ }
174
+
175
+ // Run command
176
+ $h = popen(dirname(__FILE__) . '/bin/RoleEnvironmentProxy.exe ' . $command . ' 2>&1', 'r');
177
+ $value = '';
178
+ while (!feof($h)) {
179
+ $value .= fread($h, 8192);
180
+ }
181
+ pclose($h);
182
+
183
+ // Parse value
184
+ if ($value == 'null') {
185
+ $value = null;
186
+ }
187
+ self::$_commandCache[$command] = $value;
188
+ return $value;
189
+ }
190
+ }
libs/Microsoft/WindowsAzure/SessionHandler.php CHANGED
@@ -1,347 +1,347 @@
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
- * @subpackage Session
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 21617 2009-06-12 10:46:31Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Session
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- */
48
- class Microsoft_WindowsAzure_SessionHandler
49
- {
50
- /**
51
- * Maximal property size in table storage.
52
- *
53
- * @var int
54
- * @see http://msdn.microsoft.com/en-us/library/dd179338.aspx
55
- */
56
- const MAX_TS_PROPERTY_SIZE = 65536;
57
-
58
- /** Storage backend type */
59
- const STORAGE_TYPE_TABLE = 'table';
60
- const STORAGE_TYPE_BLOB = 'blob';
61
-
62
- /**
63
- * Storage back-end
64
- *
65
- * @var Microsoft_WindowsAzure_Storage_Table|Microsoft_WindowsAzure_Storage_Blob
66
- */
67
- protected $_storage;
68
-
69
- /**
70
- * Storage backend type
71
- *
72
- * @var string
73
- */
74
- protected $_storageType;
75
-
76
- /**
77
- * Session container name
78
- *
79
- * @var string
80
- */
81
- protected $_sessionContainer;
82
-
83
- /**
84
- * Session container partition
85
- *
86
- * @var string
87
- */
88
- protected $_sessionContainerPartition;
89
-
90
- /**
91
- * Creates a new Microsoft_WindowsAzure_SessionHandler instance
92
- *
93
- * @param Microsoft_WindowsAzure_Storage_Table|Microsoft_WindowsAzure_Storage_Blob $storage Storage back-end, can be table storage and blob storage
94
- * @param string $sessionContainer Session container name
95
- * @param string $sessionContainerPartition Session container partition
96
- */
97
- public function __construct(Microsoft_WindowsAzure_Storage $storage, $sessionContainer = 'phpsessions', $sessionContainerPartition = 'sessions')
98
- {
99
- // Validate $storage
100
- if (!($storage instanceof Microsoft_WindowsAzure_Storage_Table || $storage instanceof Microsoft_WindowsAzure_Storage_Blob)) {
101
- throw new Microsoft_WindowsAzure_Exception('Invalid storage back-end given. Storage back-end should be of type Microsoft_WindowsAzure_Storage_Table or Microsoft_WindowsAzure_Storage_Blob.');
102
- }
103
-
104
- // Validate other parameters
105
- if ($sessionContainer == '' || $sessionContainerPartition == '') {
106
- throw new Microsoft_WindowsAzure_Exception('Session container and session partition should be specified.');
107
- }
108
-
109
- // Determine storage type
110
- $storageType = self::STORAGE_TYPE_TABLE;
111
- if ($storage instanceof Microsoft_WindowsAzure_Storage_Blob) {
112
- $storageType = self::STORAGE_TYPE_BLOB;
113
- }
114
-
115
- // Set properties
116
- $this->_storage = $storage;
117
- $this->_storageType = $storageType;
118
- $this->_sessionContainer = $sessionContainer;
119
- $this->_sessionContainerPartition = $sessionContainerPartition;
120
- }
121
-
122
- /**
123
- * Object destructor
124
- */
125
- public function __destruct() {
126
- session_write_close();
127
- }
128
-
129
- /**
130
- * Registers the current session handler as PHP's session handler
131
- *
132
- * @return boolean
133
- */
134
- public function register()
135
- {
136
- return session_set_save_handler(array($this, 'open'),
137
- array($this, 'close'),
138
- array($this, 'read'),
139
- array($this, 'write'),
140
- array($this, 'destroy'),
141
- array($this, 'gc')
142
- );
143
- }
144
-
145
- /**
146
- * Open the session store
147
- *
148
- * @return bool
149
- */
150
- public function open()
151
- {
152
- // Make sure storage container exists
153
- if ($this->_storageType == self::STORAGE_TYPE_TABLE) {
154
- $this->_storage->createTableIfNotExists($this->_sessionContainer);
155
- } else if ($this->_storageType == self::STORAGE_TYPE_BLOB) {
156
- $this->_storage->createContainerIfNotExists($this->_sessionContainer);
157
- }
158
-
159
- // Ok!
160
- return true;
161
- }
162
-
163
- /**
164
- * Close the session store
165
- *
166
- * @return bool
167
- */
168
- public function close()
169
- {
170
- return true;
171
- }
172
-
173
- /**
174
- * Read a specific session
175
- *
176
- * @param int $id Session Id
177
- * @return string
178
- */
179
- public function read($id)
180
- {
181
- // Read data
182
- if ($this->_storageType == self::STORAGE_TYPE_TABLE) {
183
- // In table storage
184
- try
185
- {
186
- $sessionRecord = $this->_storage->retrieveEntityById(
187
- $this->_sessionContainer,
188
- $this->_sessionContainerPartition,
189
- $id
190
- );
191
- return unserialize(base64_decode($sessionRecord->serializedData));
192
- }
193
- catch (Microsoft_WindowsAzure_Exception $ex)
194
- {
195
- return '';
196
- }
197
- } else if ($this->_storageType == self::STORAGE_TYPE_BLOB) {
198
- // In blob storage
199
- try
200
- {
201
- $data = $this->_storage->getBlobData(
202
- $this->_sessionContainer,
203
- $this->_sessionContainerPartition . '/' . $id
204
- );
205
- return unserialize(base64_decode($data));
206
- }
207
- catch (Microsoft_WindowsAzure_Exception $ex)
208
- {
209
- return false;
210
- }
211
- }
212
- }
213
-
214
- /**
215
- * Write a specific session
216
- *
217
- * @param int $id Session Id
218
- * @param string $serializedData Serialized PHP object
219
- * @throws Exception
220
- */
221
- public function write($id, $serializedData)
222
- {
223
- // Encode data
224
- $serializedData = base64_encode(serialize($serializedData));
225
- if (strlen($serializedData) >= self::MAX_TS_PROPERTY_SIZE && $this->_storageType == self::STORAGE_TYPE_TABLE) {
226
- throw new Microsoft_WindowsAzure_Exception('Session data exceeds the maximum allowed size of ' . self::MAX_TS_PROPERTY_SIZE . ' bytes that can be stored using table storage. Consider switching to a blob storage back-end or try reducing session data size.');
227
- }
228
-
229
- // Store data
230
- if ($this->_storageType == self::STORAGE_TYPE_TABLE) {
231
- // In table storage
232
- $sessionRecord = new Microsoft_WindowsAzure_Storage_DynamicTableEntity($this->_sessionContainerPartition, $id);
233
- $sessionRecord->sessionExpires = time();
234
- $sessionRecord->serializedData = $serializedData;
235
-
236
- $sessionRecord->setAzurePropertyType('sessionExpires', 'Edm.Int32');
237
-
238
- try
239
- {
240
- $this->_storage->updateEntity($this->_sessionContainer, $sessionRecord);
241
- }
242
- catch (Microsoft_WindowsAzure_Exception $unknownRecord)
243
- {
244
- $this->_storage->insertEntity($this->_sessionContainer, $sessionRecord);
245
- }
246
- } else if ($this->_storageType == self::STORAGE_TYPE_BLOB) {
247
- // In blob storage
248
- $this->_storage->putBlobData(
249
- $this->_sessionContainer,
250
- $this->_sessionContainerPartition . '/' . $id,
251
- $serializedData,
252
- array('sessionexpires' => time())
253
- );
254
- }
255
- }
256
-
257
- /**
258
- * Destroy a specific session
259
- *
260
- * @param int $id Session Id
261
- * @return boolean
262
- */
263
- public function destroy($id)
264
- {
265
- // Destroy data
266
- if ($this->_storageType == self::STORAGE_TYPE_TABLE) {
267
- // In table storage
268
- try
269
- {
270
- $sessionRecord = $this->_storage->retrieveEntityById(
271
- $this->_sessionContainer,
272
- $this->_sessionContainerPartition,
273
- $id
274
- );
275
- $this->_storage->deleteEntity($this->_sessionContainer, $sessionRecord);
276
-
277
- return true;
278
- }
279
- catch (Microsoft_WindowsAzure_Exception $ex)
280
- {
281
- return false;
282
- }
283
- } else if ($this->_storageType == self::STORAGE_TYPE_BLOB) {
284
- // In blob storage
285
- try
286
- {
287
- $this->_storage->deleteBlob(
288
- $this->_sessionContainer,
289
- $this->_sessionContainerPartition . '/' . $id
290
- );
291
-
292
- return true;
293
- }
294
- catch (Microsoft_WindowsAzure_Exception $ex)
295
- {
296
- return false;
297
- }
298
- }
299
- }
300
-
301
- /**
302
- * Garbage collector
303
- *
304
- * @param int $lifeTime Session maximal lifetime
305
- * @see session.gc_divisor 100
306
- * @see session.gc_maxlifetime 1440
307
- * @see session.gc_probability 1
308
- * @usage Execution rate 1/100 (session.gc_probability/session.gc_divisor)
309
- * @return boolean
310
- */
311
- public function gc($lifeTime)
312
- {
313
- if ($this->_storageType == self::STORAGE_TYPE_TABLE) {
314
- // In table storage
315
- try
316
- {
317
- $result = $this->_storage->retrieveEntities($this->_sessionContainer, 'PartitionKey eq \'' . $this->_sessionContainerPartition . '\' and sessionExpires lt ' . (time() - $lifeTime));
318
- foreach ($result as $sessionRecord)
319
- {
320
- $this->_storage->deleteEntity($this->_sessionContainer, $sessionRecord);
321
- }
322
- return true;
323
- }
324
- catch (Microsoft_WindowsAzure_exception $ex)
325
- {
326
- return false;
327
- }
328
- } else if ($this->_storageType == self::STORAGE_TYPE_BLOB) {
329
- // In blob storage
330
- try
331
- {
332
- $result = $this->_storage->listBlobs($this->_sessionContainer, $this->_sessionContainerPartition, '', null, null, 'metadata');
333
- foreach ($result as $sessionRecord)
334
- {
335
- if ($sessionRecord->Metadata['sessionexpires'] < (time() - $lifeTime)) {
336
- $this->_storage->deleteBlob($this->_sessionContainer, $sessionRecord->Name);
337
- }
338
- }
339
- return true;
340
- }
341
- catch (Microsoft_WindowsAzure_exception $ex)
342
- {
343
- return false;
344
- }
345
- }
346
- }
347
- }
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
+ * @subpackage Session
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 21617 2009-06-12 10:46:31Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Session
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ */
48
+ class Microsoft_WindowsAzure_SessionHandler
49
+ {
50
+ /**
51
+ * Maximal property size in table storage.
52
+ *
53
+ * @var int
54
+ * @see http://msdn.microsoft.com/en-us/library/dd179338.aspx
55
+ */
56
+ const MAX_TS_PROPERTY_SIZE = 65536;
57
+
58
+ /** Storage backend type */
59
+ const STORAGE_TYPE_TABLE = 'table';
60
+ const STORAGE_TYPE_BLOB = 'blob';
61
+
62
+ /**
63
+ * Storage back-end
64
+ *
65
+ * @var Microsoft_WindowsAzure_Storage_Table|Microsoft_WindowsAzure_Storage_Blob
66
+ */
67
+ protected $_storage;
68
+
69
+ /**
70
+ * Storage backend type
71
+ *
72
+ * @var string
73
+ */
74
+ protected $_storageType;
75
+
76
+ /**
77
+ * Session container name
78
+ *
79
+ * @var string
80
+ */
81
+ protected $_sessionContainer;
82
+
83
+ /**
84
+ * Session container partition
85
+ *
86
+ * @var string
87
+ */
88
+ protected $_sessionContainerPartition;
89
+
90
+ /**
91
+ * Creates a new Microsoft_WindowsAzure_SessionHandler instance
92
+ *
93
+ * @param Microsoft_WindowsAzure_Storage_Table|Microsoft_WindowsAzure_Storage_Blob $storage Storage back-end, can be table storage and blob storage
94
+ * @param string $sessionContainer Session container name
95
+ * @param string $sessionContainerPartition Session container partition
96
+ */
97
+ public function __construct(Microsoft_WindowsAzure_Storage $storage, $sessionContainer = 'phpsessions', $sessionContainerPartition = 'sessions')
98
+ {
99
+ // Validate $storage
100
+ if (!($storage instanceof Microsoft_WindowsAzure_Storage_Table || $storage instanceof Microsoft_WindowsAzure_Storage_Blob)) {
101
+ throw new Microsoft_WindowsAzure_Exception('Invalid storage back-end given. Storage back-end should be of type Microsoft_WindowsAzure_Storage_Table or Microsoft_WindowsAzure_Storage_Blob.');
102
+ }
103
+
104
+ // Validate other parameters
105
+ if ($sessionContainer == '' || $sessionContainerPartition == '') {
106
+ throw new Microsoft_WindowsAzure_Exception('Session container and session partition should be specified.');
107
+ }
108
+
109
+ // Determine storage type
110
+ $storageType = self::STORAGE_TYPE_TABLE;
111
+ if ($storage instanceof Microsoft_WindowsAzure_Storage_Blob) {
112
+ $storageType = self::STORAGE_TYPE_BLOB;
113
+ }
114
+
115
+ // Set properties
116
+ $this->_storage = $storage;
117
+ $this->_storageType = $storageType;
118
+ $this->_sessionContainer = $sessionContainer;
119
+ $this->_sessionContainerPartition = $sessionContainerPartition;
120
+ }
121
+
122
+ /**
123
+ * Object destructor
124
+ */
125
+ public function __destruct() {
126
+ session_write_close();
127
+ }
128
+
129
+ /**
130
+ * Registers the current session handler as PHP's session handler
131
+ *
132
+ * @return boolean
133
+ */
134
+ public function register()
135
+ {
136
+ return session_set_save_handler(array($this, 'open'),
137
+ array($this, 'close'),
138
+ array($this, 'read'),
139
+ array($this, 'write'),
140
+ array($this, 'destroy'),
141
+ array($this, 'gc')
142
+ );
143
+ }
144
+
145
+ /**
146
+ * Open the session store
147
+ *
148
+ * @return bool
149
+ */
150
+ public function open()
151
+ {
152
+ // Make sure storage container exists
153
+ if ($this->_storageType == self::STORAGE_TYPE_TABLE) {
154
+ $this->_storage->createTableIfNotExists($this->_sessionContainer);
155
+ } else if ($this->_storageType == self::STORAGE_TYPE_BLOB) {
156
+ $this->_storage->createContainerIfNotExists($this->_sessionContainer);
157
+ }
158
+
159
+ // Ok!
160
+ return true;
161
+ }
162
+
163
+ /**
164
+ * Close the session store
165
+ *
166
+ * @return bool
167
+ */
168
+ public function close()
169
+ {
170
+ return true;
171
+ }
172
+
173
+ /**
174
+ * Read a specific session
175
+ *
176
+ * @param int $id Session Id
177
+ * @return string
178
+ */
179
+ public function read($id)
180
+ {
181
+ // Read data
182
+ if ($this->_storageType == self::STORAGE_TYPE_TABLE) {
183
+ // In table storage
184
+ try
185
+ {
186
+ $sessionRecord = $this->_storage->retrieveEntityById(
187
+ $this->_sessionContainer,
188
+ $this->_sessionContainerPartition,
189
+ $id
190
+ );
191
+ return unserialize(base64_decode($sessionRecord->serializedData));
192
+ }
193
+ catch (Microsoft_WindowsAzure_Exception $ex)
194
+ {
195
+ return '';
196
+ }
197
+ } else if ($this->_storageType == self::STORAGE_TYPE_BLOB) {
198
+ // In blob storage
199
+ try
200
+ {
201
+ $data = $this->_storage->getBlobData(
202
+ $this->_sessionContainer,
203
+ $this->_sessionContainerPartition . '/' . $id
204
+ );
205
+ return unserialize(base64_decode($data));
206
+ }
207
+ catch (Microsoft_WindowsAzure_Exception $ex)
208
+ {
209
+ return false;
210
+ }
211
+ }
212
+ }
213
+
214
+ /**
215
+ * Write a specific session
216
+ *
217
+ * @param int $id Session Id
218
+ * @param string $serializedData Serialized PHP object
219
+ * @throws Exception
220
+ */
221
+ public function write($id, $serializedData)
222
+ {
223
+ // Encode data
224
+ $serializedData = base64_encode(serialize($serializedData));
225
+ if (strlen($serializedData) >= self::MAX_TS_PROPERTY_SIZE && $this->_storageType == self::STORAGE_TYPE_TABLE) {
226
+ throw new Microsoft_WindowsAzure_Exception('Session data exceeds the maximum allowed size of ' . self::MAX_TS_PROPERTY_SIZE . ' bytes that can be stored using table storage. Consider switching to a blob storage back-end or try reducing session data size.');
227
+ }
228
+
229
+ // Store data
230
+ if ($this->_storageType == self::STORAGE_TYPE_TABLE) {
231
+ // In table storage
232
+ $sessionRecord = new Microsoft_WindowsAzure_Storage_DynamicTableEntity($this->_sessionContainerPartition, $id);
233
+ $sessionRecord->sessionExpires = time();
234
+ $sessionRecord->serializedData = $serializedData;
235
+
236
+ $sessionRecord->setAzurePropertyType('sessionExpires', 'Edm.Int32');
237
+
238
+ try
239
+ {
240
+ $this->_storage->updateEntity($this->_sessionContainer, $sessionRecord);
241
+ }
242
+ catch (Microsoft_WindowsAzure_Exception $unknownRecord)
243
+ {
244
+ $this->_storage->insertEntity($this->_sessionContainer, $sessionRecord);
245
+ }
246
+ } else if ($this->_storageType == self::STORAGE_TYPE_BLOB) {
247
+ // In blob storage
248
+ $this->_storage->putBlobData(
249
+ $this->_sessionContainer,
250
+ $this->_sessionContainerPartition . '/' . $id,
251
+ $serializedData,
252
+ array('sessionexpires' => time())
253
+ );
254
+ }
255
+ }
256
+
257
+ /**
258
+ * Destroy a specific session
259
+ *
260
+ * @param int $id Session Id
261
+ * @return boolean
262
+ */
263
+ public function destroy($id)
264
+ {
265
+ // Destroy data
266
+ if ($this->_storageType == self::STORAGE_TYPE_TABLE) {
267
+ // In table storage
268
+ try
269
+ {
270
+ $sessionRecord = $this->_storage->retrieveEntityById(
271
+ $this->_sessionContainer,
272
+ $this->_sessionContainerPartition,
273
+ $id
274
+ );
275
+ $this->_storage->deleteEntity($this->_sessionContainer, $sessionRecord);
276
+
277
+ return true;
278
+ }
279
+ catch (Microsoft_WindowsAzure_Exception $ex)
280
+ {
281
+ return false;
282
+ }
283
+ } else if ($this->_storageType == self::STORAGE_TYPE_BLOB) {
284
+ // In blob storage
285
+ try
286
+ {
287
+ $this->_storage->deleteBlob(
288
+ $this->_sessionContainer,
289
+ $this->_sessionContainerPartition . '/' . $id
290
+ );
291
+
292
+ return true;
293
+ }
294
+ catch (Microsoft_WindowsAzure_Exception $ex)
295
+ {
296
+ return false;
297
+ }
298
+ }
299
+ }
300
+
301
+ /**
302
+ * Garbage collector
303
+ *
304
+ * @param int $lifeTime Session maximal lifetime
305
+ * @see session.gc_divisor 100
306
+ * @see session.gc_maxlifetime 1440
307
+ * @see session.gc_probability 1
308
+ * @usage Execution rate 1/100 (session.gc_probability/session.gc_divisor)
309
+ * @return boolean
310
+ */
311
+ public function gc($lifeTime)
312
+ {
313
+ if ($this->_storageType == self::STORAGE_TYPE_TABLE) {
314
+ // In table storage
315
+ try
316
+ {
317
+ $result = $this->_storage->retrieveEntities($this->_sessionContainer, 'PartitionKey eq \'' . $this->_sessionContainerPartition . '\' and sessionExpires lt ' . (time() - $lifeTime));
318
+ foreach ($result as $sessionRecord)
319
+ {
320
+ $this->_storage->deleteEntity($this->_sessionContainer, $sessionRecord);
321
+ }
322
+ return true;
323
+ }
324
+ catch (Microsoft_WindowsAzure_exception $ex)
325
+ {
326
+ return false;
327
+ }
328
+ } else if ($this->_storageType == self::STORAGE_TYPE_BLOB) {
329
+ // In blob storage
330
+ try
331
+ {
332
+ $result = $this->_storage->listBlobs($this->_sessionContainer, $this->_sessionContainerPartition, '', null, null, 'metadata');
333
+ foreach ($result as $sessionRecord)
334
+ {
335
+ if ($sessionRecord->Metadata['sessionexpires'] < (time() - $lifeTime)) {
336
+ $this->_storage->deleteBlob($this->_sessionContainer, $sessionRecord->Name);
337
+ }
338
+ }
339
+ return true;
340
+ }
341
+ catch (Microsoft_WindowsAzure_exception $ex)
342
+ {
343
+ return false;
344
+ }
345
+ }
346
+ }
347
+ }
libs/Microsoft/WindowsAzure/Storage.php CHANGED
@@ -1,629 +1,629 @@
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
- * @subpackage Storage
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 66505 2011-12-02 08:45:51Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Storage
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- */
48
- class Microsoft_WindowsAzure_Storage
49
- {
50
- /**
51
- * Development storage URLS
52
- */
53
- const URL_DEV_BLOB = "http://127.0.0.1:10000";
54
- const URL_DEV_QUEUE = "http://127.0.0.1:10001";
55
- const URL_DEV_TABLE = "http://127.0.0.1:10002";
56
-
57
- /**
58
- * Live storage URLS
59
- */
60
- const URL_CLOUD_BLOB = "http://blob.core.windows.net";
61
- const URL_CLOUD_QUEUE = "http://queue.core.windows.net";
62
- const URL_CLOUD_TABLE = "http://table.core.windows.net";
63
- const URL_CLOUD_BLOB_HTTPS = "ssl://blob.core.windows.net";
64
- const URL_CLOUD_QUEUE_HTTPS = "ssl://queue.core.windows.net";
65
- const URL_CLOUD_TABLE_HTTPS = "ssl://table.core.windows.net";
66
-
67
- /**
68
- * Resource types
69
- */
70
- const RESOURCE_UNKNOWN = "unknown";
71
- const RESOURCE_CONTAINER = "c";
72
- const RESOURCE_BLOB = "b";
73
- const RESOURCE_TABLE = "t";
74
- const RESOURCE_ENTITY = "e";
75
- const RESOURCE_QUEUE = "q";
76
-
77
- /**
78
- * HTTP header prefixes
79
- */
80
- const PREFIX_PROPERTIES = "x-ms-prop-";
81
- const PREFIX_METADATA = "x-ms-meta-";
82
- const PREFIX_STORAGE_HEADER = "x-ms-";
83
-
84
- /**
85
- * Protocols
86
- */
87
- const PROTOCOL_HTTP = 'http://';
88
- const PROTOCOL_HTTPS = 'https://';
89
- const PROTOCOL_SSL = 'ssl://';
90
-
91
- /**
92
- * Current API version
93
- *
94
- * @var string
95
- */
96
- protected $_apiVersion = '2009-09-19';
97
-
98
- /**
99
- * Storage protocol
100
- *
101
- * @var string
102
- */
103
- protected $_protocol = 'http://';
104
-
105
- /**
106
- * Storage host name
107
- *
108
- * @var string
109
- */
110
- protected $_host = '';
111
-
112
- /**
113
- * Account name for Windows Azure
114
- *
115
- * @var string
116
- */
117
- protected $_accountName = '';
118
-
119
- /**
120
- * Account key for Windows Azure
121
- *
122
- * @var string
123
- */
124
- protected $_accountKey = '';
125
-
126
- /**
127
- * Use path-style URI's
128
- *
129
- * @var boolean
130
- */
131
- protected $_usePathStyleUri = false;
132
-
133
- /**
134
- * Microsoft_WindowsAzure_Credentials_CredentialsAbstract instance
135
- *
136
- * @var Microsoft_WindowsAzure_Credentials_CredentialsAbstract
137
- */
138
- protected $_credentials = null;
139
-
140
- /**
141
- * Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract instance
142
- *
143
- * @var Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract
144
- */
145
- protected $_retryPolicy = null;
146
-
147
- /**
148
- * Microsoft_Http_Client channel used for communication with REST services
149
- *
150
- * @var Microsoft_Http_Client
151
- */
152
- protected $_httpClientChannel = null;
153
-
154
- /**
155
- * Use proxy?
156
- *
157
- * @var boolean
158
- */
159
- protected $_useProxy = false;
160
-
161
- /**
162
- * Proxy url
163
- *
164
- * @var string
165
- */
166
- protected $_proxyUrl = '';
167
-
168
- /**
169
- * Proxy port
170
- *
171
- * @var int
172
- */
173
- protected $_proxyPort = 80;
174
-
175
- /**
176
- * Proxy credentials
177
- *
178
- * @var string
179
- */
180
- protected $_proxyCredentials = '';
181
-
182
- /**
183
- * Creates a new Microsoft_WindowsAzure_Storage instance
184
- *
185
- * @param string $host Storage host name
186
- * @param string $accountName Account name for Windows Azure
187
- * @param string $accountKey Account key for Windows Azure
188
- * @param boolean $usePathStyleUri Use path-style URI's
189
- * @param Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy Retry policy to use when making requests
190
- */
191
- public function __construct(
192
- $host = self::URL_DEV_BLOB,
193
- $accountName = Microsoft_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_ACCOUNT,
194
- $accountKey = Microsoft_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_KEY,
195
- $usePathStyleUri = false,
196
- Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null
197
- ) {
198
- if (strpos($host, self::PROTOCOL_HTTP) !== false) {
199
- $this->_protocol = self::PROTOCOL_HTTP;
200
- $this->_host = str_replace(self::PROTOCOL_HTTP, '', $host);
201
- } else if (strpos($host, self::PROTOCOL_HTTPS) !== false) {
202
- $this->_protocol = self::PROTOCOL_HTTPS;
203
- $this->_host = str_replace(self::PROTOCOL_HTTPS, '', $host);
204
- } else if (strpos($host, self::PROTOCOL_SSL) !== false) {
205
- $this->_protocol = self::PROTOCOL_SSL;
206
- $this->_host = str_replace(self::PROTOCOL_SSL, '', $host);
207
- } else {
208
- $this->_protocol = self::PROTOCOL_HTTP;
209
- $this->_host = $host;
210
- }
211
- $this->_accountName = $accountName;
212
- $this->_accountKey = $accountKey;
213
- $this->_usePathStyleUri = $usePathStyleUri;
214
-
215
- // Using local storage?
216
- if (!$this->_usePathStyleUri
217
- && ($this->_protocol . $this->_host == self::URL_DEV_BLOB
218
- || $this->_protocol . $this->_host == self::URL_DEV_QUEUE
219
- || $this->_protocol . $this->_host == self::URL_DEV_TABLE)
220
- ) {
221
- // Local storage
222
- $this->_usePathStyleUri = true;
223
- }
224
-
225
- if (is_null($this->_credentials)) {
226
- $this->_credentials = new Microsoft_WindowsAzure_Credentials_SharedKey(
227
- $this->_accountName, $this->_accountKey, $this->_usePathStyleUri);
228
- }
229
-
230
- $this->_retryPolicy = $retryPolicy;
231
- if (is_null($this->_retryPolicy)) {
232
- $this->_retryPolicy = Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract::noRetry();
233
- }
234
-
235
- // Setup default Microsoft_Http_Client channel
236
- $options = array(
237
- 'adapter' => 'Microsoft_Http_Client_Adapter_Proxy'
238
- );
239
- if (function_exists('curl_init')) {
240
- // Set cURL options if cURL is used afterwards
241
- $options['curloptions'] = array(
242
- CURLOPT_FOLLOWLOCATION => true,
243
- CURLOPT_TIMEOUT => 120,
244
- );
245
- }
246
- $this->_httpClientChannel = new Microsoft_Http_Client(null, $options);
247
- }
248
-
249
- /**
250
- * Set the HTTP client channel to use
251
- *
252
- * @param Microsoft_Http_Client_Adapter_Interface|string $adapterInstance Adapter instance or adapter class name.
253
- */
254
- public function setHttpClientChannel($adapterInstance = 'Microsoft_Http_Client_Adapter_Proxy')
255
- {
256
- $this->_httpClientChannel->setAdapter($adapterInstance);
257
- }
258
-
259
- /**
260
- * Retrieve HTTP client channel
261
- *
262
- * @return Microsoft_Http_Client_Adapter_Interface
263
- */
264
- public function getHttpClientChannel()
265
- {
266
- return $this->_httpClientChannel;
267
- }
268
-
269
- /**
270
- * Set retry policy to use when making requests
271
- *
272
- * @param Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy Retry policy to use when making requests
273
- */
274
- public function setRetryPolicy(Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null)
275
- {
276
- $this->_retryPolicy = $retryPolicy;
277
- if (is_null($this->_retryPolicy)) {
278
- $this->_retryPolicy = Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract::noRetry();
279
- }
280
- }
281
-
282
- /**
283
- * Set proxy
284
- *
285
- * @param boolean $useProxy Use proxy?
286
- * @param string $proxyUrl Proxy URL
287
- * @param int $proxyPort Proxy port
288
- * @param string $proxyCredentials Proxy credentials
289
- */
290
- public function setProxy($useProxy = false, $proxyUrl = '', $proxyPort = 80, $proxyCredentials = '')
291
- {
292
- $this->_useProxy = $useProxy;
293
- $this->_proxyUrl = $proxyUrl;
294
- $this->_proxyPort = $proxyPort;
295
- $this->_proxyCredentials = $proxyCredentials;
296
-
297
- if ($this->_useProxy) {
298
- $credentials = explode(':', $this->_proxyCredentials);
299
-
300
- $this->_httpClientChannel->setConfig(array(
301
- 'proxy_host' => $this->_proxyUrl,
302
- 'proxy_port' => $this->_proxyPort,
303
- 'proxy_user' => $credentials[0],
304
- 'proxy_pass' => $credentials[1],
305
- ));
306
- } else {
307
- $this->_httpClientChannel->setConfig(array(
308
- 'proxy_host' => '',
309
- 'proxy_port' => 8080,
310
- 'proxy_user' => '',
311
- 'proxy_pass' => '',
312
- ));
313
- }
314
- }
315
-
316
- /**
317
- * Returns the Windows Azure account name
318
- *
319
- * @return string
320
- */
321
- public function getAccountName()
322
- {
323
- return $this->_accountName;
324
- }
325
-
326
- /**
327
- * Get base URL for creating requests
328
- *
329
- * @return string
330
- */
331
- public function getBaseUrl()
332
- {
333
- if ($this->_usePathStyleUri) {
334
- return $this->_protocol . $this->_host . '/' . $this->_accountName;
335
- } else {
336
- return $this->_protocol . $this->_accountName . '.' . $this->_host;
337
- }
338
- }
339
-
340
- /**
341
- * Set Microsoft_WindowsAzure_Credentials_CredentialsAbstract instance
342
- *
343
- * @param Microsoft_WindowsAzure_Credentials_CredentialsAbstract $credentials Microsoft_WindowsAzure_Credentials_CredentialsAbstract instance to use for request signing.
344
- */
345
- public function setCredentials(Microsoft_WindowsAzure_Credentials_CredentialsAbstract $credentials)
346
- {
347
- $this->_credentials = $credentials;
348
- $this->_credentials->setAccountName($this->_accountName);
349
- $this->_credentials->setAccountkey($this->_accountKey);
350
- $this->_credentials->setUsePathStyleUri($this->_usePathStyleUri);
351
- }
352
-
353
- /**
354
- * Get Microsoft_WindowsAzure_Credentials_CredentialsAbstract instance
355
- *
356
- * @return Microsoft_WindowsAzure_Credentials_CredentialsAbstract
357
- */
358
- public function getCredentials()
359
- {
360
- return $this->_credentials;
361
- }
362
-
363
- /**
364
- * Returns the properties of a storage service.
365
- * Service properties include Logging (no connection with the logging components of this SDK)
366
- * and Metrics details.
367
- * Returned strucutre:
368
- * array(
369
- * '<Area>' => array('<Property>' => string|array)
370
- * );
371
- * <Area> can be: Logging, Metrics or other service areas.
372
- *
373
- * @return array
374
- */
375
- public function getServiceProperties()
376
- {
377
- // Perform request
378
- $response = $this->_performRequest('/', '?restype=service&comp=properties');
379
- if (!$response->isSuccessful()) {
380
- throw new Microsoft_WindowsAzure_Exception($this->_getErrorMessage(
381
- $response, 'Cannot obtain service properties.'
382
- ));
383
- }
384
-
385
- // turn the response from a SimpleXML object to an array
386
- $parsedResponse = $this->_parseResponse($response);
387
-
388
- $returnArray = array();
389
- foreach ($parsedResponse as $key => $propertyAsXmlNode) {
390
- $returnArray[$key] = $this->_parseServicePropertyResponseNode($propertyAsXmlNode);
391
- }
392
-
393
- return $returnArray;
394
- }
395
-
396
- /**
397
- * Parses a node of the service property response. A node is a direct child of the root
398
- * element (StorageServiceProperties).
399
- * Returns the array representation of that node.
400
- *
401
- * @param $responseNode
402
- * @return array
403
- */
404
- protected function _parseServicePropertyResponseNode($responseNode)
405
- {
406
- if ($responseNode->count() > 0) {
407
- $returnArray = array();
408
- foreach ($responseNode as $key => $childNode) {
409
- $returnArray[$key] = $this->_parseServicePropertyResponseNode($childNode);
410
- }
411
- return $returnArray;
412
- } else {
413
- return (string)$responseNode;
414
- }
415
- }
416
-
417
- /**
418
- * Perform request using Microsoft_Http_Client channel
419
- *
420
- * @param string $path Path
421
- * @param array $query Query parameters
422
- * @param string $httpVerb HTTP verb the request will use
423
- * @param array $headers x-ms headers to add
424
- * @param boolean $forTableStorage Is the request for table storage?
425
- * @param mixed $rawData Optional RAW HTTP data to be sent over the wire
426
- * @param string $resourceType Resource type
427
- * @param string $requiredPermission Required permission
428
- * @return Microsoft_Http_Response
429
- */
430
- protected function _performRequest(
431
- $path = '/',
432
- $query = array(),
433
- $httpVerb = Microsoft_Http_Client::GET,
434
- $headers = array(),
435
- $forTableStorage = false,
436
- $rawData = null,
437
- $resourceType = Microsoft_WindowsAzure_Storage::RESOURCE_UNKNOWN,
438
- $requiredPermission = Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ
439
- ) {
440
- // Clean path
441
- if (strpos($path, '/') !== 0) {
442
- $path = '/' . $path;
443
- }
444
-
445
- // Clean headers
446
- if (is_null($headers)) {
447
- $headers = array();
448
- }
449
-
450
- // Ensure cUrl will also work correctly:
451
- // - disable Content-Type if required
452
- // - disable Expect: 100 Continue
453
- if (!isset($headers["Content-Type"])) {
454
- $headers["Content-Type"] = '';
455
- }
456
- $headers["Expect"]= '';
457
-
458
- // Add version header
459
- $headers['x-ms-version'] = $this->_apiVersion;
460
-
461
- // Generate URL
462
- $path = str_replace(' ', '%20', $path);
463
- $requestUrl = $this->getBaseUrl() . $path;
464
- if (count($query) > 0) {
465
- $queryString = '';
466
- foreach ($query as $key => $value) {
467
- $queryString .= ($queryString ? '&' : '?') . rawurlencode($key) . '=' . rawurlencode($value);
468
- }
469
- $requestUrl .= $queryString;
470
- }
471
-
472
- // Sign request
473
- $requestUrl = $this->_credentials
474
- ->signRequestUrl($requestUrl, $resourceType, $requiredPermission);
475
- $requestHeaders = $this->_credentials
476
- ->signRequestHeaders($httpVerb, $path, $query, $headers, $forTableStorage, $resourceType, $requiredPermission, $rawData);
477
-
478
- // Prepare request
479
- $this->_httpClientChannel->resetParameters(true);
480
- $this->_httpClientChannel->setUri($requestUrl);
481
- $this->_httpClientChannel->setHeaders($requestHeaders);
482
- $this->_httpClientChannel->setRawData($rawData);
483
-
484
- // Execute request
485
- $response = $this->_retryPolicy->execute(
486
- array($this->_httpClientChannel, 'request'),
487
- array($httpVerb)
488
- );
489
-
490
- return $response;
491
- }
492
-
493
- /**
494
- * Parse result from Microsoft_Http_Response
495
- *
496
- * @param Microsoft_Http_Response $response Response from HTTP call
497
- * @return object
498
- * @throws Microsoft_WindowsAzure_Exception
499
- */
500
- protected function _parseResponse(Microsoft_Http_Response $response = null)
501
- {
502
- if (is_null($response)) {
503
- throw new Microsoft_WindowsAzure_Exception('Response should not be null.');
504
- }
505
-
506
- $xml = @simplexml_load_string($response->getBody());
507
-
508
- if ($xml !== false) {
509
- // Fetch all namespaces
510
- $namespaces = array_merge($xml->getNamespaces(true), $xml->getDocNamespaces(true));
511
-
512
- // Register all namespace prefixes
513
- foreach ($namespaces as $prefix => $ns) {
514
- if ($prefix != '') {
515
- $xml->registerXPathNamespace($prefix, $ns);
516
- }
517
- }
518
- }
519
-
520
- return $xml;
521
- }
522
-
523
- /**
524
- * Generate metadata headers
525
- *
526
- * @param array $metadata
527
- * @return HTTP headers containing metadata
528
- */
529
- protected function _generateMetadataHeaders($metadata = array())
530
- {
531
- // Validate
532
- if (!is_array($metadata)) {
533
- return array();
534
- }
535
-
536
- // Return headers
537
- $headers = array();
538
- foreach ($metadata as $key => $value) {
539
- if (strpos($value, "\r") !== false || strpos($value, "\n") !== false) {
540
- throw new Microsoft_WindowsAzure_Exception('Metadata cannot contain newline characters.');
541
- }
542
-
543
- if (!self::isValidMetadataName($key)) {
544
- throw new Microsoft_WindowsAzure_Exception('Metadata name does not adhere to metadata naming conventions. See http://msdn.microsoft.com/en-us/library/aa664670(VS.71).aspx for more information.');
545
- }
546
-
547
- $headers["x-ms-meta-" . strtolower($key)] = $value;
548
- }
549
- return $headers;
550
- }
551
-
552
- /**
553
- * Parse metadata headers
554
- *
555
- * @param array $headers HTTP headers containing metadata
556
- * @return array
557
- */
558
- protected function _parseMetadataHeaders($headers = array())
559
- {
560
- // Validate
561
- if (!is_array($headers)) {
562
- return array();
563
- }
564
-
565
- // Return metadata
566
- $metadata = array();
567
- foreach ($headers as $key => $value) {
568
- if (substr(strtolower($key), 0, 10) == "x-ms-meta-") {
569
- $metadata[str_replace("x-ms-meta-", '', strtolower($key))] = $value;
570
- }
571
- }
572
- return $metadata;
573
- }
574
-
575
- /**
576
- * Parse metadata XML
577
- *
578
- * @param SimpleXMLElement $parentElement Element containing the Metadata element.
579
- * @return array
580
- */
581
- protected function _parseMetadataElement($element = null)
582
- {
583
- // Metadata present?
584
- if (!is_null($element) && isset($element->Metadata) && !is_null($element->Metadata)) {
585
- return get_object_vars($element->Metadata);
586
- }
587
-
588
- return array();
589
- }
590
-
591
- /**
592
- * Generate ISO 8601 compliant date string in UTC time zone
593
- *
594
- * @param int $timestamp
595
- * @return string
596
- */
597
- public function isoDate($timestamp = null)
598
- {
599
- $tz = @date_default_timezone_get();
600
- @date_default_timezone_set('UTC');
601
-
602
- if (is_null($timestamp)) {
603
- $timestamp = time();
604
- }
605
-
606
- $returnValue = str_replace('+00:00', '.0000000Z', @date('c', $timestamp));
607
- @date_default_timezone_set($tz);
608
- return $returnValue;
609
- }
610
-
611
- /**
612
- * Is valid metadata name?
613
- *
614
- * @param string $metadataName Metadata name
615
- * @return boolean
616
- */
617
- public static function isValidMetadataName($metadataName = '')
618
- {
619
- if (preg_match("/^[a-zA-Z0-9_@][a-zA-Z0-9_]*$/", $metadataName) === 0) {
620
- return false;
621
- }
622
-
623
- if ($metadataName == '') {
624
- return false;
625
- }
626
-
627
- return true;
628
- }
629
- }
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
+ * @subpackage Storage
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 66505 2011-12-02 08:45:51Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Storage
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ */
48
+ class Microsoft_WindowsAzure_Storage
49
+ {
50
+ /**
51
+ * Development storage URLS
52
+ */
53
+ const URL_DEV_BLOB = "http://127.0.0.1:10000";
54
+ const URL_DEV_QUEUE = "http://127.0.0.1:10001";
55
+ const URL_DEV_TABLE = "http://127.0.0.1:10002";
56
+
57
+ /**
58
+ * Live storage URLS
59
+ */
60
+ const URL_CLOUD_BLOB = "http://blob.core.windows.net";
61
+ const URL_CLOUD_QUEUE = "http://queue.core.windows.net";
62
+ const URL_CLOUD_TABLE = "http://table.core.windows.net";
63
+ const URL_CLOUD_BLOB_HTTPS = "ssl://blob.core.windows.net";
64
+ const URL_CLOUD_QUEUE_HTTPS = "ssl://queue.core.windows.net";
65
+ const URL_CLOUD_TABLE_HTTPS = "ssl://table.core.windows.net";
66
+
67
+ /**
68
+ * Resource types
69
+ */
70
+ const RESOURCE_UNKNOWN = "unknown";
71
+ const RESOURCE_CONTAINER = "c";
72
+ const RESOURCE_BLOB = "b";
73
+ const RESOURCE_TABLE = "t";
74
+ const RESOURCE_ENTITY = "e";
75
+ const RESOURCE_QUEUE = "q";
76
+
77
+ /**
78
+ * HTTP header prefixes
79
+ */
80
+ const PREFIX_PROPERTIES = "x-ms-prop-";
81
+ const PREFIX_METADATA = "x-ms-meta-";
82
+ const PREFIX_STORAGE_HEADER = "x-ms-";
83
+
84
+ /**
85
+ * Protocols
86
+ */
87
+ const PROTOCOL_HTTP = 'http://';
88
+ const PROTOCOL_HTTPS = 'https://';
89
+ const PROTOCOL_SSL = 'ssl://';
90
+
91
+ /**
92
+ * Current API version
93
+ *
94
+ * @var string
95
+ */
96
+ protected $_apiVersion = '2009-09-19';
97
+
98
+ /**
99
+ * Storage protocol
100
+ *
101
+ * @var string
102
+ */
103
+ protected $_protocol = 'http://';
104
+
105
+ /**
106
+ * Storage host name
107
+ *
108
+ * @var string
109
+ */
110
+ protected $_host = '';
111
+
112
+ /**
113
+ * Account name for Windows Azure
114
+ *
115
+ * @var string
116
+ */
117
+ protected $_accountName = '';
118
+
119
+ /**
120
+ * Account key for Windows Azure
121
+ *
122
+ * @var string
123
+ */
124
+ protected $_accountKey = '';
125
+
126
+ /**
127
+ * Use path-style URI's
128
+ *
129
+ * @var boolean
130
+ */
131
+ protected $_usePathStyleUri = false;
132
+
133
+ /**
134
+ * Microsoft_WindowsAzure_Credentials_CredentialsAbstract instance
135
+ *
136
+ * @var Microsoft_WindowsAzure_Credentials_CredentialsAbstract
137
+ */
138
+ protected $_credentials = null;
139
+
140
+ /**
141
+ * Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract instance
142
+ *
143
+ * @var Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract
144
+ */
145
+ protected $_retryPolicy = null;
146
+
147
+ /**
148
+ * Microsoft_Http_Client channel used for communication with REST services
149
+ *
150
+ * @var Microsoft_Http_Client
151
+ */
152
+ protected $_httpClientChannel = null;
153
+
154
+ /**
155
+ * Use proxy?
156
+ *
157
+ * @var boolean
158
+ */
159
+ protected $_useProxy = false;
160
+
161
+ /**
162
+ * Proxy url
163
+ *
164
+ * @var string
165
+ */
166
+ protected $_proxyUrl = '';
167
+
168
+ /**
169
+ * Proxy port
170
+ *
171
+ * @var int
172
+ */
173
+ protected $_proxyPort = 80;
174
+
175
+ /**
176
+ * Proxy credentials
177
+ *
178
+ * @var string
179
+ */
180
+ protected $_proxyCredentials = '';
181
+
182
+ /**
183
+ * Creates a new Microsoft_WindowsAzure_Storage instance
184
+ *
185
+ * @param string $host Storage host name
186
+ * @param string $accountName Account name for Windows Azure
187
+ * @param string $accountKey Account key for Windows Azure
188
+ * @param boolean $usePathStyleUri Use path-style URI's
189
+ * @param Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy Retry policy to use when making requests
190
+ */
191
+ public function __construct(
192
+ $host = self::URL_DEV_BLOB,
193
+ $accountName = Microsoft_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_ACCOUNT,
194
+ $accountKey = Microsoft_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_KEY,
195
+ $usePathStyleUri = false,
196
+ Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null
197
+ ) {
198
+ if (strpos($host, self::PROTOCOL_HTTP) !== false) {
199
+ $this->_protocol = self::PROTOCOL_HTTP;
200
+ $this->_host = str_replace(self::PROTOCOL_HTTP, '', $host);
201
+ } else if (strpos($host, self::PROTOCOL_HTTPS) !== false) {
202
+ $this->_protocol = self::PROTOCOL_HTTPS;
203
+ $this->_host = str_replace(self::PROTOCOL_HTTPS, '', $host);
204
+ } else if (strpos($host, self::PROTOCOL_SSL) !== false) {
205
+ $this->_protocol = self::PROTOCOL_SSL;
206
+ $this->_host = str_replace(self::PROTOCOL_SSL, '', $host);
207
+ } else {
208
+ $this->_protocol = self::PROTOCOL_HTTP;
209
+ $this->_host = $host;
210
+ }
211
+ $this->_accountName = $accountName;
212
+ $this->_accountKey = $accountKey;
213
+ $this->_usePathStyleUri = $usePathStyleUri;
214
+
215
+ // Using local storage?
216
+ if (!$this->_usePathStyleUri
217
+ && ($this->_protocol . $this->_host == self::URL_DEV_BLOB
218
+ || $this->_protocol . $this->_host == self::URL_DEV_QUEUE
219
+ || $this->_protocol . $this->_host == self::URL_DEV_TABLE)
220
+ ) {
221
+ // Local storage
222
+ $this->_usePathStyleUri = true;
223
+ }
224
+
225
+ if (is_null($this->_credentials)) {
226
+ $this->_credentials = new Microsoft_WindowsAzure_Credentials_SharedKey(
227
+ $this->_accountName, $this->_accountKey, $this->_usePathStyleUri);
228
+ }
229
+
230
+ $this->_retryPolicy = $retryPolicy;
231
+ if (is_null($this->_retryPolicy)) {
232
+ $this->_retryPolicy = Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract::noRetry();
233
+ }
234
+
235
+ // Setup default Microsoft_Http_Client channel
236
+ $options = array(
237
+ 'adapter' => 'Microsoft_Http_Client_Adapter_Proxy'
238
+ );
239
+ if (function_exists('curl_init')) {
240
+ // Set cURL options if cURL is used afterwards
241
+ $options['curloptions'] = array(
242
+ CURLOPT_FOLLOWLOCATION => true,
243
+ CURLOPT_TIMEOUT => 120,
244
+ );
245
+ }
246
+ $this->_httpClientChannel = new Microsoft_Http_Client(null, $options);
247
+ }
248
+
249
+ /**
250
+ * Set the HTTP client channel to use
251
+ *
252
+ * @param Microsoft_Http_Client_Adapter_Interface|string $adapterInstance Adapter instance or adapter class name.
253
+ */
254
+ public function setHttpClientChannel($adapterInstance = 'Microsoft_Http_Client_Adapter_Proxy')
255
+ {
256
+ $this->_httpClientChannel->setAdapter($adapterInstance);
257
+ }
258
+
259
+ /**
260
+ * Retrieve HTTP client channel
261
+ *
262
+ * @return Microsoft_Http_Client_Adapter_Interface
263
+ */
264
+ public function getHttpClientChannel()
265
+ {
266
+ return $this->_httpClientChannel;
267
+ }
268
+
269
+ /**
270
+ * Set retry policy to use when making requests
271
+ *
272
+ * @param Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy Retry policy to use when making requests
273
+ */
274
+ public function setRetryPolicy(Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null)
275
+ {
276
+ $this->_retryPolicy = $retryPolicy;
277
+ if (is_null($this->_retryPolicy)) {
278
+ $this->_retryPolicy = Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract::noRetry();
279
+ }
280
+ }
281
+
282
+ /**
283
+ * Set proxy
284
+ *
285
+ * @param boolean $useProxy Use proxy?
286
+ * @param string $proxyUrl Proxy URL
287
+ * @param int $proxyPort Proxy port
288
+ * @param string $proxyCredentials Proxy credentials
289
+ */
290
+ public function setProxy($useProxy = false, $proxyUrl = '', $proxyPort = 80, $proxyCredentials = '')
291
+ {
292
+ $this->_useProxy = $useProxy;
293
+ $this->_proxyUrl = $proxyUrl;
294
+ $this->_proxyPort = $proxyPort;
295
+ $this->_proxyCredentials = $proxyCredentials;
296
+
297
+ if ($this->_useProxy) {
298
+ $credentials = explode(':', $this->_proxyCredentials);
299
+
300
+ $this->_httpClientChannel->setConfig(array(
301
+ 'proxy_host' => $this->_proxyUrl,
302
+ 'proxy_port' => $this->_proxyPort,
303
+ 'proxy_user' => $credentials[0],
304
+ 'proxy_pass' => $credentials[1],
305
+ ));
306
+ } else {
307
+ $this->_httpClientChannel->setConfig(array(
308
+ 'proxy_host' => '',
309
+ 'proxy_port' => 8080,
310
+ 'proxy_user' => '',
311
+ 'proxy_pass' => '',
312
+ ));
313
+ }
314
+ }
315
+
316
+ /**
317
+ * Returns the Windows Azure account name
318
+ *
319
+ * @return string
320
+ */
321
+ public function getAccountName()
322
+ {
323
+ return $this->_accountName;
324
+ }
325
+
326
+ /**
327
+ * Get base URL for creating requests
328
+ *
329
+ * @return string
330
+ */
331
+ public function getBaseUrl()
332
+ {
333
+ if ($this->_usePathStyleUri) {
334
+ return $this->_protocol . $this->_host . '/' . $this->_accountName;
335
+ } else {
336
+ return $this->_protocol . $this->_accountName . '.' . $this->_host;
337
+ }
338
+ }
339
+
340
+ /**
341
+ * Set Microsoft_WindowsAzure_Credentials_CredentialsAbstract instance
342
+ *
343
+ * @param Microsoft_WindowsAzure_Credentials_CredentialsAbstract $credentials Microsoft_WindowsAzure_Credentials_CredentialsAbstract instance to use for request signing.
344
+ */
345
+ public function setCredentials(Microsoft_WindowsAzure_Credentials_CredentialsAbstract $credentials)
346
+ {
347
+ $this->_credentials = $credentials;
348
+ $this->_credentials->setAccountName($this->_accountName);
349
+ $this->_credentials->setAccountkey($this->_accountKey);
350
+ $this->_credentials->setUsePathStyleUri($this->_usePathStyleUri);
351
+ }
352
+
353
+ /**
354
+ * Get Microsoft_WindowsAzure_Credentials_CredentialsAbstract instance
355
+ *
356
+ * @return Microsoft_WindowsAzure_Credentials_CredentialsAbstract
357
+ */
358
+ public function getCredentials()
359
+ {
360
+ return $this->_credentials;
361
+ }
362
+
363
+ /**
364
+ * Returns the properties of a storage service.
365
+ * Service properties include Logging (no connection with the logging components of this SDK)
366
+ * and Metrics details.
367
+ * Returned strucutre:
368
+ * array(
369
+ * '<Area>' => array('<Property>' => string|array)
370
+ * );
371
+ * <Area> can be: Logging, Metrics or other service areas.
372
+ *
373
+ * @return array
374
+ */
375
+ public function getServiceProperties()
376
+ {
377
+ // Perform request
378
+ $response = $this->_performRequest('/', '?restype=service&comp=properties');
379
+ if (!$response->isSuccessful()) {
380
+ throw new Microsoft_WindowsAzure_Exception($this->_getErrorMessage(
381
+ $response, 'Cannot obtain service properties.'
382
+ ));
383
+ }
384
+
385
+ // turn the response from a SimpleXML object to an array
386
+ $parsedResponse = $this->_parseResponse($response);
387
+
388
+ $returnArray = array();
389
+ foreach ($parsedResponse as $key => $propertyAsXmlNode) {
390
+ $returnArray[$key] = $this->_parseServicePropertyResponseNode($propertyAsXmlNode);
391
+ }
392
+
393
+ return $returnArray;
394
+ }
395
+
396
+ /**
397
+ * Parses a node of the service property response. A node is a direct child of the root
398
+ * element (StorageServiceProperties).
399
+ * Returns the array representation of that node.
400
+ *
401
+ * @param $responseNode
402
+ * @return array
403
+ */
404
+ protected function _parseServicePropertyResponseNode($responseNode)
405
+ {
406
+ if ($responseNode->count() > 0) {
407
+ $returnArray = array();
408
+ foreach ($responseNode as $key => $childNode) {
409
+ $returnArray[$key] = $this->_parseServicePropertyResponseNode($childNode);
410
+ }
411
+ return $returnArray;
412
+ } else {
413
+ return (string)$responseNode;
414
+ }
415
+ }
416
+
417
+ /**
418
+ * Perform request using Microsoft_Http_Client channel
419
+ *
420
+ * @param string $path Path
421
+ * @param array $query Query parameters
422
+ * @param string $httpVerb HTTP verb the request will use
423
+ * @param array $headers x-ms headers to add
424
+ * @param boolean $forTableStorage Is the request for table storage?
425
+ * @param mixed $rawData Optional RAW HTTP data to be sent over the wire
426
+ * @param string $resourceType Resource type
427
+ * @param string $requiredPermission Required permission
428
+ * @return Microsoft_Http_Response
429
+ */
430
+ protected function _performRequest(
431
+ $path = '/',
432
+ $query = array(),
433
+ $httpVerb = Microsoft_Http_Client::GET,
434
+ $headers = array(),
435
+ $forTableStorage = false,
436
+ $rawData = null,
437
+ $resourceType = Microsoft_WindowsAzure_Storage::RESOURCE_UNKNOWN,
438
+ $requiredPermission = Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ
439
+ ) {
440
+ // Clean path
441
+ if (strpos($path, '/') !== 0) {
442
+ $path = '/' . $path;
443
+ }
444
+
445
+ // Clean headers
446
+ if (is_null($headers)) {
447
+ $headers = array();
448
+ }
449
+
450
+ // Ensure cUrl will also work correctly:
451
+ // - disable Content-Type if required
452
+ // - disable Expect: 100 Continue
453
+ if (!isset($headers["Content-Type"])) {
454
+ $headers["Content-Type"] = '';
455
+ }
456
+ $headers["Expect"]= '';
457
+
458
+ // Add version header
459
+ $headers['x-ms-version'] = $this->_apiVersion;
460
+
461
+ // Generate URL
462
+ $path = str_replace(' ', '%20', $path);
463
+ $requestUrl = $this->getBaseUrl() . $path;
464
+ if (count($query) > 0) {
465
+ $queryString = '';
466
+ foreach ($query as $key => $value) {
467
+ $queryString .= ($queryString ? '&' : '?') . rawurlencode($key) . '=' . rawurlencode($value);
468
+ }
469
+ $requestUrl .= $queryString;
470
+ }
471
+
472
+ // Sign request
473
+ $requestUrl = $this->_credentials
474
+ ->signRequestUrl($requestUrl, $resourceType, $requiredPermission);
475
+ $requestHeaders = $this->_credentials
476
+ ->signRequestHeaders($httpVerb, $path, $query, $headers, $forTableStorage, $resourceType, $requiredPermission, $rawData);
477
+
478
+ // Prepare request
479
+ $this->_httpClientChannel->resetParameters(true);
480
+ $this->_httpClientChannel->setUri($requestUrl);
481
+ $this->_httpClientChannel->setHeaders($requestHeaders);
482
+ $this->_httpClientChannel->setRawData($rawData);
483
+
484
+ // Execute request
485
+ $response = $this->_retryPolicy->execute(
486
+ array($this->_httpClientChannel, 'request'),
487
+ array($httpVerb)
488
+ );
489
+
490
+ return $response;
491
+ }
492
+
493
+ /**
494
+ * Parse result from Microsoft_Http_Response
495
+ *
496
+ * @param Microsoft_Http_Response $response Response from HTTP call
497
+ * @return object
498
+ * @throws Microsoft_WindowsAzure_Exception
499
+ */
500
+ protected function _parseResponse(Microsoft_Http_Response $response = null)
501
+ {
502
+ if (is_null($response)) {
503
+ throw new Microsoft_WindowsAzure_Exception('Response should not be null.');
504
+ }
505
+
506
+ $xml = @simplexml_load_string($response->getBody());
507
+
508
+ if ($xml !== false) {
509
+ // Fetch all namespaces
510
+ $namespaces = array_merge($xml->getNamespaces(true), $xml->getDocNamespaces(true));
511
+
512
+ // Register all namespace prefixes
513
+ foreach ($namespaces as $prefix => $ns) {
514
+ if ($prefix != '') {
515
+ $xml->registerXPathNamespace($prefix, $ns);
516
+ }
517
+ }
518
+ }
519
+
520
+ return $xml;
521
+ }
522
+
523
+ /**
524
+ * Generate metadata headers
525
+ *
526
+ * @param array $metadata
527
+ * @return HTTP headers containing metadata
528
+ */
529
+ protected function _generateMetadataHeaders($metadata = array())
530
+ {
531
+ // Validate
532
+ if (!is_array($metadata)) {
533
+ return array();
534
+ }
535
+
536
+ // Return headers
537
+ $headers = array();
538
+ foreach ($metadata as $key => $value) {
539
+ if (strpos($value, "\r") !== false || strpos($value, "\n") !== false) {
540
+ throw new Microsoft_WindowsAzure_Exception('Metadata cannot contain newline characters.');
541
+ }
542
+
543
+ if (!self::isValidMetadataName($key)) {
544
+ throw new Microsoft_WindowsAzure_Exception('Metadata name does not adhere to metadata naming conventions. See http://msdn.microsoft.com/en-us/library/aa664670(VS.71).aspx for more information.');
545
+ }
546
+
547
+ $headers["x-ms-meta-" . strtolower($key)] = $value;
548
+ }
549
+ return $headers;
550
+ }
551
+
552
+ /**
553
+ * Parse metadata headers
554
+ *
555
+ * @param array $headers HTTP headers containing metadata
556
+ * @return array
557
+ */
558
+ protected function _parseMetadataHeaders($headers = array())
559
+ {
560
+ // Validate
561
+ if (!is_array($headers)) {
562
+ return array();
563
+ }
564
+
565
+ // Return metadata
566
+ $metadata = array();
567
+ foreach ($headers as $key => $value) {
568
+ if (substr(strtolower($key), 0, 10) == "x-ms-meta-") {
569
+ $metadata[str_replace("x-ms-meta-", '', strtolower($key))] = $value;
570
+ }
571
+ }
572
+ return $metadata;
573
+ }
574
+
575
+ /**
576
+ * Parse metadata XML
577
+ *
578
+ * @param SimpleXMLElement $parentElement Element containing the Metadata element.
579
+ * @return array
580
+ */
581
+ protected function _parseMetadataElement($element = null)
582
+ {
583
+ // Metadata present?
584
+ if (!is_null($element) && isset($element->Metadata) && !is_null($element->Metadata)) {
585
+ return get_object_vars($element->Metadata);
586
+ }
587
+
588
+ return array();
589
+ }
590
+
591
+ /**
592
+ * Generate ISO 8601 compliant date string in UTC time zone
593
+ *
594
+ * @param int $timestamp
595
+ * @return string
596
+ */
597
+ public function isoDate($timestamp = null)
598
+ {
599
+ $tz = @date_default_timezone_get();
600
+ @date_default_timezone_set('UTC');
601
+
602
+ if (is_null($timestamp)) {
603
+ $timestamp = time();
604
+ }
605
+
606
+ $returnValue = str_replace('+00:00', '.0000000Z', @date('c', $timestamp));
607
+ @date_default_timezone_set($tz);
608
+ return $returnValue;
609
+ }
610
+
611
+ /**
612
+ * Is valid metadata name?
613
+ *
614
+ * @param string $metadataName Metadata name
615
+ * @return boolean
616
+ */
617
+ public static function isValidMetadataName($metadataName = '')
618
+ {
619
+ if (preg_match("/^[a-zA-Z0-9_@][a-zA-Z0-9_]*$/", $metadataName) === 0) {
620
+ return false;
621
+ }
622
+
623
+ if ($metadataName == '') {
624
+ return false;
625
+ }
626
+
627
+ return true;
628
+ }
629
+ }
libs/Microsoft/WindowsAzure/Storage/Batch.php CHANGED
@@ -1,259 +1,259 @@
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
- * @subpackage Storage
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 21617 2009-06-12 10:46:31Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Storage
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- */
48
- class Microsoft_WindowsAzure_Storage_Batch
49
- {
50
- /**
51
- * Storage client the batch is defined on
52
- *
53
- * @var Microsoft_WindowsAzure_Storage_BatchStorageAbstract
54
- */
55
- protected $_storageClient = null;
56
-
57
- /**
58
- * For table storage?
59
- *
60
- * @var boolean
61
- */
62
- protected $_forTableStorage = false;
63
-
64
- /**
65
- * Base URL
66
- *
67
- * @var string
68
- */
69
- protected $_baseUrl;
70
-
71
- /**
72
- * Pending operations
73
- *
74
- * @var unknown_type
75
- */
76
- protected $_operations = array();
77
-
78
- /**
79
- * Does the batch contain a single select?
80
- *
81
- * @var boolean
82
- */
83
- protected $_isSingleSelect = false;
84
-
85
- /**
86
- * Creates a new Microsoft_WindowsAzure_Storage_Batch
87
- *
88
- * @param Microsoft_WindowsAzure_Storage_BatchStorageAbstract $storageClient Storage client the batch is defined on
89
- */
90
- public function __construct(Microsoft_WindowsAzure_Storage_BatchStorageAbstract $storageClient = null, $baseUrl = '')
91
- {
92
- $this->_storageClient = $storageClient;
93
- $this->_baseUrl = $baseUrl;
94
- $this->_beginBatch();
95
- }
96
-
97
- /**
98
- * Get base URL for creating requests
99
- *
100
- * @return string
101
- */
102
- public function getBaseUrl()
103
- {
104
- return $this->_baseUrl;
105
- }
106
-
107
- /**
108
- * Starts a new batch operation set
109
- *
110
- * @throws Microsoft_WindowsAzure_Exception
111
- */
112
- protected function _beginBatch()
113
- {
114
- $this->_storageClient->setCurrentBatch($this);
115
- }
116
-
117
- /**
118
- * Cleanup current batch
119
- */
120
- protected function _clean()
121
- {
122
- unset($this->_operations);
123
- $this->_storageClient->setCurrentBatch(null);
124
- $this->_storageClient = null;
125
- unset($this);
126
- }
127
-
128
- /**
129
- * Enlist operation in current batch
130
- *
131
- * @param string $path Path
132
- * @param array $query Query parameters
133
- * @param string $httpVerb HTTP verb the request will use
134
- * @param array $headers x-ms headers to add
135
- * @param boolean $forTableStorage Is the request for table storage?
136
- * @param mixed $rawData Optional RAW HTTP data to be sent over the wire
137
- * @throws Microsoft_WindowsAzure_Exception
138
- */
139
- public function enlistOperation($path = '/', $query = array(), $httpVerb = Microsoft_Http_Client::GET, $headers = array(), $forTableStorage = false, $rawData = null)
140
- {
141
- // Set _forTableStorage
142
- if ($forTableStorage) {
143
- $this->_forTableStorage = true;
144
- }
145
-
146
- // Set _isSingleSelect
147
- if ($httpVerb == Microsoft_Http_Client::GET) {
148
- if (count($this->_operations) > 0) {
149
- throw new Microsoft_WindowsAzure_Exception("Select operations can only be performed in an empty batch transaction.");
150
- }
151
- $this->_isSingleSelect = true;
152
- }
153
-
154
- // Clean path
155
- if (strpos($path, '/') !== 0) {
156
- $path = '/' . $path;
157
- }
158
-
159
- // Clean headers
160
- if (is_null($headers)) {
161
- $headers = array();
162
- }
163
-
164
- // Generate URL
165
- $requestUrl = $this->getBaseUrl() . $path;
166
- if (count($query) > 0) {
167
- $queryString = '';
168
- foreach ($query as $key => $value) {
169
- $queryString .= ($queryString ? '&' : '?') . rawurlencode($key) . '=' . rawurlencode($value);
170
- }
171
- $requestUrl .= $queryString;
172
- }
173
-
174
- // Generate $rawData
175
- if (is_null($rawData)) {
176
- $rawData = '';
177
- }
178
-
179
- // Add headers
180
- if ($httpVerb != Microsoft_Http_Client::GET) {
181
- $headers['Content-ID'] = count($this->_operations) + 1;
182
- if ($httpVerb != Microsoft_Http_Client::DELETE) {
183
- $headers['Content-Type'] = 'application/atom+xml;type=entry';
184
- }
185
- $headers['Content-Length'] = strlen($rawData);
186
- }
187
-
188
- // Generate $operation
189
- $operation = '';
190
- $operation .= $httpVerb . ' ' . $requestUrl . ' HTTP/1.1' . "\n";
191
- foreach ($headers as $key => $value)
192
- {
193
- $operation .= $key . ': ' . $value . "\n";
194
- }
195
- $operation .= "\n";
196
-
197
- // Add data
198
- $operation .= $rawData;
199
-
200
- // Store operation
201
- $this->_operations[] = $operation;
202
- }
203
-
204
- /**
205
- * Commit current batch
206
- *
207
- * @return Microsoft_Http_Response
208
- * @throws Microsoft_WindowsAzure_Exception
209
- */
210
- public function commit()
211
- {
212
- // Perform batch
213
- $response = $this->_storageClient->performBatch($this->_operations, $this->_forTableStorage, $this->_isSingleSelect);
214
-
215
- // Dispose
216
- $this->_clean();
217
-
218
- // Parse response
219
- $errors = null;
220
- preg_match_all('/<message (.*?)>(.*?)<\/message>/s', $response->getBody(), $errors);
221
-
222
- // Error?
223
- if (count($errors[2]) > 0) {
224
- throw new Microsoft_WindowsAzure_Exception('An error has occured while committing a batch: ' . $errors[2][0]);
225
- }
226
-
227
- // Return
228
- return $response;
229
- }
230
-
231
- /**
232
- * Rollback current batch
233
- */
234
- public function rollback()
235
- {
236
- // Dispose
237
- $this->_clean();
238
- }
239
-
240
- /**
241
- * Get operation count
242
- *
243
- * @return integer
244
- */
245
- public function getOperationCount()
246
- {
247
- return count($this->_operations);
248
- }
249
-
250
- /**
251
- * Is single select?
252
- *
253
- * @return boolean
254
- */
255
- public function isSingleSelect()
256
- {
257
- return $this->_isSingleSelect;
258
- }
259
- }
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
+ * @subpackage Storage
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 21617 2009-06-12 10:46:31Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Storage
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ */
48
+ class Microsoft_WindowsAzure_Storage_Batch
49
+ {
50
+ /**
51
+ * Storage client the batch is defined on
52
+ *
53
+ * @var Microsoft_WindowsAzure_Storage_BatchStorageAbstract
54
+ */
55
+ protected $_storageClient = null;
56
+
57
+ /**
58
+ * For table storage?
59
+ *
60
+ * @var boolean
61
+ */
62
+ protected $_forTableStorage = false;
63
+
64
+ /**
65
+ * Base URL
66
+ *
67
+ * @var string
68
+ */
69
+ protected $_baseUrl;
70
+
71
+ /**
72
+ * Pending operations
73
+ *
74
+ * @var unknown_type
75
+ */
76
+ protected $_operations = array();
77
+
78
+ /**
79
+ * Does the batch contain a single select?
80
+ *
81
+ * @var boolean
82
+ */
83
+ protected $_isSingleSelect = false;
84
+
85
+ /**
86
+ * Creates a new Microsoft_WindowsAzure_Storage_Batch
87
+ *
88
+ * @param Microsoft_WindowsAzure_Storage_BatchStorageAbstract $storageClient Storage client the batch is defined on
89
+ */
90
+ public function __construct(Microsoft_WindowsAzure_Storage_BatchStorageAbstract $storageClient = null, $baseUrl = '')
91
+ {
92
+ $this->_storageClient = $storageClient;
93
+ $this->_baseUrl = $baseUrl;
94
+ $this->_beginBatch();
95
+ }
96
+
97
+ /**
98
+ * Get base URL for creating requests
99
+ *
100
+ * @return string
101
+ */
102
+ public function getBaseUrl()
103
+ {
104
+ return $this->_baseUrl;
105
+ }
106
+
107
+ /**
108
+ * Starts a new batch operation set
109
+ *
110
+ * @throws Microsoft_WindowsAzure_Exception
111
+ */
112
+ protected function _beginBatch()
113
+ {
114
+ $this->_storageClient->setCurrentBatch($this);
115
+ }
116
+
117
+ /**
118
+ * Cleanup current batch
119
+ */
120
+ protected function _clean()
121
+ {
122
+ unset($this->_operations);
123
+ $this->_storageClient->setCurrentBatch(null);
124
+ $this->_storageClient = null;
125
+ unset($this);
126
+ }
127
+
128
+ /**
129
+ * Enlist operation in current batch
130
+ *
131
+ * @param string $path Path
132
+ * @param array $query Query parameters
133
+ * @param string $httpVerb HTTP verb the request will use
134
+ * @param array $headers x-ms headers to add
135
+ * @param boolean $forTableStorage Is the request for table storage?
136
+ * @param mixed $rawData Optional RAW HTTP data to be sent over the wire
137
+ * @throws Microsoft_WindowsAzure_Exception
138
+ */
139
+ public function enlistOperation($path = '/', $query = array(), $httpVerb = Microsoft_Http_Client::GET, $headers = array(), $forTableStorage = false, $rawData = null)
140
+ {
141
+ // Set _forTableStorage
142
+ if ($forTableStorage) {
143
+ $this->_forTableStorage = true;
144
+ }
145
+
146
+ // Set _isSingleSelect
147
+ if ($httpVerb == Microsoft_Http_Client::GET) {
148
+ if (count($this->_operations) > 0) {
149
+ throw new Microsoft_WindowsAzure_Exception("Select operations can only be performed in an empty batch transaction.");
150
+ }
151
+ $this->_isSingleSelect = true;
152
+ }
153
+
154
+ // Clean path
155
+ if (strpos($path, '/') !== 0) {
156
+ $path = '/' . $path;
157
+ }
158
+
159
+ // Clean headers
160
+ if (is_null($headers)) {
161
+ $headers = array();
162
+ }
163
+
164
+ // Generate URL
165
+ $requestUrl = $this->getBaseUrl() . $path;
166
+ if (count($query) > 0) {
167
+ $queryString = '';
168
+ foreach ($query as $key => $value) {
169
+ $queryString .= ($queryString ? '&' : '?') . rawurlencode($key) . '=' . rawurlencode($value);
170
+ }
171
+ $requestUrl .= $queryString;
172
+ }
173
+
174
+ // Generate $rawData
175
+ if (is_null($rawData)) {
176
+ $rawData = '';
177
+ }
178
+
179
+ // Add headers
180
+ if ($httpVerb != Microsoft_Http_Client::GET) {
181
+ $headers['Content-ID'] = count($this->_operations) + 1;
182
+ if ($httpVerb != Microsoft_Http_Client::DELETE) {
183
+ $headers['Content-Type'] = 'application/atom+xml;type=entry';
184
+ }
185
+ $headers['Content-Length'] = strlen($rawData);
186
+ }
187
+
188
+ // Generate $operation
189
+ $operation = '';
190
+ $operation .= $httpVerb . ' ' . $requestUrl . ' HTTP/1.1' . "\n";
191
+ foreach ($headers as $key => $value)
192
+ {
193
+ $operation .= $key . ': ' . $value . "\n";
194
+ }
195
+ $operation .= "\n";
196
+
197
+ // Add data
198
+ $operation .= $rawData;
199
+
200
+ // Store operation
201
+ $this->_operations[] = $operation;
202
+ }
203
+
204
+ /**
205
+ * Commit current batch
206
+ *
207
+ * @return Microsoft_Http_Response
208
+ * @throws Microsoft_WindowsAzure_Exception
209
+ */
210
+ public function commit()
211
+ {
212
+ // Perform batch
213
+ $response = $this->_storageClient->performBatch($this->_operations, $this->_forTableStorage, $this->_isSingleSelect);
214
+
215
+ // Dispose
216
+ $this->_clean();
217
+
218
+ // Parse response
219
+ $errors = null;
220
+ preg_match_all('/<message (.*?)>(.*?)<\/message>/s', $response->getBody(), $errors);
221
+
222
+ // Error?
223
+ if (count($errors[2]) > 0) {
224
+ throw new Microsoft_WindowsAzure_Exception('An error has occured while committing a batch: ' . $errors[2][0]);
225
+ }
226
+
227
+ // Return
228
+ return $response;
229
+ }
230
+
231
+ /**
232
+ * Rollback current batch
233
+ */
234
+ public function rollback()
235
+ {
236
+ // Dispose
237
+ $this->_clean();
238
+ }
239
+
240
+ /**
241
+ * Get operation count
242
+ *
243
+ * @return integer
244
+ */
245
+ public function getOperationCount()
246
+ {
247
+ return count($this->_operations);
248
+ }
249
+
250
+ /**
251
+ * Is single select?
252
+ *
253
+ * @return boolean
254
+ */
255
+ public function isSingleSelect()
256
+ {
257
+ return $this->_isSingleSelect;
258
+ }
259
+ }
libs/Microsoft/WindowsAzure/Storage/BatchStorageAbstract.php CHANGED
@@ -1,184 +1,184 @@
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
- * @subpackage Storage
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 21617 2009-06-12 10:46:31Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
- /**
42
- * @category Microsoft
43
- * @package Microsoft_WindowsAzure
44
- * @subpackage Storage
45
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
- * @license http://phpazure.codeplex.com/license
47
- */
48
- abstract class Microsoft_WindowsAzure_Storage_BatchStorageAbstract
49
- extends Microsoft_WindowsAzure_Storage
50
- {
51
- /**
52
- * Current batch
53
- *
54
- * @var Microsoft_WindowsAzure_Storage_Batch
55
- */
56
- protected $_currentBatch = null;
57
-
58
- /**
59
- * Set current batch
60
- *
61
- * @param Microsoft_WindowsAzure_Storage_Batch $batch Current batch
62
- * @throws Microsoft_WindowsAzure_Exception
63
- */
64
- public function setCurrentBatch(Microsoft_WindowsAzure_Storage_Batch $batch = null)
65
- {
66
- if (!is_null($batch) && $this->isInBatch()) {
67
- throw new Microsoft_WindowsAzure_Exception('Only one batch can be active at a time.');
68
- }
69
- $this->_currentBatch = $batch;
70
- }
71
-
72
- /**
73
- * Get current batch
74
- *
75
- * @return Microsoft_WindowsAzure_Storage_Batch
76
- */
77
- public function getCurrentBatch()
78
- {
79
- return $this->_currentBatch;
80
- }
81
-
82
- /**
83
- * Is there a current batch?
84
- *
85
- * @return boolean
86
- */
87
- public function isInBatch()
88
- {
89
- return !is_null($this->_currentBatch);
90
- }
91
-
92
- /**
93
- * Starts a new batch operation set
94
- *
95
- * @return Microsoft_WindowsAzure_Storage_Batch
96
- * @throws Microsoft_WindowsAzure_Exception
97
- */
98
- public function startBatch()
99
- {
100
- return new Microsoft_WindowsAzure_Storage_Batch($this, $this->getBaseUrl());
101
- }
102
-
103
- /**
104
- * Perform batch using Microsoft_Http_Client channel, combining all batch operations into one request
105
- *
106
- * @param array $operations Operations in batch
107
- * @param boolean $forTableStorage Is the request for table storage?
108
- * @param boolean $isSingleSelect Is the request a single select statement?
109
- * @param string $resourceType Resource type
110
- * @param string $requiredPermission Required permission
111
- * @return Microsoft_Http_Response
112
- */
113
- public function performBatch($operations = array(), $forTableStorage = false, $isSingleSelect = false, $resourceType = Microsoft_WindowsAzure_Storage::RESOURCE_UNKNOWN, $requiredPermission = Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ)
114
- {
115
- // Generate boundaries
116
- $batchBoundary = 'batch_' . md5(time() . microtime());
117
- $changesetBoundary = 'changeset_' . md5(time() . microtime());
118
-
119
- // Set headers
120
- $headers = array();
121
-
122
- // Add version header
123
- $headers['x-ms-version'] = $this->_apiVersion;
124
-
125
- // Add dataservice headers
126
- $headers['DataServiceVersion'] = '1.0;NetFx';
127
- $headers['MaxDataServiceVersion'] = '1.0;NetFx';
128
-
129
- // Add content-type header
130
- $headers['Content-Type'] = 'multipart/mixed; boundary=' . $batchBoundary;
131
-
132
- // Set path
133
- $path = '/$batch';
134
-
135
- // Set verb
136
- $httpVerb = Microsoft_Http_Client::POST;
137
-
138
- // Generate raw data
139
- $rawData = '';
140
-
141
- // Single select?
142
- if ($isSingleSelect) {
143
- $operation = $operations[0];
144
- $rawData .= '--' . $batchBoundary . "\n";
145
- $rawData .= 'Content-Type: application/http' . "\n";
146
- $rawData .= 'Content-Transfer-Encoding: binary' . "\n\n";
147
- $rawData .= $operation;
148
- $rawData .= '--' . $batchBoundary . '--';
149
- } else {
150
- $rawData .= '--' . $batchBoundary . "\n";
151
- $rawData .= 'Content-Type: multipart/mixed; boundary=' . $changesetBoundary . "\n\n";
152
-
153
- // Add operations
154
- foreach ($operations as $operation)
155
- {
156
- $rawData .= '--' . $changesetBoundary . "\n";
157
- $rawData .= 'Content-Type: application/http' . "\n";
158
- $rawData .= 'Content-Transfer-Encoding: binary' . "\n\n";
159
- $rawData .= $operation;
160
- }
161
- $rawData .= '--' . $changesetBoundary . '--' . "\n";
162
-
163
- $rawData .= '--' . $batchBoundary . '--';
164
- }
165
-
166
- // Generate URL and sign request
167
- $requestUrl = $this->_credentials->signRequestUrl($this->getBaseUrl() . $path, $resourceType, $requiredPermission);
168
- $requestHeaders = $this->_credentials->signRequestHeaders($httpVerb, $path, array(), $headers, $forTableStorage, $resourceType, $requiredPermission);
169
-
170
- // Prepare request
171
- $this->_httpClientChannel->resetParameters(true);
172
- $this->_httpClientChannel->setUri($requestUrl);
173
- $this->_httpClientChannel->setHeaders($requestHeaders);
174
- $this->_httpClientChannel->setRawData($rawData);
175
-
176
- // Execute request
177
- $response = $this->_retryPolicy->execute(
178
- array($this->_httpClientChannel, 'request'),
179
- array($httpVerb)
180
- );
181
-
182
- return $response;
183
- }
184
- }
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
+ * @subpackage Storage
31
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
+ * @license http://phpazure.codeplex.com/license
33
+ * @version $Id: Storage.php 21617 2009-06-12 10:46:31Z unknown $
34
+ */
35
+
36
+ /**
37
+ * @see Microsoft_AutoLoader
38
+ */
39
+ require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
+
41
+ /**
42
+ * @category Microsoft
43
+ * @package Microsoft_WindowsAzure
44
+ * @subpackage Storage
45
+ * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
46
+ * @license http://phpazure.codeplex.com/license
47
+ */
48
+ abstract class Microsoft_WindowsAzure_Storage_BatchStorageAbstract
49
+ extends Microsoft_WindowsAzure_Storage
50
+ {
51
+ /**
52
+ * Current batch
53
+ *
54
+ * @var Microsoft_WindowsAzure_Storage_Batch
55
+ */
56
+ protected $_currentBatch = null;
57
+
58
+ /**
59
+ * Set current batch
60
+ *
61
+ * @param Microsoft_WindowsAzure_Storage_Batch $batch Current batch
62
+ * @throws Microsoft_WindowsAzure_Exception
63
+ */
64
+ public function setCurrentBatch(Microsoft_WindowsAzure_Storage_Batch $batch = null)
65
+ {
66
+ if (!is_null($batch) && $this->isInBatch()) {
67
+ throw new Microsoft_WindowsAzure_Exception('Only one batch can be active at a time.');
68
+ }
69
+ $this->_currentBatch = $batch;
70
+ }
71
+
72
+ /**
73
+ * Get current batch
74
+ *
75
+ * @return Microsoft_WindowsAzure_Storage_Batch
76
+ */
77
+ public function getCurrentBatch()
78
+ {
79
+ return $this->_currentBatch;
80
+ }
81
+
82
+ /**
83
+ * Is there a current batch?
84
+ *
85
+ * @return boolean
86
+ */
87
+ public function isInBatch()
88
+ {
89
+ return !is_null($this->_currentBatch);
90
+ }
91
+
92
+ /**
93
+ * Starts a new batch operation set
94
+ *
95
+ * @return Microsoft_WindowsAzure_Storage_Batch
96
+ * @throws Microsoft_WindowsAzure_Exception
97
+ */
98
+ public function startBatch()
99
+ {
100
+ return new Microsoft_WindowsAzure_Storage_Batch($this, $this->getBaseUrl());
101
+ }
102
+
103
+ /**
104
+ * Perform batch using Microsoft_Http_Client channel, combining all batch operations into one request
105
+ *
106
+ * @param array $operations Operations in batch
107
+ * @param boolean $forTableStorage Is the request for table storage?
108
+ * @param boolean $isSingleSelect Is the request a single select statement?
109
+ * @param string $resourceType Resource type
110
+ * @param string $requiredPermission Required permission
111
+ * @return Microsoft_Http_Response
112
+ */
113
+ public function performBatch($operations = array(), $forTableStorage = false, $isSingleSelect = false, $resourceType = Microsoft_WindowsAzure_Storage::RESOURCE_UNKNOWN, $requiredPermission = Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ)
114
+ {
115
+ // Generate boundaries
116
+ $batchBoundary = 'batch_' . md5(time() . microtime());
117
+ $changesetBoundary = 'changeset_' . md5(time() . microtime());
118
+
119
+ // Set headers
120
+ $headers = array();
121
+
122
+ // Add version header
123
+ $headers['x-ms-version'] = $this->_apiVersion;
124
+
125
+ // Add dataservice headers
126
+ $headers['DataServiceVersion'] = '1.0;NetFx';
127
+ $headers['MaxDataServiceVersion'] = '1.0;NetFx';
128
+
129
+ // Add content-type header
130
+ $headers['Content-Type'] = 'multipart/mixed; boundary=' . $batchBoundary;
131
+
132
+ // Set path
133
+ $path = '/$batch';
134
+
135
+ // Set verb
136
+ $httpVerb = Microsoft_Http_Client::POST;
137
+
138
+ // Generate raw data
139
+ $rawData = '';
140
+
141
+ // Single select?
142
+ if ($isSingleSelect) {
143
+ $operation = $operations[0];
144
+ $rawData .= '--' . $batchBoundary . "\n";
145
+ $rawData .= 'Content-Type: application/http' . "\n";
146
+ $rawData .= 'Content-Transfer-Encoding: binary' . "\n\n";
147
+ $rawData .= $operation;
148
+ $rawData .= '--' . $batchBoundary . '--';
149
+ } else {
150
+ $rawData .= '--' . $batchBoundary . "\n";
151
+ $rawData .= 'Content-Type: multipart/mixed; boundary=' . $changesetBoundary . "\n\n";
152
+
153
+ // Add operations
154
+ foreach ($operations as $operation)
155
+ {
156
+ $rawData .= '--' . $changesetBoundary . "\n";
157
+ $rawData .= 'Content-Type: application/http' . "\n";
158
+ $rawData .= 'Content-Transfer-Encoding: binary' . "\n\n";
159
+ $rawData .= $operation;
160
+ }
161
+ $rawData .= '--' . $changesetBoundary . '--' . "\n";
162
+
163
+ $rawData .= '--' . $batchBoundary . '--';
164
+ }
165
+
166
+ // Generate URL and sign request
167
+ $requestUrl = $this->_credentials->signRequestUrl($this->getBaseUrl() . $path, $resourceType, $requiredPermission);
168
+ $requestHeaders = $this->_credentials->signRequestHeaders($httpVerb, $path, array(), $headers, $forTableStorage, $resourceType, $requiredPermission);
169
+
170
+ // Prepare request
171
+ $this->_httpClientChannel->resetParameters(true);
172
+ $this->_httpClientChannel->setUri($requestUrl);
173
+ $this->_httpClientChannel->setHeaders($requestHeaders);
174
+ $this->_httpClientChannel->setRawData($rawData);
175
+
176
+ // Execute request
177
+ $response = $this->_retryPolicy->execute(
178
+ array($this->_httpClientChannel, 'request'),
179
+ array($httpVerb)
180
+ );
181
+
182
+ return $response;
183
+ }
184
+ }
libs/Microsoft/WindowsAzure/Storage/Blob.php CHANGED
@@ -1,1968 +1,1968 @@
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
- * @subpackage Storage
31
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
32
- * @license http://todo name_todo
33
- * @version $Id: Blob.php 66505 2011-12-02 08:45:51Z unknown $
34
- */
35
-
36
- /**
37
- * @see Microsoft_AutoLoader
38
- */
39
- require_once dirname(__FILE__) . '/../../AutoLoader.php';
40
-
41
-
42
- /**
43
- * @category Microsoft
44
- * @package Microsoft_WindowsAzure
45
- * @subpackage Storage
46
- * @copyright Copyright (c) 2009 - 2011, RealDolmen (http://www.realdolmen.com)
47
- * @license http://phpazure.codeplex.com/license
48
- */
49
- class Microsoft_WindowsAzure_Storage_Blob extends Microsoft_WindowsAzure_Storage
50
- {
51
- /**
52
- * ACL - Private access
53
- */
54
- const ACL_PRIVATE = null;
55
-
56
- /**
57
- * ACL - Public access (read all blobs)
58
- *
59
- * @deprecated Use ACL_PUBLIC_CONTAINER or ACL_PUBLIC_BLOB instead.
60
- */
61
- const ACL_PUBLIC = 'container';
62
-
63
- /**
64
- * ACL - Blob Public access (read all blobs)
65
- */
66
- const ACL_PUBLIC_BLOB = 'blob';
67
-
68
- /**
69
- * ACL - Container Public access (enumerate and read all blobs)
70
- */
71
- const ACL_PUBLIC_CONTAINER = 'container';
72
-
73
- /**
74
- * Blob lease constants
75
- */
76
- const LEASE_ACQUIRE = 'acquire';
77
- const LEASE_RENEW = 'renew';
78
- const LEASE_RELEASE = 'release';
79
- const LEASE_BREAK = 'break';
80
-
81
- /**
82
- * Maximal blob size (in bytes)
83
- */
84
- const MAX_BLOB_SIZE = 67108864;
85
-
86
- /**
87
- * Maximal blob transfer size (in bytes)
88
- */
89
- const MAX_BLOB_TRANSFER_SIZE = 4194304;
90
-
91
- /**
92
- * Blob types
93
- */
94
- const BLOBTYPE_BLOCK = 'BlockBlob';
95
- const BLOBTYPE_PAGE = 'PageBlob';
96
-
97
- /**
98
- * Put page write options
99
- */
100
- const PAGE_WRITE_UPDATE = 'update';
101
- const PAGE_WRITE_CLEAR = 'clear';
102
-
103
- /**
104
- * Stream wrapper clients
105
- *
106
- * @var array
107
- */
108
- protected static $_wrapperClients = array();
109
-
110
- /**
111
- * SharedAccessSignature credentials
112
- *
113
- * @var Microsoft_WindowsAzure_Credentials_SharedAccessSignature
114
- */
115
- protected $_sharedAccessSignatureCredentials = null;
116
-
117
- /**
118
- * Creates a new Microsoft_WindowsAzure_Storage_Blob instance
119
- *
120
- * @param string $host Storage host name
121
- * @param string $accountName Account name for Windows Azure
122
- * @param string $accountKey Account key for Windows Azure
123
- * @param boolean $usePathStyleUri Use path-style URI's
124
- * @param Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy Retry policy to use when making requests
125
- */
126
- public function __construct($host = Microsoft_WindowsAzure_Storage::URL_DEV_BLOB, $accountName = Microsoft_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_ACCOUNT, $accountKey = Microsoft_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_KEY, $usePathStyleUri = false, Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null)
127
- {
128
- parent::__construct($host, $accountName, $accountKey, $usePathStyleUri, $retryPolicy);
129
-
130
- // API version
131
- $this->_apiVersion = '2009-09-19';
132
-
133
- // SharedAccessSignature credentials
134
- $this->_sharedAccessSignatureCredentials = new Microsoft_WindowsAzure_Credentials_SharedAccessSignature($accountName, $accountKey, $usePathStyleUri);
135
- }
136
-
137
- /**
138
- * Check if a blob exists
139
- *
140
- * @param string $containerName Container name
141
- * @param string $blobName Blob name
142
- * @param string $snapshotId Snapshot identifier
143
- * @return boolean
144
- */
145
- public function blobExists($containerName = '', $blobName = '', $snapshotId = null)
146
- {
147
- if ($containerName === '') {
148
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
149
- }
150
- if (!self::isValidContainerName($containerName)) {
151
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
152
- }
153
- if ($blobName === '') {
154
- throw new Microsoft_WindowsAzure_Exception('Blob name is not specified.');
155
- }
156
-
157
- // Get blob instance
158
- try {
159
- $this->getBlobInstance($containerName, $blobName, $snapshotId);
160
- } catch (Microsoft_WindowsAzure_Exception $e) {
161
- return false;
162
- }
163
-
164
- return true;
165
- }
166
-
167
- /**
168
- * Check if a container exists
169
- *
170
- * @param string $containerName Container name
171
- * @return boolean
172
- */
173
- public function containerExists($containerName = '')
174
- {
175
- if ($containerName === '') {
176
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
177
- }
178
- if (!self::isValidContainerName($containerName)) {
179
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
180
- }
181
-
182
- // List containers
183
- $containers = $this->listContainers($containerName, 1);
184
- foreach ($containers as $container) {
185
- if ($container->Name == $containerName) {
186
- return true;
187
- }
188
- }
189
-
190
- return false;
191
- }
192
-
193
- /**
194
- * Create container
195
- *
196
- * @param string $containerName Container name
197
- * @param array $metadata Key/value pairs of meta data
198
- * @return object Container properties
199
- * @throws Microsoft_WindowsAzure_Exception
200
- */
201
- public function createContainer($containerName = '', $metadata = array())
202
- {
203
- if ($containerName === '') {
204
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
205
- }
206
- if (!self::isValidContainerName($containerName)) {
207
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
208
- }
209
- if (!is_array($metadata)) {
210
- throw new Microsoft_WindowsAzure_Exception('Meta data should be an array of key and value pairs.');
211
- }
212
-
213
- // Create metadata headers
214
- $headers = array();
215
- $headers = array_merge($headers, $this->_generateMetadataHeaders($metadata));
216
-
217
- // Perform request
218
- $response = $this->_performRequest($containerName, array('restype' => 'container'), Microsoft_Http_Client::PUT, $headers, false, null, Microsoft_WindowsAzure_Storage::RESOURCE_CONTAINER, Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_WRITE);
219
- if ($response->isSuccessful()) {
220
- return new Microsoft_WindowsAzure_Storage_BlobContainer(
221
- $containerName,
222
- $response->getHeader('Etag'),
223
- $response->getHeader('Last-modified'),
224
- $metadata
225
- );
226
- } else {
227
- throw new Microsoft_WindowsAzure_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
228
- }
229
- }
230
-
231
- /**
232
- * Create container if it does not exist
233
- *
234
- * @param string $containerName Container name
235
- * @param array $metadata Key/value pairs of meta data
236
- * @throws Microsoft_WindowsAzure_Exception
237
- */
238
- public function createContainerIfNotExists($containerName = '', $metadata = array())
239
- {
240
- if (!$this->containerExists($containerName)) {
241
- $this->createContainer($containerName, $metadata);
242
- }
243
- }
244
-
245
- /**
246
- * Get container ACL
247
- *
248
- * @param string $containerName Container name
249
- * @param bool $signedIdentifiers Display only private/blob/container or display signed identifiers?
250
- * @return string Acl, to be compared with Microsoft_WindowsAzure_Storage_Blob::ACL_*
251
- * @throws Microsoft_WindowsAzure_Exception
252
- */
253
- public function getContainerAcl($containerName = '', $signedIdentifiers = false)
254
- {
255
- if ($containerName === '') {
256
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
257
- }
258
- if (!self::isValidContainerName($containerName)) {
259
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
260
- }
261
-
262
- // Perform request
263
- $response = $this->_performRequest($containerName, array('restype' => 'container', 'comp' => 'acl'), Microsoft_Http_Client::GET, array(), false, null, Microsoft_WindowsAzure_Storage::RESOURCE_CONTAINER, Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ);
264
- if ($response->isSuccessful()) {
265
- if ($signedIdentifiers == false) {
266
- // Only private/blob/container
267
- $accessType = $response->getHeader(Microsoft_WindowsAzure_Storage::PREFIX_STORAGE_HEADER . 'blob-public-access');
268
- if (strtolower($accessType) == 'true') {
269
- $accessType = self::ACL_PUBLIC_CONTAINER;
270
- }
271
- return $accessType;
272
- } else {
273
- // Parse result
274
- $result = $this->_parseResponse($response);
275
- if (!$result) {
276
- return array();
277
- }
278
-
279
- $entries = null;
280
- if ($result->SignedIdentifier) {
281
- if (count($result->SignedIdentifier) > 1) {
282
- $entries = $result->SignedIdentifier;
283
- } else {
284
- $entries = array($result->SignedIdentifier);
285
- }
286
- }
287
-
288
- // Return value
289
- $returnValue = array();
290
- foreach ($entries as $entry) {
291
- $returnValue[] = new Microsoft_WindowsAzure_Storage_SignedIdentifier(
292
- $entry->Id,
293
- $entry->AccessPolicy ? $entry->AccessPolicy->Start ? $entry->AccessPolicy->Start : '' : '',
294
- $entry->AccessPolicy ? $entry->AccessPolicy->Expiry ? $entry->AccessPolicy->Expiry : '' : '',
295
- $entry->AccessPolicy ? $entry->AccessPolicy->Permission ? $entry->AccessPolicy->Permission : '' : ''
296
- );
297
- }
298
-
299
- // Return
300
- return $returnValue;
301
- }
302
- } else {
303
- throw new Microsoft_WindowsAzure_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
304
- }
305
- }
306
-
307
- /**
308
- * Set container ACL
309
- *
310
- * @param string $containerName Container name
311
- * @param bool $acl Microsoft_WindowsAzure_Storage_Blob::ACL_*
312
- * @param array $signedIdentifiers Signed identifiers
313
- * @throws Microsoft_WindowsAzure_Exception
314
- */
315
- public function setContainerAcl($containerName = '', $acl = self::ACL_PRIVATE, $signedIdentifiers = array())
316
- {
317
- if ($containerName === '') {
318
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
319
- }
320
- if (!self::isValidContainerName($containerName)) {
321
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
322
- }
323
-
324
- // Headers
325
- $headers = array();
326
-
327
- // Acl specified?
328
- if ($acl != self::ACL_PRIVATE && !is_null($acl) && $acl != '') {
329
- $headers[Microsoft_WindowsAzure_Storage::PREFIX_STORAGE_HEADER . 'blob-public-access'] = $acl;
330
- }
331
-
332
- // Policies
333
- $policies = null;
334
- if (is_array($signedIdentifiers) && count($signedIdentifiers) > 0) {
335
- $policies = '';
336
- $policies .= '<?xml version="1.0" encoding="utf-8"?>' . "\r\n";
337
- $policies .= '<SignedIdentifiers>' . "\r\n";
338
- foreach ($signedIdentifiers as $signedIdentifier) {
339
- $policies .= ' <SignedIdentifier>' . "\r\n";
340
- $policies .= ' <Id>' . $signedIdentifier->Id . '</Id>' . "\r\n";
341
- $policies .= ' <AccessPolicy>' . "\r\n";
342
- if ($signedIdentifier->Start != '')
343
- $policies .= ' <Start>' . $signedIdentifier->Start . '</Start>' . "\r\n";
344
- if ($signedIdentifier->Expiry != '')
345
- $policies .= ' <Expiry>' . $signedIdentifier->Expiry . '</Expiry>' . "\r\n";
346
- if ($signedIdentifier->Permissions != '')
347
- $policies .= ' <Permission>' . $signedIdentifier->Permissions . '</Permission>' . "\r\n";
348
- $policies .= ' </AccessPolicy>' . "\r\n";
349
- $policies .= ' </SignedIdentifier>' . "\r\n";
350
- }
351
- $policies .= '</SignedIdentifiers>' . "\r\n";
352
- }
353
-
354
- // Perform request
355
- $response = $this->_performRequest($containerName, array('restype' => 'container', 'comp' => 'acl'), Microsoft_Http_Client::PUT, $headers, false, $policies, Microsoft_WindowsAzure_Storage::RESOURCE_CONTAINER, Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_WRITE);
356
- if (!$response->isSuccessful()) {
357
- throw new Microsoft_WindowsAzure_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
358
- }
359
- }
360
-
361
- /**
362
- * Get container
363
- *
364
- * @param string $containerName Container name
365
- * @return Microsoft_WindowsAzure_Storage_BlobContainer
366
- * @throws Microsoft_WindowsAzure_Exception
367
- */
368
- public function getContainer($containerName = '')
369
- {
370
- if ($containerName === '') {
371
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
372
- }
373
- if (!self::isValidContainerName($containerName)) {
374
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
375
- }
376
-
377
- // Perform request
378
- $response = $this->_performRequest($containerName, array('restype' => 'container'), Microsoft_Http_Client::GET, array(), false, null, Microsoft_WindowsAzure_Storage::RESOURCE_CONTAINER, Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ);
379
- if ($response->isSuccessful()) {
380
- // Parse metadata
381
- $metadata = $this->_parseMetadataHeaders($response->getHeaders());
382
-
383
- // Return container
384
- return new Microsoft_WindowsAzure_Storage_BlobContainer(
385
- $containerName,
386
- $response->getHeader('Etag'),
387
- $response->getHeader('Last-modified'),
388
- $metadata
389
- );
390
- } else {
391
- throw new Microsoft_WindowsAzure_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
392
- }
393
- }
394
-
395
- /**
396
- * Get container metadata
397
- *
398
- * @param string $containerName Container name
399
- * @return array Key/value pairs of meta data
400
- * @throws Microsoft_WindowsAzure_Exception
401
- */
402
- public function getContainerMetadata($containerName = '')
403
- {
404
- if ($containerName === '') {
405
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
406
- }
407
- if (!self::isValidContainerName($containerName)) {
408
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
409
- }
410
-
411
- return $this->getContainer($containerName)->Metadata;
412
- }
413
-
414
- /**
415
- * Set container metadata
416
- *
417
- * Calling the Set Container Metadata operation overwrites all existing metadata that is associated with the container. It's not possible to modify an individual name/value pair.
418
- *
419
- * @param string $containerName Container name
420
- * @param array $metadata Key/value pairs of meta data
421
- * @param array $additionalHeaders Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
422
- * @throws Microsoft_WindowsAzure_Exception
423
- */
424
- public function setContainerMetadata($containerName = '', $metadata = array(), $additionalHeaders = array())
425
- {
426
- if ($containerName === '') {
427
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
428
- }
429
- if (!self::isValidContainerName($containerName)) {
430
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
431
- }
432
- if (!is_array($metadata)) {
433
- throw new Microsoft_WindowsAzure_Exception('Meta data should be an array of key and value pairs.');
434
- }
435
- if (count($metadata) == 0) {
436
- return;
437
- }
438
-
439
- // Create metadata headers
440
- $headers = array();
441
- $headers = array_merge($headers, $this->_generateMetadataHeaders($metadata));
442
-
443
- // Additional headers?
444
- foreach ($additionalHeaders as $key => $value) {
445
- $headers[$key] = $value;
446
- }
447
-
448
- // Perform request
449
- $response = $this->_performRequest($containerName, array('restype' => 'container', 'comp' => 'metadata'), Microsoft_Http_Client::PUT, $headers, false, null, Microsoft_WindowsAzure_Storage::RESOURCE_CONTAINER, Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_WRITE);
450
- if (!$response->isSuccessful()) {
451
- throw new Microsoft_WindowsAzure_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
452
- }
453
- }
454
-
455
- /**
456
- * Delete container
457
- *
458
- * @param string $containerName Container name
459
- * @param array $additionalHeaders Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
460
- * @throws Microsoft_WindowsAzure_Exception
461
- */
462
- public function deleteContainer($containerName = '', $additionalHeaders = array())
463
- {
464
- if ($containerName === '') {
465
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
466
- }
467
- if (!self::isValidContainerName($containerName)) {
468
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
469
- }
470
-
471
- // Additional headers?
472
- $headers = array();
473
- foreach ($additionalHeaders as $key => $value) {
474
- $headers[$key] = $value;
475
- }
476
-
477
- // Perform request
478
- $response = $this->_performRequest($containerName, array('restype' => 'container'), Microsoft_Http_Client::DELETE, $headers, false, null, Microsoft_WindowsAzure_Storage::RESOURCE_CONTAINER, Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_WRITE);
479
- if (!$response->isSuccessful()) {
480
- throw new Microsoft_WindowsAzure_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
481
- }
482
- }
483
-
484
- /**
485
- * List containers
486
- *
487
- * @param string $prefix Optional. Filters the results to return only containers whose name begins with the specified prefix.
488
- * @param int $maxResults Optional. Specifies the maximum number of containers to return per call to Azure storage. This does NOT affect list size returned by this function. (maximum: 5000)
489
- * @param string $marker Optional string value that identifies the portion of the list to be returned with the next list operation.
490
- * @param string $include Optional. Include this parameter to specify that the container's metadata be returned as part of the response body. (allowed values: '', 'metadata')
491
- * @param int $currentResultCount Current result count (internal use)
492
- * @return array
493
- * @throws Microsoft_WindowsAzure_Exception
494
- */
495
- public function listContainers($prefix = null, $maxResults = null, $marker = null, $include = null, $currentResultCount = 0)
496
- {
497
- // Build query string
498
- $query = array('comp' => 'list');
499
- if (!is_null($prefix)) {
500
- $query['prefix'] = $prefix;
501
- }
502
- if (!is_null($maxResults)) {
503
- $query['maxresults'] = $maxResults;
504
- }
505
- if (!is_null($marker)) {
506
- $query['marker'] = $marker;
507
- }
508
- if (!is_null($include)) {
509
- $query['include'] = $include;
510
- }
511
-
512
- // Perform request
513
- $response = $this->_performRequest('', $query, Microsoft_Http_Client::GET, array(), false, null, Microsoft_WindowsAzure_Storage::RESOURCE_CONTAINER, Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_LIST);
514
- if ($response->isSuccessful()) {
515
- $xmlContainers = $this->_parseResponse($response)->Containers->Container;
516
- $xmlMarker = (string)$this->_parseResponse($response)->NextMarker;
517
-
518
- $containers = array();
519
- if (!is_null($xmlContainers)) {
520
- for ($i = 0; $i < count($xmlContainers); $i++) {
521
- $containers[] = new Microsoft_WindowsAzure_Storage_BlobContainer(
522
- (string)$xmlContainers[$i]->Name,
523
- (string)$xmlContainers[$i]->Etag,
524
- (string)$xmlContainers[$i]->LastModified,
525
- $this->_parseMetadataElement($xmlContainers[$i])
526
- );
527
- }
528
- }
529
- $currentResultCount = $currentResultCount + count($containers);
530
- if (!is_null($maxResults) && $currentResultCount < $maxResults) {
531
- if (!is_null($xmlMarker) && $xmlMarker != '') {
532
- $containers = array_merge($containers, $this->listContainers($prefix, $maxResults, $xmlMarker, $include, $currentResultCount));
533
- }
534
- }
535
- if (!is_null($maxResults) && count($containers) > $maxResults) {
536
- $containers = array_slice($containers, 0, $maxResults);
537
- }
538
-
539
- return $containers;
540
- } else {
541
- throw new Microsoft_WindowsAzure_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
542
- }
543
- }
544
-
545
- /**
546
- * Put blob
547
- *
548
- * @param string $containerName Container name
549
- * @param string $blobName Blob name
550
- * @param string $localFileName Local file name to be uploaded
551
- * @param array $metadata Key/value pairs of meta data
552
- * @param string $leaseId Lease identifier
553
- * @param array $additionalHeaders Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
554
- * @return object Partial blob properties
555
- * @throws Microsoft_WindowsAzure_Exception
556
- */
557
- public function putBlob($containerName = '', $blobName = '', $localFileName = '', $metadata = array(), $leaseId = null, $additionalHeaders = array())
558
- {
559
- if ($containerName === '') {
560
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
561
- }
562
- if (!self::isValidContainerName($containerName)) {
563
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
564
- }
565
- if ($blobName === '') {
566
- throw new Microsoft_WindowsAzure_Exception('Blob name is not specified.');
567
- }
568
- if ($localFileName === '') {
569
- throw new Microsoft_WindowsAzure_Exception('Local file name is not specified.');
570
- }
571
- if (!file_exists($localFileName)) {
572
- throw new Microsoft_WindowsAzure_Exception('Local file not found.');
573
- }
574
- if ($containerName === '$root' && strpos($blobName, '/') !== false) {
575
- throw new Microsoft_WindowsAzure_Exception('Blobs stored in the root container can not have a name containing a forward slash (/).');
576
- }
577
-
578
- // Check file size
579
- if (filesize($localFileName) >= self::MAX_BLOB_SIZE) {
580
- return $this->putLargeBlob($containerName, $blobName, $localFileName, $metadata, $leaseId, $additionalHeaders);
581
- }
582
-
583
- // Put the data to Windows Azure Storage
584
- return $this->putBlobData($containerName, $blobName, file_get_contents($localFileName), $metadata, $leaseId, $additionalHeaders);
585
- }
586
-
587
- /**
588
- * Put blob data
589
- *
590
- * @param string $containerName Container name
591
- * @param string $blobName Blob name
592
- * @param mixed $data Data to store
593
- * @param array $metadata Key/value pairs of meta data
594
- * @param string $leaseId Lease identifier
595
- * @param array $additionalHeaders Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
596
- * @return object Partial blob properties
597
- * @throws Microsoft_WindowsAzure_Exception
598
- */
599
- public function putBlobData($containerName = '', $blobName = '', $data = '', $metadata = array(), $leaseId = null, $additionalHeaders = array())
600
- {
601
- if ($containerName === '') {
602
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
603
- }
604
- if (!self::isValidContainerName($containerName)) {
605
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
606
- }
607
- if ($blobName === '') {
608
- throw new Microsoft_WindowsAzure_Exception('Blob name is not specified.');
609
- }
610
- if ($containerName === '$root' && strpos($blobName, '/') !== false) {
611
- throw new Microsoft_WindowsAzure_Exception('Blobs stored in the root container can not have a name containing a forward slash (/).');
612
- }
613
-
614
- // Create metadata headers
615
- $headers = array();
616
- if (!is_null($leaseId)) {
617
- $headers['x-ms-lease-id'] = $leaseId;
618
- }
619
- $headers = array_merge($headers, $this->_generateMetadataHeaders($metadata));
620
-
621
- // Additional headers?
622
- foreach ($additionalHeaders as $key => $value) {
623
- $headers[$key] = $value;
624
- }
625
-
626
- // Specify blob type
627
- $headers[Microsoft_WindowsAzure_Storage::PREFIX_STORAGE_HEADER . 'blob-type'] = self::BLOBTYPE_BLOCK;
628
-
629
- // Resource name
630
- $resourceName = self::createResourceName($containerName , $blobName);
631
-
632
- // Perform request
633
- $response = $this->_performRequest($resourceName, array(), Microsoft_Http_Client::PUT, $headers, false, $data, Microsoft_WindowsAzure_Storage::RESOURCE_BLOB, Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_WRITE);
634
- if ($response->isSuccessful()) {
635
- return new Microsoft_WindowsAzure_Storage_BlobInstance(
636
- $containerName,
637
- $blobName,
638
- null,
639
- $response->getHeader('Etag'),
640
- $response->getHeader('Last-modified'),
641
- $this->getBaseUrl() . '/' . $containerName . '/' . $blobName,
642
- strlen($data),
643
- '',
644
- '',
645
- '',
646
- false,
647
- $metadata
648
- );
649
- } else {
650
- throw new Microsoft_WindowsAzure_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
651
- }
652
- }
653
-
654
- /**
655
- * Put large blob (> 64 MB)
656
- *
657
- * @param string $containerName Container name
658
- * @param string $blobName Blob name
659
- * @param string $localFileName Local file name to be uploaded
660
- * @param array $metadata Key/value pairs of meta data
661
- * @param string $leaseId Lease identifier
662
- * @param array $additionalHeaders Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
663
- * @return object Partial blob properties
664
- * @throws Microsoft_WindowsAzure_Exception
665
- */
666
- public function putLargeBlob($containerName = '', $blobName = '', $localFileName = '', $metadata = array(), $leaseId = null, $additionalHeaders = array())
667
- {
668
- if ($containerName === '') {
669
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
670
- }
671
- if (!self::isValidContainerName($containerName)) {
672
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
673
- }
674
- if ($blobName === '') {
675
- throw new Microsoft_WindowsAzure_Exception('Blob name is not specified.');
676
- }
677
- if ($localFileName === '') {
678
- throw new Microsoft_WindowsAzure_Exception('Local file name is not specified.');
679
- }
680
- if (!file_exists($localFileName)) {
681
- throw new Microsoft_WindowsAzure_Exception('Local file not found.');
682
- }
683
- if ($containerName === '$root' && strpos($blobName, '/') !== false) {
684
- throw new Microsoft_WindowsAzure_Exception('Blobs stored in the root container can not have a name containing a forward slash (/).');
685
- }
686
-
687
- // Check file size
688
- if (filesize($localFileName) < self::MAX_BLOB_SIZE) {
689
- return $this->putBlob($containerName, $blobName, $localFileName, $metadata, $leaseId, $additionalHeaders);
690
- }
691
-
692
- // Determine number of parts
693
- $numberOfParts = ceil( filesize($localFileName) / self::MAX_BLOB_TRANSFER_SIZE );
694
-
695
- // Generate block id's
696
- $blockIdentifiers = array();
697
- for ($i = 0; $i < $numberOfParts; $i++) {
698
- $blockIdentifiers[] = $this->_generateBlockId($i);
699
- }
700
-
701
- // Open file
702
- $fp = fopen($localFileName, 'r');
703
- if ($fp === false) {
704
- throw new Microsoft_WindowsAzure_Exception('Could not open local file.');
705
- }
706
-
707
- // Upload parts
708
- for ($i = 0; $i < $numberOfParts; $i++) {
709
- // Seek position in file
710
- fseek($fp, $i * self::MAX_BLOB_TRANSFER_SIZE);
711
-
712
- // Read contents
713
- $fileContents = fread($fp, self::MAX_BLOB_TRANSFER_SIZE);
714
-
715
- // Put block
716
- $this->putBlock($containerName, $blobName, $blockIdentifiers[$i], $fileContents, $leaseId);
717
-
718
- // Dispose file contents
719
- $fileContents = null;
720
- unset($fileContents);
721
- }
722
-
723
- // Close file
724
- fclose($fp);
725
-
726
- // Put block list
727
- $this->putBlockList($containerName, $blobName, $blockIdentifiers, $metadata, $leaseId, $additionalHeaders);
728
-
729
- // Return information of the blob
730
- return $this->getBlobInstance($containerName, $blobName, null, $leaseId);
731
- }
732
-
733
- /**
734
- * Put large blob block
735
- *
736
- * @param string $containerName Container name
737
- * @param string $blobName Blob name
738
- * @param string $identifier Block ID
739
- * @param array $contents Contents of the block
740
- * @param string $leaseId Lease identifier
741
- * @throws Microsoft_WindowsAzure_Exception
742
- */
743
- public function putBlock($containerName = '', $blobName = '', $identifier = '', $contents = '', $leaseId = null)
744
- {
745
- if ($containerName === '') {
746
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
747
- }
748
- if (!self::isValidContainerName($containerName)) {
749
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
750
- }
751
- if ($identifier === '') {
752
- throw new Microsoft_WindowsAzure_Exception('Block identifier is not specified.');
753
- }
754
- if (strlen($contents) > self::MAX_BLOB_TRANSFER_SIZE) {
755
- throw new Microsoft_WindowsAzure_Exception('Block size is too big.');
756
- }
757
- if ($containerName === '$root' && strpos($blobName, '/') !== false) {
758
- throw new Microsoft_WindowsAzure_Exception('Blobs stored in the root container can not have a name containing a forward slash (/).');
759
- }
760
-
761
- // Headers
762
- $headers = array();
763
- if (!is_null($leaseId)) {
764
- $headers['x-ms-lease-id'] = $leaseId;
765
- }
766
-
767
- // Resource name
768
- $resourceName = self::createResourceName($containerName , $blobName);
769
-
770
- // Upload
771
- $response = $this->_performRequest($resourceName, array('comp' => 'block', 'blockid' => base64_encode($identifier)), Microsoft_Http_Client::PUT, $headers, false, $contents, Microsoft_WindowsAzure_Storage::RESOURCE_BLOB, Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_WRITE);
772
- if (!$response->isSuccessful()) {
773
- throw new Microsoft_WindowsAzure_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
774
- }
775
- }
776
-
777
- /**
778
- * Put block list
779
- *
780
- * @param string $containerName Container name
781
- * @param string $blobName Blob name
782
- * @param array $blockList Array of block identifiers
783
- * @param array $metadata Key/value pairs of meta data
784
- * @param string $leaseId Lease identifier
785
- * @param array $additionalHeaders Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
786
- * @throws Microsoft_WindowsAzure_Exception
787
- */
788
- public function putBlockList($containerName = '', $blobName = '', $blockList = array(), $metadata = array(), $leaseId = null, $additionalHeaders = array())
789
- {
790
- if ($containerName === '') {
791
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
792
- }
793
- if (!self::isValidContainerName($containerName)) {
794
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
795
- }
796
- if ($blobName === '') {
797
- throw new Microsoft_WindowsAzure_Exception('Blob name is not specified.');
798
- }
799
- if (count($blockList) == 0) {
800
- throw new Microsoft_WindowsAzure_Exception('Block list does not contain any elements.');
801
- }
802
- if ($containerName === '$root' && strpos($blobName, '/') !== false) {
803
- throw new Microsoft_WindowsAzure_Exception('Blobs stored in the root container can not have a name containing a forward slash (/).');
804
- }
805
-
806
- // Generate block list
807
- $blocks = '';
808
- foreach ($blockList as $block) {
809
- $blocks .= ' <Latest>' . base64_encode($block) . '</Latest>' . "\n";
810
- }
811
-
812
- // Generate block list request
813
- $fileContents = utf8_encode(implode("\n", array(
814
- '<?xml version="1.0" encoding="utf-8"?>',
815
- '<BlockList>',
816
- $blocks,
817
- '</BlockList>'
818
- )));
819
-
820
- // Create metadata headers
821
- $headers = array();
822
- if (!is_null($leaseId)) {
823
- $headers['x-ms-lease-id'] = $leaseId;
824
- }
825
- $headers = array_merge($headers, $this->_generateMetadataHeaders($metadata));
826
-
827
- // Additional headers?
828
- foreach ($additionalHeaders as $key => $value) {
829
- $headers[$key] = $value;
830
- }
831
-
832
- // Resource name
833
- $resourceName = self::createResourceName($containerName , $blobName);
834
-
835
- // Perform request
836
- $response = $this->_performRequest($resourceName, array('comp' => 'blocklist'), Microsoft_Http_Client::PUT, $headers, false, $fileContents, Microsoft_WindowsAzure_Storage::RESOURCE_BLOB, Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_WRITE);
837
- if (!$response->isSuccessful()) {
838
- throw new Microsoft_WindowsAzure_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
839
- }
840
- }
841
-
842
- /**
843
- * Get block list
844
- *
845
- * @param string $containerName Container name
846
- * @param string $blobName Blob name
847
- * @param string $snapshotId Snapshot identifier
848
- * @param string $leaseId Lease identifier
849
- * @param integer $type Type of block list to retrieve. 0 = all, 1 = committed, 2 = uncommitted
850
- * @return array
851
- * @throws Microsoft_WindowsAzure_Exception
852
- */
853
- public function getBlockList($containerName = '', $blobName = '', $snapshotId = null, $leaseId = null, $type = 0)
854
- {
855
- if ($containerName === '') {
856
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
857
- }
858
- if (!self::isValidContainerName($containerName)) {
859
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
860
- }
861
- if ($blobName === '') {
862
- throw new Microsoft_WindowsAzure_Exception('Blob name is not specified.');
863
- }
864
- if ($type < 0 || $type > 2) {
865
- throw new Microsoft_WindowsAzure_Exception('Invalid type of block list to retrieve.');
866
- }
867
-
868
- // Set $blockListType
869
- $blockListType = 'all';
870
- if ($type == 1) {
871
- $blockListType = 'committed';
872
- }
873
- if ($type == 2) {
874
- $blockListType = 'uncommitted';
875
- }
876
-
877
- // Headers
878
- $headers = array();
879
- if (!is_null($leaseId)) {
880
- $headers['x-ms-lease-id'] = $leaseId;
881
- }
882
-
883
- // Build query string
884
- $query = array('comp' => 'blocklist', 'blocklisttype' => $blockListType);
885
- if (!is_null($snapshotId)) {
886
- $query['snapshot'] = $snapshotId;
887
- }
888
-
889
- // Resource name
890
- $resourceName = self::createResourceName($containerName , $blobName);
891
-
892
- // Perform request
893
- $response = $this->_performRequest($resourceName, $query, Microsoft_Http_Client::GET, $headers, false, null, Microsoft_WindowsAzure_Storage::RESOURCE_BLOB, Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ);
894
- if ($response->isSuccessful()) {
895
- // Parse response
896
- $blockList = $this->_parseResponse($response);
897
-
898
- // Create return value
899
- $returnValue = array();
900
- if ($blockList->CommittedBlocks) {
901
- foreach ($blockList->CommittedBlocks->Block as $block) {
902
- $returnValue['CommittedBlocks'][] = (object)array(
903
- 'Name' => (string)$block->Name,
904
- 'Size' => (string)$block->Size
905
- );
906
- }
907
- }
908
- if ($blockList->UncommittedBlocks) {
909
- foreach ($blockList->UncommittedBlocks->Block as $block) {
910
- $returnValue['UncommittedBlocks'][] = (object)array(
911
- 'Name' => (string)$block->Name,
912
- 'Size' => (string)$block->Size
913
- );
914
- }
915
- }
916
-
917
- return $returnValue;
918
- } else {
919
- throw new Microsoft_WindowsAzure_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
920
- }
921
- }
922
-
923
- /**
924
- * Create page blob
925
- *
926
- * @param string $containerName Container name
927
- * @param string $blobName Blob name
928
- * @param int $size Size of the page blob in bytes
929
- * @param array $metadata Key/value pairs of meta data
930
- * @param string $leaseId Lease identifier
931
- * @param array $additionalHeaders Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
932
- * @return object Partial blob properties
933
- * @throws Microsoft_WindowsAzure_Exception
934
- */
935
- public function createPageBlob($containerName = '', $blobName = '', $size = 0, $metadata = array(), $leaseId = null, $additionalHeaders = array())
936
- {
937
- if ($containerName === '') {
938
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
939
- }
940
- if (!self::isValidContainerName($containerName)) {
941
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
942
- }
943
- if ($blobName === '') {
944
- throw new Microsoft_WindowsAzure_Exception('Blob name is not specified.');
945
- }
946
- if ($containerName === '$root' && strpos($blobName, '/') !== false) {
947
- throw new Microsoft_WindowsAzure_Exception('Blobs stored in the root container can not have a name containing a forward slash (/).');
948
- }
949
- if ($size <= 0) {
950
- throw new Microsoft_WindowsAzure_Exception('Page blob size must be specified.');
951
- }
952
-
953
- // Create metadata headers
954
- $headers = array();
955
- if (!is_null($leaseId)) {
956
- $headers['x-ms-lease-id'] = $leaseId;
957
- }
958
- $headers = array_merge($headers, $this->_generateMetadataHeaders($metadata));
959
-
960
- // Additional headers?
961
- foreach ($additionalHeaders as $key => $value) {
962
- $headers[$key] = $value;
963
- }
964
-
965
- // Specify blob type & blob length
966
- $headers[Microsoft_WindowsAzure_Storage::PREFIX_STORAGE_HEADER . 'blob-type'] = self::BLOBTYPE_PAGE;
967
- $headers[Microsoft_WindowsAzure_Storage::PREFIX_STORAGE_HEADER . 'blob-content-length'] = $size;
968
- $headers['Content-Length'] = 0;
969
-
970
- // Resource name
971
- $resourceName = self::createResourceName($containerName , $blobName);
972
-
973
- // Perform request
974
- $response = $this->_performRequest($resourceName, array(), Microsoft_Http_Client::PUT, $headers, false, '', Microsoft_WindowsAzure_Storage::RESOURCE_BLOB, Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_WRITE);
975
- if ($response->isSuccessful()) {
976
- return new Microsoft_WindowsAzure_Storage_BlobInstance(
977
- $containerName,
978
- $blobName,
979
- null,
980
- $response->getHeader('Etag'),
981
- $response->getHeader('Last-modified'),
982
- $this->getBaseUrl() . '/' . $containerName . '/' . $blobName,
983
- $size,
984
- '',
985
- '',
986
- '',
987
- false,
988
- $metadata
989
- );
990
- } else {
991
- throw new Microsoft_WindowsAzure_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
992
- }
993
- }
994
-
995
- /**
996
- * Put page in page blob
997
- *
998
- * @param string $containerName Container name
999
- * @param string $blobName Blob name
1000
- * @param int $startByteOffset Start byte offset
1001
- * @param int $endByteOffset End byte offset
1002
- * @param mixed $contents Page contents
1003
- * @param string $writeMethod Write method (Microsoft_WindowsAzure_Storage_Blob::PAGE_WRITE_*)
1004
- * @param string $leaseId Lease identifier
1005
- * @param array $additionalHeaders Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
1006
- * @throws Microsoft_WindowsAzure_Exception
1007
- */
1008
- public function putPage($containerName = '', $blobName = '', $startByteOffset = 0, $endByteOffset = 0, $contents = '', $writeMethod = self::PAGE_WRITE_UPDATE, $leaseId = null, $additionalHeaders = array())
1009
- {
1010
- if ($containerName === '') {
1011
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
1012
- }
1013
- if (!self::isValidContainerName($containerName)) {
1014
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
1015
- }
1016
- if ($blobName === '') {
1017
- throw new Microsoft_WindowsAzure_Exception('Blob name is not specified.');
1018
- }
1019
- if ($containerName === '$root' && strpos($blobName, '/') !== false) {
1020
- throw new Microsoft_WindowsAzure_Exception('Blobs stored in the root container can not have a name containing a forward slash (/).');
1021
- }
1022
- if ($startByteOffset % 512 != 0) {
1023
- throw new Microsoft_WindowsAzure_Exception('Start byte offset must be a modulus of 512.');
1024
- }
1025
- if (($endByteOffset + 1) % 512 != 0) {
1026
- throw new Microsoft_WindowsAzure_Exception('End byte offset must be a modulus of 512 minus 1.');
1027
- }
1028
-
1029
- // Determine size
1030
- $size = strlen($contents);
1031
- if ($size >= self::MAX_BLOB_TRANSFER_SIZE) {
1032
- throw new Microsoft_WindowsAzure_Exception('Page blob size must not be larger than ' + self::MAX_BLOB_TRANSFER_SIZE . ' bytes.');
1033
- }
1034
-
1035
- // Create metadata headers
1036
- $headers = array();
1037
- if (!is_null($leaseId)) {
1038
- $headers['x-ms-lease-id'] = $leaseId;
1039
- }
1040
-
1041
- // Additional headers?
1042
- foreach ($additionalHeaders as $key => $value) {
1043
- $headers[$key] = $value;
1044
- }
1045
-
1046
- // Specify range
1047
- $headers['Range'] = 'bytes=' . $startByteOffset . '-' . $endByteOffset;
1048
-
1049
- // Write method
1050
- $headers[Microsoft_WindowsAzure_Storage::PREFIX_STORAGE_HEADER . 'page-write'] = $writeMethod;
1051
-
1052
- // Resource name
1053
- $resourceName = self::createResourceName($containerName , $blobName);
1054
-
1055
- // Perform request
1056
- $response = $this->_performRequest($resourceName, array('comp' => 'page'), Microsoft_Http_Client::PUT, $headers, false, $contents, Microsoft_WindowsAzure_Storage::RESOURCE_BLOB, Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_WRITE);
1057
- if (!$response->isSuccessful()) {
1058
- throw new Microsoft_WindowsAzure_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1059
- }
1060
- }
1061
-
1062
- /**
1063
- * Put page in page blob
1064
- *
1065
- * @param string $containerName Container name
1066
- * @param string $blobName Blob name
1067
- * @param int $startByteOffset Start byte offset
1068
- * @param int $endByteOffset End byte offset
1069
- * @param string $leaseId Lease identifier
1070
- * @return array Array of page ranges
1071
- * @throws Microsoft_WindowsAzure_Exception
1072
- */
1073
- public function getPageRegions($containerName = '', $blobName = '', $startByteOffset = 0, $endByteOffset = 0, $leaseId = null)
1074
- {
1075
- if ($containerName === '') {
1076
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
1077
- }
1078
- if (!self::isValidContainerName($containerName)) {
1079
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
1080
- }
1081
- if ($blobName === '') {
1082
- throw new Microsoft_WindowsAzure_Exception('Blob name is not specified.');
1083
- }
1084
- if ($containerName === '$root' && strpos($blobName, '/') !== false) {
1085
- throw new Microsoft_WindowsAzure_Exception('Blobs stored in the root container can not have a name containing a forward slash (/).');
1086
- }
1087
- if ($startByteOffset % 512 != 0) {
1088
- throw new Microsoft_WindowsAzure_Exception('Start byte offset must be a modulus of 512.');
1089
- }
1090
- if ($endByteOffset > 0 && ($endByteOffset + 1) % 512 != 0) {
1091
- throw new Microsoft_WindowsAzure_Exception('End byte offset must be a modulus of 512 minus 1.');
1092
- }
1093
-
1094
- // Create metadata headers
1095
- $headers = array();
1096
- if (!is_null($leaseId)) {
1097
- $headers['x-ms-lease-id'] = $leaseId;
1098
- }
1099
-
1100
- // Specify range?
1101
- if ($endByteOffset > 0) {
1102
- $headers['Range'] = 'bytes=' . $startByteOffset . '-' . $endByteOffset;
1103
- }
1104
-
1105
- // Resource name
1106
- $resourceName = self::createResourceName($containerName , $blobName);
1107
-
1108
- // Perform request
1109
- $response = $this->_performRequest($resourceName, array('comp' => 'pagelist'), Microsoft_Http_Client::GET, $headers, false, null, Microsoft_WindowsAzure_Storage::RESOURCE_BLOB, Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_WRITE);
1110
- if ($response->isSuccessful()) {
1111
- $result = $this->_parseResponse($response);
1112
- $xmlRanges = null;
1113
- if (count($result->PageRange) > 1) {
1114
- $xmlRanges = $result->PageRange;
1115
- } else {
1116
- $xmlRanges = array($result->PageRange);
1117
- }
1118
-
1119
- $ranges = array();
1120
- for ($i = 0; $i < count($xmlRanges); $i++) {
1121
- $ranges[] = new Microsoft_WindowsAzure_Storage_PageRegionInstance(
1122
- (int)$xmlRanges[$i]->Start,
1123
- (int)$xmlRanges[$i]->End
1124
- );
1125
- }
1126
-
1127
- return $ranges;
1128
- } else {
1129
- throw new Microsoft_WindowsAzure_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1130
- }
1131
- }
1132
-
1133
- /**
1134
- * Copy blob
1135
- *
1136
- * @param string $sourceContainerName Source container name
1137
- * @param string $sourceBlobName Source blob name
1138
- * @param string $destinationContainerName Destination container name
1139
- * @param string $destinationBlobName Destination blob name
1140
- * @param array $metadata Key/value pairs of meta data
1141
- * @param string $sourceSnapshotId Source snapshot identifier
1142
- * @param string $destinationLeaseId Destination lease identifier
1143
- * @param array $additionalHeaders Additional headers. See http://msdn.microsoft.com/en-us/library/dd894037.aspx for more information.
1144
- * @return object Partial blob properties
1145
- * @throws Microsoft_WindowsAzure_Exception
1146
- */
1147
- public function copyBlob($sourceContainerName = '', $sourceBlobName = '', $destinationContainerName = '', $destinationBlobName = '', $metadata = array(), $sourceSnapshotId = null, $destinationLeaseId = null, $additionalHeaders = array())
1148
- {
1149
- if ($sourceContainerName === '') {
1150
- throw new Microsoft_WindowsAzure_Exception('Source container name is not specified.');
1151
- }
1152
- if (!self::isValidContainerName($sourceContainerName)) {
1153
- throw new Microsoft_WindowsAzure_Exception('Source container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
1154
- }
1155
- if ($sourceBlobName === '') {
1156
- throw new Microsoft_WindowsAzure_Exception('Source blob name is not specified.');
1157
- }
1158
- if ($destinationContainerName === '') {
1159
- throw new Microsoft_WindowsAzure_Exception('Destination container name is not specified.');
1160
- }
1161
- if (!self::isValidContainerName($destinationContainerName)) {
1162
- throw new Microsoft_WindowsAzure_Exception('Destination container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
1163
- }
1164
- if ($destinationBlobName === '') {
1165
- throw new Microsoft_WindowsAzure_Exception('Destination blob name is not specified.');
1166
- }
1167
- if ($sourceContainerName === '$root' && strpos($sourceBlobName, '/') !== false) {
1168
- throw new Microsoft_WindowsAzure_Exception('Blobs stored in the root container can not have a name containing a forward slash (/).');
1169
- }
1170
- if ($destinationContainerName === '$root' && strpos($destinationBlobName, '/') !== false) {
1171
- throw new Microsoft_WindowsAzure_Exception('Blobs stored in the root container can not have a name containing a forward slash (/).');
1172
- }
1173
-
1174
- // Create metadata headers
1175
- $headers = array();
1176
- if (!is_null($destinationLeaseId)) {
1177
- $headers['x-ms-lease-id'] = $destinationLeaseId;
1178
- }
1179
- $headers = array_merge($headers, $this->_generateMetadataHeaders($metadata));
1180
-
1181
- // Additional headers?
1182
- foreach ($additionalHeaders as $key => $value) {
1183
- $headers[$key] = $value;
1184
- }
1185
-
1186
- // Resource names
1187
- $sourceResourceName = self::createResourceName($sourceContainerName, $sourceBlobName);
1188
- if (!is_null($sourceSnapshotId)) {
1189
- $sourceResourceName .= '?snapshot=' . $sourceSnapshotId;
1190
- }
1191
- $destinationResourceName = self::createResourceName($destinationContainerName, $destinationBlobName);
1192
-
1193
- // Set source blob
1194
- $headers["x-ms-copy-source"] = '/' . $this->_accountName . '/' . $sourceResourceName;
1195
-
1196
- // Perform request
1197
- $response = $this->_performRequest($destinationResourceName, array(), Microsoft_Http_Client::PUT, $headers, false, null, Microsoft_WindowsAzure_Storage::RESOURCE_BLOB, Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_WRITE);
1198
- if ($response->isSuccessful()) {
1199
- return new Microsoft_WindowsAzure_Storage_BlobInstance(
1200
- $destinationContainerName,
1201
- $destinationBlobName,
1202
- null,
1203
- $response->getHeader('Etag'),
1204
- $response->getHeader('Last-modified'),
1205
- $this->getBaseUrl() . '/' . $destinationContainerName . '/' . $destinationBlobName,
1206
- 0,
1207
- '',
1208
- '',
1209
- '',
1210
- false,
1211
- $metadata
1212
- );
1213
- } else {
1214
- throw new Microsoft_WindowsAzure_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1215
- }
1216
- }
1217
-
1218
- /**
1219
- * Get blob
1220
- *
1221
- * @param string $containerName Container name
1222
- * @param string $blobName Blob name
1223
- * @param string $localFileName Local file name to store downloaded blob
1224
- * @param string $snapshotId Snapshot identifier
1225
- * @param string $leaseId Lease identifier
1226
- * @param array $additionalHeaders Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
1227
- * @throws Microsoft_WindowsAzure_Exception
1228
- */
1229
- public function getBlob($containerName = '', $blobName = '', $localFileName = '', $snapshotId = null, $leaseId = null, $additionalHeaders = array())
1230
- {
1231
- if ($containerName === '') {
1232
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
1233
- }
1234
- if (!self::isValidContainerName($containerName)) {
1235
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
1236
- }
1237
- if ($blobName === '') {
1238
- throw new Microsoft_WindowsAzure_Exception('Blob name is not specified.');
1239
- }
1240
- if ($localFileName === '') {
1241
- throw new Microsoft_WindowsAzure_Exception('Local file name is not specified.');
1242
- }
1243
-
1244
- // Fetch data
1245
- file_put_contents($localFileName, $this->getBlobData($containerName, $blobName, $snapshotId, $leaseId, $additionalHeaders));
1246
- }
1247
-
1248
- /**
1249
- * Get blob data
1250
- *
1251
- * @param string $containerName Container name
1252
- * @param string $blobName Blob name
1253
- * @param string $snapshotId Snapshot identifier
1254
- * @param string $leaseId Lease identifier
1255
- * @param array $additionalHeaders Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
1256
- * @return mixed Blob contents
1257
- * @throws Microsoft_WindowsAzure_Exception
1258
- */
1259
- public function getBlobData($containerName = '', $blobName = '', $snapshotId = null, $leaseId = null, $additionalHeaders = array())
1260
- {
1261
- if ($containerName === '') {
1262
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
1263
- }
1264
- if (!self::isValidContainerName($containerName)) {
1265
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
1266
- }
1267
- if ($blobName === '') {
1268
- throw new Microsoft_WindowsAzure_Exception('Blob name is not specified.');
1269
- }
1270
-
1271
- // Build query string
1272
- $query = array();
1273
- if (!is_null($snapshotId)) {
1274
- $query['snapshot'] = $snapshotId;
1275
- }
1276
-
1277
- // Additional headers?
1278
- $headers = array();
1279
- if (!is_null($leaseId)) {
1280
- $headers['x-ms-lease-id'] = $leaseId;
1281
- }
1282
- foreach ($additionalHeaders as $key => $value) {
1283
- $headers[$key] = $value;
1284
- }
1285
-
1286
- // Resource name
1287
- $resourceName = self::createResourceName($containerName , $blobName);
1288
-
1289
- // Perform request
1290
- $response = $this->_performRequest($resourceName, $query, Microsoft_Http_Client::GET, $headers, false, null, Microsoft_WindowsAzure_Storage::RESOURCE_BLOB, Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ);
1291
- if ($response->isSuccessful()) {
1292
- return $response->getBody();
1293
- } else {
1294
- throw new Microsoft_WindowsAzure_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1295
- }
1296
- }
1297
-
1298
- /**
1299
- * Get blob instance
1300
- *
1301
- * @param string $containerName Container name
1302
- * @param string $blobName Blob name
1303
- * @param string $snapshotId Snapshot identifier
1304
- * @param string $leaseId Lease identifier
1305
- * @param array $additionalHeaders Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
1306
- * @return Microsoft_WindowsAzure_Storage_BlobInstance
1307
- * @throws Microsoft_WindowsAzure_Exception
1308
- */
1309
- public function getBlobInstance($containerName = '', $blobName = '', $snapshotId = null, $leaseId = null, $additionalHeaders = array())
1310
- {
1311
- if ($containerName === '') {
1312
- throw new Microsoft_WindowsAzure_Exception('Container name is not specified.');
1313
- }
1314
- if (!self::isValidContainerName($containerName)) {
1315
- throw new Microsoft_WindowsAzure_Exception('Container name does not adhere to container naming conventions. See http://msdn.microsoft.com/en-us/library/dd135715.aspx for more information.');
1316
- }
1317
- if ($blobName === '') {
1318
- throw new Microsoft_WindowsAzure_Exception('Blob name is not specified.');
1319
- }
1320
- if ($containerName === '$root' && strpos($blobName, '/') !== false) {
1321
- throw new Microsoft_WindowsAzure_Exception('Blobs stored in the root container can not have a name containing a forward slash (/).');
1322
- }
1323
-
1324
- // Build query string
1325
- $query = array();
1326
- if (!is_null($snapshotId)) {
1327
- $query['snapshot'] = $snapshotId;
1328
- }
1329
-
1330
- // Additional headers?
1331
- $headers = array();
1332
- if (!is_null($leaseId)) {
1333
- $headers['x-ms-lease-id'] = $leaseId;
1334
- }
1335
- foreach ($additionalHeaders as $key => $value) {
1336
- $headers[$key] = $value;
1337
- }
1338
-
1339
- // Resource name
1340
- $resourceName = self::createResourceName($containerName , $blobName);
1341
-
1342
- // Perform request
1343
- $response = $this->_performRequest($resourceName, $query, Microsoft_Http_Client::HEAD, $headers, false, null, Microsoft_WindowsAzure_Storage::RESOURCE_BLOB, Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ);
1344
- if ($response->isSuccessful()) {
1345
- // Parse metadata
1346
- $metadata = $this->_parseMetadataHeaders($response->getHeaders());
1347
-
1348
- // Return blob
1349
- return new Microsoft_WindowsAzure_Storage_BlobInstance(
1350
- $containerName,
1351
- $blobName,
1352
- $snapshotId,
1353
- $response->getHeader('Etag'),
1354
- $response->getHeader('Last-modified'),
1355
- $this->getBaseUrl() . '/' . $containerName . '/' . $blobName,
1356
- $response->getHeader('Content-Length'),
1357
- $response->getHeader('Content-Type'),
1358
- $response->getHeader('Content-Encoding'),
1359
- $response->getHeader('Content-Language'),
1360
- $response->getHeader('Cache-Control'),
1361
- $response->getHeader('x-ms-blob-type'),
1362
- $response->getHeader('x-ms-lease-status'),
1363
- false,
1364
- $metadata
1365
- );
1366
- } else {
1367
- throw new Microsoft_WindowsAzure_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));
1368
-