本文整理汇总了PHP中Task::main方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::main方法的具体用法?PHP Task::main怎么用?PHP Task::main使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task::main方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runTask
protected function runTask(Project $project, Task $task)
{
// Add if the client has not already done so
if (!$task->getProject()) {
$task->setProject($project);
}
$task->main();
}
示例2: finished
/**
* 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;
}
}
}
示例3: process
/**
* 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();
}
}
示例4: process
/**
* 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();
}
}