Don't try to use routes when called from cli

This commit is contained in:
Robin Appelman 2013-02-07 17:53:38 +01:00
parent 6cff5418a7
commit afa1a6d2b3
1 changed files with 10 additions and 8 deletions

View 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;