Changeset 27211
- Timestamp:
- 01/26/10 21:23:26 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.3/lib/task/generator/sfGenerateProjectTask.class.php
r23322 r27211 136 136 if ($options['installer'] && $this->commandApplication) 137 137 { 138 $this->reloadTasks(); 139 140 include $options['installer']; 138 if ($this->canRunInstaller($options['installer'])) 139 { 140 $this->reloadTasks(); 141 include $options['installer']; 142 } 141 143 } 142 144 … … 149 151 $this->replaceTokens(); 150 152 } 153 154 protected function canRunInstaller($installer) 155 { 156 if (preg_match('#^(https?|ftps?)://#', $installer)) 157 { 158 if (ini_get('allow_url_fopen') === false) 159 { 160 $this->logSection('generate', sprintf('Cannot run remote installer "%s" because "allow_url_fopen" is off', $installer)); 161 } 162 if (ini_get('allow_url_include') === false) 163 { 164 $this->logSection('generate', sprintf('Cannot run remote installer "%s" because "allow_url_include" is off', $installer)); 165 } 166 return ini_get('allow_url_fopen') && ini_get('allow_url_include'); 167 } 168 return true; 169 } 151 170 } branches/1.4/lib/task/generator/sfGenerateProjectTask.class.php
r23922 r27211 135 135 if ($options['installer'] && $this->commandApplication) 136 136 { 137 $this->reloadTasks(); 138 139 include $options['installer']; 137 if ($this->canRunInstaller($options['installer'])) 138 { 139 $this->reloadTasks(); 140 include $options['installer']; 141 } 140 142 } 141 143 … … 148 150 $this->replaceTokens(); 149 151 } 152 153 protected function canRunInstaller($installer) 154 { 155 if (preg_match('#^(https?|ftps?)://#', $installer)) 156 { 157 if (ini_get('allow_url_fopen') === false) 158 { 159 $this->logSection('generate', sprintf('Cannot run remote installer "%s" because "allow_url_fopen" is off', $installer)); 160 } 161 if (ini_get('allow_url_include') === false) 162 { 163 $this->logSection('generate', sprintf('Cannot run remote installer "%s" because "allow_url_include" is off', $installer)); 164 } 165 return ini_get('allow_url_fopen') && ini_get('allow_url_include'); 166 } 167 return true; 168 } 150 169 }