]> source.dussan.org Git - nextcloud-server.git/commitdiff
Don't try to use routes when called from cli
authorRobin Appelman <icewind@owncloud.com>
Thu, 7 Feb 2013 16:53:38 +0000 (17:53 +0100)
committerRobin Appelman <icewind@owncloud.com>
Thu, 7 Feb 2013 16:53:38 +0000 (17:53 +0100)
lib/base.php

index b432f282aafd0ae819dde64782965c81209433b8..5bfdb0b7c0a568f893d864b3e31c51f0a0580733 100644 (file)
@@ -554,14 +554,16 @@ class OC {
                        self::checkUpgrade();
                }
 
-               try {
-                       OC::getRouter()->match(OC_Request::getPathInfo());
-                       return;
-               } catch (Symfony\Component\Routing\Exception\ResourceNotFoundException $e) {
-                       //header('HTTP/1.0 404 Not Found');
-               } catch (Symfony\Component\Routing\Exception\MethodNotAllowedException $e) {
-                       OC_Response::setStatus(405);
-                       return;
+               if (!self::$CLI) {
+                       try {
+                               OC::getRouter()->match(OC_Request::getPathInfo());
+                               return;
+                       } catch (Symfony\Component\Routing\Exception\ResourceNotFoundException $e) {
+                               //header('HTTP/1.0 404 Not Found');
+                       } catch (Symfony\Component\Routing\Exception\MethodNotAllowedException $e) {
+                               OC_Response::setStatus(405);
+                               return;
+                       }
                }
 
                $app = OC::$REQUESTEDAPP;