Update file controller to serve packs and simfiles
authorCameron Ball <cameron@getapproved.com.au>
Fri, 5 Dec 2014 03:14:40 +0000 (11:14 +0800)
committerCameron Ball <cameron@getapproved.com.au>
Fri, 5 Dec 2014 03:14:40 +0000 (11:14 +0800)
Controllers/FileController.php
config/Routes.php

index 1fb1cb2..6fe626e 100644 (file)
@@ -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')
index bdcd7ab..b79aafd 100644 (file)
@@ -45,6 +45,12 @@ return [
     '/files/pack/:hash' => [\r
         'method' => ['GET'],\r
         'controller' => 'File',\r
-        'action' => 'servePack'\r
+        'action' => 'serveSimfileOrPack'\r
+    ],\r
+    \r
+    '/files/simfile/:hash' => [\r
+        'method' => ['GET'],\r
+        'controller' => 'File',\r
+        'action' => 'serveSimfileOrPack'\r
     ]\r
 ];\r