mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
General cleanup of Context vars
This commit is contained in:
parent
af0dab0e1b
commit
a602779fc2
2 changed files with 90 additions and 118 deletions
|
|
@ -8,10 +8,15 @@ namespace Rhymix\Framework;
|
|||
class Request
|
||||
{
|
||||
/**
|
||||
* The request method.
|
||||
* The actual HTTP request method.
|
||||
*/
|
||||
public $method = '';
|
||||
|
||||
/**
|
||||
* XE-compatible request method, e.g. XMLRPC.
|
||||
*/
|
||||
public $compat_method = '';
|
||||
|
||||
/**
|
||||
* The request URL, not including RX_BASEURL.
|
||||
*/
|
||||
|
|
@ -54,7 +59,8 @@ class Request
|
|||
public function __construct(string $method = '', string $url = '', string $hostname = '', string $protocol = '')
|
||||
{
|
||||
// Set instance properties.
|
||||
$this->method = $method ?: (\PHP_SAPI === 'cli' ? 'CLI' : \Context::getRequestMethod());
|
||||
$this->method = $method ?: (\PHP_SAPI === 'cli' ? 'CLI' : ($_SERVER['REQUEST_METHOD'] ?? 'GET'));
|
||||
$this->compat_method = \Context::getRequestMethod();
|
||||
$this->url = $url ?: \RX_REQUEST_URL;
|
||||
$this->hostname = $hostname ?: $_SERVER['HTTP_HOST'];
|
||||
$this->protocol = \RX_SSL ? 'https' : 'http';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue