本文整理汇总了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.');
}