Ticket #207: phing-lint-interpreter.diff
| File phing-lint-interpreter.diff, 2.4 kB (added by Markus Fischer <markus@fischer.name>, 7 months ago) |
|---|
-
classes/phing/Phing.php
old new 1099 1107 } 1100 1108 1101 1109 self::setProperty('php.classpath', PHP_CLASSPATH); 1110 self::setProperty('php.command', getenv('PHP_COMMAND')); 1102 1111 1103 1112 // try to determine the host filesystem and set system property 1104 1113 // used by Fileself::getFileSystem to instantiate the correct -
docs/phing_guide/book/chapters/appendixes/AppendixC-OptionalTasks.html
old new 1197 1197 <td>n/a</td> 1198 1198 <td>No</td> 1199 1199 </tr> 1200 <tr> 1201 <td>interpreter</td> 1202 <td>string</td> 1203 <td>Path to alternative PHP interpreter</td> 1204 <td>Defaults to the <tt>${php.command}</tt> property which is the 1205 interpreter used to execute phing itself.</td> 1206 <td>No</td> 1207 </tr> 1200 1208 </tbody> 1201 1209 </table> 1202 1210 -
classes/phing/tasks/ext/PhpLintTask.php
old new 37 37 protected $haltOnFailure = false; 38 38 protected $hasErrors = false; 39 39 private $badFiles = array(); 40 protected $interpreter = ''; // php interpreter to use for linting 40 41 42 /** 43 * Initialize the interpreter with the Phing property 44 */ 45 public function __construct() { 46 $this->setInterpreter(Phing::getProperty('php.command')); 47 } 48 41 49 /** 50 * Override default php interpreter 51 * @todo Do some sort of checking if the path is correct but would 52 * require traversing the systems executeable path too 53 * @param string $sPhp 54 */ 55 public function setInterpreter($sPhp) { 56 $this->Interpreter = $sPhp; 57 } 58 59 /** 42 60 * The haltonfailure property 43 61 * @param boolean $aValue 44 62 */ … … 105 123 * @return void 106 124 */ 107 125 protected function lint($file) { 108 $command = 'php -l '; 126 $command = $this->Interpreter == '' 127 ? 'php' 128 : $this->Interpreter; 129 $command .= ' -l '; 109 130 if(file_exists($file)) { 110 131 if(is_readable($file)) { 111 132 $messages = array();
