Maintenance impl
This commit is contained in:
parent
f6db82c646
commit
992e04fb0b
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue