22 lines
534 B
PHP
22 lines
534 B
PHP
<?php
|
|
|
|
namespace App\Commands;
|
|
|
|
use App\Libraries\AlertEngine;
|
|
use CodeIgniter\CLI\BaseCommand;
|
|
use CodeIgniter\CLI\CLI;
|
|
|
|
class AlertCheck extends BaseCommand
|
|
{
|
|
protected $group = 'ChartBoard';
|
|
protected $name = 'alert:check';
|
|
protected $description = 'Evaluate active alerts and send notifications (run every minute via cron).';
|
|
|
|
public function run(array $params)
|
|
{
|
|
$engine = new AlertEngine();
|
|
$n = $engine->runAll();
|
|
CLI::write('Alerts evaluated: ' . $n, 'green');
|
|
}
|
|
}
|