artack / symfony-ohdear-command
Provides out of the box functionality for Oh Dear Scheduled tasks.
0.1.2
2023-02-10 08:15 UTC
Requires
- php: ^8.0
- symfony/console: ^6.0
- symfony/http-client: ^6.0
README
Oh Dear Symfony Abscract Command
Developed by artack in Zurich, Switzerland.
Features
- Provides out of the box functionality for Scheduled tasks. That includes:
- Consumed memory of the command
- Runtime of the command
- Exit-Code of the command
- Failure Message in case of an exception
Installation
You can install this color library through Composer:
$ composer require artack/symfony-ohdear-command
Usage
Creating a Symfony Command extending the abstract OhDearCommand
class:
class YourNewSymfonyCommand extends OhDearCommand
If you configure your Command with the `` method make sure you run the parent method as well.
protected function configure(): void { parent::configure(); # following your own configurations }
Instead of the execute
method you need to use doExecute
for the actual implementation of your command. The rest of the signature of that method is identical to the execute
method.
protected function doExecute(InputInterface $input, OutputInterface $output): int {...}
Now you can run the command with the option --ohdear-uuid
and the uuid given by Oh Dear as a value. The uuid is part of the "ping URL" shown by Oh Dear.