bitrix.php)
Baseline: main 23.0+ · Verified: main 26.800.0
cd /var/www/site && php bitrix/bitrix.php list # or: cd bitrix && php bitrix.php list
php bitrix/bitrix.php help make:service
php bitrix/bitrix.php make:service Post -m vendor.blog -n # -n: no questions
| Task | Read |
|---|---|
Generators make:*, which exist on 25.x, output paths |
rules/generators.md |
Kernel commands: orm:annotate, messenger:consume, update:*, translate:index |
rules/generators.md |
| Own command, registration, cron | rules/custom-command.md |
Invariants
- Needs Symfony Console from Composer:
composer.jsonwithsymfony/consoleand.settings.phpcomposer.config_path(bitrix-settings); otherwisebitrix.phpprints "Symfony Console is not installed". DOCUMENT_ROOTis derived fromgetcwd()+ script path: run from the site root orbitrix/, neverphp /abs/path/bitrix.phpfrom another dir.- Commands come only from installed modules'
.settings.php→console.commands; global/local/.settings.phpis not a source. - The kernel does
new $commandClass()— no constructor DI; resolve services inexecute()(bitrix-framework). - Always
-n/--no-interactionin cron and CI.