Changeset 342
- Timestamp:
- 01/21/08 14:49:48 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2.3/classes/phing/Phing.php
r332 r342 1108 1108 case 'WINNT': 1109 1109 self::setProperty('host.fstype', 'WINNT'); 1110 self::setProperty('php.interpreter', getenv('PHP_COMMAND')); 1110 1111 break; 1111 1112 case 'WIN32': branches/2.3/classes/phing/tasks/ext/PhpLintTask.php
r325 r342 37 37 protected $haltOnFailure = false; 38 38 protected $hasErrors = false; 39 private $badFiles = array(); 39 private $badFiles = array(); 40 protected $interpreter = ''; // php interpreter to use for linting 41 42 /** 43 * Initialize the interpreter with the Phing property 44 */ 45 public function __construct() { 46 $this->setInterpreter(Phing::getProperty('php.interpreter')); 47 } 48 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 } 40 58 41 59 /** … … 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)) { … … 136 157 137 158 159 branches/2.3/docs/phing_guide/book/chapters/appendixes/AppendixC-OptionalTasks.html
r329 r342 1196 1196 <td>The name of a property that will be set to contain the error string (if any).</td> 1197 1197 <td>n/a</td> 1198 <td>No</td> 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> 1198 1206 <td>No</td> 1199 1207 </tr>
