本文整理汇总了PHP中BuildEvent类的典型用法代码示例。如果您正苦于以下问题:PHP BuildEvent类的具体用法?PHP BuildEvent怎么用?PHP BuildEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BuildEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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', '[email protected]', 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 <[email protected]>
* @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 <[email protected]>
* @since 1.0.0
*/
public function targetFinished(BuildEvent $event)
{
if (!$event->getTarget() instanceof AgaviProxyTarget) {
parent::targetFinished($event);
}
}
开发者ID:philippjenni,项目名称:icinga-web,代码行数:20,代码来源:AgaviProxyBuildLogger.php
示例16: 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
示例17: 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
示例18: messageLogged
/**
* Handles the Phing message logged event.
*
* @param BuildEvent The Phing build event.
*
* @author Noah Fontes <[email protected]>
* @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
示例19: fireTaskFinished
/**
* @param $task
* @param $exception
*/
public function fireTaskFinished($task, $exception)
{
$event = new BuildEvent($task);
$event->setException($exception);
foreach ($this->listeners as $listener) {
$listener->taskFinished($event);
}
}
开发者ID:Ingewikkeld,项目名称:phing,代码行数:12,代码来源:Project.php
示例20: 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
注:本文中的BuildEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论