本文整理汇总了PHP中Illuminate\Events\Dispatcher::until方法的典型用法代码示例。如果您正苦于以下问题:PHP Dispatcher::until方法的具体用法?PHP Dispatcher::until怎么用?PHP Dispatcher::until使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Events\Dispatcher
的用法示例。
在下文中一共展示了Dispatcher::until方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filter
/**
* @param $route
* @param $request
* @param null $scope
* @return null|BridgeResponse
*/
public function filter($route, $request, $scope = null)
{
$beforeAccessResult = $this->dispatcher->until('oauth.access.before', array($scope));
if ($beforeAccessResult) {
return null;
}
/** @var BridgeRequest $bridgeRequest */
$bridgeRequest = BridgeRequest::createFromRequest($request);
$bridgeResponse = new BridgeResponse();
$resController = $this->server->getResourceController();
if (!$resController->verifyResourceRequest($bridgeRequest, $bridgeResponse, $scope)) {
$this->dispatcher->fire('oauth.access.failed');
return $bridgeResponse;
}
$token = $resController->getAccessTokenData($bridgeRequest, $bridgeResponse);
$client = $this->clientRepo->find($token['client_id']);
$tokenScope = $token['scope'];
$user = null;
if (isset($token['user_id'])) {
$user = $this->userProvider->retrieveById($token['user_id']);
}
if ($tokenScope) {
$tokenScope = explode(' ', $tokenScope);
}
$eventPayload = array($client, $user, $tokenScope);
$this->dispatcher->fire('oauth.access.valid', $eventPayload);
}
示例2: daemonShouldRun
/**
* Determine if the daemon should process on this iteration.
*
* @return bool
*/
protected function daemonShouldRun()
{
if ($this->manager->isDownForMaintenance()) {
return false;
}
return $this->events->until('illuminate.queue.looping') !== false;
}
示例3: callRouteFilter
/**
* Call the given route filter.
*
* @param string $filter
* @param array $parameters
* @param \Illuminate\Routing\Route $route
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Http\Response|null $response
* @return mixed
*/
public function callRouteFilter($filter, $parameters, $route, $request, $response = null)
{
if (!$this->filtering) {
return null;
}
$data = array_merge(array($route, $request, $response), $parameters);
return $this->events->until('router.filter: ' . $filter, $this->cleanFilterParameters($data));
}
示例4: until
/**
* Fire an event until the first non-null response is returned.
*
* @param string|object $event
* @param array $payload
* @return mixed
* @static
*/
public static function until($event, $payload = array())
{
return \Illuminate\Events\Dispatcher::until($event, $payload);
}
示例5: daemonShouldRun
/**
* Determine if the daemon should process on this iteration.
*
* @return bool
*/
protected function daemonShouldRun()
{
return $this->events->until('illuminate.queue.looping') !== false;
}