当前位置: 首页>>代码示例>>PHP>>正文


PHP Event::firing方法代码示例

本文整理汇总了PHP中Illuminate\Support\Facades\Event::firing方法的典型用法代码示例。如果您正苦于以下问题:PHP Event::firing方法的具体用法?PHP Event::firing怎么用?PHP Event::firing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Support\Facades\Event的用法示例。


在下文中一共展示了Event::firing方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: registerListeners

 /**
  *
  */
 protected function registerListeners()
 {
     EventFacade::listen('*', function ($param) {
         $this->data[] = ['name' => EventFacade::firing(), 'param' => $param, 'time' => microtime(true)];
         $this->stream();
     });
 }
开发者ID:ndrx-io,项目名称:profiler-laravel,代码行数:10,代码来源:Event.php

示例2: register

 public function register()
 {
     foreach ($this->listening as $webookable) {
         $this->app['events']->listen($webookable, function ($event) use($webookable) {
             if (!Config::get("seeding")) {
                 $this->react(Event::firing(), $event);
             }
         });
     }
 }
开发者ID:alfred-nutile-inc,项目名称:webhooks,代码行数:10,代码来源:WebhooksServiceProvider.php

示例3: registerEloquentEvents

 protected function registerEloquentEvents()
 {
     // Flush Elegant cache when anything changes for models registered by Elegant
     Event::listen('eloquent.*', function ($caller) {
         $callerClass = get_class($caller);
         if (!in_array($callerClass, ElegantConfig::getModelsAsClassNames())) {
             return;
         }
         if (in_array(Event::firing(), ['eloquent.saved', 'eloquent.deleted', 'eloquent.updated', 'eloquent.created']) && $this->cacheIsTaggable()) {
             Cache::tags('elegant-' . Support\ElegantModel::normalizeClassName($callerClass))->flush();
         }
     });
 }
开发者ID:pixelindustries,项目名称:elegant-asgard,代码行数:13,代码来源:ElegantServiceProvider.php

示例4: __construct

 /**
  * EventsDataSource constructor.
  */
 public function __construct()
 {
     $this->events = [];
     Event::listen('*', function ($param) {
         /** @todo fix that shit */
         if (!class_exists('events')) {
             return;
         }
         $this->events[] = ['name' => Event::firing(), 'param' => json_encode($param), 'time' => microtime(true)];
         $currentTime = microtime(true);
         Clockwork::addEvent(uniqid('event_'), Event::firing(), $currentTime, $currentTime);
     });
 }
开发者ID:lahaxearnaud,项目名称:clockwork,代码行数:16,代码来源:EventsDataSource.php

示例5: testRun

 public function testRun()
 {
     $dsn = 'ipc://test-run.ipc';
     if (!($pid = pcntl_fork())) {
         $listener = new EventListener(['bind' => $dsn]);
         Event::listen('request.event', function () use($listener) {
             $listener->socket()->push(Event::firing(), func_get_args());
             Event::fire('zeroevents.service.stop');
         });
         (new EventService())->listen($listener)->run();
         exit;
     }
     $listener = new EventListener(['connect' => $dsn]);
     Event::listen('request.event', $listener);
     Event::fire('request.event', ['source', 'parent']);
     $this->assertSame(['event' => 'request.event', 'payload' => ['source', 'parent'], 'address' => null], $listener->socket()->pull());
     pcntl_wait($status);
     posix_kill($pid, SIGKILL);
 }
开发者ID:ptrofimov,项目名称:zeroevents,代码行数:19,代码来源:EventServiceTest.php

示例6: handleEvent

 /**
  * Event listener.
  *
  * @param $eventData
  */
 public function handleEvent($eventData)
 {
     $eventName = Event::firing();
     $webhooks = $this->getWebhooks()->where("event", $eventName);
     $webhooks = $webhooks->filter($this->config->get("captain_hook.filter", null));
     $this->callWebhooks($webhooks, $eventData);
 }
开发者ID:sschlein,项目名称:captainhook,代码行数:12,代码来源:CaptainHookServiceProvider.php

示例7: handleEvent

 /**
  * Event listener.
  *
  * @param $eventData
  */
 public function handleEvent($eventData)
 {
     $eventName = Event::firing();
     $webhooks = $this->getWebhooks()->where('event', $eventName);
     $webhooks = $webhooks->filter($this->config->get('captain_hook.filter', null));
     if (!$webhooks->isEmpty()) {
         $this->dispatch(new TriggerWebhooksJob($webhooks, $eventData));
     }
 }
开发者ID:mpociot,项目名称:captainhook,代码行数:14,代码来源:CaptainHookServiceProvider.php

示例8: testPullAndFire

 public function testPullAndFire()
 {
     $dsn = 'ipc://test-pull-and-fire.ipc';
     if (!($pid = pcntl_fork())) {
         $socket = $this->socket();
         $socket->bind($dsn);
         $socket->push('response.event', [$socket->pull()]);
         exit;
     }
     $socket = $this->socket();
     $socket->connect($dsn)->push('request.event', ['source', 'parent']);
     $event = null;
     Event::listen('response.event', function () use(&$event) {
         $event = ['event' => Event::firing(), 'payload' => func_get_args()];
         return true;
     });
     $this->assertTrue($socket->pullAndFire());
     $this->assertSame(['event' => 'response.event', 'payload' => [['event' => 'request.event', 'payload' => ['source', 'parent'], 'address' => null]]], $event);
     posix_kill($pid, SIGKILL);
     @unlink('test-pull-and-fire.ipc');
 }
开发者ID:ptrofimov,项目名称:zeroevents,代码行数:21,代码来源:EventSocketTest.php

示例9: logEvent

 /**
  * Log Esensi events to the info log.
  *
  * @return void
  */
 public function logEvent()
 {
     if (config('app.debug')) {
         Log::info(Event::firing());
     }
 }
开发者ID:esensi,项目名称:core,代码行数:11,代码来源:EsensiEventListener.php

示例10: __invoke

 /**
  * Magic method for event dispatcher
  *
  * @return mixed
  */
 public function __invoke()
 {
     return $this->socket()->push(Event::firing(), func_get_args());
 }
开发者ID:ptrofimov,项目名称:zeroevents,代码行数:9,代码来源:EventListener.php


注:本文中的Illuminate\Support\Facades\Event::firing方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。