/** * @return void */ protected function matchRoute() { if (isset($this->routeCollection)) { $context = new WebRequestContext(); $context->fromWebRequest($this->request); $matcher = new RouteMatcher($this->routeCollection, $context); try { Logger::debug('Looking for route match: ' . $this->request->getPathInfo()); $parameters = $matcher->match($this->request->getPathInfo()); if (is_array($matcher->getRouteOption('parameters'))) { $this->parameters = array_merge($this->parameters, $matcher->getRouteOption('parameters')); } } catch (ResourceNotFoundException $ex) { // Use our DefaultController $parameters = $this->getDefaultController(); } } else { // no route to match against, so use the DefaultController $parameters = $this->getDefaultController(); } if (!isset($parameters)) { Logger::alert('Route not found'); } else { $this->parseRouteParameters($parameters); Logger::debug('Route matched: ' . $this->route); } }
public function __destruct() { if (isset($this->process_pid)) { Logger::alert('Daemon process ' . getmypid() . ' ended'); } else { Logger::debug('parent process ' . getmypid() . ' ended'); } parent::__destruct(); }