/**
* Broadcast the given event class.
*
* @param \Illuminate\Contracts\Broadcasting\ShouldBroadcast $event
* @return void
*/protectedfunctionbroadcastEvent($event)
{// why use this function name is broadcast// event class means event instanceif ($this->queueResolver) {// use this queueResolver function$connection = $eventinstanceof ShouldBroadcastNow ? 'sync' : null;// determine this instance about$queue = method_exists($event, 'onQueue') ? $event->onQueue() : null;// determine method_exits$this->resolveQueue()->connection($connection)->pushOn($queue, 'Illuminate\Broadcasting\BroadcastEvent', [
'event' => serialize(clone$event),
]);// good look bad use ,maybe
}
}
/**
* Get all of the listeners for a given event name.
*
* @param string $eventName
* @return array
*/publicfunctiongetListeners($eventName)
{// Get all of the listeners for a given event name.$wildcards = $this->getWildcardListeners($eventName);// get the wild card by eventsName use this function ,that name is cardlisters// first use eventNameif (! isset($this->sorted[$eventName])) {
$this->sortListeners($eventName);// use this sort Listeners
}// if isset eventsName never be sort ,return array_merge($this->sorted[$eventName], $wildcards);// array_merge
}
/**
* Get the wildcard listeners for the event.
*
* @param string $eventName
* @return array
*/protectedfunctiongetWildcardListeners($eventName)
{$wildcards = [];// getWildcardListeners() set the listenerforeach ($this->wildcards as$key => $listeners) {// foreach $this->wildcards as keyif (Str::is($key, $eventName)) {// determine is a str$wildcards = array_merge($wildcards, $listeners); // get the array_merge
}
}
return$wildcards;
}
// first get listener,second get the wildcard listener
').addClass('pre-numbering').hide();
$(this).addClass('has-numbering').parent().append($numbering);
for (i = 1; i <= lines; i++) {
$numbering.append($('').text(i));
};
$numbering.fadeIn(1700);
});
});
以上就介绍了 [李景山php]每天laravel-20160906|Dispatcher-6,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
![php中文网最新课程二维码](/static/images/article_wechat2021.jpg?1111)
声明:本文原创发布php中文网,转载请注明出处,感谢您的尊重!如有疑问,请联系admin@php.cn处理
网友评论
文明上网理性发言,请遵守 新闻评论服务协议
我要评论