Use dummy request method in CLI

This commit is contained in:
Robin Appelman 2013-02-07 18:28:56 +01:00
parent afa1a6d2b3
commit f3f55654ce
1 changed files with 5 additions and 1 deletions

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