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
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
}
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
}
$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:53
ActionSwitchOnline\switchApache
switchApache($putOnline)
Definition
class.action.switchOnline.php:42
ActionSwitchOnline\switchVhosts
switchVhosts($putOnline)
Definition
class.action.switchOnline.php:64
Config\DISABLED
const DISABLED
Definition
class.config.php:35
Config\CFG_ONLINE
const CFG_ONLINE
Definition
class.config.php:31
Config\ENABLED
const ENABLED
Definition
class.config.php:34
Util\startLoading
static startLoading()
Definition
class.util.php:935
$bearsamppConfig
global $bearsamppConfig
Definition
homepage.php:27
Bearsampp-development
sandbox
core
classes
actions
class.action.switchOnline.php
Generated by
1.14.0