MMOframework
Pourquoi l'IA Playground Bibliothèques Développeurs Agence
FR EN
Créer un projet en direct
Index

Schedule

MMO\admin\monitoring · 1 symbole · générée le 30 Nov 2026

class

Schedule

Schedule.php:15

When something of the hub runs by itself, as its Settings page set it: on or off, every day or every week, the day, the time on this machine -- and, for what takes them, its own values (keep: how many backup sets stay; where: on the servers, here, or both). One file in the hub's data, which php hub.php scheduled -- the second crontab line of php hub.php cron -- reads every quarter of an hour.

class MMO\admin\monitoring\Schedule
Espace de noms
MMO\admin\monitoring
$schedule = new Schedule($folder . '/project/sync-schedule.json', SyncStatus::SCHEDULE); if ($schedule->due()) {...; $schedule->markRun();}

Index

WHEREwhere a cleanup deletes (BackupFiles::WHERE): the servers, this machine, both
defaults
filename
Check($schedule, $defaults) static
debugName()
due($now)Whether it is to run now: it is enabled, and a moment of it came since it last ran -- or, never run, since it was set (a hub that never set it counts from now on: the first moment after).
get()
getFilename()
markRun($at)Remember that it ran.
next($now)
Previous($schedule, $now) static
set($schedule)Change it: what was not given stays as it was.
write($schedule)
__construct($filename, $defaults)

Constantes1

WHERE

where a cleanup deletes (BackupFiles::WHERE): the servers, this machine, both

const WHERE = ['server', 'local', 'server,local']

Propriétés2

defaults

protected array $defaults
Type
array

filename

protected string $filename
Type
string

Méthodes11

Check($schedule, $defaults)

staticSchedule.php:45
static function Check(array $schedule, array $defaults): array
$schedulearraywhat a page sent
$defaultsarray__construct: for what is missing, and which values it takes
retournearraybool, every: string, day: int, time: string, keep?: int, where?: string} checked, and its own values
lèvefor a value that is not one

due($now)

Schedule.php:95

Whether it is to run now: it is enabled, and a moment of it came since it last ran -- or, never run, since it was set (a hub that never set it counts from now on: the first moment after).

function due(?int $now = null): bool
$now = nullnull | intnull: now
retournebool

get()

Schedule.php:34
function get(): array
retournearraybool, every: string, day: int, time: string, keep?: int, where?: string, setAt: ?int, lastRun: ?int} every daily or weekly, day 0 (Sunday) to 6 for a weekly one, time HH:MM on this machine, and its own values; setAt when it was set, lastRun when it last ran

next($now)

Schedule.php:108
function next(?int $now = null): ?int
$now = nullnull | int
retournenull | intits next moment after $now; null when it is disabled

Previous($schedule, $now)

staticSchedule.php:118
static function Previous(array $schedule, int $now): int
$schedulearray
$nowint
retourneintits last moment at or before $now, on this machine's clock

set($schedule)

Schedule.php:73

Change it: what was not given stays as it was.

function set(array $schedule): array
$schedulearrayCheck
retournearraythe schedule now (get)
lève

__construct($filename, $defaults)

Schedule.php:23
function __construct(string $filename, array $defaults)
$filenamestringits file
$defaultsarraywhat a hub that never set it has: enabled, every, day, time, and the values it takes