[李景山php]每天laravel-20160901|Dispatcher-1

namespace Illuminate\Events;

use Exception;
use ReflectionClass;
use Illuminate\Support\Str;
use Illuminate\Container\Container;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
use Illuminate\Contracts\Container\Container as ContainerContract;
// use namespace
class Dispatcher implements DispatcherContract
{// a Dispatcher implements Dispatcher Contract
    /**
     * The IoC container instance.
     *
     * @var \Illuminate\Contracts\Container\Container
     */
    protected $container;// The Ioc container instance.

    /**
     * The registered event listeners.
     *
     * @var array
     */
    protected $listeners = [];// listeners be registered

    /**
     * The wildcard listeners.
     *
     * @var array
     */
    protected $wildcards = [];// The wildcard listeners. like store

    /**
     * The sorted event listeners.
     *
     * @var array
     */
    protected $sorted = [];// The sorted event listeners.

    /**
     * The event firing stack.
     *
     * @var array
     */
    protected $firing = [];//The event firing stack.

    /**
     * The queue resolver instance.
     *
     * @var callable
     */
    protected $queueResolver;// The queue resolver instance.

   // at last ,we find to instance ,some listeners

    /**
     * Create a new event dispatcher instance.
     *
     * @param  \Illuminate\Contracts\Container\Container|null  $container
     * @return void
     */
   // dispathcer is use to make it like you want
    public function __construct(ContainerContract $container = null)
    {
        $this->container = $container ?: new Container;
    }// ContainerContract is $contanier
时间: 2024-08-02 17:55:26

[李景山php]每天laravel-20160901|Dispatcher-1的相关文章

[李景山php]每天laravel-20160920|Writer-2

    //2016-07-20     /**      * Register a file log handler.      *      * @param  string  $path      * @param  string  $level      * @return void      */     public function useFiles($path, $level = 'debug')     {         $this->monolog->pushHandle

[李景山php]每天laravel-20160902|Dispatcher-2

/**  * Register an event listener with the dispatcher.  *  * @param  string|array  $events  * @param  mixed  $listener  * @param  int  $priority  * @return void  */ public function listen($events, $listener, $priority = 0) {// Register an event liste

[李景山php]每天laravel-20160831|EventServiceProvider

<?php namespace Illuminate\Events; use Illuminate\Support\ServiceProvider; class EventServiceProvider extends ServiceProvider {// Event Service Provider extends Service Provider     /**      * Register the service provider.      *      * @return void

[李景山php]每天laravel-20161112|Factory-3.php

    /**      * Parse a class based composer name.      *      * @param  string  $class      * @param  string  $prefix      * @return array      */     protected function parseClassEvent($class, $prefix)     {//Parse a class based composer name.      

[李景山php]每天laravel-20161110|Factory.php

<?php namespace Illuminate\View; use Closure; use Illuminate\Support\Arr; use Illuminate\Support\Str; use InvalidArgumentException; use Illuminate\Contracts\Support\Arrayable; use Illuminate\View\Engines\EngineResolver; use Illuminate\Contracts\Event

[李景山php]每天laravel-20161111|Factory-2.php

    /**      * Get the evaluated view contents for the given view.      *      * @param  string  $view      * @param  array   $data      * @param  array   $mergeData      * @return \Illuminate\Contracts\View\View      */     public function make($vie

[李景山php]每天laravel-20161021|Request.php-2

/**  * Determine if the current request URL and query string matches a pattern.  *  * @param  mixed  string  * @return bool  */ public function fullUrlIs() {// check string like URL     $url = $this->fullUrl();     foreach (func_get_args() as $patter

[李景山php]每天laravel-20160908|Dispatcher-8

    /**      * Create the class based event callable.      *      * @param  string  $listener      * @param  \Illuminate\Container\Container  $container      * @return callable      */     protected function createClassCallable($listener, $container)

[李景山php]每天laravel-20160903|Dispatcher-3

   /**     * Setup a wildcard listener callback.     *     * @param  string  $event     * @param  mixed  $listener     * @return void     */    protected function setupWildcardListen($event, $listener)    {        $this->wildcards[$event][] = $this->