当前位置: 首页>>代码示例>>PHP>>正文


PHP BuildEvent::getTask方法代码示例

本文整理汇总了PHP中BuildEvent::getTask方法的典型用法代码示例。如果您正苦于以下问题:PHP BuildEvent::getTask方法的具体用法?PHP BuildEvent::getTask怎么用?PHP BuildEvent::getTask使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BuildEvent的用法示例。


在下文中一共展示了BuildEvent::getTask方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: messageLogged

 /**
  *  Logs a message to the configured PEAR logger.
  *
  * @param  BuildEvent  The BuildEvent
  *
  * @see    BuildEvent::getMessage()
  */
 public function messageLogged(BuildEvent $event)
 {
     if ($event->getPriority() <= $this->msgOutputLevel) {
         $msg = "";
         if ($event->getTask() !== null) {
             $name = $event->getTask();
             $name = $name->getTaskName();
             $msg = str_pad("[{$name}] ", self::LEFT_COLUMN_SIZE, " ", STR_PAD_LEFT);
         }
         $msg .= $event->getMessage();
         $this->logger()->log($msg, self::$levelMap[$event->getPriority()]);
     }
 }
开发者ID:TheTypoMaster,项目名称:SPHERE-Framework,代码行数:20,代码来源:PearLogListener.php

示例2: messageLogged

 /** {@inheritDoc}. */
 public function messageLogged(BuildEvent $event)
 {
     $this->log("--- MESSAGE LOGGED", Project::MSG_DEBUG);
     $buf = '';
     if ($event->getTask() != null) {
         $name = $event->getTask()->getTaskName();
         if (!$this->emacsMode) {
             $label = "[" . $name . "] ";
             $size = DefaultLogger::LEFT_COLUMN_SIZE - strlen($label);
             for ($i = 0; $i < $size; $i++) {
                 $buf .= " ";
             }
             $buf .= $label;
         }
     }
     $buf .= $event->getMessage();
     $this->log($buf, $event->getPriority());
 }
开发者ID:Ingewikkeld,项目名称:phing,代码行数:19,代码来源:RecorderEntry.php

示例3: messageLogged

 /**
  *  Print a message to the stdout.
  *
  *  @param  object  The BuildEvent
  *  @access public
  *  @see    BuildEvent::getMessage()
  */
 public function messageLogged(BuildEvent $event)
 {
     $priority = $event->getPriority();
     if ($priority <= $this->msgOutputLevel) {
         $msg = "";
         if ($event->getTask() !== null) {
             $name = $event->getTask();
             $name = $name->getTaskName();
             $msg = str_pad("[{$name}] ", self::LEFT_COLUMN_SIZE, " ", STR_PAD_LEFT);
         }
         $msg .= $event->getMessage();
         if ($priority != Project::MSG_ERR) {
             $this->printMessage($msg, $this->out, $priority);
         } else {
             $this->printMessage($msg, $this->err, $priority);
         }
     }
 }
开发者ID:alexspark21,项目名称:symfony_bisM,代码行数:25,代码来源:DefaultLogger.php

示例4: messageLogged

 /**
  *  Print any echo messages to the stdout.
  *
  *  @param  object  The BuildEvent
  *  @access public
  *  @see    BuildEvent::getMessage()
  */
 function messageLogged(BuildEvent $event)
 {
     if ($event->getPriority() <= $this->msgOutputLevel) {
         $msg = "";
         if ($event->getTask() !== null) {
             $name = $event->getTask();
             $name = $name->getTaskName();
             if ($name == 'echo') {
                 $msg = "[{$name}] ";
                 $msg .= $event->getMessage();
                 $this->printMessage($msg, $event->getPriority());
             }
         }
     }
 }
开发者ID:robert-h-curry,项目名称:silverstripe-buildtools,代码行数:22,代码来源:EchoLogger.php

示例5: taskStarted

 /**
  * Fired when a task starts building, remembers the current time and the name of the task.
  *
  * @param BuildEvent $event An event with any relevant extra information.
  *                          Will not be <code>null</code>.
  */
 public function taskStarted(BuildEvent $event)
 {
     $task = $event->getTask();
     $taskElement = $this->doc->createElement(XmlLogger::TASK_TAG);
     $taskElement->setAttribute(XmlLogger::NAME_ATTR, $task->getTaskName());
     $taskElement->setAttribute(XmlLogger::LOCATION_ATTR, $task->getLocation()->toString());
     array_push($this->timesStack, Phing::currentTimeMillis());
     array_push($this->elementStack, $taskElement);
 }
开发者ID:codebubb,项目名称:web_ssh,代码行数:15,代码来源:XmlLogger.php

示例6: taskFinished

 /**
  * Logs a message to say that the task has finished.
  *
  * @param BuildEvent $event
  *            An event with any relevant extra information. Must not be
  *            <code>null</code>.
  */
 public function taskFinished(BuildEvent $event)
 {
     $start = array_pop($this->profileData);
     $name = $event->getTask()->getTaskName();
     $this->logFinish($event, $start, $name);
 }
开发者ID:Ingewikkeld,项目名称:phing,代码行数:13,代码来源:ProfileLogger.php

示例7: messageLogged

 /**
  *  Print a message to the stdout.
  *
  *  @param  object  The BuildEvent
  *  @access public
  *  @see    BuildEvent::getMessage()
  */
 function messageLogged(BuildEvent $event)
 {
     if ($event->getPriority() <= $this->msgOutputLevel) {
         $msg = "";
         if ($event->getTask() !== null) {
             $name = $event->getTask();
             $name = $name->getTaskName();
             $msg = str_pad("[{$name}] ", self::LEFT_COLUMN_SIZE, " ", STR_PAD_LEFT);
             #for ($i=0; $i < ($this->LEFT_COLUMN_SIZE - strlen($msg)); ++$i) {
             #    print(" ");
             #}
             #print($msg);
         }
         $msg .= $event->getMessage();
         $this->printMessage($msg, $event->getPriority());
     }
 }
开发者ID:Daniel-Marynicz,项目名称:symfony1-legacy,代码行数:24,代码来源:DefaultLogger.php

示例8: messageLogged

 /**
  * Fired when a message is logged, this adds a message element to the
  * most appropriate parent element (task, target or build) and records
  * the priority and text of the message.
  *
  * @param BuildEvent An event with any relevant extra information.
  *              Will not be <code>null</code>.
  */
 function messageLogged(BuildEvent $event)
 {
     $priority = $event->getPriority();
     if ($priority > $this->msgOutputLevel) {
         return;
     }
     $messageElement = $this->doc->createElement(XmlLogger::MESSAGE_TAG);
     switch ($priority) {
         case PROJECT_MSG_ERR:
             $name = "error";
             break;
         case PROJECT_MSG_WARN:
             $name = "warn";
             break;
         case PROJECT_MSG_INFO:
             $name = "info";
             break;
         default:
             $name = "debug";
             break;
     }
     $messageElement->setAttribute(XmlLogger::PRIORITY_ATTR, $name);
     $messageText = $this->doc->createCDATASection($event->getMessage());
     $messageElement->appendChild($messageText);
     if ($event->getTask() != null) {
         $this->taskElement->appendChild($messageElement);
     } else {
         if ($event->getTarget() != null) {
             $this->targetElement->appendChild($messageElement);
         } else {
             if ($this->buildElement != null) {
                 $this->buildElement->appendChild($messageElement);
             }
         }
     }
 }
开发者ID:Daniel-Marynicz,项目名称:symfony1-legacy,代码行数:44,代码来源:XmlLogger.php

示例9: taskFinished

 /**
  * Handles the Phing task finished event.
  *
  * @param       BuildEvent The Phing build event.
  *
  * @author     Noah Fontes <noah.fontes@bitextender.com>
  * @since      1.0.0
  */
 public function taskFinished(BuildEvent $phingEvent)
 {
     $event = new AgaviPhingTaskEvent();
     $event->setSource($phingEvent->getTask());
     $event->setTask($phingEvent->getTask());
     if ($phingEvent->getTask()->getOwningTarget() !== null) {
         $event->setTarget($phingEvent->getTask()->getOwningTarget());
     }
     $event->setProject($phingEvent->getProject());
     foreach ($this->taskListeners as $listener) {
         $listener->taskLeft($event);
     }
 }
开发者ID:horros,项目名称:agavi,代码行数:21,代码来源:AgaviPhingEventDispatcher.class.php

示例10: messageLogged

 /**
  *  Fired whenever a message is logged.
  *
  *  @param BuildEvent The BuildEvent
  *  @see BuildEvent::getMessage()
  */
 public function messageLogged(BuildEvent $event)
 {
     if ($event->getPriority() == Project::MSG_ERR) {
         if (preg_match('/XLST transformation/', $event->getMessage())) {
             // not really an error
             return;
         }
         $msg = '';
         if ($event->getTask() !== null) {
             $msg = sprintf('[%s] ', $event->getTask()->getTaskName());
         }
         $msg .= $event->getMessage();
         self::$errors[] = $msg;
     }
 }
开发者ID:cuongnv540,项目名称:jobeet,代码行数:21,代码来源:sfPhingListener.php


注:本文中的BuildEvent::getTask方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。