Changeset 12787
- Timestamp:
- 10/12/11 18:05:54 (2 years ago)
- Files:
-
- modules/branches/2.10/package.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.10/package.php
r12785 r12787 149 149 150 150 //check php files for syntax errors 151 if ($vars['checkphp']) { 152 //get a recursivle list of all files 153 $files = scandirr($mod, true); 154 foreach ($files as $f) { 155 //if its a php file, test it 156 if (pathinfo($f, PATHINFO_EXTENSION) == 'php') { 157 if (!system('php -l ' . $f)) { 158 echo('syntaxt error detected in ' . $f . ',' . $mod . ' won\'t be packaged' . PHP_EOL); 159 continue 2; 160 } 151 $bail = false; 152 $files = scandirr($mod, true); 153 foreach ($files as $f) { 154 if (pathinfo($f, PATHINFO_EXTENSION) == 'php') { 155 $ret_val = 0; 156 system('php -l ' . $f, $ret_val); 157 if ($ret_val != 0) { 158 echo('syntax error detected in ' . $f . ',' . $mod . ' won\'t be packaged' . PHP_EOL); 159 $bail=true; // finish scanning all files before bailing 161 160 } 162 161 } 162 } 163 if ($bail && $vars['checkphp']) { 164 echo('syntax error detecteded in ' . $mod . ' skipping packaging going to next' . PHP_EOL); 165 continue; 163 166 } 164 167 … … 269 272 } 270 273 271 //runs systems commands, or echo's them 272 function run_cmd($cmd, $quite = false) { 274 function run_cmd($cmd, $quiet = false) { 273 275 global $vars; 274 $qui te = $quite? ' > /dev/null' : '';276 $quiet = $quiet ? ' > /dev/null' : ''; 275 277 276 278 if ($vars['debug']) { … … 281 283 echo PHP_EOL . '+' . $bt[0]["file"] . ':' . $bt[0]["line"] . PHP_EOL; 282 284 echo "\t" . $cmd . PHP_EOL; 283 return system($cmd . $qui te);285 return system($cmd . $quiet); 284 286 } else { 285 return system($cmd . $qui te);287 return system($cmd . $quiet); 286 288 } 287 289 } … … 315 317 return array($rawname, $ver); 316 318 } 319 317 320 ?>
