public function startup() { parent::startup(); \Tracy\Debugger::timer('global'); // Log visits // todo: replace by mongoDB log_visit /* $httpRequest = $this->getHttpRequest(); $requestHeaders = apache_request_headers(); $ipAddress = (empty($requestHeaders['X-Forwarded-For']) ? $httpRequest->getRemoteAddress() : $requestHeaders['X-Forwarded-For']); // ip address can be more values divided by comma (it's path to remote server), take only the last (most accurate IP of visitor) $ipAddressParts = explode(',', $ipAddress); $ipAddress = array_pop($ipAddressParts); if ($httpRequest->getUrl()->path != '/healthy-check') { $this->lastLogItem = $this->logger->logVisit( $httpRequest->getUrl()->path, // URL $ipAddress, // IP $httpRequest->getHeader('User-Agent'), // USER_AGENT $httpRequest->getReferer() // REFERRER ); }*/ }
protected function startup() { parent::startup(); \Stopwatch::start('BasePresenter'); AntispamControl::register(); AntispamControl::$minDelay = 2; if ($this->isAjax()) { $this->payload->doNotSave = false; } //$this->getSession('agility')->setExpiration('+ 1 years'); // set up session $this->permissionRepository = $this->context->permissionRepository; $this->itemRepository = $this->context->itemRepository; $this->calendarRepository = $this->context->calendarRepository; $this->pages = $this->context->parameters["pageLayout"]; /** * Create list of used JS and CSS files */ $this->jsFiles = array(APP_DIR . '/templates/javascript/libs/jquery-1.8.2.min.js', APP_DIR . '/templates/javascript/libs/jquery-ui-1.9.1.custom.min.js', APP_DIR . '/templates/javascript/libs/transify-min.js', APP_DIR . '/templates/javascript/libs/nette.ajax.js', APP_DIR . '/templates/javascript/libs/nette-extension/spinner.ajax.js', APP_DIR . '/templates/javascript/libs/nette-extension/diagnostics.dumps.ajax.js', APP_DIR . '/templates/javascript/libs/netteForms-live.js', APP_DIR . '/templates/javascript/libs/nette-extension/history.ajax.js', 'init.js', 'ui.js', 'calendar.js'); $this->jsFilesIE['mediaQuery'] = 'ie.mediaqueries.replacement.js'; $this->cssFiles = array('jqueryui' => 'jquery-ui-1.9.1.custom.min.css', 'calendart' => 'eventCalendar.less', 'screen' => 'screen.less', 'screen.layout' => 'screen.layout.less', 'screen.content' => 'screen.content.less', 'screen.colors' => 'screen.colors.less'); $this->cssFilesOldIE['IE'] = APP_DIR . '/templates/less/screen.old.ie.less'; $this->cssFilesPrint['print'] = 'print.less'; if ($this->getUser()->isLoggedIn()) { $this->jsFiles[] = 'admin.js'; } }
public function startup() { parent::startup(); \AntispamControl::register(); $this->productionMode = $this->context->parameters['productionMode']; $this->sendEmails = $this->context->parameters['sendEmails']; $this->template->productionMode = $this->productionMode; }
public function startup() { parent::startup(); \Nette\Diagnostics\Debugger::timer('global'); $httpRequest = $this->getHttpRequest(); // Log visits $ipAddress = empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? $this->getHttpRequest()->getRemoteAddress() : $_SERVER['HTTP_X_FORWARDED_FOR']; // ip address can be more values divided by comma (it's path to remote server), take only the last (most accurate IP of visitor) $ipAddressParts = explode(',', $ipAddress); $ipAddress = array_pop($ipAddressParts); if ($httpRequest->getUrl()->path != '/healthy-check') { $this->lastLogItem = $this->logger->logVisit($httpRequest->getUrl()->path, $ipAddress, $httpRequest->getHeader('User-Agent'), $httpRequest->getReferer()); } }
public function startup() { parent::startup(); $this->context->documentManager; }
protected function startup() { parent::startup(); $this->taskLists = $this->context->taskLists; }