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


PHP Task::getTaskName方法代碼示例

本文整理匯總了PHP中Task::getTaskName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Task::getTaskName方法的具體用法?PHP Task::getTaskName怎麽用?PHP Task::getTaskName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Task的用法示例。


在下文中一共展示了Task::getTaskName方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: main

    /**
     * Perform the work.
     *
     * @throws BuildException if there is an error.
     */
    public function main()
    {
        $errorMessages = '';
        for ($i = 0; $i <= $this->retryCount; $i++) {
            try {
                $this->nestedTask->perform();
                break;
            } catch (Exception $e) {
                $errorMessages .= $e->getMessage();
                if ($i >= $this->retryCount) {
                    $taskName = $this->nestedTask->getTaskName();
                    $exceptionMessage = <<<EXCEPTION_MESSAGE
Task [{$taskName}] failed after [{$this->retryCount}] attempts; giving up
Error messages:
{$errorMessages}
EXCEPTION_MESSAGE;
                    throw new BuildException($exceptionMessage, $this->getLocation());
                }
                if ($this->retryDelay > 0) {
                    $msg = sprintf('Attempt [%s]: error occurred; retrying after %s s...', $i, $this->retryDelay);
                } else {
                    $msg = sprintf('Attempt [%s]: error occurred; retrying...', $i);
                }
                $this->log($msg, Project::MSG_INFO);
                $errorMessages .= PHP_EOL;
                if ($this->retryDelay > 0) {
                    sleep($this->retryDelay);
                }
            }
        }
    }
開發者ID:tammyd,項目名稱:phing,代碼行數:36,代碼來源:Retry.php

示例2: getTaskName

 /**
  *  Get the name of the task to use in logging messages.
  *
  * @return string The task's name
  */
 public function getTaskName()
 {
     return $this->realThing === null ? parent::getTaskName() : $this->realThing->getTaskName();
 }
開發者ID:xxspartan16,項目名稱:BMS-Market,代碼行數:9,代碼來源:UnknownElement.php

示例3: getTaskName

 /**
  *  Get the name of the task to use in logging messages.
  *
  * @return string The task's name
  */
 public function getTaskName()
 {
     return $this->realThing === null || !$this->realThing instanceof Task ? parent::getTaskName() : $this->realThing->getTaskName();
 }
開發者ID:Geeklog-Japan,項目名稱:geeklog-japan,代碼行數:9,代碼來源:UnknownElement.php

示例4: testUpdate

 function testUpdate()
 {
     //Arrange
     $task_name = "Wash the dog";
     $id = 1;
     $due_date = null;
     $test_task = new Task($task_name, $id, $due_date);
     $test_task->save();
     $new_task_name = "Clean the dog";
     //Act
     $test_task->update($new_task_name);
     //Assert
     $this->assertEquals("Clean the dog", $test_task->getTaskName());
 }
開發者ID:kennygrage,項目名稱:epic_to_do_list_mySQL,代碼行數:14,代碼來源:TaskTest.php


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