Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix for php scaffolding and runtime null ref

  • Loading branch information...
commit 7983e41b5713c157c6c67bc27072d0ee0a95f2af 1 parent 407ced4
unknown authored
4 WindowsAzurePowershell/src/Management.CloudService/Cmdlet/PublishAzureServiceProject.cs
View
@@ -331,7 +331,7 @@ private void CreatePackage()
List<CloudRuntimeApplicator> applicators = new List<CloudRuntimeApplicator>();
if (definition.WebRole != null)
{
- foreach (ServiceDefinitionSchema.WebRole role in definition.WebRole.Where(role => role.Startup != null))
+ foreach (ServiceDefinitionSchema.WebRole role in definition.WebRole.Where(role => role.Startup != null && CloudRuntime.GetRuntimeStartupTask(role.Startup) != null))
{
CloudRuntime.ClearRuntime(role);
string rolePath = Path.Combine(service.Paths.RootPath, role.name);
@@ -356,7 +356,7 @@ private void CreatePackage()
if (definition.WorkerRole != null)
{
- foreach (ServiceDefinitionSchema.WorkerRole role in definition.WorkerRole.Where(role => role.Startup != null))
+ foreach (ServiceDefinitionSchema.WorkerRole role in definition.WorkerRole.Where(role => role.Startup != null && CloudRuntime.GetRuntimeStartupTask(role.Startup) != null))
{
string rolePath = Path.Combine(service.Paths.RootPath, role.name);
CloudRuntime.ClearRuntime(role);
12 WindowsAzurePowershell/src/Management.CloudService/Model/CloudRuntime.cs
View
@@ -287,12 +287,20 @@ private static void ApplyRoleXmlChanges(Dictionary<string, string> changes, Work
public static void ClearRuntime(WebRole role)
{
- ClearEnvironmentValue(GetRuntimeStartupTask(role.Startup).Environment, Resources.RuntimeUrlKey);
+ Task startupTask = GetRuntimeStartupTask(role.Startup);
+ if (startupTask != null)
+ {
+ ClearEnvironmentValue(startupTask.Environment, Resources.RuntimeUrlKey);
+ }
}
public static void ClearRuntime(WorkerRole role)
{
- ClearEnvironmentValue(GetRuntimeStartupTask(role.Startup).Environment, Resources.RuntimeUrlKey);
+ Task startupTask = GetRuntimeStartupTask(role.Startup);
+ if (startupTask != null)
+ {
+ ClearEnvironmentValue(startupTask.Environment, Resources.RuntimeUrlKey);
+ }
}
static void ClearEnvironmentValue(Variable[] environment, string key)
16 WindowsAzurePowershell/src/Management.CloudService/Resources/Scaffolding/PHP/WebRole/bin/setup_web.cmd
View
@@ -28,16 +28,16 @@ exit /b 0
icacls %RoleRoot%\approot /grant "Everyone":F /T
:: Detect PHP Runtime Path
-:: where php-cgi.exe > tmpFile
-:: set /p phprt= < tmpFile
-:: del tmpFile
-:: if DEFINED phprt goto setup_iis
-:: SET phprt=%ProgramFiles%\PHP\v5.3\php-cgi.exe
-:: if DEFINED ProgramFiles(x86) SET phprt=%ProgramFiles(x86)%\PHP\v5.3\php-cgi.exe
+where php-cgi.exe > tmpFile
+set /p phprt= < tmpFile
+del tmpFile
+if DEFINED phprt goto setup_iis
+SET phprt=%ProgramFiles%\PHP\v5.3\php-cgi.exe
+if DEFINED ProgramFiles(x86) SET phprt=%ProgramFiles(x86)%\PHP\v5.3\php-cgi.exe
:setup_iis
-:: %appcmd% set config -section:system.webServer/fastCgi /+"[fullPath='%phprt%',arguments='',maxInstances='4',idleTimeout='300',activityTimeout='30',requestTimeout='90',queueLength='1000',instanceMaxRequests='200',protocol='NamedPipe',flushNamedPipe='False',rapidFailsPerMinute='10']" /commit:apphost
-:: %appcmd% set config -section:system.webServer/handlers /+"[name='PHP-FastCGI',path='*.php',modules='FastCgiModule',verb='*', scriptProcessor='%phprt%']" /commit:apphost
+%appcmd% set config -section:system.webServer/fastCgi /+"[fullPath='%phprt%',arguments='',maxInstances='4',idleTimeout='300',activityTimeout='30',requestTimeout='90',queueLength='1000',instanceMaxRequests='200',protocol='NamedPipe',flushNamedPipe='False',rapidFailsPerMinute='10']" /commit:apphost
+%appcmd% set config -section:system.webServer/handlers /+"[name='PHP-FastCGI',path='*.php',modules='FastCgiModule',verb='*', scriptProcessor='%phprt%']" /commit:apphost
exit /b 0
Please sign in to comment.
Something went wrong with that request. Please try again.