revision display support
[phorkie.git] / src / phorkie / Tool / Info.php
1 <?php
2 namespace phorkie;
3
4 class Tool_Info
5 {
6     public $class;
7
8     public function __construct($class)
9     {
10         $this->class = $class;
11     }
12
13     public function getLink(File $file)
14     {
15         return $file->getLink('tool', $this->stripPrefix($this->class));
16     }
17
18     public function getTitle()
19     {
20         return $this->stripPrefix($this->class);
21     }
22
23     protected function stripPrefix($class)
24     {
25         $prefix = '\\phorkie\\Tool_';
26         if (substr($class, 0, strlen($prefix)) === $prefix) {
27             return substr($class, strlen($prefix));
28         }
29         return $class;
30     }
31 }
32
33 ?>