ClaimedTaskRunner.php
1 month ago
Cli.php
1 month ago
CronCommand.php
1 month ago
DaemonRunner.php
1 month ago
ExecutionLimitOverride.php
1 month ago
ScheduledTaskResolver.php
1 month ago
ScheduledTasksLister.php
1 month ago
TaskAdder.php
1 month ago
TaskCanceller.php
1 month ago
TaskRunner.php
1 month ago
TaskTrigger.php
1 month ago
WorkerTypesCatalog.php
1 month ago
index.php
1 month ago
Cli.php
29 lines
| 1 | <?php declare(strict_types = 1); |
| 2 | |
| 3 | namespace MailPoet\Cron\CliCommands; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | use WP_CLI; |
| 9 | |
| 10 | class Cli { |
| 11 | private CronCommand $cronCommand; |
| 12 | |
| 13 | public function __construct( |
| 14 | CronCommand $cronCommand |
| 15 | ) { |
| 16 | $this->cronCommand = $cronCommand; |
| 17 | } |
| 18 | |
| 19 | public function initialize(): void { |
| 20 | if (!class_exists(WP_CLI::class)) { |
| 21 | return; |
| 22 | } |
| 23 | |
| 24 | WP_CLI::add_command('mailpoet cron', $this->cronCommand, [ |
| 25 | 'shortdesc' => 'Manages MailPoet cron tasks', |
| 26 | ]); |
| 27 | } |
| 28 | } |
| 29 |