Example #1
0
 public function __construct(SystemContext $context)
 {
     parent::__construct($context);
     $this->_system_context = $context;
     $uri = $context->_ENV->getVal('request_uri', '/');
     $query = null;
     if (false !== ($pos = strpos($uri, '?'))) {
         $query = substr($uri, $pos + 1);
         $uri = substr($uri, 0, $pos);
     }
     $method = $context->_ENV->getVal('request_method', 'GET');
     $port = $context->_ENV->getVal('server_port', 80);
     $this->data()->initValues(['is_https' => $context->_ENV->getVal('HTTPS', 'off') === 'on' || $context->_ENV->getVal('SERVER_PORT') === 443, 'hostname' => $context->_ENV->getVal('http_host'), 'from_ip' => $context->getRemoteIP(), 'request_uri' => $uri, 'request_method' => $method, 'port' => $port, 'query' => $query, '_POST' => $context->_POST, '_GET' => $context->_GET, '_COOKIE' => $context->_COOKIE]);
 }
Example #2
0
 public function __construct(BaseContext $context, $dir)
 {
     parent::__construct($context);
     $this->setVal('root', $dir);
 }