[Li Jingshan php]daily laravel-20160906|Dispatcher-6

WBOY
Release: 2016-07-28 08:29:34
Original
1410 people have browsed it

/** * 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
Copy after login
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces [Li Jingshan php] laravel-20160906|Dispatcher-6 every day, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!