public function bootstrap($app) { parent::bootstrap($app); $app->on(Application::EVENT_AFTER_ACTION, function () use($app) { foreach ($app->requestedParams as $key => $value) { $this->getAgent()->backgroundJob(); $this->getAgent()->addCustomParameter($key, var_export($value, true)); } }); }
public function bootstrap($app) { parent::bootstrap($app); if ($this->newrelic->enableEndUser) { $app->on(Application::EVENT_BEFORE_ACTION, function () use($app, &$agent) { $app->controller->view->registerJs(preg_replace('#</?script( type="text/javascript")?>#', '', $this->getAgent()->getBrowserTimingHeader()), View::POS_HEAD, 'newrelic-head'); $app->controller->view->registerJs(preg_replace('#</?script( type="text/javascript")?>#', '', $this->getAgent()->getBrowserTimingFooter()), View::POS_END, 'newrelic-end'); }); } $app->on(Application::EVENT_AFTER_ACTION, function () use($app) { foreach ($app->controller->actionParams as $key => $value) { $this->getAgent()->addCustomParameter($key, var_export($value, true)); } }); }
/** * @inheritdoc */ public function bootstrap($app) { if (!$this->enabled) { return; } if ($this->handler) { $handler = new $this->handler(['newrelic' => $this]); } elseif ($app instanceof \yii\web\Application) { $handler = new WebHandler(['newrelic' => $this]); } elseif ($app instanceof \yii\console\Application) { $handler = new ConsoleHandler(['newrelic' => $this]); } else { $handler = new BaseHandler(['newrelic' => $this]); } $handler->bootstrap($app); }