예제 #1
0
파일: BuildEvent.php 프로젝트: hunde/bsc
 /**
  * Construct a BuildEvent for a project, task or target source event
  *
  * @param  object  project the project that emitted the event.
  */
 public function __construct($source)
 {
     parent::__construct($source);
     if ($source instanceof Project) {
         $this->project = $source;
         $this->target = null;
         $this->task = null;
     } elseif ($source instanceof Target) {
         $this->project = $source->getProject();
         $this->target = $source;
         $this->task = null;
     } elseif ($source instanceof Task) {
         $this->project = $source->getProject();
         $this->target = $source->getOwningTarget();
         $this->task = $source;
     } else {
         throw new Exception("Can not construct BuildEvent, unknown source given.");
     }
 }
예제 #2
0
 public function __construct($user, $relatedSource = null)
 {
     parent::__construct($user, $relatedSource);
     $this->skel = null;
 }
예제 #3
0
 public function formatEvent($event, $info = null)
 {
     $myFilename = $event->getFilename();
     $myLinenum = $event->getLinenum();
     $string = "<!-- " . EventObject::PrettyErrorType($event->getLayoutType()) . ": " . $event->getMessage() . (!empty($myFilename) ? " in {$myFilename}" . (!empty($myLinenum) ? " on line {$myLinenum}" : "") : "");
     if ($event->classifyErrorType() == 'error') {
         $string .= "\nStack Backtrace\n" . self::FormatBacktrace($event->getContext()) . "\n";
     }
     $string .= " -->\n";
     return $string;
 }
예제 #4
0
 public function __construct($source, $relatedSource = null, $changes = null)
 {
     parent::__construct($source, $relatedSource);
     $this->changes = $changes;
 }
 public function addEvent(EventObject $eventObject)
 {
     $this->events[$eventObject->getEventName()][] = $eventObject->getEventDispatchClass();
 }
예제 #6
0
 public function __construct($source, $relatedSource = null)
 {
     parent::__construct($source, $relatedSource);
 }
예제 #7
0
 public function formatEvent($event, $info = null)
 {
     $dt = date("Y-m-d H:i:s (T)", $event->getTimestamp());
     $myFilename = $event->getFilename();
     $myLinenum = $event->getLinenum();
     // Get information about node
     $myCurrentNode = Node::getCurrentNode();
     if (empty($myCurrentNode)) {
         $myNodeName = '*nonode*';
     } else {
         $myNodeName = $myCurrentNode->getName();
     }
     // Get information about network
     $myNetwork = Network::getCurrentNetwork();
     if (empty($myNetwork)) {
         $myNetworkName = '*nonetwork*';
     } else {
         $myNetworkName = $myNetwork->getName();
     }
     // Get information about user
     $myCurrentUser = User::getCurrentUser();
     if (empty($myCurrentUser)) {
         $myUserName = '******';
     } else {
         $myUserName = $myCurrentUser->getUsername();
     }
     $string = "{$dt} " . EventObject::PrettyErrorType($event->getLayoutType()) . " >{$myNetworkName} >{$myUserName}@{$myNodeName} [" . $_SERVER['REQUEST_URI'] . "]" . ": " . $event->getMessage() . (!empty($myFilename) ? " in {$myFilename}" . (!empty($myLinenum) ? " on line {$myLinenum}" : "") : "") . "\n";
     if ($event->classifyErrorType() == 'error') {
         $string .= "   Stack Backtrace\n" . self::FormatBacktrace($event->getContext()) . "\n";
     }
     return $string;
 }