Bearsampp 2026.7.11
Loading...
Searching...
No Matches
TplAppApache Class Reference

Static Public Member Functions

static getActionAddAlias ()
static getActionAddVhost ()
static getActionChangeApachePort ()
static getActionEditAlias ($alias)
static getActionEditVhost ($vhost)
static getActionEnableApache ($enable)
static getActionInstallApacheService ()
static getActionRemoveApacheService ()
static getActionSwitchApacheModule ($module, $switch)
static getActionSwitchApacheVersion ($version)
static getMenuApache ()
static getMenuApacheAlias ()
static getMenuApacheDebug ()
static getMenuApacheModules ()
static getMenuApacheService ()
static getMenuApacheVersions ()
static getMenuApacheVhosts ()
static process ()

Data Fields

const ACTION_ADD_ALIAS = 'addAlias'
const ACTION_ADD_VHOST = 'addVhost'
const ACTION_CHANGE_PORT = 'changeApachePort'
const ACTION_DEL_SSL_CERTIFICATE = 'delSslCertificate'
const ACTION_EDIT_ALIAS = 'editAlias'
const ACTION_EDIT_VHOST = 'editVhost'
const ACTION_ENABLE = 'enableApache'
const ACTION_GEN_SSL_CERTIFICATE = 'genSslCertificate'
const ACTION_INSTALL_SERVICE = 'installApacheService'
const ACTION_REMOVE_SERVICE = 'removeApacheService'
const ACTION_SWITCH_MODULE = 'switchApacheModule'
const ACTION_SWITCH_VERSION = 'switchApacheVersion'
const MENU = 'apache'
const MENU_ALIAS = 'apacheAlias'
const MENU_DEBUG = 'apacheDebug'
const MENU_MODULES = 'apacheModules'
const MENU_SERVICE = 'apacheService'
const MENU_VERSIONS = 'apacheVersions'
const MENU_VHOSTS = 'apacheVhosts'

Detailed Description

Class TplAppApache

This class provides methods to generate menu items and actions for managing Apache services within the Bearsampp application. It includes functionalities for enabling/disabling Apache, switching versions, changing ports, managing modules, aliases, and virtual hosts.

Definition at line 17 of file class.tpl.app.apache.php.

Member Function Documentation

◆ getActionAddAlias()

getActionAddAlias ( )
static

Generates the action to add an Apache alias.

Returns
string The generated action to add an Apache alias.

Definition at line 435 of file class.tpl.app.apache.php.

436 {
437 return TplApp::getActionRun(Action::ADD_ALIAS) . PHP_EOL .
439 }
const ADD_ALIAS
static getActionRun($action, $args=array(), $item=array(), $waitUntilTerminated=true)

References Action\ADD_ALIAS, TplAppReload\getActionReload(), and TplApp\getActionRun().

Here is the call graph for this function:

◆ getActionAddVhost()

getActionAddVhost ( )
static

Generates the action to add an Apache Virtual Host (Vhost).

Returns
string The generated action to add an Apache Vhost.

Definition at line 500 of file class.tpl.app.apache.php.

501 {
502 return TplApp::getActionRun(Action::ADD_VHOST) . PHP_EOL .
504 }
const ADD_VHOST

References Action\ADD_VHOST, TplAppReload\getActionReload(), and TplApp\getActionRun().

Here is the call graph for this function:

◆ getActionChangeApachePort()

getActionChangeApachePort ( )
static

Generates the action to change the Apache port.

@global object $bearsamppBins Provides access to system binaries and their configurations.

Returns
string The generated action to change the Apache port.

Definition at line 273 of file class.tpl.app.apache.php.

274 {
275 global $bearsamppBins;
276
277 return TplApp::getActionRun(Action::CHANGE_PORT, array($bearsamppBins->getApache()->getName())) . PHP_EOL .
279 }
global $bearsamppBins
const CHANGE_PORT

References $bearsamppBins, Action\CHANGE_PORT, TplAppReload\getActionReload(), and TplApp\getActionRun().

Here is the call graph for this function:

◆ getActionEditAlias()

getActionEditAlias ( $alias)
static

Generates the action to edit an Apache alias.

Parameters
string$aliasThe alias to edit.
Returns
string The generated action to edit an Apache alias.

Definition at line 447 of file class.tpl.app.apache.php.

448 {
449 return TplApp::getActionRun(Action::EDIT_ALIAS, array($alias)) . PHP_EOL .
451 }
const EDIT_ALIAS

References Action\EDIT_ALIAS, TplAppReload\getActionReload(), and TplApp\getActionRun().

Here is the call graph for this function:

◆ getActionEditVhost()

getActionEditVhost ( $vhost)
static

Generates the action to edit an Apache Virtual Host (Vhost).

Parameters
string$vhostThe Vhost to edit.
Returns
string The generated action to edit an Apache Vhost.

Definition at line 512 of file class.tpl.app.apache.php.

513 {
514 return TplApp::getActionRun(Action::EDIT_VHOST, array($vhost)) . PHP_EOL .
516 }
const EDIT_VHOST

References Action\EDIT_VHOST, TplAppReload\getActionReload(), and TplApp\getActionRun().

Here is the call graph for this function:

◆ getActionEnableApache()

getActionEnableApache ( $enable)
static

Generates the action to enable or disable Apache.

@global object $bearsamppBins Provides access to system binaries and their configurations.

Parameters
int$enableThe flag to enable (1) or disable (0) Apache.
Returns
string The generated action to enable or disable Apache.

Definition at line 183 of file class.tpl.app.apache.php.

184 {
185 global $bearsamppBins;
186
187 return TplApp::getActionRun(Action::ENABLE, array($bearsamppBins->getApache()->getName(), $enable)) . PHP_EOL .
189 }
const ENABLE

References $bearsamppBins, Action\ENABLE, TplAppReload\getActionReload(), and TplApp\getActionRun().

Here is the call graph for this function:

◆ getActionInstallApacheService()

getActionInstallApacheService ( )
static

Generates the action to install the Apache service.

Returns
string The generated action to install the Apache service.

Definition at line 286 of file class.tpl.app.apache.php.

References TplAppReload\getActionReload(), TplApp\getActionRun(), ActionService\INSTALL, Action\SERVICE, and BinApache\SERVICE_NAME.

Here is the call graph for this function:

◆ getActionRemoveApacheService()

getActionRemoveApacheService ( )
static

Generates the action to remove the Apache service.

Returns
string The generated action to remove the Apache service.

Definition at line 297 of file class.tpl.app.apache.php.

References TplAppReload\getActionReload(), TplApp\getActionRun(), ActionService\REMOVE, Action\SERVICE, and BinApache\SERVICE_NAME.

Here is the call graph for this function:

◆ getActionSwitchApacheModule()

getActionSwitchApacheModule ( $module,
$switch )
static

Generates the action to switch an Apache module on or off.

Parameters
string$moduleThe module to switch.
string$switchThe current switch state of the module.
Returns
string The generated action to switch the Apache module.

Definition at line 381 of file class.tpl.app.apache.php.

References TplAppReload\getActionReload(), TplService\getActionRestart(), TplApp\getActionRun(), BinApache\SERVICE_NAME, Action\SWITCH_APACHE_MODULE, ActionSwitchApacheModule\SWITCH_OFF, and ActionSwitchApacheModule\SWITCH_ON.

Here is the call graph for this function:

◆ getActionSwitchApacheVersion()

getActionSwitchApacheVersion ( $version)
static

Generates the action to switch the Apache version.

@global object $bearsamppBins Provides access to system binaries and their configurations.

Parameters
string$versionThe version to switch to.
Returns
string The generated action to switch the Apache version.

Definition at line 199 of file class.tpl.app.apache.php.

200 {
201 global $bearsamppBins;
202 return TplApp::getActionRun(Action::SWITCH_VERSION, array($bearsamppBins->getApache()->getName(), $version)) . PHP_EOL .
204 }
const SWITCH_VERSION

References $bearsamppBins, TplAppReload\getActionReload(), TplApp\getActionRun(), and Action\SWITCH_VERSION.

Here is the call graph for this function:

◆ getMenuApache()

getMenuApache ( )
static

Generates the Apache menu with options for versions, service, debug, modules, aliases, and virtual hosts.

@global object $bearsamppBins Provides access to system binaries and their configurations. @global object $bearsamppLang Provides language support for retrieving language-specific values.

Returns
string The generated menu items and actions for Apache.

Definition at line 64 of file class.tpl.app.apache.php.

65 {
67 $resultItems = $resultActions = '';
68
69 $isEnabled = $bearsamppBins->getApache()->isEnable();
70
71 // Download
72 $resultItems .= TplAestan::getItemLink(
74 HttpClient::getWebsiteUrl('module/apache', '#releases'),
75 false,
77 ) . PHP_EOL;
78
79 // Enable
80 $tplEnable = TplApp::getActionMulti(
81 self::ACTION_ENABLE, array($isEnabled ? Config::DISABLED : Config::ENABLED),
82 array($bearsamppLang->getValue(Lang::MENU_ENABLE), $isEnabled ? TplAestan::GLYPH_CHECK : ''),
83 false, get_called_class()
84 );
85 $resultItems .= $tplEnable[TplApp::SECTION_CALL] . PHP_EOL;
86 $resultActions .= $tplEnable[TplApp::SECTION_CONTENT] . PHP_EOL;
87
88 if ($isEnabled) {
89 $resultItems .= TplAestan::getItemSeparator() . PHP_EOL;
90
91 // Versions
92 $tplVersions = TplApp::getMenu($bearsamppLang->getValue(Lang::VERSIONS), self::MENU_VERSIONS, get_called_class());
93 $resultItems .= $tplVersions[TplApp::SECTION_CALL] . PHP_EOL;
94 $resultActions .= $tplVersions[TplApp::SECTION_CONTENT] . PHP_EOL;
95
96 // Service
97 $tplService = TplApp::getMenu($bearsamppLang->getValue(Lang::SERVICE), self::MENU_SERVICE, get_called_class());
98 $resultItems .= $tplService[TplApp::SECTION_CALL] . PHP_EOL;
99 $resultActions .= $tplService[TplApp::SECTION_CONTENT] . PHP_EOL;
100
101 // Debug
102 $tplDebug = TplApp::getMenu($bearsamppLang->getValue(Lang::DEBUG), self::MENU_DEBUG, get_called_class());
103 $resultItems .= $tplDebug[TplApp::SECTION_CALL] . PHP_EOL;
104 $resultActions .= $tplDebug[TplApp::SECTION_CONTENT] . PHP_EOL;
105
106 // Modules
107 $tplModules = TplApp::getMenu($bearsamppLang->getValue(Lang::MODULES), self::MENU_MODULES, get_called_class());
108 $resultItems .= $tplModules[TplApp::SECTION_CALL] . PHP_EOL;
109 $resultActions .= $tplModules[TplApp::SECTION_CONTENT] . PHP_EOL;
110
111 // Alias
112 $tplAlias = TplApp::getMenu($bearsamppLang->getValue(Lang::ALIASES), self::MENU_ALIAS, get_called_class());
113 $resultItems .= $tplAlias[TplApp::SECTION_CALL] . PHP_EOL;
114 $resultActions .= $tplAlias[TplApp::SECTION_CONTENT] . PHP_EOL;
115
116 // Vhosts
117 $tplVhosts = TplApp::getMenu($bearsamppLang->getValue(Lang::VIRTUAL_HOSTS), self::MENU_VHOSTS, get_called_class());
118 $resultItems .= $tplVhosts[TplApp::SECTION_CALL] . PHP_EOL;
119 $resultActions .= $tplVhosts[TplApp::SECTION_CONTENT] . PHP_EOL;
120
121 // Conf
122 $resultItems .= TplAestan::getItemNotepad(basename($bearsamppBins->getApache()->getConf()), $bearsamppBins->getApache()->getConf()) . PHP_EOL;
123
124 // Access log
125 $resultItems .= TplAestan::getItemNotepad($bearsamppLang->getValue(Lang::MENU_ACCESS_LOGS), $bearsamppBins->getApache()->getAccessLog()) . PHP_EOL;
126
127 // Rewrite log
128 $resultItems .= TplAestan::getItemNotepad($bearsamppLang->getValue(Lang::MENU_REWRITE_LOGS), $bearsamppBins->getApache()->getRewriteLog()) . PHP_EOL;
129
130 // Error log
131 $resultItems .= TplAestan::getItemNotepad($bearsamppLang->getValue(Lang::MENU_ERROR_LOGS), $bearsamppBins->getApache()->getErrorLog()) . PHP_EOL;
132 }
133
134 return $resultItems . PHP_EOL . $resultActions;
135 }
global $bearsamppLang
const DISABLED
const ENABLED
static getWebsiteUrl($path='', $fragment='', $utmSource=true)
const MENU_ENABLE
const MODULES
const SERVICE
const DOWNLOAD_MORE
const DEBUG
const MENU_ERROR_LOGS
const MENU_REWRITE_LOGS
const VIRTUAL_HOSTS
const ALIASES
const MENU_ACCESS_LOGS
const VERSIONS
static getItemLink($caption, $link, $local=false, $glyph=self::GLYPH_WEB_PAGE)
static getItemNotepad($caption, $path)
static getItemSeparator()
static getActionMulti($action, $args=array(), $item=array(), $disabled=false, $class=false)
static getMenu($caption, $menu, $class)
const SECTION_CALL
const SECTION_CONTENT

References $bearsamppBins, $bearsamppLang, Lang\ALIASES, Lang\DEBUG, Config\DISABLED, Lang\DOWNLOAD_MORE, Config\ENABLED, TplApp\getActionMulti(), TplAestan\getItemLink(), TplAestan\getItemNotepad(), TplAestan\getItemSeparator(), TplApp\getMenu(), HttpClient\getWebsiteUrl(), TplAestan\GLYPH_BROWSER, TplAestan\GLYPH_CHECK, Lang\MENU_ACCESS_LOGS, Lang\MENU_ENABLE, Lang\MENU_ERROR_LOGS, Lang\MENU_REWRITE_LOGS, Lang\MODULES, TplApp\SECTION_CALL, TplApp\SECTION_CONTENT, Lang\SERVICE, Lang\VERSIONS, and Lang\VIRTUAL_HOSTS.

Here is the call graph for this function:

◆ getMenuApacheAlias()

getMenuApacheAlias ( )
static

Generates the Apache Alias menu with options to add and edit aliases.

@global object $bearsamppLang Provides language support for retrieving language-specific values. @global object $bearsamppBins Provides access to system binaries and their configurations.

Returns
string The generated menu items and actions for Apache aliases.

Definition at line 396 of file class.tpl.app.apache.php.

397 {
399
400 $tplAddAlias = TplApp::getActionMulti(
401 self::ACTION_ADD_ALIAS, null,
403 false, get_called_class()
404 );
405
406 // Items
407 $items = $tplAddAlias[TplApp::SECTION_CALL] . PHP_EOL .
408 TplAestan::getItemSeparator() . PHP_EOL;
409
410 // Actions
411 $actions = PHP_EOL . $tplAddAlias[TplApp::SECTION_CONTENT];
412
413 foreach ($bearsamppBins->getApache()->getAlias() as $alias) {
414 $tplEditAlias = TplApp::getActionMulti(
415 self::ACTION_EDIT_ALIAS, array($alias),
416 array(sprintf($bearsamppLang->getValue(Lang::MENU_EDIT_ALIAS), $alias), TplAestan::GLYPH_FILE),
417 false, get_called_class()
418 );
419
420 // Items
421 $items .= $tplEditAlias[TplApp::SECTION_CALL] . PHP_EOL;
422
423 // Actions
424 $actions .= PHP_EOL . PHP_EOL . $tplEditAlias[TplApp::SECTION_CONTENT];
425 }
426
427 return $items . $actions;
428 }
const MENU_ADD_ALIAS
const MENU_EDIT_ALIAS

References $bearsamppBins, $bearsamppLang, TplApp\getActionMulti(), TplAestan\getItemSeparator(), TplAestan\GLYPH_ADD, TplAestan\GLYPH_FILE, Lang\MENU_ADD_ALIAS, Lang\MENU_EDIT_ALIAS, TplApp\SECTION_CALL, and TplApp\SECTION_CONTENT.

Here is the call graph for this function:

◆ getMenuApacheDebug()

getMenuApacheDebug ( )
static

Generates the Apache debug menu with options to run various debug commands.

@global object $bearsamppLang Provides language support for retrieving language-specific values.

Returns
string The generated menu items and actions for Apache debug.

Definition at line 310 of file class.tpl.app.apache.php.

311 {
312 global $bearsamppLang;
313
317 ) . PHP_EOL .
321 ) . PHP_EOL .
325 ) . PHP_EOL .
329 ) . PHP_EOL .
333 ) . PHP_EOL .
337 ) . PHP_EOL .
341 ) . PHP_EOL;
342 }
const DEBUG_APACHE
const CMD_SYNTAX_CHECK
const CMD_CONFIG_DIRECTIVES
const CMD_COMPILE_SETTINGS
const CMD_COMPILED_MODULES
const CMD_LOADED_MODULES
const CMD_VERSION_NUMBER
const CMD_VHOSTS_SETTINGS
const DEBUG_APACHE_SYNTAX_CHECK
const DEBUG_APACHE_COMPILE_SETTINGS
const DEBUG_APACHE_COMPILED_MODULES
const DEBUG_APACHE_CONFIG_DIRECTIVES
const DEBUG_APACHE_LOADED_MODULES
const DEBUG_APACHE_VERSION_NUMBER
const DEBUG_APACHE_VHOSTS_SETTINGS

References $bearsamppLang, 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, Action\DEBUG_APACHE, 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, TplApp\getActionRun(), and TplAestan\GLYPH_DEBUG.

Here is the call graph for this function:

◆ getMenuApacheModules()

getMenuApacheModules ( )
static

Generates the Apache modules menu with options to switch modules on or off.

@global object $bearsamppBins Provides access to system binaries and their configurations.

Returns
string The generated menu items and actions for Apache modules.

Definition at line 351 of file class.tpl.app.apache.php.

352 {
353 global $bearsamppBins;
354 $items = '';
355 $actions = '';
356
357 foreach ($bearsamppBins->getApache()->getModulesFromConf() as $module => $switch) {
358 $tplSwitchApacheModule = TplApp::getActionMulti(
359 self::ACTION_SWITCH_MODULE, array($module, $switch),
360 array($module, ($switch == ActionSwitchApacheModule::SWITCH_ON ? TplAestan::GLYPH_CHECK : '')),
361 false, get_called_class()
362 );
363
364 // Item
365 $items .= $tplSwitchApacheModule[TplApp::SECTION_CALL] . PHP_EOL;
366
367 // Action
368 $actions .= PHP_EOL . $tplSwitchApacheModule[TplApp::SECTION_CONTENT];
369 }
370
371 return $items . $actions;
372 }

References $bearsamppBins, TplApp\getActionMulti(), TplAestan\GLYPH_CHECK, TplApp\SECTION_CALL, TplApp\SECTION_CONTENT, and ActionSwitchApacheModule\SWITCH_ON.

Here is the call graph for this function:

◆ getMenuApacheService()

getMenuApacheService ( )
static

Generates the Apache service menu with options to start, stop, restart, and manage the service.

@global object $bearsamppRoot Provides access to the root path of the application. @global object $bearsamppLang Provides language support for retrieving language-specific values. @global object $bearsamppBins Provides access to system binaries and their configurations.

Returns
string The generated menu items and actions for Apache service.

Definition at line 215 of file class.tpl.app.apache.php.

216 {
218
219 $tplChangePort = TplApp::getActionMulti(
220 self::ACTION_CHANGE_PORT, null,
222 false, get_called_class()
223 );
224
225 $result = TplAestan::getItemActionServiceStart($bearsamppBins->getApache()->getService()->getName()) . PHP_EOL .
226 TplAestan::getItemActionServiceStop($bearsamppBins->getApache()->getService()->getName()) . PHP_EOL .
227 TplAestan::getItemActionServiceRestart($bearsamppBins->getApache()->getService()->getName()) . PHP_EOL .
228 TplAestan::getItemSeparator() . PHP_EOL .
230 Action::CHECK_PORT, array($bearsamppBins->getApache()->getName(), $bearsamppBins->getApache()->getPort()),
231 array(sprintf($bearsamppLang->getValue(Lang::MENU_CHECK_PORT), $bearsamppBins->getApache()->getPort()), TplAestan::GLYPH_LIGHT)
232 ) . PHP_EOL .
234 Action::CHECK_PORT, array($bearsamppBins->getApache()->getName(), $bearsamppBins->getApache()->getSslPort(), true),
235 array(sprintf($bearsamppLang->getValue(Lang::MENU_CHECK_PORT), $bearsamppBins->getApache()->getSslPort()) . ' (SSL)', TplAestan::GLYPH_RED_LIGHT)
236 ) . PHP_EOL .
237 $tplChangePort[TplApp::SECTION_CALL] . PHP_EOL .
238 TplAestan::getItemNotepad($bearsamppLang->getValue(Lang::MENU_UPDATE_ENV_PATH), Path::getRootPath() . '/nssmEnvPaths.dat') . PHP_EOL;
239
240 $isInstalled = $bearsamppBins->getApache()->getService()->isInstalled();
241 if (!$isInstalled) {
242 $tplInstallService = TplApp::getActionMulti(
243 self::ACTION_INSTALL_SERVICE, null,
245 $isInstalled, get_called_class()
246 );
247
248 $result .= $tplInstallService[TplApp::SECTION_CALL] . PHP_EOL . PHP_EOL .
249 $tplInstallService[TplApp::SECTION_CONTENT] . PHP_EOL;
250 } else {
251 $tplRemoveService = TplApp::getActionMulti(
252 self::ACTION_REMOVE_SERVICE, null,
254 !$isInstalled, get_called_class()
255 );
256
257 $result .= $tplRemoveService[TplApp::SECTION_CALL] . PHP_EOL . PHP_EOL .
258 $tplRemoveService[TplApp::SECTION_CONTENT] . PHP_EOL;
259 }
260
261 $result .= $tplChangePort[TplApp::SECTION_CONTENT] . PHP_EOL;
262
263 return $result;
264 }
$result
global $bearsamppRoot
const CHECK_PORT
const MENU_CHANGE_PORT
const MENU_INSTALL_SERVICE
const MENU_UPDATE_ENV_PATH
const MENU_REMOVE_SERVICE
const MENU_CHECK_PORT
static getRootPath($aetrayPath=false)
const GLYPH_RED_LIGHT
const GLYPH_SERVICE_REMOVE
static getItemActionServiceStop($service)
const GLYPH_SERVICE_INSTALL
static getItemActionServiceStart($service)
static getItemActionServiceRestart($service)

References $bearsamppBins, $bearsamppLang, $bearsamppRoot, $result, Action\CHECK_PORT, TplApp\getActionMulti(), TplApp\getActionRun(), TplAestan\getItemActionServiceRestart(), TplAestan\getItemActionServiceStart(), TplAestan\getItemActionServiceStop(), TplAestan\getItemNotepad(), TplAestan\getItemSeparator(), Path\getRootPath(), TplAestan\GLYPH_LIGHT, TplAestan\GLYPH_NETWORK, TplAestan\GLYPH_RED_LIGHT, TplAestan\GLYPH_SERVICE_INSTALL, TplAestan\GLYPH_SERVICE_REMOVE, Lang\MENU_CHANGE_PORT, Lang\MENU_CHECK_PORT, Lang\MENU_INSTALL_SERVICE, Lang\MENU_REMOVE_SERVICE, Lang\MENU_UPDATE_ENV_PATH, TplApp\SECTION_CALL, and TplApp\SECTION_CONTENT.

Here is the call graph for this function:

◆ getMenuApacheVersions()

getMenuApacheVersions ( )
static

Generates the Apache versions menu with options to switch between different versions.

@global object $bearsamppBins Provides access to system binaries and their configurations.

Returns
string The generated menu items and actions for Apache versions.

Definition at line 144 of file class.tpl.app.apache.php.

145 {
146 global $bearsamppBins;
147 $items = '';
148 $actions = '';
149
150 foreach ($bearsamppBins->getApache()->getVersionList() as $version) {
151 $glyph = '';
152 $apachePhpModule = $bearsamppBins->getPhp()->getApacheModule($version);
153 if ($apachePhpModule === false) {
155 } elseif ($version == $bearsamppBins->getApache()->getVersion()) {
156 $glyph = TplAestan::GLYPH_CHECK;
157 }
158
159 $tplSwitchApacheVersion = TplApp::getActionMulti(
160 self::ACTION_SWITCH_VERSION, array($version),
161 array($version, $glyph),
162 false, get_called_class()
163 );
164
165 // Item
166 $items .= $tplSwitchApacheVersion[TplApp::SECTION_CALL] . PHP_EOL;
167
168 // Action
169 $actions .= PHP_EOL . $tplSwitchApacheVersion[TplApp::SECTION_CONTENT];
170 }
171
172 return $items . $actions;
173 }

References $bearsamppBins, TplApp\getActionMulti(), TplAestan\GLYPH_CHECK, TplAestan\GLYPH_WARNING, TplApp\SECTION_CALL, and TplApp\SECTION_CONTENT.

Here is the call graph for this function:

◆ getMenuApacheVhosts()

getMenuApacheVhosts ( )
static

Generates the Apache Virtual Hosts (Vhosts) menu with options to add and edit Vhosts.

@global object $bearsamppLang Provides language support for retrieving language-specific values. @global object $bearsamppBins Provides access to system binaries and their configurations.

Returns
string The generated menu items and actions for Apache Vhosts.

Definition at line 461 of file class.tpl.app.apache.php.

462 {
464
465 $tplAddVhost = TplApp::getActionMulti(
466 self::ACTION_ADD_VHOST, null,
468 false, get_called_class()
469 );
470
471 // Items
472 $items = $tplAddVhost[TplApp::SECTION_CALL] . PHP_EOL .
473 TplAestan::getItemSeparator() . PHP_EOL;
474
475 // Actions
476 $actions = PHP_EOL . $tplAddVhost[TplApp::SECTION_CONTENT];
477
478 foreach ($bearsamppBins->getApache()->getVhosts() as $vhost) {
479 $tplEditVhost = TplApp::getActionMulti(
480 self::ACTION_EDIT_VHOST, array($vhost),
481 array(sprintf($bearsamppLang->getValue(Lang::MENU_EDIT_VHOST), $vhost), TplAestan::GLYPH_FILE),
482 false, get_called_class()
483 );
484
485 // Items
486 $items .= $tplEditVhost[TplApp::SECTION_CALL] . PHP_EOL;
487
488 // Actions
489 $actions .= PHP_EOL . PHP_EOL . $tplEditVhost[TplApp::SECTION_CONTENT];
490 }
491
492 return $items . $actions;
493 }
const MENU_ADD_VHOST
const MENU_EDIT_VHOST

References $bearsamppBins, $bearsamppLang, TplApp\getActionMulti(), TplAestan\getItemSeparator(), TplAestan\GLYPH_ADD, TplAestan\GLYPH_FILE, Lang\MENU_ADD_VHOST, Lang\MENU_EDIT_VHOST, TplApp\SECTION_CALL, and TplApp\SECTION_CONTENT.

Here is the call graph for this function:

◆ process()

process ( )
static

Generates the main Apache menu with options to enable/disable Apache and access submenus.

@global object $bearsamppLang Provides language support for retrieving language-specific values. @global object $bearsamppBins Provides access to system binaries and their configurations.

Returns
string The generated menu items and actions for Apache.

Definition at line 49 of file class.tpl.app.apache.php.

50 {
52
53 return TplApp::getMenuEnable($bearsamppLang->getValue(Lang::APACHE), self::MENU, get_called_class(), $bearsamppBins->getApache()->isEnable());
54 }
const APACHE
static getMenuEnable($caption, $menu, $class, $enabled=true)

References $bearsamppBins, $bearsamppLang, Lang\APACHE, and TplApp\getMenuEnable().

Referenced by TplApp\getSectionMenuLeft().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ ACTION_ADD_ALIAS

const ACTION_ADD_ALIAS = 'addAlias'

Definition at line 34 of file class.tpl.app.apache.php.

◆ ACTION_ADD_VHOST

const ACTION_ADD_VHOST = 'addVhost'

Definition at line 36 of file class.tpl.app.apache.php.

◆ ACTION_CHANGE_PORT

const ACTION_CHANGE_PORT = 'changeApachePort'

Definition at line 30 of file class.tpl.app.apache.php.

◆ ACTION_DEL_SSL_CERTIFICATE

const ACTION_DEL_SSL_CERTIFICATE = 'delSslCertificate'

Definition at line 39 of file class.tpl.app.apache.php.

◆ ACTION_EDIT_ALIAS

const ACTION_EDIT_ALIAS = 'editAlias'

Definition at line 35 of file class.tpl.app.apache.php.

◆ ACTION_EDIT_VHOST

const ACTION_EDIT_VHOST = 'editVhost'

Definition at line 37 of file class.tpl.app.apache.php.

◆ ACTION_ENABLE

const ACTION_ENABLE = 'enableApache'

Definition at line 28 of file class.tpl.app.apache.php.

◆ ACTION_GEN_SSL_CERTIFICATE

const ACTION_GEN_SSL_CERTIFICATE = 'genSslCertificate'

Definition at line 38 of file class.tpl.app.apache.php.

◆ ACTION_INSTALL_SERVICE

const ACTION_INSTALL_SERVICE = 'installApacheService'

Definition at line 31 of file class.tpl.app.apache.php.

◆ ACTION_REMOVE_SERVICE

const ACTION_REMOVE_SERVICE = 'removeApacheService'

Definition at line 32 of file class.tpl.app.apache.php.

◆ ACTION_SWITCH_MODULE

const ACTION_SWITCH_MODULE = 'switchApacheModule'

Definition at line 33 of file class.tpl.app.apache.php.

◆ ACTION_SWITCH_VERSION

const ACTION_SWITCH_VERSION = 'switchApacheVersion'

Definition at line 29 of file class.tpl.app.apache.php.

◆ MENU

const MENU = 'apache'

Definition at line 20 of file class.tpl.app.apache.php.

◆ MENU_ALIAS

const MENU_ALIAS = 'apacheAlias'

Definition at line 25 of file class.tpl.app.apache.php.

◆ MENU_DEBUG

const MENU_DEBUG = 'apacheDebug'

Definition at line 23 of file class.tpl.app.apache.php.

◆ MENU_MODULES

const MENU_MODULES = 'apacheModules'

Definition at line 24 of file class.tpl.app.apache.php.

◆ MENU_SERVICE

const MENU_SERVICE = 'apacheService'

Definition at line 22 of file class.tpl.app.apache.php.

◆ MENU_VERSIONS

const MENU_VERSIONS = 'apacheVersions'

Definition at line 21 of file class.tpl.app.apache.php.

◆ MENU_VHOSTS

const MENU_VHOSTS = 'apacheVhosts'

Definition at line 26 of file class.tpl.app.apache.php.


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