mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-07 16:24:43 +03:00
Describe "cronRun" event in Events class
This commit is contained in:
parent
de1d5d6d51
commit
55b1476139
@ -20,6 +20,7 @@
|
|||||||
namespace Mibew\Controller;
|
namespace Mibew\Controller;
|
||||||
|
|
||||||
use Mibew\EventDispatcher\EventDispatcher;
|
use Mibew\EventDispatcher\EventDispatcher;
|
||||||
|
use Mibew\EventDispatcher\Events;
|
||||||
use Mibew\Settings;
|
use Mibew\Settings;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
@ -31,6 +32,8 @@ class CronController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Runs the cron.
|
* Runs the cron.
|
||||||
*
|
*
|
||||||
|
* Triggers {@link \Mibew\EventDispatcher\Events::CRON_RUN} event.
|
||||||
|
*
|
||||||
* @param Request $request Incoming request.
|
* @param Request $request Incoming request.
|
||||||
* @return string Rendered page content.
|
* @return string Rendered page content.
|
||||||
*/
|
*/
|
||||||
@ -59,7 +62,7 @@ class CronController extends AbstractController
|
|||||||
|
|
||||||
// Trigger cron event
|
// Trigger cron event
|
||||||
$dispatcher = EventDispatcher::getInstance();
|
$dispatcher = EventDispatcher::getInstance();
|
||||||
$dispatcher->triggerEvent('cronRun');
|
$dispatcher->triggerEvent(Events::CRON_RUN);
|
||||||
|
|
||||||
// Update time of last cron run
|
// Update time of last cron run
|
||||||
Settings::set('_last_cron_run', time());
|
Settings::set('_last_cron_run', time());
|
||||||
|
@ -24,6 +24,14 @@ namespace Mibew\EventDispatcher;
|
|||||||
*/
|
*/
|
||||||
final class Events
|
final class Events
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Cron is run.
|
||||||
|
*
|
||||||
|
* This event is triggered when cron is run. It provides an ability for
|
||||||
|
* plugins to perform custom maintenance actions.
|
||||||
|
*/
|
||||||
|
const CRON_RUN = 'cronRun';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An operator cannot be authenticated.
|
* An operator cannot be authenticated.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user