aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-02-07 17:53:38 +0100
committerRobin Appelman <icewind@owncloud.com>2013-02-07 17:53:38 +0100
commitafa1a6d2b3cc1b07c7e99b370ad88f9473c50add (patch)
treed1be51a7100abd390e0881dac209a4c137930be7
parent6cff5418a75775b9cb2f8c877797b469d5cd3ce9 (diff)
downloadnextcloud-server-afa1a6d2b3cc1b07c7e99b370ad88f9473c50add.tar.gz
nextcloud-server-afa1a6d2b3cc1b07c7e99b370ad88f9473c50add.zip
Don't try to use routes when called from cli
-rw-r--r--lib/base.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/base.php b/lib/base.php
index b432f282aaf..5bfdb0b7c0a 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -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;