summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorTom Needham <tom@owncloud.com>2013-02-09 12:05:48 +0000
committerTom Needham <tom@owncloud.com>2013-02-09 12:05:48 +0000
commit5d14a2cc463f09d010537a5537e3339a87d57558 (patch)
treee53b4fece6b204e7ffdaaa6ce3601ddaf25b5ba6 /lib/base.php
parenteefaefe87d4ef2271c7a079632744948ca8d2496 (diff)
parent0c73cae77b402355809c8f5f5be69d8a730fe3e2 (diff)
downloadnextcloud-server-5d14a2cc463f09d010537a5537e3339a87d57558.tar.gz
nextcloud-server-5d14a2cc463f09d010537a5537e3339a87d57558.zip
Merge in master
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php26
1 files changed, 15 insertions, 11 deletions
diff --git a/lib/base.php b/lib/base.php
index 90e64f13af6..5bfdb0b7c0a 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -402,9 +402,11 @@ class OC {
self::initPaths();
- register_shutdown_function(array('OC_Log', 'onShutdown'));
- set_error_handler(array('OC_Log', 'onError'));
- set_exception_handler(array('OC_Log', 'onException'));
+ if (!defined('PHPUNIT_RUN')) {
+ register_shutdown_function(array('OC_Log', 'onShutdown'));
+ set_error_handler(array('OC_Log', 'onError'));
+ set_exception_handler(array('OC_Log', 'onException'));
+ }
// set debug mode if an xdebug session is active
if (!defined('DEBUG') || !DEBUG) {
@@ -552,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;