本文整理匯總了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();
}
}