Author: FabianLange
Date: 2010-01-26 21:23:26 +0100 (Tue, 26 Jan 2010)
New Revision: 27211
Modified:
branches/1.3/lib/task/generator/sfGenerateProjectTask.class.php
branches/1.4/lib/task/generator/sfGenerateProjectTask.class.php
Log:
[1.3, 1.4] added check and logging for non executable remote installer files in
sfGenerateProjectTask (closes #7921)
Modified: branches/1.3/lib/task/generator/sfGenerateProjectTask.class.php
===================================================================
--- branches/1.3/lib/task/generator/sfGenerateProjectTask.class.php
2010-01-26 20:00:28 UTC (rev 27210)
+++ branches/1.3/lib/task/generator/sfGenerateProjectTask.class.php
2010-01-26 20:23:26 UTC (rev 27211)
@@ -135,9 +135,11 @@
// execute a custom installer
if ($options['installer'] && $this->commandApplication)
{
- $this->reloadTasks();
-
- include $options['installer'];
+ if ($this->canRunInstaller($options['installer']))
+ {
+ $this->reloadTasks();
+ include $options['installer'];
+ }
}
// fix permission for common directories
@@ -148,4 +150,21 @@
$this->replaceTokens();
}
+
+ protected function canRunInstaller($installer)
+ {
+ if (preg_match('#^(https?|ftps?)://#', $installer))
+ {
+ if (ini_get('allow_url_fopen') === false)
+ {
+ $this->logSection('generate', sprintf('Cannot run remote installer
"%s" because "allow_url_fopen" is off', $installer));
+ }
+ if (ini_get('allow_url_include') === false)
+ {
+ $this->logSection('generate', sprintf('Cannot run remote installer
"%s" because "allow_url_include" is off', $installer));
+ }
+ return ini_get('allow_url_fopen') && ini_get('allow_url_include');
+ }
+ return true;
+ }
}
Modified: branches/1.4/lib/task/generator/sfGenerateProjectTask.class.php
===================================================================
--- branches/1.4/lib/task/generator/sfGenerateProjectTask.class.php
2010-01-26 20:00:28 UTC (rev 27210)
+++ branches/1.4/lib/task/generator/sfGenerateProjectTask.class.php
2010-01-26 20:23:26 UTC (rev 27211)
@@ -134,9 +134,11 @@
// execute a custom installer
if ($options['installer'] && $this->commandApplication)
{
- $this->reloadTasks();
-
- include $options['installer'];
+ if ($this->canRunInstaller($options['installer']))
+ {
+ $this->reloadTasks();
+ include $options['installer'];
+ }
}
// fix permission for common directories
@@ -147,4 +149,21 @@
$this->replaceTokens();
}
+
+ protected function canRunInstaller($installer)
+ {
+ if (preg_match('#^(https?|ftps?)://#', $installer))
+ {
+ if (ini_get('allow_url_fopen') === false)
+ {
+ $this->logSection('generate', sprintf('Cannot run remote installer
"%s" because "allow_url_fopen" is off', $installer));
+ }
+ if (ini_get('allow_url_include') === false)
+ {
+ $this->logSection('generate', sprintf('Cannot run remote installer
"%s" because "allow_url_include" is off', $installer));
+ }
+ return ini_get('allow_url_fopen') && ini_get('allow_url_include');
+ }
+ return true;
+ }
}
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.