12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- require_once 'phing/Task.php';
- class TaskAdapter extends Task {
-
-
- private $proxy;
-
-
- function main() {
-
- if (method_exists($this->proxy, "setProject")) {
- try {
- $this->proxy->setProject($this->project);
- } catch (Exception $ex) {
- $this->log("Error setting project in " . get_class($this->proxy) . Project::MSG_ERR);
- throw new BuildException($ex);
- }
- } else {
- throw new Exception("Error setting project in class " . get_class($this->proxy));
- }
-
- if (method_exists($this->proxy, "main")) {
- try {
- $this->proxy->main($this->project);
- } catch (Exception $ex) {
- $this->log("Error in " . get_class($this->proxy), Project::MSG_ERR);
- throw new BuildException($ex->getMessage());
- }
- } else {
- throw new BuildException("Your task-like class '" . get_class($this->proxy) ."' does not have a main() method");
- }
- }
-
- function setProxy($o) {
- $this->proxy = $o;
- }
-
- function getProxy() {
- return $this->proxy;
- }
- }
|