diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2012-03-30 21:15:31 +0200 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2012-03-30 21:15:31 +0200 |
| commit | cdaa5e28290fe0e9e73ca3a0557ee021a7ab404b (patch) | |
| tree | 5cb6ba6f05bb5cafd8735775ddfeda78923f4940 /src/Phorkie/Repository.php | |
| parent | 8fadde4a3b26523b15ff019cafc1b49f9143293f (diff) | |
| download | phorkie-cdaa5e28290fe0e9e73ca3a0557ee021a7ab404b.tar.gz phorkie-cdaa5e28290fe0e9e73ca3a0557ee021a7ab404b.zip | |
paste deletion is possible now
Diffstat (limited to 'src/Phorkie/Repository.php')
| -rw-r--r-- | src/Phorkie/Repository.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/Phorkie/Repository.php b/src/Phorkie/Repository.php index d9fc234..bcaf3e1 100644 --- a/src/Phorkie/Repository.php +++ b/src/Phorkie/Repository.php @@ -102,6 +102,17 @@ class Repository return true; } + /** + * Permanently deletes the paste repository without any way to get + * it back. + * + * @return boolean True if all went well, false if not + */ + public function delete() + { + return Tools::recursiveDelete($this->repoDir); + } + public function getDescription() { if (!is_readable($this->repoDir . '/.git/description')) { @@ -133,8 +144,12 @@ class Repository return '/' . $this->id; } else if ($type == 'fork') { return '/' . $this->id . '/fork'; + } else if ($type == 'delete') { + return '/' . $this->id . '/delete'; + } else if ($type == 'delete-confirm') { + return '/' . $this->id . '/delete/confirm'; } - throw new Exception('Unknown type'); + throw new Exception('Unknown link type'); } } |
