7 * Full path to the file
14 * Repository this file belongs to
20 public function __construct($path, Repository $repo)
27 * Get filename relative to the repository path
31 public function getFilename()
33 return basename($this->path);
37 * Returns the type of the file, as used internally by Phorkie
41 public function getType()
43 return substr($this->path, strrpos($this->path, '.') + 1);
46 public function getContent()
48 return file_get_contents($this->path);
52 * Get a link to the file
54 * @param string $type Link type. Supported are:
60 public function getLink($type)
63 return '/' . $this->repo->id . '/raw/' . $this->getFilename();
65 throw new Exception('Unknown type');