[ Index ] |
|
Code source de Symfony 1.0.0 |
1 <?php 2 3 /** 4 * @package pake 5 * @author Fabien Potencier <fabien.potencier@symfony-project.com> 6 * @copyright 2004-2005 Fabien Potencier <fabien.potencier@symfony-project.com> 7 * @license see the LICENSE file included in the distribution 8 * @version SVN: $Id: pakePhingTask.class.php 1846 2006-08-25 12:35:26Z fabien $ 9 */ 10 11 include_once 'phing/Phing.php'; 12 if (!class_exists('Phing')) 13 { 14 throw new pakeException('You must install Phing to use this task. (pear install http://phing.info/pear/phing-current.tgz)'); 15 } 16 17 class pakePhingTask 18 { 19 public static function import_default_tasks() 20 { 21 } 22 23 public static function call_phing($task, $target, $build_file = '', $options = array()) 24 { 25 $args = array(); 26 foreach ($options as $key => $value) 27 { 28 $args[] = "-D$key=$value"; 29 } 30 31 if ($build_file) 32 { 33 $args[] = '-f'; 34 $args[] = realpath($build_file); 35 } 36 37 if (!$task->is_verbose()) 38 { 39 $args[] = '-q'; 40 } 41 42 if (is_array($target)) 43 { 44 $args = array_merge($args, $target); 45 } 46 else 47 { 48 $args[] = $target; 49 } 50 51 Phing::startup(); 52 Phing::setProperty('phing.home', getenv('PHING_HOME')); 53 54 ob_start(array('pakePhingTask', 'colorize'), 2); 55 $m = new pakePhing(); 56 $m->execute($args); 57 $m->runBuild(); 58 ob_end_clean(); 59 } 60 61 public static function colorize($text) 62 { 63 return preg_replace(array( 64 '#\[(.+?)\]#', 65 '#{{PHP Error}}#e', 66 '#({{.+?}})#e', 67 '#(\+ [^ ]+)#e', 68 '#{{(.+?)}}#', 69 ), array( 70 '{{$1}}', 71 'pakeColor::colorize("(PHP Error)", "ERROR")', 72 'pakeColor::colorize("$1", "INFO")', 73 'pakeColor::colorize("$1", "INFO")', 74 '[$1]', 75 ), $text); 76 } 77 } 78 79 class pakePhing extends Phing 80 { 81 function getPhingVersion() 82 { 83 return 'pakePhing'; 84 } 85 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Fri Mar 16 22:42:14 2007 | par Balluche grâce à PHPXref 0.7 |