drjele / symfony-command
This package is abandoned and no longer maintained.
The author suggests using the drjele/symfony-console package instead.
Symfony command utilities
v4.0.0
2021-12-07 15:37 UTC
Requires
- php: ^8.0
- symfony/config: ^4.0|^5.0|^6.0
- symfony/console: ^4.0|^5.0|^6.0
- symfony/dependency-injection: ^4.0|^5.0|^6.0
- symfony/filesystem: ^4.0|^5.0|^6.0
- symfony/http-kernel: ^4.0|^5.0|^6.0
Requires (Dev)
- drjele/symfony-phpunit: ^3.0
- friendsofphp/php-cs-fixer: ^3.3
- squizlabs/php_codesniffer: ^3.6
README
THIS PROJECT IS NO LONGER MAINTAINED, THE NEW PROJECT IS https://gitlab.com/drjele-symfony/console
Symfony command
You may fork and modify it as you wish.
Any suggestions are welcomed.
Config example
drjele_symfony_command.yaml
drjele_symfony_command:
cron:
config:
template_class: \Drjele\Symfony\Command\Template\CrontabTemplate
conf_files_dir: '%kernel.project_dir%/generated_conf/cron'
logs_dir: '%kernel.logs_dir%/cron'
log: true
destination_file: 'crontab'
heartbeat: true
commands:
list:
command: '%kernel.project_dir%/bin/console list'
schedule:
minute: '*'
hour: '*'
day_of_month: '*'
month: '*'
day_of_week: '*'
log: false
worker:
config:
template_class: \Drjele\Symfony\Command\Template\SupervisorTemplate
conf_files_dir: '%kernel.project_dir%/generated_conf/worker'
logs_dir: '%kernel.logs_dir%/worker'
number_of_processes: 1
auto_start: true
auto_restart: true
prefix: 'app-name'
user: 'root'
commands:
list:
command: '%kernel.project_dir%/bin/console list'
number_of_processes: 2
If the drjele_symfony_command.cron.config.heartbeat a command with the name heartbeat
will automatically be added, if not added by you.
For custom templates
Create a template service to implement Drjele\Symfony\Command\Contract\TemplateInterface and add to your services.yaml this config:
services:
_instanceof:
Drjele\Symfony\Command\Contract\TemplateInterface:
tags: ['drjele.symfony.command.template']
Dev
git clone git@gitlab.com:drjele-symfony/command.git
cd command/scripts/docker/
cp ~/.ssh/id_* ./
create .profile_personal with:
echo 'git config --global user.name "<your name>"' >> ./.profile_personal && \
echo 'git config --global user.email "<your email>"' >> ./.profile_personal
docker-compose build && docker-compose up -d
docker-compose exec php sh
composer install