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

Public Member Functions

 __construct ($args)
 

Detailed Description

Class ActionDebugApache

This class handles the debugging of Apache configurations and settings. It retrieves various Apache debug information based on the provided arguments and displays the information in a message box or editor.

Definition at line 17 of file class.action.debugApache.php.

Constructor & Destructor Documentation

◆ __construct()

ActionDebugApache::__construct ( $args)

Constructor for ActionDebugApache.

Parameters
array$argsAn array of arguments specifying the type of Apache debug information to retrieve.

Definition at line 24 of file class.action.debugApache.php.

25 {
26 global $bearsamppLang, $bearsamppBins, $bearsamppTools, $bearsamppWinbinder;
27
28 if (isset($args[0]) && !empty($args[0])) {
29 $editor = false;
30 $msgBoxError = false;
31 $caption = $bearsamppLang->getValue(Lang::DEBUG) . ' ' . $bearsamppLang->getValue(Lang::APACHE) . ' - ';
32
33 // Determine the type of debug information requested and set the caption accordingly
34 if ($args[0] == BinApache::CMD_VERSION_NUMBER) {
36 } elseif ($args[0] == BinApache::CMD_COMPILE_SETTINGS) {
38 } elseif ($args[0] == BinApache::CMD_COMPILED_MODULES) {
40 } elseif ($args[0] == BinApache::CMD_CONFIG_DIRECTIVES) {
41 $editor = true;
43 } elseif ($args[0] == BinApache::CMD_VHOSTS_SETTINGS) {
44 $editor = true;
46 } elseif ($args[0] == BinApache::CMD_LOADED_MODULES) {
47 $editor = true;
49 } elseif ($args[0] == BinApache::CMD_SYNTAX_CHECK) {
51 }
52 $caption .= ' (' . $args[0] . ')';
53
54 // Retrieve the debug output from Apache
55 $debugOutput = $bearsamppBins->getApache()->getCmdLineOutput($args[0]);
56
57 // Handle syntax check specifically
58 if ($args[0] == BinApache::CMD_SYNTAX_CHECK) {
59 $msgBoxError = !$debugOutput['syntaxOk'];
60 $debugOutput['content'] = $debugOutput['syntaxOk'] ? 'Syntax OK !' : $debugOutput['content'];
61 }
62
63 // Display the debug output in an editor or message box
64 if ($editor) {
65 Util::openFileContent($caption, $debugOutput['content']);
66 } else {
67 if ($msgBoxError) {
68 $bearsamppWinbinder->messageBoxError(
69 $debugOutput['content'],
70 $caption
71 );
72 } else {
73 $bearsamppWinbinder->messageBoxInfo(
74 $debugOutput['content'],
75 $caption
76 );
77 }
78 }
79 }
80 }
global $bearsamppBins
global $bearsamppLang
const CMD_LOADED_MODULES
const CMD_VERSION_NUMBER
const CMD_VHOSTS_SETTINGS
const CMD_CONFIG_DIRECTIVES
const CMD_COMPILE_SETTINGS
const CMD_SYNTAX_CHECK
const CMD_COMPILED_MODULES
const DEBUG_APACHE_CONFIG_DIRECTIVES
const DEBUG_APACHE_COMPILE_SETTINGS
const DEBUG_APACHE_COMPILED_MODULES
const DEBUG_APACHE_VHOSTS_SETTINGS
const DEBUG_APACHE_SYNTAX_CHECK
const DEBUG
const DEBUG_APACHE_VERSION_NUMBER
const DEBUG_APACHE_LOADED_MODULES
const APACHE
static openFileContent($caption, $content)

References $bearsamppBins, $bearsamppLang, Lang\APACHE, BinApache\CMD_COMPILE_SETTINGS, BinApache\CMD_COMPILED_MODULES, BinApache\CMD_CONFIG_DIRECTIVES, BinApache\CMD_LOADED_MODULES, BinApache\CMD_SYNTAX_CHECK, BinApache\CMD_VERSION_NUMBER, BinApache\CMD_VHOSTS_SETTINGS, Lang\DEBUG, Lang\DEBUG_APACHE_COMPILE_SETTINGS, Lang\DEBUG_APACHE_COMPILED_MODULES, Lang\DEBUG_APACHE_CONFIG_DIRECTIVES, Lang\DEBUG_APACHE_LOADED_MODULES, Lang\DEBUG_APACHE_SYNTAX_CHECK, Lang\DEBUG_APACHE_VERSION_NUMBER, Lang\DEBUG_APACHE_VHOSTS_SETTINGS, and Util\openFileContent().


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