]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use dummy request method in CLI
authorRobin Appelman <icewind@owncloud.com>
Thu, 7 Feb 2013 17:28:56 +0000 (18:28 +0100)
committerRobin Appelman <icewind@owncloud.com>
Thu, 7 Feb 2013 17:28:56 +0000 (18:28 +0100)
lib/router.php

index 746b68c2c0c4a8078f0c738d5b991d9808814f0f..fbf56a1bb422164f2d0713ff4a4267dac78bbe97 100644 (file)
@@ -23,7 +23,11 @@ class OC_Router {
 
        public function __construct() {
                $baseUrl = OC_Helper::linkTo('', 'index.php');
-               $method = $_SERVER['REQUEST_METHOD'];
+               if (OC::$CLI) {
+                       $method = $_SERVER['REQUEST_METHOD'];
+               }else{
+                       $method = 'GET';
+               }
                $host = OC_Request::serverHost();
                $schema = OC_Request::serverProtocol();
                $this->context = new RequestContext($baseUrl, $method, $host, $schema);