本文整理匯總了PHP中Piwik\API\Request::getRequestArrayFromString方法的典型用法代碼示例。如果您正苦於以下問題:PHP Request::getRequestArrayFromString方法的具體用法?PHP Request::getRequestArrayFromString怎麽用?PHP Request::getRequestArrayFromString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Piwik\API\Request
的用法示例。
在下文中一共展示了Request::getRequestArrayFromString方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: redirectToPaypal
/**
* Redirects the user to a paypal so they can donate to Piwik.
*/
public function redirectToPaypal()
{
$parameters = Request::getRequestArrayFromString($request = null);
foreach ($parameters as $name => $param) {
if ($name == 'idSite' || $name == 'module' || $name == 'action') {
unset($parameters[$name]);
}
}
$url = "https://www.paypal.com/cgi-bin/webscr?" . Url::getQueryStringFromParameters($parameters);
Url::redirectToUrl($url);
exit;
}
示例2: applyGenericFilters
/**
* Second, generic filters (Sort, Limit, Replace Column Names, etc.)
*/
private function applyGenericFilters()
{
$requestArray = $this->request->getRequestArray();
$request = \Piwik\API\Request::getRequestArrayFromString($requestArray);
if (false === $this->config->enable_sort) {
$request['filter_sort_column'] = '';
$request['filter_sort_order'] = '';
}
$genericFilter = new \Piwik\API\DataTableGenericFilter($request);
$genericFilter->filter($this->dataTable);
}
示例3: getBulkRequest
/**
* Performs multiple API requests at once and returns every result.
*
* @param array $urls The array of API requests.
* @return array
*/
public function getBulkRequest($urls)
{
if (empty($urls)) {
return array();
}
$urls = array_map('urldecode', $urls);
$urls = array_map(array('Piwik\\Common', 'unsanitizeInputValue'), $urls);
$result = array();
foreach ($urls as $url) {
$params = Request::getRequestArrayFromString($url . '&format=php&serialize=0');
if (isset($params['urls']) && $params['urls'] == $urls) {
// by default 'urls' is added to $params as Request::getRequestArrayFromString adds all $_GET/$_POST
// default parameters
unset($params['urls']);
}
if (!empty($params['segment']) && strpos($url, 'segment=') > -1) {
// only unsanitize input when segment is actually present in URL, not when it was used from
// $defaultRequest in Request::getRequestArrayFromString from $_GET/$_POST
$params['segment'] = urlencode(Common::unsanitizeInputValue($params['segment']));
}
$req = new Request($params);
$result[] = $req->process();
}
return $result;
}