diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-05-16 21:07:29 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-05-16 21:07:29 -0400 |
commit | b1e2ca00ce7375ffcbe5e927135c8892036e6bd6 (patch) | |
tree | 07ce453261f6493de7c901cfd8b4f0d9af85556d /app/Api/File.php | |
parent | 4514bc1d4b4abff23902e46da76e70f13a3647eb (diff) |
Rename Api classes
Diffstat (limited to 'app/Api/File.php')
-rw-r--r-- | app/Api/File.php | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/app/Api/File.php b/app/Api/File.php deleted file mode 100644 index 71c31c76..00000000 --- a/app/Api/File.php +++ /dev/null @@ -1,90 +0,0 @@ -<?php - -namespace Kanboard\Api; - -use Kanboard\Core\ObjectStorage\ObjectStorageException; - -/** - * File API controller - * - * @package api - * @author Frederic Guillot - */ -class File extends Base -{ - public function getTaskFile($file_id) - { - return $this->taskFile->getById($file_id); - } - - public function getAllTaskFiles($task_id) - { - return $this->taskFile->getAll($task_id); - } - - public function downloadTaskFile($file_id) - { - try { - $file = $this->taskFile->getById($file_id); - - if (! empty($file)) { - return base64_encode($this->objectStorage->get($file['path'])); - } - } catch (ObjectStorageException $e) { - $this->logger->error($e->getMessage()); - return ''; - } - } - - public function createTaskFile($project_id, $task_id, $filename, $blob) - { - try { - return $this->taskFile->uploadContent($task_id, $filename, $blob); - } catch (ObjectStorageException $e) { - $this->logger->error($e->getMessage()); - return false; - } - } - - public function removeTaskFile($file_id) - { - return $this->taskFile->remove($file_id); - } - - public function removeAllTaskFiles($task_id) - { - return $this->taskFile->removeAll($task_id); - } - - // Deprecated procedures - - public function getFile($file_id) - { - return $this->getTaskFile($file_id); - } - - public function getAllFiles($task_id) - { - return $this->getAllTaskFiles($task_id); - } - - public function downloadFile($file_id) - { - return $this->downloadTaskFile($file_id); - } - - public function createFile($project_id, $task_id, $filename, $blob) - { - return $this->createTaskFile($project_id, $task_id, $filename, $blob); - } - - public function removeFile($file_id) - { - return $this->removeTaskFile($file_id); - } - - public function removeAllFiles($task_id) - { - return $this->removeAllTaskFiles($task_id); - } -} |