當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Task::main方法代碼示例

本文整理匯總了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();
 }
開發者ID:halfer,項目名稱:Meshing,代碼行數:8,代碼來源:Task.php

示例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;
         }
     }
 }
開發者ID:jonphipps,項目名稱:Metadata-Registry,代碼行數:14,代碼來源:TaskHandler.php

示例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();
     }
 }
開發者ID:codebubb,項目名稱:web_ssh,代碼行數:71,代碼來源:ForeachTask.php

示例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();
     }
 }
開發者ID:philippjenni,項目名稱:icinga-web,代碼行數:49,代碼來源:ForeachTask.php


注:本文中的Task::main方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。