本文整理汇总了PHP中BuildEvent::getTarget方法的典型用法代码示例。如果您正苦于以下问题:PHP BuildEvent::getTarget方法的具体用法?PHP BuildEvent::getTarget怎么用?PHP BuildEvent::getTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BuildEvent
的用法示例。
在下文中一共展示了BuildEvent::getTarget方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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());
}
}
示例2: targetFinished
/** {@inheritDoc}. */
public function targetFinished(BuildEvent $event)
{
$this->log("<< TARGET FINISHED -- " . $event->getTarget()->getName(), Project::MSG_DEBUG);
$time = $this->formatTime(Phing::currentTimeMillis() - $this->targetStartTime);
$this->log($event->getTarget()->getName() . ": duration " . $time, Project::MSG_VERBOSE);
flush();
}
示例3: targetStarted
function targetStarted(BuildEvent $event)
{
$target = $event->getTarget();
$this->targetName = $target->getName();
}
示例4: 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());
}
}
示例5: targetStarted
/**
* Fired when a target starts building, remembers the current time and the name of the target.
*
* @param BuildEvent $event An event with any relevant extra information.
* Will not be <code>null</code>.
*/
public function targetStarted(BuildEvent $event)
{
$target = $event->getTarget();
$targetElement = $this->doc->createElement(XmlLogger::TARGET_TAG);
$targetElement->setAttribute(XmlLogger::NAME_ATTR, $target->getName());
array_push($this->timesStack, Phing::currentTimeMillis());
array_push($this->elementStack, $targetElement);
}
示例6: targetFinished
/**
* Logs a message to say that the target has finished.
*
* @param BuildEvent $event
* An event with any relevant extra information. Must not be
* <code>null</code>.
*/
public function targetFinished(BuildEvent $event)
{
$start = array_pop($this->profileData);
$name = "Target " . $event->getTarget()->getName();
$this->logFinish($event, $start, $name);
}
示例7: 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;
}
}
示例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);
}
}
}
}
示例9: targetFinished
/**
* Handles the Phing target finished event.
*
* @param BuildEvent The Phing build event.
*
* @author Noah Fontes <noah.fontes@bitextender.com>
* @since 1.0.0
*/
public function targetFinished(BuildEvent $phingEvent)
{
$event = new AgaviPhingTargetEvent();
$event->setSource($phingEvent->getTarget());
$event->setTarget($phingEvent->getTarget());
$event->setProject($phingEvent->getProject());
foreach ($this->targetListeners as $listener) {
$listener->targetLeft($event);
}
}
示例10: 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);
}
}