예제 #1
0
 public function __construct(Server $server, array $queryString, array $postData, array $files, array $cookies)
 {
     $request = array_merge($queryString, $postData);
     parent::__construct($server, $request);
     $this->queryString = new \Bitrix\Main\System\ReadonlyDictionary($queryString);
     $this->postData = new \Bitrix\Main\System\ReadonlyDictionary($postData);
     $this->files = new \Bitrix\Main\System\ReadonlyDictionary($files);
     $this->cookies = new \Bitrix\Main\System\ReadonlyDictionary($cookies);
 }
예제 #2
0
 /**
  * Creates new HttpRequest object
  *
  * @param Server $server
  * @param array $queryString _GET
  * @param array $postData _POST
  * @param array $files _FILES
  * @param array $cookies _COOKIE
  */
 public function __construct(Server $server, array $queryString, array $postData, array $files, array $cookies)
 {
     $request = array_merge($queryString, $postData);
     parent::__construct($server, $request);
     $this->queryString = new Type\ParameterDictionary($queryString);
     $this->postData = new Type\ParameterDictionary($postData);
     $this->files = new Type\ParameterDictionary($files);
     $this->cookiesRaw = new Type\ParameterDictionary($cookies);
     $this->cookies = new Type\ParameterDictionary($this->prepareCookie($cookies));
 }
예제 #3
0
 public function __construct(Server $server, array $queryString, array $postData, array $files, array $cookies)
 {
     $request = array_merge($queryString, $postData);
     parent::__construct($server, $request);
     $this->queryString = new \Bitrix\Main\System\ReadonlyDictionary($queryString);
     $this->postData = new \Bitrix\Main\System\ReadonlyDictionary($postData);
     $this->files = new \Bitrix\Main\System\ReadonlyDictionary($files);
     $cookiePrefix = \Bitrix\Main\Config\Option::get("main", "cookie_name", "BITRIX_SM") . "_";
     $cookiePrefixLength = strlen($cookiePrefix);
     $cookiesNew = array();
     foreach ($cookies as $name => $value) {
         $nameNew = $name;
         if (strpos($name, $cookiePrefix) === 0) {
             $nameNew = substr($name, $cookiePrefixLength);
         }
         $cookiesNew[$nameNew] = $value;
     }
     $this->cookies = new \Bitrix\Main\System\ReadonlyDictionary($cookiesNew);
 }