Bearsampp
2026.7.11
Toggle main menu visibility
Loading...
Searching...
No Matches
class.action.switchApacheModule.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
class
ActionSwitchApacheModule
16
{
17
const
SWITCH_ON
=
'on'
;
18
const
SWITCH_OFF
=
'off'
;
19
25
public
function
__construct
($args)
26
{
27
global
$bearsamppBins
;
28
29
if
(isset($args[0]) && !empty($args[0]) && isset($args[1]) && !empty($args[1])) {
30
$onContent =
'LoadModule '
. $args[0];
31
$offContent =
'#LoadModule '
. $args[0];
32
33
$httpdContent = file_get_contents(
$bearsamppBins
->getApache()->getConf());
34
if
($args[1] == self::SWITCH_ON) {
35
$httpdContent = str_replace($offContent, $onContent, $httpdContent);
36
} elseif ($args[1] == self::SWITCH_OFF) {
37
$httpdContent = str_replace($onContent, $offContent, $httpdContent);
38
}
39
40
file_put_contents(
$bearsamppBins
->getApache()->getConf(), $httpdContent);
41
}
42
}
43
}
44
$bearsamppBins
global $bearsamppBins
Definition
ajax.apache.php:16
ActionSwitchApacheModule
Definition
class.action.switchApacheModule.php:16
ActionSwitchApacheModule\__construct
__construct($args)
Definition
class.action.switchApacheModule.php:25
ActionSwitchApacheModule\SWITCH_OFF
const SWITCH_OFF
Definition
class.action.switchApacheModule.php:18
ActionSwitchApacheModule\SWITCH_ON
const SWITCH_ON
Definition
class.action.switchApacheModule.php:17
sandbox
core
classes
actions
class.action.switchApacheModule.php
Generated by
1.17.0