diff options
Diffstat (limited to 'src/Phorkie/Repository.php')
| -rw-r--r-- | src/Phorkie/Repository.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Phorkie/Repository.php b/src/Phorkie/Repository.php index ae01f6c..ebd420f 100644 --- a/src/Phorkie/Repository.php +++ b/src/Phorkie/Repository.php @@ -57,6 +57,19 @@ class Repository return $arFiles; } + public function getFileByName($name) + { + $base = basename($name); + if ($base != $name) { + throw new Exception('No directories supported for now'); + } + $path = $this->repoDir . '/' . $base; + if (!is_readable($path)) { + throw new Exception_Input('File does not exist'); + } + return new File($path, $this); + } + public function getDescription() { return file_get_contents($this->repoDir . '/.git/description'); |
