/** * Execute the registered Adapters and return a processed response. * * @return array */ public function execute() { // Fire the CRON Event and retrieve the results. $responses = $this->events->fire('cron.execute'); // Extract the not null items from the responses. $result = array_filter($responses, function ($value) { return !is_null($value); }); return $result; }
/** * Fires a log event. * * @param string $level * @param string $message * @param array $context * @return void */ protected function fireLogEvent($level, $message, array $context = array()) { // If the event dispatcher is set, we will pass along the parameters to the // log listeners. These are useful for building profilers or other tools // that aggregate all of the log messages for a given "request" cycle. if (isset($this->dispatcher)) { $this->dispatcher->fire('nova.log', compact('level', 'message', 'context')); } }
/** * Send a Swift Message instance. * * @param \Swift_Message $message * @return void */ protected function sendSwiftMessage($message) { if ($this->events) { $this->events->fire('mailer.sending', array($message)); } if (!$this->pretending) { $this->swift->send($message, $this->failedRecipients); } else { if (isset($this->logger)) { $this->logMessage($message); } } }
/** * Dispatch the request to a route and return the response. * * @param \Nova\Http\Request $request * @return mixed */ public function dispatchToRoute(Request $request) { $route = $this->findRoute($request); $this->events->fire('router.matched', array($route, $request)); // Once we have successfully matched the incoming request to a given route we // can call the before filters on that route. This works similar to global // filters in that if a response is returned we will not call the route. $response = $this->callRouteBefore($route, $request); if (is_null($response)) { $response = $route->run($request); } $response = $this->prepareResponse($request, $response); // After we have a prepared response from the route or filter we will call to // the "after" filters to do any last minute processing on this request or // response object before the response is returned back to the consumer. $this->callRouteAfter($route, $request, $response); return $response; }
/** * Log the user out of the application. * * @return void */ public function logout() { $user = $this->user(); // If we have an event dispatcher instance, we can fire off the logout event // so any further processing can be done. This allows the developer to be // listening for anytime a user signs out of this application manually. $this->clearUserDataFromStorage(); if (!is_null($this->user)) { $this->refreshRememberToken($user); } if (isset($this->events)) { $this->events->fire('auth.logout', array($user)); } // Once we have fired the logout event we will clear the users out of memory // so they are no longer available as the user is no longer considered as // being signed into this application and should not be available here. $this->user = null; $this->loggedOut = true; }
/** * Fire an event for this connection. * * @param string $event * @return void */ protected function fireConnectionEvent($event) { if (isset($this->events)) { $this->events->fire('connection.' . $this->getName() . '.' . $event, $this); } }