Exemplo n.º 1
0
 /**
  * Depart and normalize the requested URI
  */
 protected function TokenizeURI()
 {
     $this->_parts = array_filter(\explode('?', $this->requested_uri));
     if (count($this->_parts) === 0) {
         $this->_parts = array();
         return;
     }
     $this->_parts = \explode('/', $this->_parts[0]);
     /*
      * Normalizing the $this->_parts arrays
      */
     \zinux\kernel\utilities\_array::array_normalize($this->_parts);
     # fetch page type
     if (count($this->_parts) && \zinux\kernel\utilities\string::Contains($this->_parts[count($this->_parts) - 1], ".")) {
         $dpos = strpos($this->_parts[count($this->_parts) - 1], ".");
         $this->type = substr($this->_parts[count($this->_parts) - 1], $dpos + 1);
         $this->_parts[count($this->_parts) - 1] = substr($this->_parts[count($this->_parts) - 1], 0, $dpos);
     }
 }
Exemplo n.º 2
0
 /**
  * Prepares the params for sending requests
  */
 protected function __normalize_params()
 {
     if (!\zinux\kernel\utilities\string::Contains($this->uri, "?")) {
         $this->uri .= "?";
     }
     $get_str = http_build_query($this->GET);
     if (strlen($get_str)) {
         $this->uri .= "&{$get_str}";
     }
     if (count($this->COOKIE)) {
         $this->COOKIE = str_replace("&", "; ", http_build_query($this->COOKIE));
     } else {
         $this->COOKIE = "";
     }
     if (count($this->POST)) {
         $this->POST = http_build_query($this->POST);
     } else {
         $this->POST = "";
     }
 }