|
Revision 307, 2.8 kB
(checked in by hans, 1 year ago)
|
Refs #188 - Adding work-in-progress (still-broken!) namespace support.
|
- Property svn:keywords set to
author date id revision
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
namespace phing; |
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
class TaskAdapter extends Task { |
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
private $proxy; |
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
* Main entry point. |
|---|
| 41 |
* @return void |
|---|
| 42 |
*/ |
|---|
| 43 |
function main() { |
|---|
| 44 |
|
|---|
| 45 |
if (method_exists($this->proxy, "setProject")) { |
|---|
| 46 |
try { |
|---|
| 47 |
$this->proxy->setProject($this->project); |
|---|
| 48 |
} catch (Exception $ex) { |
|---|
| 49 |
$this->log("Error setting project in " . get_class($this->proxy) . Project::MSG_ERR); |
|---|
| 50 |
throw new BuildException($ex); |
|---|
| 51 |
} |
|---|
| 52 |
} else { |
|---|
| 53 |
throw new Exception("Error setting project in class " . get_class($this->proxy)); |
|---|
| 54 |
} |
|---|
| 55 |
|
|---|
| 56 |
if (method_exists($this->proxy, "main")) { |
|---|
| 57 |
try { |
|---|
| 58 |
$this->proxy->main($this->project); |
|---|
| 59 |
} catch (Exception $ex) { |
|---|
| 60 |
$this->log("Error in " . get_class($this->proxy), Project::MSG_ERR); |
|---|
| 61 |
throw new BuildException($ex->getMessage()); |
|---|
| 62 |
} |
|---|
| 63 |
} else { |
|---|
| 64 |
throw new BuildException("Your task-like class '" . get_class($this->proxy) ."' does not have a main() method"); |
|---|
| 65 |
} |
|---|
| 66 |
} |
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
* Set the target object. |
|---|
| 70 |
* @param object $o |
|---|
| 71 |
* @return void |
|---|
| 72 |
*/ |
|---|
| 73 |
function setProxy($o) { |
|---|
| 74 |
$this->proxy = $o; |
|---|
| 75 |
} |
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
* Gets the target object. |
|---|
| 79 |
* @return object |
|---|
| 80 |
*/ |
|---|
| 81 |
function getProxy() { |
|---|
| 82 |
return $this->proxy; |
|---|
| 83 |
} |
|---|
| 84 |
|
|---|
| 85 |
} |
|---|
| 86 |
|
|---|