Changeset 118
- Timestamp:
- 09/14/06 19:54:52 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/classes/phing/tasks/ext/CreoleSQLExecTask.php
r115 r118 71 71 72 72 /** 73 * all filterchains objects assigned to this task 74 */ 75 private $filterChains = array(); 76 77 /** 73 78 * SQL statement 74 79 */ … … 153 158 public function addFileset(FileSet $set) { 154 159 $this->filesets[] = $set; 160 } 161 162 /** 163 * Creates a filterchain 164 * 165 * @access public 166 * @return object The created filterchain object 167 */ 168 function createFilterChain() { 169 $num = array_push($this->filterChains, new FilterChain($this->project)); 170 return $this->filterChains[$num-1]; 155 171 } 156 172 … … 358 374 $sql = ""; 359 375 $line = ""; 360 $in = new BufferedReader($reader); 376 377 $buffer = ''; 378 379 if ((is_array($this->filterChains)) && (!empty($this->filterChains))) { 380 $in = FileUtils::getChainedReader(new BufferedReader($reader), $this->filterChains, $this->getProject()); 381 while(-1 !== ($read = $in->read())) { // -1 indicates EOF 382 $buffer .= $read; 383 } 384 $lines = explode("\n", $buffer); 385 } else { 386 $in = new BufferedReader($reader); 387 388 while (($line = $in->readLine()) !== null) { 389 $lines[] = $line; 390 } 391 } 392 361 393 try { 362 while (($line = $in->readLine()) !== null) {394 foreach ($lines as $line) { 363 395 $line = trim($line); 364 396 $line = ProjectConfigurator::replaceProperties($this->project, $line, … … 391 423 && $line == $this->delimiter) { 392 424 $this->log("SQL: " . $sql, PROJECT_MSG_VERBOSE); 393 $this->execSQL(StringHelper::substring($sql, 0, strlen($sql) - strlen($this->delimiter) - 1), $out);425 $this->execSQL(StringHelper::substring($sql, 0, strlen($sql) - strlen($this->delimiter)), $out); 394 426 $sql = ""; 395 427 } … … 547 579 $this->parent->log("Executing file: " . $this->tSrcFile->getAbsolutePath(), 548 580 PROJECT_MSG_INFO); 581 549 582 $reader = new FileReader($this->tSrcFile); 583 550 584 $this->parent->runStatements($reader, $out); 551 585 $reader->close();
