Bearsampp 2025.8.29
Loading...
Searching...
No Matches
ActionSwitchOnline Class Reference

Public Member Functions

 __construct ($args)

Private Member Functions

 switchAlias ($putOnline)
 switchApache ($putOnline)
 switchVhosts ($putOnline)

Detailed Description

Class ActionSwitchOnline Handles the switching of the application between online and offline modes.

Definition at line 14 of file class.action.switchOnline.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( $args)

ActionSwitchOnline constructor. Initializes the online/offline switch based on the provided arguments.

Parameters
array$argsArguments to determine the online/offline state.

Definition at line 22 of file class.action.switchOnline.php.

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 }
const DISABLED
const CFG_ONLINE
const ENABLED
static startLoading()
global $bearsamppConfig
Definition homepage.php:27

References $bearsamppConfig, Config\CFG_ONLINE, Config\DISABLED, Config\ENABLED, Util\startLoading(), switchAlias(), switchApache(), and switchVhosts().

Member Function Documentation

◆ switchAlias()

switchAlias ( $putOnline)
private

Switches the Apache aliases based on the online/offline state.

Parameters
bool$putOnlineTrue to put online, false to put offline.

Definition at line 53 of file class.action.switchOnline.php.

54 {
55 global $bearsamppBins;
56 $bearsamppBins->getApache()->refreshAlias($putOnline);
57 }
global $bearsamppBins

References $bearsamppBins.

Referenced by __construct().

◆ switchApache()

switchApache ( $putOnline)
private

Switches the Apache configuration based on the online/offline state.

Parameters
bool$putOnlineTrue to put online, false to put offline.

Definition at line 42 of file class.action.switchOnline.php.

43 {
44 global $bearsamppBins;
45 $bearsamppBins->getApache()->refreshConf($putOnline);
46 }

References $bearsamppBins.

Referenced by __construct().

◆ switchVhosts()

switchVhosts ( $putOnline)
private

Switches the Apache virtual hosts based on the online/offline state.

Parameters
bool$putOnlineTrue to put online, false to put offline.

Definition at line 64 of file class.action.switchOnline.php.

65 {
66 global $bearsamppBins;
67 $bearsamppBins->getApache()->refreshVhosts($putOnline);
68 }

References $bearsamppBins.

Referenced by __construct().


The documentation for this class was generated from the following file: