chartboard/app/Commands/AlertCheck.php
2026-03-30 09:51:33 +05:30

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');
}
}