php8
[web.mtrack] / MTrack / SCMEvent.php
1 <?php
2
3 //require_once 'MTrack/Wiki.php';
4
5 class MTrackSCMEvent 
6 {
7     
8     public $repo;
9     /** Revision or changeset identifier for this particular file */
10     public $rev;
11
12     /** commit message associated with this revision */
13     public $changelog;
14
15     /** who committed this revision */
16     public $changeby;
17
18     /** when this revision was committed */
19     public $ctime;
20
21     /** files affected in this event; may be null, but otherwise
22     * will be an array of MTrackSCMFileEvent */
23     public $files;
24
25     
26     function changelogOneToHtml()
27     {
28         list($one) = explode("\n", $this->changelog);
29         return htmlspecialchars($one);
30     }
31     function changelogToHtml()
32     {
33        return htmlspecialchars($this->changelog);
34     }
35     // get rid of this..
36     function changeByToHtml($linkHandler)
37     {
38         return $linkHandler->username($this->changeby, array('no_image' => true));
39         //mtrack_username($d->changeby, array('size' => 16)) <<< might add size here as an arg..   
40     }
41     function ctimeToHtml($linkHandler) 
42     {
43         return  $linkHandler->date($this->ctime);
44     }
45     function changeset($linkHandler)
46     {
47         return  $linkHandler->changeset($this->rev, $this->repo);
48     }
49     /**
50      * return the changeby as a RFC address..
51      */
52     
53     function changebyToEmail()
54     {
55         require_once 'Mail/RFC822.php';
56         $m = new Mail_RFC822;
57         $addr = $m->parseAddressList($this->changeby);
58          
59         return $addr[0]->mailbox.'@'.$addr[0]->host;
60     }
61      
62 }