for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace WebServCo\Framework\Libraries;
final class Request extends \WebServCo\Framework\AbstractRequest
{
public function __construct($config, $server, $post = [])
parent::__construct($config);
$this->init($server, $post);
}
public function getSchema()
if (\WebServCo\Framework\Framework::isCLI()) {
return null;
if (isset($this->server['HTTPS']) && 'off' != $this->server['HTTPS']) {
return 'https';
} elseif (isset($this->server['HTTP_X_FORWARDED_PROTO']) &&
'https' == $this->server['HTTP_X_FORWARDED_PROTO']) {
} elseif (isset($this->server['HTTP_X_FORWARDED_SSL']) &&
'on' == $this->server['HTTP_X_FORWARDED_SSL']) {
return 'http';
public function getReferer()
return isset($this->server['HTTP_REFERER']) ? $this->server['HTTP_REFERER'] : null;
public function getHost()
if (!empty($this->server['HTTP_HOST'])) {
return $this->server['HTTP_HOST'];
} elseif (!empty($this->server['SERVER_NAME'])) {
return $this->server['SERVER_NAME'];
} elseif (!empty($this->server['HOSTNAME'])) {
return $this->server['HOSTNAME']; //CLI
public function guessAppUrl()
return false;
return $this->getSchema() .
'://' .
$this->getHost() .
$this->path .
DIRECTORY_SEPARATOR;