Maintenance impl

This commit is contained in:
Astrologies 2021-12-31 03:27:04 -05:00
parent f6db82c646
commit 992e04fb0b
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
<?php
namespace Alphaland\Administration {
use Alphaland\Grid\RccServiceHelper;
use PDO;
class Maintenance
{
public static function Enable($text = "Alphaland is currently under maintenance, check back later.")
{
$setmaintenance = $GLOBALS['pdo']->prepare("UPDATE websettingsdeprecated SET maintenance = 1, maintenance_text = :t");
$setmaintenance->bindParam(":t", $text, PDO::PARAM_STR);
$setmaintenance->execute();
$jobClose = new RccServiceHelper($GLOBALS['gamesArbiter']);
$jobClose->CloseAllJobs();
}
public static function Disable()
{
$setmaintenance = $GLOBALS['pdo']->prepare("UPDATE websettingsdeprecated SET maintenance = 0, maintenance_text = ''");
$setmaintenance->execute();
}
}
}