[李景山php]每天laravel-20160901|Dispatcher-1
2016-06-16 08:53
671 查看
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
相关文章推荐
- 一个关于if else容易迷惑的问题
- PHP5.2.*防止Hash冲突拒绝服务攻击的Patch
- 深入理解PHP之匿名函数
- JSP/PHP基于Ajax的分页功能实现
- 关于PHP通过PDO用中文条件查询MySQL的问题。
- 什么是设计模式
- PHP数据库长连接mysql_pconnect的细节
- Php Installing An Expansion
- rem : web app适配的秘密武器
- jquery高级应用之Deferred对象
- php7 读取php.ini[4]
- PHP+Apache在Windows 9x下的安装和配置
- IIS 6 的 PHP 最佳配置方法
- 安装Apache和PHP的一些补充
- Linux Apache+MySQL+PHP
- 建立Apache+PHP+MySQL数据库驱动的动态网站
- PHP 5.3.0 安装分析心得
- apache 环境下 php 的配置注意事项
- 简单好用的PHP分页类