Exemplo n.º 1
0
 /**
  * Make multiple requests.
  * Each request is an associative array containing an HTTP method (key = method), a URL (key = url) and optional request parameters, HTTP headers and cURL options (keys = parms, http_headers, curl_options).
  * Each array of request settings can be associated with a key (recommended for easier extraction of results):
  *		$requests = array
  *		(
  *			'memakeit' => array('method' => 'GET', 'url' => 'user/show/memakeit'),
  *			'shadowhand' => array('method' => 'GET', 'url' => 'user/show/shadowhand'),
  *		);
  *
  * or the keys can be ommited:
  *		$requests = array
  *		(
  *			array('method' => 'GET', 'url' => 'user/show/memakeit'),
  *			array('method' => 'GET', 'url' => 'user/show/shadowhand'),
  *		);
  *
  * @param	array	the request details (HTTP method, URL, request parameters, HTTP headers, and cURL options)
  * @return	array
  */
 public function mexec($requests)
 {
     $name = 'uh';
     foreach ($requests as $key => $request) {
         $method = Arr::get($request, 'method', MMI_HTTP::METHOD_GET);
         if (strtoupper($method) === MMI_HTTP::METHOD_POST) {
             $parms = Arr::get($request, 'parms', array());
             $temp = Arr::get($parms, $name);
             if (empty($temp)) {
                 $parms[$name] = $this->_usermodhash;
                 $requests[$key]['parms'] = $parms;
             }
         }
     }
     return parent::mexec($requests);
 }