protected function runTask(Project $project, Task $task) { // Add if the client has not already done so if (!$task->getProject()) { $task->setProject($project); } $task->main(); }
/** * Executes the task at once if it's directly beneath the <project> tag. */ protected function finished() { if ($this->task !== null && $this->target === null && $this->container === null) { try { $this->task->main(); } catch (Exception $e) { $this->task->log($e->getMessage(), PROJECT_MSG_ERR); throw $e; } } }
/** * Processes a list of files & directories * * @param Task $callee * @param PhingFile $fromDir * @param array $srcFiles * @param array $srcDirs */ protected function process(Task $callee, PhingFile $fromDir, $srcFiles, $srcDirs) { $mapper = null; if ($this->mapperElement !== null) { $mapper = $this->mapperElement->getImplementation(); } $filecount = count($srcFiles); $this->total_files += $filecount; for ($j = 0; $j < $filecount; $j++) { $value = $srcFiles[$j]; $premapped = ""; if ($this->absparam) { $prop = $callee->createProperty(); $prop->setOverride(true); $prop->setName($this->absparam); $prop->setValue($fromDir . FileSystem::getFileSystem()->getSeparator() . $value); } if ($mapper !== null) { $premapped = $value; $value = $mapper->main($value); if ($value === null) { continue; } $value = array_shift($value); } if ($this->param) { $this->log("Setting param '{$this->param}' to value '{$value}'" . ($premapped ? " (mapped from '{$premapped}')" : ''), Project::MSG_VERBOSE); $prop = $callee->createProperty(); $prop->setOverride(true); $prop->setName($this->param); $prop->setValue($value); } $callee->main(); } $dircount = count($srcDirs); $this->total_dirs += $dircount; for ($j = 0; $j < $dircount; $j++) { $value = $srcDirs[$j]; $premapped = ""; if ($this->absparam) { $prop = $callee->createProperty(); $prop->setOverride(true); $prop->setName($this->absparam); $prop->setValue($fromDir . FileSystem::getFileSystem()->getSeparator() . $value); } if ($mapper !== null) { $premapped = $value; $value = $mapper->main($value); if ($value === null) { continue; } $value = array_shift($value); } if ($this->param) { $this->log("Setting param '{$this->param}' to value '{$value}'" . ($premapped ? " (mapped from '{$premapped}')" : ''), Project::MSG_VERBOSE); $prop = $callee->createProperty(); $prop->setOverride(true); $prop->setName($this->param); $prop->setValue($value); } $callee->main(); } }
/** * Processes a list of files & directories * * @param Task $callee * @param PhingFile $fromDir * @param array $srcFiles * @param array $srcDirs */ protected function process(Task $callee, PhingFile $fromDir, $srcFiles, $srcDirs) { $filecount = count($srcFiles); $this->total_files += $filecount; for ($j = 0; $j < $filecount; $j++) { $value = $srcFiles[$j]; if ($this->param) { $this->log("Setting param '{$this->param}' to value '{$value}'", Project::MSG_VERBOSE); $prop = $callee->createProperty(); $prop->setOverride(true); $prop->setName($this->param); $prop->setValue($value); } if ($this->absparam) { $prop = $callee->createProperty(); $prop->setOverride(true); $prop->setName($this->absparam); $prop->setValue($fromDir . FileSystem::getFileSystem()->getSeparator() . $value); } $callee->main(); } $dircount = count($srcDirs); $this->total_dirs += $dircount; for ($j = 0; $j < $dircount; $j++) { $value = $srcDirs[$j]; if ($this->param) { $this->log("Setting param '{$this->param}' to value '{$value}'", Project::MSG_VERBOSE); $prop = $callee->createProperty(); $prop->setOverride(true); $prop->setName($this->param); $prop->setValue($value); } if ($this->absparam) { $prop = $callee->createProperty(); $prop->setOverride(true); $prop->setName($this->absparam); $prop->setValue($fromDir . FileSystem::getFileSystem()->getSeparator() . $value); } $callee->main(); } }