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


PHP BuildEvent::getPriority方法代碼示例

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


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

示例1: messageLogged

 function messageLogged(BuildEvent $event)
 {
     if ($event->getPriority() > $this->msgOutputLevel || null === $event->getMessage() || trim($event->getMessage() === "")) {
         return;
     }
     if ($this->targetName !== null) {
         $msg = PHP_EOL . $event->getProject()->getName() . ' > ' . $this->targetName . ':' . PHP_EOL;
         $this->printMessage($msg, $this->out, $event->getPriority());
         $this->targetName = null;
     }
     parent::messageLogged($event);
 }
開發者ID:sergeytsivin,項目名稱:haru,代碼行數:12,代碼來源:NoBannerLogger.php

示例2: messageLogged

 function messageLogged(BuildEvent $event)
 {
     if ($event->getPriority() > $this->msgOutputLevel || null === $event->getMessage() || trim($event->getMessage() === "")) {
         return;
     }
     if ($this->targetName !== null) {
         print $this->lSep . "Target: " . $this->targetName . $this->lSep;
         $this->targetName = null;
     }
     parent::messageLogged($event);
 }
開發者ID:jonphipps,項目名稱:Metadata-Registry,代碼行數:11,代碼來源:NoBannerLogger.php

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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>.
  */
 public 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);
     if (function_exists('mb_convert_encoding')) {
         $messageConverted = mb_convert_encoding($event->getMessage(), 'UTF-8');
     } else {
         $messageConverted = utf8_encode($event->getMessage());
     }
     $messageText = $this->doc->createCDATASection($messageConverted);
     $messageElement->appendChild($messageText);
     if (!empty($this->elementStack)) {
         $this->elementStack[count($this->elementStack) - 1]->appendChild($messageElement);
     }
 }
開發者ID:codebubb,項目名稱:web_ssh,代碼行數:41,代碼來源:XmlLogger.php

示例8: 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

示例9: logStart

 private function logStart(BuildEvent $event, $start, $name)
 {
     $msg = Phing::getProperty("line.separator") . $name . ": started " . date(self::$dateFormat, $start);
     $this->printMessage($msg, $this->out, $event->getPriority());
 }
開發者ID:Ingewikkeld,項目名稱:phing,代碼行數:5,代碼來源:ProfileLogger.php

示例10: 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

示例11: 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

示例12: messageLogged

 /**
  * Handles the Phing message logged event.
  *
  * @param       BuildEvent The Phing build event.
  *
  * @author     Noah Fontes <noah.fontes@bitextender.com>
  * @since      1.0.0
  */
 public function messageLogged(BuildEvent $phingEvent)
 {
     $event = new AgaviPhingMessageEvent();
     $event->setSource($phingEvent->getSource());
     $event->setMessage($phingEvent->getMessage());
     $event->setPriority($phingEvent->getPriority());
     $event->setProject($phingEvent->getProject());
     foreach ($this->messageListeners as $listener) {
         $listener->messageReported($event);
     }
 }
開發者ID:horros,項目名稱:agavi,代碼行數:19,代碼來源:AgaviPhingEventDispatcher.class.php

示例13: buildFinished

 /**
  * Logs the end of a build.
  *
  * @param      BuildEvent An event containing the data to be logged.
  *
  * @see        DefaultLogger::buildFinished()
  *
  * @author     Noah Fontes <noah.fontes@bitextender.com>
  * @since      1.0.0
  */
 public function buildFinished(BuildEvent $event)
 {
     $exception = $event->getException();
     if ($exception !== null) {
         $this->printMessage(str_pad('[error] ', DefaultLogger::LEFT_COLUMN_SIZE, ' ', STR_PAD_LEFT) . $exception->getMessage(), $this->out, $event->getPriority());
     }
 }
開發者ID:philippjenni,項目名稱:icinga-web,代碼行數:17,代碼來源:AgaviBuildLogger.php

示例14: messageLogged

 /**
  *  Fired whenever a message is logged.
  *
  *  @param BuildEvent The BuildEvent
  *
  *  @see BuildEvent::getMessage()
  */
 public function messageLogged(BuildEvent $event)
 {
     $logger = Xinc_Logger::getInstance();
     /**
      * write to a temporary logfile
      * - which will be read afterwards and the logentries will
      * - be used to determine the status of the build
      */
     switch ($event->getPriority()) {
         case self::MSG_DEBUG:
         case self::MSG_VERBOSE:
             $logger->debug('[phing] ' . $event->getMessage());
             break;
         case self::MSG_INFO:
             $logger->info('[phing] ' . $event->getMessage());
             break;
         case self::MSG_WARN:
             $logger->warn('[phing] ' . $event->getMessage());
             break;
         case self::MSG_ERR:
             $logger->error('[phing] ' . $event->getMessage());
             Xinc::getCurrentBuild()->setStatus(Xinc_Build_Interface::FAILED);
             break;
     }
     $exception = $event->getException();
     if ($exception != null) {
         $logger->error('[phing] ' . $exception->getMessage());
         Xinc::getCurrentBuild()->setStatus(Xinc_Build_Interface::FAILED);
     }
 }
開發者ID:google-code-backups,項目名稱:xinc,代碼行數:37,代碼來源:Listener.php


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