Ejemplo n.º 1
0
 /**
  * @param WebRequestDictionary $dictonary
  * @param array $getVars request's $_GET
  * @param array $postVars request's $_POST
  * @param array $cookieVars request's $_COOKIE
  * @param array $filesVars request's $_FILES
  * @param string|null $baseHost optional base host for request's request url (SiteUrl)
  * @param string $baseUri optional base uri
  */
 function __construct(WebRequestDictionary $dictonary, array $getVars, array $postVars, array $cookieVars, array $filesVars, $baseHost = null, $baseUri = '/')
 {
     Assert::isScalar($baseUri);
     $this->dictionary = $dictonary->getFields();
     $this->httpUrl = SiteUrl::import($dictonary, $baseHost, $baseUri);
     $this->vars = array(WebRequestPart::GET => $getVars, WebRequestPart::POST => $postVars, WebRequestPart::COOKIE => $cookieVars, WebRequestPart::FILES => $filesVars);
     $this->allVars = call_user_func_array('array_merge', array($filesVars, $cookieVars, $postVars, $getVars));
 }
Ejemplo n.º 2
0
 function __construct(array $getVars, array $postVars, array $cookieVars, array $filesVars, array $serverVars, array $envVars, $baseHost = null, $baseUri = '/')
 {
     Assert::isScalar($baseUri);
     $this->getVars = $getVars;
     $this->postVars = $postVars;
     $this->cookieVars = $cookieVars;
     $this->filesVars = $filesVars;
     $this->serverVars = $serverVars;
     $this->envVars = $envVars;
     // GPCF
     $this->allVars = array_replace_recursive($cookieVars, $getVars, $postVars, $filesVars);
     $this->httpUrl = SiteUrl::import($this->isSecured() ? 'https' : 'http', $this->serverVars['HTTP_HOST'], $this->serverVars['SERVER_PORT'], $this->serverVars['REQUEST_URI'], $baseHost, $baseUri);
 }