Bearsampp
2026.7.11
Toggle main menu visibility
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
14
class
ActionSwitchOnline
15
{
22
public
function
__construct
($args)
23
{
24
global
$bearsamppConfig
;
25
26
if
(isset($args[0]) && $args[0] ==
Config::ENABLED
|| $args[0] ==
Config::DISABLED
) {
27
Util::startLoading
();
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
Util::stopLoading
();
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
$bearsamppBins
global $bearsamppBins
Definition
ajax.apache.php:16
ActionSwitchOnline
Definition
class.action.switchOnline.php:15
ActionSwitchOnline\__construct
__construct($args)
Definition
class.action.switchOnline.php:22
ActionSwitchOnline\switchAlias
switchAlias($putOnline)
Definition
class.action.switchOnline.php:54
ActionSwitchOnline\switchApache
switchApache($putOnline)
Definition
class.action.switchOnline.php:43
ActionSwitchOnline\switchVhosts
switchVhosts($putOnline)
Definition
class.action.switchOnline.php:65
Config\DISABLED
const DISABLED
Definition
class.config.php:36
Config\CFG_ONLINE
const CFG_ONLINE
Definition
class.config.php:32
Config\ENABLED
const ENABLED
Definition
class.config.php:35
Util\startLoading
static startLoading()
Definition
class.util.php:530
Util\stopLoading
static stopLoading()
Definition
class.util.php:550
$bearsamppConfig
global $bearsamppConfig
Definition
homepage.php:41
sandbox
core
classes
actions
class.action.switchOnline.php
Generated by
1.17.0