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

SyncStatus

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

class

SyncStatus

SyncStatus.php:18

Whether each site holds what this machine holds: its data, its metrics, its database files, its database server -- as the last data-status read it (admin.php's, DataSync::summary), one file per site in the hub's data (project/sync/{target}.json), for the pages and the root hub to show without reaching any server.

class MMO\admin\monitoring\SyncStatus
Espace de noms
MMO\admin\monitoring
And when it is read again by itself: the schedule (`project/sync-schedule.json`), changed on the hub's Settings page, which `php hub.php scheduled` -- the second crontab line of `php hub.php cron` -- follows.
$sync = new SyncStatus($hub); foreach ($sync->all() as $target => $status) {echo $target, ' ', $status['status'], "\n";} if ($sync->due()) {...} // what `hub.php scheduled` asks

Index

SCHEDULEthe schedule of a hub that never set one: every week, Sunday night
STATUSESwhat the statuses say, for the pages: to do nothing, to pull, to push, to merge, to look at
UNCHECKEDa site whose data was never read
UNKNOWNa site whose data could not be read: its server unreachable, its folder missing...
hub
all()
Check($schedule) static
counts()
debugName()
due($now)
fileName($target)
get($target)
getFolder()
getSchedule()
getScheduleFilename()
markRun($at)Remember that the scheduled reading ran.
next($now)
Previous($schedule, $now) static
save($target, $status, $at)Keep what was read of a site.
schedule()
setSchedule($schedule)
__construct($hub)

Constantes4

SCHEDULE

the schedule of a hub that never set one: every week, Sunday night

const SCHEDULE = ['enabled' => true, 'every' => 'weekly', 'day' => 0, 'time' => '02:00']

STATUSES

what the statuses say, for the pages: to do nothing, to pull, to push, to merge, to look at

const STATUSES = ['synced', 'target', 'local', 'both', 'unknown', 'unchecked']

UNCHECKED

a site whose data was never read

const UNCHECKED = 'unchecked'

UNKNOWN

a site whose data could not be read: its server unreachable, its folder missing...

const UNKNOWN = 'unknown'

Propriétés1

hub

protected MMO\admin\monitoring\Hub $hub
Type
Hub

Méthodes17

counts()

SyncStatus.php:66
function counts(): array
retournearrayint|null> how many sites are in each of STATUSES, and checkedAt: the oldest reading of them, null when one never was

fileName($target)

SyncStatus.php:79
protected function fileName(string $target): string
$targetstring
retournestringa target's file: its name, nothing that climbs out of the folder

save($target, $status, $at)

SyncStatus.php:44

Keep what was read of a site.

function save(string $target, array $status, ?int $at = null): void
$targetstringa site of the hub
$statusarrayDataSync::summary, or {status: unknown, error}
$at = nullnull | intwhen it was read (null: now)
retournevoid