diff options
author | Florian Pritz <bluewind@xinu.at> | 2014-11-02 13:29:33 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2014-11-02 16:29:45 +0100 |
commit | e1f6ddab39486dd9819a20b5538f8b6c6b7c7e66 (patch) | |
tree | a9216c90f15c64688aba397d63626ef9484b9c43 /application/models/mmultipaste.php | |
parent | 9fcab419ba819273ed95fdfa76b08c87d72cb3e8 (diff) |
Add tarball support to multipastes
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/models/mmultipaste.php')
-rw-r--r-- | application/models/mmultipaste.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/application/models/mmultipaste.php b/application/models/mmultipaste.php index 367e74787..29fc183b6 100644 --- a/application/models/mmultipaste.php +++ b/application/models/mmultipaste.php @@ -88,11 +88,20 @@ class Mmultipaste extends CI_Model { return true; } + public function get_tarball_path($id) + { + return $this->config->item("upload_path")."/special/multipaste-tarballs/".substr(md5($id), 0, 3)."/$id.tar.gz"; + } + public function delete_id($id) { $this->db->where('url_id', $id) ->delete('multipaste'); + $path = $this->get_tarball_path($id); + $f = new \service\storage($this->config->item("upload_path"), $path); + $f->unlink(); + if ($this->id_exists($id)) { return false; } |