Bearsampp 2026.7.11
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]);
35 }
36 }
37
43 private function switchApache($putOnline)
44 {
45 global $bearsamppBins;
46 $bearsamppBins->getApache()->refreshConf($putOnline);
47 }
48
54 private function switchAlias($putOnline)
55 {
56 global $bearsamppBins;
57 $bearsamppBins->getApache()->refreshAlias($putOnline);
58 }
59
65 private function switchVhosts($putOnline)
66 {
67 global $bearsamppBins;
68 $bearsamppBins->getApache()->refreshVhosts($putOnline);
69 }
70}
71
global $bearsamppBins
const DISABLED
const CFG_ONLINE
const ENABLED
static startLoading()
static stopLoading()
global $bearsamppConfig
Definition homepage.php:41