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


PHP BuildEvent类代码示例

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


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

示例1: targetFinished

 function targetFinished(BuildEvent $event)
 {
     $msg .= PHP_EOL . "Target time: " . self::formatTime(Phing::currentTimeMillis() - $this->targetStartTime) . PHP_EOL;
     $event->setMessage($msg, Project::MSG_INFO);
     $this->messageLogged($event);
     $this->targetName = null;
 }
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:7,代码来源:TargetLogger.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

 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

示例5: buildFinished

 /**
  * Fired when the build finishes, this adds the time taken and any
  * error stacktrace to the build element and writes the document to disk.
  *
  * @param BuildEvent $event An event with any relevant extra information.
  *                          Will not be <code>null</code>.
  * @throws BuildException
  */
 public function buildFinished(BuildEvent $event)
 {
     $elapsedTime = Phing::currentTimeMillis() - $this->getBuildTimerStart();
     $this->getBuildElement()->setAttribute(XmlLogger::TIME_ATTR, DefaultLogger::formatTime($elapsedTime));
     if ($event->getException() != null) {
         $this->getBuildElement()->setAttribute(XmlLogger::ERROR_ATTR, $event->getException()->getMessage());
         $errText = $this->getDoc()->createCDATASection($event->getException()->getTraceAsString());
         $stacktrace = $this->getDoc()->createElement(XmlLogger::STACKTRACE_TAG);
         $stacktrace->appendChild($errText);
         $this->getBuildElement()->appendChild($stacktrace);
     }
     $this->getDoc()->appendChild($this->getBuildElement());
     $outFilename = $event->getProject()->getProperty("JsonLogger.file");
     if ($outFilename == null) {
         $outFilename = "log.json";
     }
     try {
         $stream = $this->getOut();
         if ($stream === null) {
             $stream = new FileOutputStream($outFilename);
         }
         $writer = new OutputStreamWriter($stream);
         $writer->write($this->xml2js(simplexml_import_dom($this->getDoc())));
         $writer->close();
     } catch (IOException $exc) {
         try {
             $stream->close();
             // in case there is a stream open still ...
         } catch (Exception $x) {
         }
         throw new BuildException("Unable to write log file.", $exc);
     }
     // cleanup:remove the buildElement
     $this->setBuildElement(null);
     array_pop($this->getElementStack());
     array_pop($this->getTimesStack());
 }
开发者ID:Ingewikkeld,项目名称:phing,代码行数:45,代码来源:JsonLogger.php

示例6: messageLogged

 /**
  *  Fired whenever a message is logged.
  *
  *  @see BuildEvent#getMessage()
  *  @see BuildEvent#getPriority()
  */
 public function messageLogged(BuildEvent $event)
 {
     $this->parent->logBuffer[] = $event->getMessage();
 }
开发者ID:rozwell,项目名称:phing,代码行数:10,代码来源:BuildFileTest.php

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

示例8: buildFinished

 public function buildFinished(BuildEvent $event)
 {
     if ($event->getException() != null) {
         parent::buildFinished($event);
     }
 }
开发者ID:TheTypoMaster,项目名称:SPHERE-Framework,代码行数:6,代码来源:SilentLogger.php

示例9: getDefaultBuildEvent

 protected function getDefaultBuildEvent()
 {
     return BuildEvent::createDefault();
 }
开发者ID:phpcrystal,项目名称:phpcrystal,代码行数:4,代码来源:AbstractPackage.php

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

示例11: subBuildFinished

 /**
  * Cleans recorder registry, if this is the subbuild the task has
  * been created in.
  * @param BuildEvent $event ignored.
  */
 public function subBuildFinished(BuildEvent $event)
 {
     if ($event->getProject() == $this->getProject()) {
         $this->cleanup();
     }
 }
开发者ID:Ingewikkeld,项目名称:phing,代码行数:11,代码来源:RecorderTask.php

示例12: parseBuildEvent

 /**
  * Parse a new BuildEvent from a SimpleXMLElement.
  *
  * @param $log_event  (Object) SimpleXMLElement node to be "parsed".
  * @return  (object) Resultant BuildEvent object.
  */
 private static function parseBuildEvent(&$log_event)
 {
     if (!$log_event instanceof SimpleXMLElement) {
         throw new Exception('Received invalid log_event');
     }
     $uniqueId = (int) $log_event->uniqueId;
     $startDate = strtotime(clean_text($log_event->startDate));
     $authorName = clean_text($log_event->authorName);
     $authorEmail = clean_text($log_event->authorEmail);
     if (!empty($log_event->releaseType)) {
         $releaseType = BuildRepositoryPlugin::parseReleaseType(clean_text($log_event->releaseType));
     } else {
         $releaseType = RT_UNSTABLE;
     }
     $event = new BuildEvent($uniqueId, $startDate, $authorName, $authorEmail, $releaseType);
     if (!empty($log_event->releaseNotes)) {
         $event->setReleaseNotesUri(clean_text($log_event->releaseNotes));
     }
     if (!empty($log_event->changeLog)) {
         $event->setReleaseChangeLogUri(clean_text($log_event->changeLog));
     }
     return $event;
 }
开发者ID:laszloekovacs,项目名称:Doomsday-Engine,代码行数:29,代码来源:buildlogparser.class.php

示例13: populateReleases

 /**
  * Produce a indexable directory of BuildEvents from the Packages
  * collection, grouping them according to the version number of the
  * 'Doomsday' packages those events produced.
  *
  * The version number (string) is used as key to each record.
  *
  * @param matrix  (Array) will be populated with new records.
  * @return  (Mixed) FALSE if no packages were added to the matrix
  *          otherwise the number of added packages (integer).
  */
 private function populateReleases(&$releases)
 {
     if (!is_array($releases)) {
         throw new Exception('populateReleases: Invalid matrix argument, array expected.');
     }
     if (!isset($this->packages)) {
         return FALSE;
     }
     // Running total of the number of events we add to the matrix.
     $numEventsAdded = (int) 0;
     foreach ($this->packages as &$pack) {
         // We are only interested in the 'Doomsday' packages.
         if ($pack->title() !== 'Doomsday') {
             continue;
         }
         // Have we encountered this version before?.
         $versionText = "{$pack->version()}";
         $key = array_casekey_exists($versionText, $releases);
         if ($key === false) {
             // Not yet construct a new record and associate it
             // in the release list using the version number as the key.
             $key = ucwords($versionText);
             $releases[$key] = $this->newReleaseInfo($key);
             $releaseInfo =& $releases[$key];
         } else {
             $releaseInfo =& $releases[$versionText];
         }
         $build = NULL;
         // Is this package a product of the autobuilder?
         if ($pack instanceof iBuilderProduct) {
             // Yes; we have "real" BuildEvent we can link with this.
             $buildUniqueId = $pack->buildUniqueId();
             $build = $this->buildByUniqueId($buildUniqueId);
         } else {
             // No - this must be a symbolic package.
             // We'll instantiate a symbolic BuildEvent for this.
             $build = new BuildEvent(0, $pack->hasReleaseDate() ? $pack->releaseDate() : strtotime('Jan 8, 2005'), 'skyjake', 'jaakko.keranen@iki.fi', RT_STABLE);
             if ($pack->hasReleaseNotesUri()) {
                 $build->setReleaseNotesUri($pack->releaseNotesUri());
             }
             if ($pack->hasReleaseChangeLogUri()) {
                 $build->setReleaseChangeLogUri($pack->releaseChangeLogUri());
             }
             $build->addPackage($pack);
         }
         if (!$build instanceof BuildEvent) {
             continue;
         }
         // Odd...
         // Is a build event already present for this release version?
         $latestBuild = isset($releaseInfo['latestBuild']) ? $releaseInfo['latestBuild'] : NULL;
         if ($latestBuild instanceof BuildEvent) {
             // Is this a newer build?
             if ($build->uniqueId() > $latestBuild->uniqueId()) {
                 $releaseInfo['latestBuild'] = $build;
             }
         } else {
             $releaseInfo['latestBuild'] = $build;
         }
         // Promote the status of the release due to this package?
         $releaseTypeId = $build->releaseTypeId();
         if ($releaseTypeId > $releaseInfo['releaseTypeId']) {
             $releaseInfo['releaseTypeId'] = $releaseTypeId;
         }
     }
     return $numEventsAdded;
 }
开发者ID:laszloekovacs,项目名称:Doomsday-Engine,代码行数:78,代码来源:buildrepository.php

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

示例15: targetFinished

 /**
  * Logs the end of a target.
  *
  * The event is only logged if the target is not an instance of
  * <code>AgaviProxyTarget</code>.
  *
  * @param      BuildEvent An event containing the data to be logged.
  *
  * @see        AgaviProxyTarget
  * @see        DefaultLogger::targetStarted()
  *
  * @author     Noah Fontes <noah.fontes@bitextender.com>
  * @since      1.0.0
  */
 public function targetFinished(BuildEvent $event)
 {
     if (!$event->getTarget() instanceof AgaviProxyTarget) {
         parent::targetFinished($event);
     }
 }
开发者ID:philippjenni,项目名称:icinga-web,代码行数:20,代码来源:AgaviProxyBuildLogger.php


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