[Li Jingshan php] every day laravel-20160906| Dispatcher-6

Source: Internet
Author: User
/** * 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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.