2024.8.23
Loading...
Searching...
No Matches
ActionSwitchOnline Class Reference

Public Member Functions

 __construct ($args)
 

Private Member Functions

 switchAlias ($putOnline)
 
 switchApache ($putOnline)
 
 switchFilezilla ($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()

ActionSwitchOnline::__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 $this->switchFilezilla($putOnline);
34 $bearsamppConfig->replace(Config::CFG_ONLINE, $args[0]);
35 }
36 }
const DISABLED
const CFG_ONLINE
const ENABLED
static startLoading()
global $bearsamppConfig
Definition homepage.php:26

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

Member Function Documentation

◆ switchAlias()

ActionSwitchOnline::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 54 of file class.action.switchOnline.php.

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

References $bearsamppBins.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ switchApache()

ActionSwitchOnline::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 43 of file class.action.switchOnline.php.

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

References $bearsamppBins.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ switchFilezilla()

ActionSwitchOnline::switchFilezilla ( $putOnline)
private

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

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

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

77 {
78 global $bearsamppBins;
79
80 if ($putOnline) {
81 $bearsamppBins->getFilezilla()->setConf(array(
84 ));
85 } else {
86 $bearsamppBins->getFilezilla()->setConf(array(
87 BinFilezilla::CFG_IP_FILTER_ALLOWED => '127.0.0.1 ::1',
89 ));
90 }
91 }

References $bearsamppBins, BinFilezilla\CFG_IP_FILTER_ALLOWED, and BinFilezilla\CFG_IP_FILTER_DISALLOWED.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ switchVhosts()

ActionSwitchOnline::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 65 of file class.action.switchOnline.php.

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

References $bearsamppBins.

Referenced by __construct().

+ Here is the caller graph for this function:

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