/** * Broadcast the given event class. * * @param \illuminate\contracts\broadcasting\shouldbroadcast $event * @return void */protected functionbroadcastevent($event) {// Why use this function name is broadcast//event class means event instanceif($this->queueresolver) {//Use this queueresolver function$connection=$eventinstanceofShouldbroadcastnow?' 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 */ Public functiongetlisteners($eventName) {//Get All of the listeners for a given event name.$wildcards=$this->getwildcardlisteners ($eventName);//Get the wild card by eventsname with the This function, which name is Cardlisters// First Use EventNameif(!isset($this->sorted[$eventName])) {$this->sortlisteners ($eventName);//Use this sort Listeners}//If isset eventsname never be sort,returnArray_merge ($this->sorted[$eventName],$wildcards);//Array_merge}/** * Get The wildcard listeners for the event. * * @param string $eventName * @return Array */protected functiongetwildcardlisteners($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); }); });
The above describes the [Li Jingshan PHP] Daily laravel-20160906| Dispatcher-6, including the aspects of the content, want to be interested in PHP tutorial friends helpful.