Bearsampp 2025.8.29
Loading...
Searching...
No Matches
class.action.switchOnline.php
Go to the documentation of this file.
1<?php
2/*
3 * Copyright (c) 2021-2024 Bearsampp
4 * License: GNU General Public License version 3 or later; see LICENSE.txt
5 * Author: Bear
6 * Website: https://bearsampp.com
7 * Github: https://github.com/Bearsampp
8 */
9
15{
22 public function __construct($args)
23 {
24 global $bearsamppConfig;
25
26 if (isset($args[0]) && $args[0] == Config::ENABLED || $args[0] == Config::DISABLED) {
28 $putOnline = $args[0] == Config::ENABLED;
29
30 $this->switchApache($putOnline);
31 $this->switchAlias($putOnline);
32 $this->switchVhosts($putOnline);
33 $bearsamppConfig->replace(Config::CFG_ONLINE, $args[0]);
34 }
35 }
36
42 private function switchApache($putOnline)
43 {
44 global $bearsamppBins;
45 $bearsamppBins->getApache()->refreshConf($putOnline);
46 }
47
53 private function switchAlias($putOnline)
54 {
55 global $bearsamppBins;
56 $bearsamppBins->getApache()->refreshAlias($putOnline);
57 }
58
64 private function switchVhosts($putOnline)
65 {
66 global $bearsamppBins;
67 $bearsamppBins->getApache()->refreshVhosts($putOnline);
68 }
69}
global $bearsamppBins
const DISABLED
const CFG_ONLINE
const ENABLED
static startLoading()
global $bearsamppConfig
Definition homepage.php:27