CallTask

Description

Version of the PhingTask that uses the system() command and changes the current working direct to directory of called build file.

Download

Here is the source:

<?php

  include_once 'phing/Task.php';

  class CallTask extends Task
  {
    protected $dir;
    protected $phingFile = 'build.xml';
    protected $phingTarget;

    public function setDir($aValue)
    {
      $this->dir = $aValue;
    }

    public function setPhingFile($aValue)
    {
      $this->phingFile = $aValue;
    }

    public function setPhingTarget($aValue)
    {
      $this->phingTarget = $aValue;
    }

    public function main()
    {
      $dir = getcwd();
      chdir($this->dir);
      system('phing -f ' . $this->phingFile . ' ' . $this->phingTarget);
      chdir($dir);
    }
  }

?>

Example

<call dir="../eno_Base"
  phingfile="build.xml"
  phingtarget="pear_install"/>

Author/Contributors

Author: Stefan Priebsch