Changeset 29997
- Timestamp:
- 06/25/10 20:17:12 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/fpBuildPlugin/trunk/lib/task/ProjectBuildTask.class.php
r29993 r29997 21 21 } 22 22 23 /** 24 * @return sfTimer 25 */ 26 private function createTimer() 27 { 28 $timer = new sfTimer(); 29 $timer->startTimer(); 30 31 return $timer; 32 } 33 34 /** 35 * @return sfTimer 36 */ 37 private function getTimer() 38 { 39 $timer = new sfTimer(); 40 $timer->startTimer(); 41 42 return $timer; 43 } 44 45 private function showTime(sfTimer $timer, $message = '', $afterMessage = "\n\n") 46 { 47 $timer->addTime(); 48 49 echo $message; 50 echo (int)$timer->getElapsedTime() . " second(s)\n"; 51 echo $afterMessage; 52 } 53 23 54 protected function execute($arguments = array(), $options = array()) 24 55 { … … 34 65 chdir(sfConfig::get('sf_root_dir')); 35 66 36 foreach (file($profile) as $task) 67 $totalTimer = $this->getTimer(); 68 69 foreach (file($profile) as $task) 37 70 { 38 71 72 $timer = $this->getTimer(); 73 39 74 $task = trim($task); 40 75 41 76 if(!empty($task)) 42 77 { … … 46 81 echo $taskName . "\n\n"; 47 82 passthru($task, $result); 48 echo "\n\n"; 83 echo "\n"; 84 85 $this->showTime($timer); 49 86 50 87 if((int)$result > 0) 51 88 { 89 $this->showTime($totalTimer, 'Total time: '); 52 90 throw new Exception('`' . $taskName . '`. Running with error #ID: `'.$result.'`'); 53 91 } 54 92 55 93 } 94 56 95 } 96 97 $this->showTime($totalTimer, 'Total time: '); 98 57 99 } 58 100 }