From 8d0a6ef7695f7045af2fb9ef6498548e18c8a0d6 Mon Sep 17 00:00:00 2001 From: Cameron Ball Date: Fri, 5 Dec 2014 11:14:40 +0800 Subject: [PATCH] Update file controller to serve packs and simfiles --- Controllers/FileController.php | 4 ++-- config/Routes.php | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Controllers/FileController.php b/Controllers/FileController.php index 1fb1cb2..6fe626e 100644 --- a/Controllers/FileController.php +++ b/Controllers/FileController.php @@ -68,7 +68,7 @@ class FileController implements IDivineController exit(); } - public function servePackAction($hash) + public function serveSimfileOrPackAction($hash) { $file = $this->_fileRepository->findByHash($hash); $quotaRemaining = $this->_userQuota->getCurrentUserQuotaRemaining(); @@ -94,7 +94,7 @@ class FileController implements IDivineController ->setBody(file_get_contents($zip)) ->sendResponse(); } - + private function notFound() { $this->_response->setHeader('HTTP/1.0 404 Not Found', 'Nothing to see here') diff --git a/config/Routes.php b/config/Routes.php index bdcd7ab..b79aafd 100644 --- a/config/Routes.php +++ b/config/Routes.php @@ -45,6 +45,12 @@ return [ '/files/pack/:hash' => [ 'method' => ['GET'], 'controller' => 'File', - 'action' => 'servePack' + 'action' => 'serveSimfileOrPack' + ], + + '/files/simfile/:hash' => [ + 'method' => ['GET'], + 'controller' => 'File', + 'action' => 'serveSimfileOrPack' ] ]; -- 2.11.0