-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbxc.php
executable file
·31 lines (24 loc) · 1.44 KB
/
bxc.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
#!/usr/bin/env php
<?php
require_once dirname(__FILE__) . '/autoload.php';
use Symfony\Component\Console\Application;
//FIXME: Хак, но пока штатно не реализован CliApplication в Битриксе, у нас выхода другого нет.
$_SERVER['DOCUMENT_ROOT'] = BitrixTool\BitrixTool::getInstance()->getSiteRoot();
$DOCUMENT_ROOT = $_SERVER["DOCUMENT_ROOT"];
define("NO_KEEP_STATISTIC", true);
define("NOT_CHECK_PERMISSIONS", true);
set_time_limit(0);
define("LANG", "ru");
$prolog = $_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/prolog_before.php";
if (file_exists($prolog)) include($prolog); else die("Not in a Bitrix site root." . PHP_EOL);
$app = new Application('BitrixTool', BitrixTool\BitrixTool::VERSION);
$app->add(new BitrixTool\Commands\ShowWebRootCommand('show-web-root'));
$app->add(new BitrixTool\Commands\TemplatesListCommand('templates:list'));
$app->add(new BitrixTool\Commands\TemplatesCopyCommand('templates:copy'));
$app->add(new BitrixTool\Commands\ComponentsListCommand('components:list'));
$app->add(new BitrixTool\Commands\IBlockListTypesCommand('iblock:types'));
$app->add(new BitrixTool\Commands\IBlockListCommand('iblock:list'));
$app->add(new BitrixTool\Commands\GenerateIncludeCommand('generate:include'));
$app->add(new BitrixTool\Commands\GenerateComponentCommand('generate:component'));
$app->run();
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_after.php");