summaryrefslogtreecommitdiffstats
path: root/paste/include/storage/FileStorage.php
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2010-02-19 03:18:55 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2010-02-19 03:18:55 +0100
commitff117414b781ac8bcfa512001af252ab44d61592 (patch)
tree9350198e0e3db76831281b0fe45c2302458e1778 /paste/include/storage/FileStorage.php
parent82b803a304b7c58338130b305a2adae95b0d3e07 (diff)
downloadrafb-nopaste-ff117414b781ac8bcfa512001af252ab44d61592.tar.gz
rafb-nopaste-ff117414b781ac8bcfa512001af252ab44d61592.tar.xz
rafb-nopaste-ff117414b781ac8bcfa512001af252ab44d61592.zip
added delContent
Diffstat (limited to 'paste/include/storage/FileStorage.php')
-rw-r--r--paste/include/storage/FileStorage.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/paste/include/storage/FileStorage.php b/paste/include/storage/FileStorage.php
index 77cf0af..057b5de 100644
--- a/paste/include/storage/FileStorage.php
+++ b/paste/include/storage/FileStorage.php
@@ -68,6 +68,17 @@ class FileStorage extends StorageEngine
return $pasteUrl;
}
+
+ public function delContent($pid)
+ {
+ $filename = realpath($this->storage_path . $pid);
+ if (!empty($filename) && file_exists($filename)) {
+ if (!@unlink($filename)) {
+ header('HTTP/1.0 503 Service Unavailable');
+ die('Failed to remove ' . $filename);
+ }
+ }
+ }
}
?>