From 5c314428027bea7f3743d24968bd294e65b662ca Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 29 Mar 2012 23:17:34 +0200 Subject: merge paste creation and paste edit code --- src/Phorkie/Repository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Phorkie/Repository.php') diff --git a/src/Phorkie/Repository.php b/src/Phorkie/Repository.php index 5273b60..d9fc234 100644 --- a/src/Phorkie/Repository.php +++ b/src/Phorkie/Repository.php @@ -76,7 +76,7 @@ class Repository return $arFiles; } - public function getFileByName($name) + public function getFileByName($name, $bHasToExist = true) { $base = basename($name); if ($base != $name) { @@ -86,7 +86,7 @@ class Repository throw new Exception_Input('Empty file name given'); } $path = $this->repoDir . '/' . $base; - if (!is_readable($path)) { + if ($bHasToExist && !is_readable($path)) { throw new Exception_Input('File does not exist'); } return new File($path, $this); -- cgit v1.2.3