Sign in
EN
games/xencenter-xenadmin-xcp-jumphp / src / Feature / Updates / HostUpdates.php · commit fb1b7c9
<?phpnamespace App\Feature\Updates;use App\Model\Connection;/** What is known of the updates of one server: the packages found (null: never asked), a check or an install running, a reboot to do. */final class HostUpdates{    /** @var list<array<string, mixed>>|null */    public ?array $packages = null;    public bool $checking = false;    public bool $installing = false;    public string $error = '';    public int $checkedAt = 0;    /** the server's boot_time when updates that need a reboot were installed ('' none): required while it has not rebooted since */    public string $rebootBoot = '';    /** @var list<string> the packages that want it */    public array $rebootFor = [];    public function rebootRequired(Connection $c, string $host): bool    {        return $this->rebootBoot !== '' && (string)($c->cache->field($host, 'other_config', [])['boot_time'] ?? '0') === $this->rebootBoot;    }}