-
Notifications
You must be signed in to change notification settings - Fork 0
/
include.php
48 lines (36 loc) · 1.37 KB
/
include.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
namespace Fi1a\BitrixRequire;
use Bitrix\Main\Loader;
use Bitrix\Main\Localization\Loc;
use Fi1a\BitrixRequire\Helpers\ModuleRegistry;
require_once __DIR__ . '/vendor/autoload.php';
$composerApi = new ComposerApi();
$autoloadPath = $composerApi->getVendorDir() . '/vendor/autoload.php';
if (is_file($autoloadPath)) {
require_once $autoloadPath;
}
$classLocFilePaths = [
__DIR__ . '/lib/ActionFilter/Rights.php',
__DIR__ . '/lib/Services/ComposerService.php',
__DIR__ . '/lib/ComposerApi.php',
__DIR__ . '/lib/ModulePackages.php',
];
foreach ($classLocFilePaths as $classLocFilePath) {
Loc::loadMessages($classLocFilePath);
}
Loader::registerAutoloadClasses(
'fi1a.bitrixrequire',
[
// Хелперы
'\Fi1a\BitrixRequire\Helpers\ModuleRegistry' => 'lib/Helpers/ModuleRegistry.php',
'Fi1a\BitrixRequire\Helpers\Flush' => 'lib/Helpers/Flush.php',
// Сервисы
'\Fi1a\BitrixRequire\Services\ComposerServiceInterface' => 'lib/Services/ComposerServiceInterface.php',
'\Fi1a\BitrixRequire\Services\ComposerService' => 'lib/Services/ComposerService.php',
// Composer API
'\Fi1a\BitrixRequire\ComposerApiInterface' => 'lib/ComposerApiInterface.php',
'\Fi1a\BitrixRequire\ComposerApi' => 'lib/ComposerApi.php',
]
);
global $APPLICATION;
ModuleRegistry::configure($APPLICATION);