Exemplo n.º 1
0
 /**
  * @param Nette\Application\Application $app
  * @param Nette\Application\Request $request
  */
 public function onRequest(Nette\Application\Application $app, Nette\Application\Request $request)
 {
     if (Consumerr::isConsole()) {
         Consumerr::setBackgroundJob(TRUE);
         Consumerr::setName('$ ' . basename($_SERVER['argv'][0]) . ' ' . implode(' ', array_slice($_SERVER['argv'], 1)));
     } else {
         $params = $request->getParameters();
         if ($request->method === 'FORWARD' && $request->getPresenterName() === $app->errorPresenter) {
             return;
             //do not replace presenter name with error presenter
         }
         Consumerr::setName($request->getPresenterName() . (isset($params['action']) ? ':' . $params['action'] : ''));
     }
 }