コード例 #1
0
ファイル: Worker.php プロジェクト: AlexCutts/framework
 /**
  * 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;
 }
コード例 #2
0
ファイル: AbstractSerializer.php プロジェクト: asifalimd/core
 /**
  * Get a custom relationship.
  *
  * @param mixed $model
  * @param string $name
  * @return Relationship|null
  */
 protected function getCustomRelationship($model, $name)
 {
     $relationship = static::$dispatcher->until(new GetApiRelationship($this, $name, $model));
     if ($relationship && !$relationship instanceof Relationship) {
         throw new LogicException('GetApiRelationship handler must return an instance of ' . Relationship::class);
     }
     return $relationship;
 }
コード例 #3
0
ファイル: Router.php プロジェクト: sporchia/framework
 /**
  * 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
0
 /**
  * Get a custom relationship.
  *
  * @param string $name
  * @return BuilderInterface|null
  */
 protected function getCustomRelationship($name)
 {
     $builder = static::$dispatcher->until(new GetApiRelationship($this, $name));
     if ($builder && !$builder instanceof BuilderInterface) {
         throw new LogicException('GetApiRelationship handler must return an instance of ' . BuilderInterface::class);
     }
     return $builder;
 }
コード例 #5
0
ファイル: Worker.php プロジェクト: bryanashley/framework
 /**
  * Determine if the daemon should process on this iteration.
  *
  * @return bool
  */
 protected function daemonShouldRun()
 {
     if ($this->manager->isDownForMaintenance() || $this->events->until('illuminate.queue.looping') === false) {
         // If the application is down for maintenance or doesn't want the queues to run
         // we will sleep for one second just in case the developer has it set to not
         // sleep at all. This just prevents CPU from maxing out in this situation.
         $this->sleep(1);
         return false;
     }
     return true;
 }
コード例 #6
0
ファイル: Router.php プロジェクト: hushibing/laravel-5-blog
 /**
  * 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
  *
  * @deprecated since version 5.1.
  */
 public function callRouteFilter($filter, $parameters, $route, $request, $response = null)
 {
     $data = array_merge([$route, $request, $response], $parameters);
     return $this->events->until('router.filter: ' . $filter, $this->cleanFilterParameters($data));
 }
コード例 #7
0
 /**
  * Fire the namespaced validating event.
  *
  * @param  \Illuminate\Database\Eloquent\Model $model
  * @param  string $event
  * @return mixed
  */
 protected function fireSluggingEvent(Model $model, $event)
 {
     return $this->events->until('eloquent.slugging: ' . get_class($model), [$model, $event]);
 }