Exemplo n.º 1
0
 /**
  * Detects the type of incoming request and calls the corresponding
  * RequestData handler to deal with it.
  * @return mixed request data as native PHP variables.
  * @access private
  */
 function getRequestData()
 {
     switch ($_SERVER['REQUEST_METHOD']) {
         case 'POST':
             global $HTTP_RAW_POST_DATA;
             if ($HTTP_RAW_POST_DATA) {
                 return JPSpan_RequestData_RawPost::fetch($this->encoding);
             } else {
                 return JPSpan_RequestData_Post::fetch($this->encoding);
             }
             break;
         case 'GET':
         default:
             return JPSpan_RequestData_Get::fetch($this->encoding);
             break;
     }
 }
Exemplo n.º 2
0
 /**
  * Populate the args array if there are any
  * @param array args (reference)
  * @return boolean TRUE if request had args
  * @access private
  */
 function getArgs(&$args)
 {
     require_once JPSPAN . 'RequestData.php';
     if ($this->RequestEncoding == 'php') {
         $args = JPSpan_RequestData_Post::fetch($this->RequestEncoding);
     } else {
         $args = JPSpan_RequestData_RawPost::fetch($this->RequestEncoding);
     }
     if (is_array($args)) {
         return TRUE;
     }
     return FALSE;
 }