|
1 | 1 | <?php |
2 | 2 |
|
3 | 3 | use Bitrix\Main\Loader; |
4 | | -use ProklUng\Module\Boilerplate\Options\ModuleManager; |
5 | | -use Proklung\Symfony\Router\Subscribers\OnAfterSaveOptionsHandler; |
6 | | -use Proklung\Symfony\Router\Subscribers\ValidatorNativeConfigs; |
7 | | -use Proklung\Symfony\Router\Subscribers\ValidatorSymfonyConfigs; |
| 4 | +use Proklung\Symfony\Router\Utils\Bootstrap; |
8 | 5 |
|
9 | | -Loader::registerAutoLoadClasses( |
10 | | - 'proklung.symfony.router', |
| 6 | +Loader::registerAutoLoadClasses('proklung.symfony.router', |
11 | 7 | [ |
12 | 8 | 'proklung_symfony_router' => 'install/index.php', |
13 | 9 | ] |
14 | 10 | ); |
15 | 11 |
|
16 | | -$moduleManager = new ModuleManager('proklung.symfony.router'); |
17 | | -$configFilePath = $moduleManager->get('yaml_config_file_path'); |
18 | | -$cachePath = $moduleManager->get('yaml_cache_path'); |
19 | | - |
20 | | -\Bitrix\Main\EventManager::getInstance()->addEventHandler( |
21 | | - $moduleManager->getModuleId(), |
22 | | - 'OnAfterSaveOptions', |
23 | | - [new OnAfterSaveOptionsHandler, 'handler'] |
24 | | -); |
25 | | - |
26 | | -\Bitrix\Main\EventManager::getInstance()->addEventHandler( |
27 | | - $moduleManager->getModuleId(), |
28 | | - 'OnBeforeSetOption', |
29 | | - [new ValidatorNativeConfigs, 'handler'] |
30 | | -); |
31 | | - |
32 | | -\Bitrix\Main\EventManager::getInstance()->addEventHandler( |
33 | | - $moduleManager->getModuleId(), |
34 | | - 'OnBeforeSetOption', |
35 | | - [new ValidatorSymfonyConfigs, 'handler'] |
36 | | -); |
37 | | - |
38 | | -$routerInstance = \Proklung\Symfony\Router\Utils\Loader::from($configFilePath, $cachePath); |
39 | | - |
40 | | -if (Proklung\Symfony\Router\Utils\Loader::checkRequirements()) { |
41 | | - $configBitrixRoutesPath = $moduleManager->get('native_config_file_path'); |
42 | | - $cacheBitrixRoutesPath = $moduleManager->get('native_yaml_cache_path'); |
43 | | - $phpConfigFile = $moduleManager->get('php_router_config_path'); |
44 | | - |
45 | | - $routeConvertor = Proklung\Symfony\Router\Utils\Loader::native($configBitrixRoutesPath, $cacheBitrixRoutesPath); |
46 | | - if ($routeConvertor !== null) { |
47 | | - Proklung\Symfony\Router\Utils\Loader::save($phpConfigFile, $routeConvertor); |
48 | | - } |
49 | | -} |
| 12 | +$bootstrapModule = new Bootstrap(); |
| 13 | +$bootstrapModule->init(); |
0 commit comments