Skip to content

Commit 36348b3

Browse files
authored
remove cli related code from request constructor bcs it made no sense… (#20)
* remove cli related code from request constructor bcs it made no sense at all * oops - restore fix for put, patch, etc requests
1 parent d52f2aa commit 36348b3

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/Nono/Request.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,8 @@ class Request
2323
public function __construct()
2424
{
2525
$_SERVER;
26-
if (PHP_SAPI == 'cli') {
27-
parse_str(implode('&', array_slice($this->server('argv'), 1)), $GLOBALS['_QUERY']);
28-
} elseif (!in_array($this->method(), ['GET', 'POST'])) {
29-
parse_str($this->content(), $GLOBALS['_QUERY']);
30-
}
26+
in_array($this->method(), ['GET', 'POST'])
27+
|| parse_str(file_get_contents('php://input'), $GLOBALS['_QUERY']);
3128
}
3229

3330
/**
@@ -146,4 +143,3 @@ public function __call($name, $args)
146143
}
147144
}
148145
}
149-

0 commit comments

Comments
 (0)