/** * Initializes application kernel. * Ўаблонный метод определ¤ет основу алгоритма и позвол¤ет наследникам переопредел¤ть * некоторые шаги алгоритма, не измен¤¤ его структуру в целом. * * @param System\IApplicationStrategy $initStrategy */ protected final function initializeKernel(\Bitrix\Main\System\IApplicationStrategy $initStrategy = null) { /*** Ѕазова¤ инициализаци¤, без которой нельз¤ ***/ $this->initializeExceptionHandler(); //<start.php> // подключение конфига // константы // соединение $this->createDatabaseConnection(); if ($initStrategy != null) { $initStrategy->createDatabaseConnection(); } // в проактивной защите нужно делать поддержку контекста $this->initializeContext(); if ($initStrategy != null) { $initStrategy->initializeContext(); } /// это не нужно //</start.php> //<include.php> //error_reporting(\COption::getOptionInt("main", "error_reporting", E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR|E_PARSE) & ~E_STRICT); // это видимо на страницу, но нужно до апдейтера //if(!defined("BX_COMP_MANAGED_CACHE") && \COption::getOptionString("main", "component_managed_cache_on", "Y") <> "N") // define("BX_COMP_MANAGED_CACHE", true); // определ¤етс¤ сайт и ¤зык // видимо, определение ¤зыка нужно куда-то отдельно // и там еще $APPLICATION->reinitPath $this->initializeCulture(); // добавить после этого инициализацию переменных $this->initializeBasicKernel(); if ($initStrategy != null) { $initStrategy->initializeBasicKernel(); } /*** Ћицензии и обновлени¤ ***/ $this->updateMainDb(); // нужны переделки контроллера и тогда делать редирект $this->updateModulesDB(); $this->initializeDispatcher(); if ($initStrategy != null) { $initStrategy->initializeDispatcher(); } /*** ѕереопределение пути ***/ $this->rewriteUrlIfNeeded(); /*** –асширенна¤ инициализаци¤ ***/ // выполнение кастомных скриптов инициализации и определение констант после init.php $this->runInitScripts(); if ($initStrategy != null) { $initStrategy->runInitScripts(); } $this->initializeExtendedKernel(); if ($initStrategy != null) { $initStrategy->initializeExtendedKernel(); } }
/** * Initializes application shell. Called after initializeKernel. * * @param System\IApplicationStrategy $initStrategy */ protected function initializeShell(\Bitrix\Main\System\IApplicationStrategy $initStrategy = null) { $this->authenticateUser(); if ($initStrategy != null) { $initStrategy->authenticateUser(); } define("BX_STARTED", true); // required for iblock to define site //magic parameters: show page creation time if ($_GET["show_page_exec_time"] == "Y" || $_GET["show_page_exec_time"] == "N") { $_SESSION["SESS_SHOW_TIME_EXEC"] = $_GET["show_page_exec_time"]; } //magic parameters: show included file processing time if ($_GET["show_include_exec_time"] == "Y" || $_GET["show_include_exec_time"] == "N") { $_SESSION["SESS_SHOW_INCLUDE_TIME_EXEC"] = $_GET["show_include_exec_time"]; } //magic parameters: show include areas if (isset($_GET["bitrix_include_areas"]) && $_GET["bitrix_include_areas"] != "") { $GLOBALS["APPLICATION"]->setShowIncludeAreas($_GET["bitrix_include_areas"] == "Y"); } //magic sound /** @var $context HttpContext */ $context = $this->context; $user = $context->getUser(); /** @var $request HttpRequest */ $request = $context->getRequest(); if ($user->isAuthenticated() && $request->getCookie("SOUND_LOGIN_PLAYED") == null) { /** @var $response HttpResponse */ $response = $context->getResponse(); $response->addCookie(new \Bitrix\Main\Web\Cookie('SOUND_LOGIN_PLAYED', 'Y', 0)); } $event = new Event("main", "OnBeforeProlog"); $event->send(); $this->authorizeUser(); if ($initStrategy != null) { $initStrategy->authorizeUser(); } }