Development

Changeset 29993

You must first sign up to be able to contribute.

Changeset 29993

Show
Ignore:
Timestamp:
06/25/10 19:28:18 (3 years ago)
Author:
slava.hatnuke
Message:

plugin throw exception when task running with errors

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/fpBuildPlugin/trunk/lib/task/ProjectBuildTask.class.php

    r29973 r29993  
    3333 
    3434    chdir(sfConfig::get('sf_root_dir')); 
    35     foreach (file($profile) as $task) { 
    36       $this->log($this->getFilesystem()->sh($task)); 
     35 
     36    foreach (file($profile) as $task)  
     37    { 
     38 
     39      $task = trim($task); 
     40       
     41      if(!empty($task)) 
     42      { 
     43        $taskName = 'Task: ' . $task; 
     44 
     45        $result = 0; 
     46        echo $taskName . "\n\n"; 
     47        passthru($task, $result); 
     48        echo "\n\n"; 
     49 
     50        if((int)$result > 0) 
     51        { 
     52          throw new Exception('`' . $taskName . '`. Running with error #ID: `'.$result.'`'); 
     53        } 
     54         
     55      } 
    3756    } 
    3857  }