本文整理汇总了PHP中Am_Request::getParams方法的典型用法代码示例。如果您正苦于以下问题:PHP Am_Request::getParams方法的具体用法?PHP Am_Request::getParams怎么用?PHP Am_Request::getParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Am_Request
的用法示例。
在下文中一共展示了Am_Request::getParams方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkPermissions
/**
* Throws exception if no permissions added
* @param Am_Request $request
* @param array $record
*/
public function checkPermissions(Am_Request $request, $alias, $method)
{
if ($this->getDi()->config->get('api_debug_mode')) {
$this->getDi()->errorLogTable->log('REST API :' . var_export($request->getParams(), true));
}
$event = $this->getDi()->hook->call(Am_Event::API_CHECK_PERMISSIONS, array('request' => $request, 'alias' => $alias, 'method' => $method));
foreach ($event->getReturn() as $return) {
if ($return === true) {
return;
}
// skip checks if allowed by hook
}
$s = $request->getFiltered('_key');
if (empty($s) || strlen($s) < 10) {
throw new Am_Exception_InputError("API Error 10001 - no [key] specified or key is too short");
}
$apikey = $this->getDi()->apiKeyTable->findFirstByKey($s);
if (!$apikey || $apikey->is_disabled) {
throw new Am_Exception_InputError("API Error 10002 - [key] is not found or disabled");
}
$perms = $apikey->getPerms();
if (empty($perms[$alias][$method]) || !$perms[$alias][$method]) {
throw new Am_Exception_InputError("API Error 10003 - no permissions for {$alias}-{$method} API call");
}
}
示例2: directAction
public function directAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
{
if ($request->getActionName() == 'thanks') {
if ($this->getConfig('debugLog')) {
Am_Di::getInstance()->errorLogTable->log('NetBilling Form [response-thanks]:' . json_encode($request->getParams()));
}
$this->invoice = $this->getDi()->invoiceTable->findFirstByPublicId($request->getFiltered('Ecom_ConsumerOrderID'));
$url = $request->get('Ecom_Ezic_Response_StatusCode') == 0 || $request->get('Ecom_Ezic_Response_StatusCode') == 'F' ? $this->getCancelUrl() : $this->getReturnUrl();
$response->setRedirect($url);
} else {
parent::directAction($request, $response, $invokeArgs);
}
}