本文整理匯總了PHP中XenForo_Link::convertApiUriToAbsoluteUri方法的典型用法代碼示例。如果您正苦於以下問題:PHP XenForo_Link::convertApiUriToAbsoluteUri方法的具體用法?PHP XenForo_Link::convertApiUriToAbsoluteUri怎麽用?PHP XenForo_Link::convertApiUriToAbsoluteUri使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XenForo_Link
的用法示例。
在下文中一共展示了XenForo_Link::convertApiUriToAbsoluteUri方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: doJob
public static function doJob($method, $uri, array $params)
{
$fc = self::getFc();
$request = new bdApi_Zend_Controller_Request_Http(XenForo_Link::convertApiUriToAbsoluteUri($uri, true));
$request->setMethod($method);
foreach ($params as $key => $value) {
$request->setParam($key, $value);
}
$fc->setRequest($request);
// routing
$routeMatch = $fc->getDependencies()->route($request);
if (!$routeMatch or !$routeMatch->getControllerName()) {
list($controllerName, $action) = $fc->getDependencies()->getNotFoundErrorRoute();
$routeMatch->setControllerName($controllerName);
$routeMatch->setAction($action);
}
$response = $fc->dispatch($routeMatch);
if ($response instanceof XenForo_ControllerResponse_Error) {
return array('_job_result' => 'error', '_job_error' => $response->errorText);
} elseif ($response instanceof XenForo_ControllerResponse_Exception) {
return array('_job_result' => 'error', '_job_error' => $response->getMessage());
} elseif ($response instanceof XenForo_ControllerResponse_Message) {
return array('_job_result' => 'message', '_job_message' => $response->message);
} elseif ($response instanceof XenForo_ControllerResponse_View) {
return array('_job_result' => 'ok', '_job_response' => $response);
}
throw new XenForo_Exception('Unexpected $response occurred.');
}