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


PHP BuildEvent::getProject方法代码示例

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


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

示例3: buildStarted

 /**
  *  Sets the start-time when the build started. Used for calculating
  *  the build-time.
  *
  * @param  BuildEvent  The BuildEvent
  */
 public function buildStarted(BuildEvent $event)
 {
     $this->startTime = Phing::currentTimeMillis();
     $this->logger()->setIdent($event->getProject()->getName());
     $this->logger()->info("Starting build with buildfile: " . $event->getProject()->getProperty("phing.file"));
 }
开发者ID:TheTypoMaster,项目名称:SPHERE-Framework,代码行数:12,代码来源:PearLogListener.php

示例4: targetStarted

 /**
  *  Prints the current target name
  *
  *  @param  object  The BuildEvent
  *  @access public
  *  @see    BuildEvent::getTarget()
  */
 public function targetStarted(BuildEvent $event)
 {
     if (Project::MSG_INFO <= $this->msgOutputLevel) {
         $msg = PHP_EOL . $event->getProject()->getName() . ' > ' . $event->getTarget()->getName() . ':' . PHP_EOL;
         $this->printMessage($msg, $this->out, $event->getPriority());
     }
 }
开发者ID:alexspark21,项目名称:symfony_bisM,代码行数:14,代码来源:DefaultLogger.php

示例5: subBuildFinished

 /**
  * Cleans up any resources held by this recorder entry at the end
  * of a subbuild if it has been created for the subbuild's project
  * instance.
  *
  * @param BuildEvent $event the buildFinished event
  */
 public function subBuildFinished(BuildEvent $event)
 {
     if ($event->getProject() == $this->project) {
         $this->cleanup();
     }
 }
开发者ID:Ingewikkeld,项目名称:phing,代码行数:13,代码来源:RecorderEntry.php

示例6: 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->buildTimerStart;
     $this->buildElement->setAttribute(XmlLogger::TIME_ATTR, DefaultLogger::formatTime($elapsedTime));
     if ($event->getException() != null) {
         $this->buildElement->setAttribute(XmlLogger::ERROR_ATTR, $event->getException()->getMessage());
         $errText = $this->doc->createCDATASection($event->getException()->getTraceAsString());
         $stacktrace = $this->doc->createElement(XmlLogger::STACKTRACE_TAG);
         $stacktrace->appendChild($errText);
         $this->buildElement->appendChild($stacktrace);
     }
     $this->doc->appendChild($this->buildElement);
     $outFilename = $event->getProject()->getProperty("XmlLogger.file");
     if ($outFilename == null) {
         $outFilename = "log.xml";
     }
     try {
         $stream = $this->out;
         if ($stream === null) {
             $stream = new FileOutputStream($outFilename);
         }
         // Yes, we could just stream->write() but this will eventually be the better
         // way to do this (when we need to worry about charset conversions.
         $writer = new OutputStreamWriter($stream);
         $writer->write($this->doc->saveXML());
         $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->buildElement = null;
     array_pop($this->elementStack);
     array_pop($this->timesStack);
 }
开发者ID:codebubb,项目名称:web_ssh,代码行数:47,代码来源:XmlLogger.php

示例7: targetStarted

 /**
  *  Prints the current target name
  *
  * @param BuildEvent $event
  * @see    BuildEvent::getTarget()
  */
 public function targetStarted(BuildEvent $event)
 {
     if (Project::MSG_INFO <= $this->msgOutputLevel && $event->getTarget()->getName() != '') {
         $showLongTargets = $event->getProject()->getProperty("phing.showlongtargets");
         $msg = PHP_EOL . $event->getProject()->getName() . ' > ' . $event->getTarget()->getName() . ($showLongTargets ? ' [' . $event->getTarget()->getDescription() . ']' : '') . ':' . PHP_EOL;
         $this->printMessage($msg, $this->out, $event->getPriority());
     }
 }
开发者ID:kenguest,项目名称:phing,代码行数:14,代码来源:DefaultLogger.php

示例8: targetStarted

 /**
  *  Prints the current target name
  *
  *  @param  object  The BuildEvent
  *  @access public
  *  @see    BuildEvent::getTarget()
  */
 function targetStarted(BuildEvent $event)
 {
     if (PROJECT_MSG_INFO <= $this->msgOutputLevel) {
         print $this->lSep . $event->getProject()->getName() . ' > ' . $event->getTarget()->getName() . ':' . $this->lSep;
     }
 }
开发者ID:Daniel-Marynicz,项目名称:symfony1-legacy,代码行数:13,代码来源:DefaultLogger.php

示例9: 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 An event with any relevant extra information.
  *              Will not be <code>null</code>.
  */
 function buildFinished(BuildEvent $event)
 {
     $this->buildTimer->stop();
     $elapsedTime = Phing::currentTimeMillis() - $this->buildTimerStart;
     $this->buildElement->setAttribute(XmlLogger::TIME_ATTR, DefaultLogger::_formatTime($elapsedTime));
     if ($event->getException() != null) {
         $this->buildElement->setAttribute(XmlLogger::ERROR_ATTR, $event->getException()->toString());
         $errText = $this->doc->createCDATASection($event->getException()->getTraceAsString());
         $stacktrace = $this->doc->createElement(XmlLogger::STACKTRACE_TAG);
         $stacktrace->appendChild($errText);
         $this->buildElement->appendChild($stacktrace);
     }
     $outFilename = $event->getProject()->getProperty("XmlLogger.file");
     if ($outFilename == "") {
         $outFilename = "log.xml";
     }
     $writer = new FileWriter($outFilename);
     $writer->write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
     $writer->write($this->doc->saveXML($this->buildElement));
     $writer->close();
 }
开发者ID:Daniel-Marynicz,项目名称:symfony1-legacy,代码行数:28,代码来源:XmlLogger.php

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


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