Bearsampp 2026.9.23
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 466 of file class.tpl.app.apache.php.

467 {
468 return TplApp::getActionRun(Action::ADD_ALIAS) . PHP_EOL .
470 }
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 536 of file class.tpl.app.apache.php.

537 {
538 return TplApp::getActionRun(Action::ADD_VHOST) . PHP_EOL .
540 }
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.

Returns
string The generated action to change the Apache port. @global object $bearsamppBins Provides access to system binaries and their configurations.

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

289 {
290 global $bearsamppBins;
291
292 return TplApp::getActionRun(Action::CHANGE_PORT, array($bearsamppBins->getApache()->getName())) . PHP_EOL .
294 }
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 479 of file class.tpl.app.apache.php.

480 {
481 return TplApp::getActionRun(Action::EDIT_ALIAS, array($alias)) . PHP_EOL .
483 }
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 549 of file class.tpl.app.apache.php.

550 {
551 return TplApp::getActionRun(Action::EDIT_VHOST, array($vhost)) . PHP_EOL .
553 }
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.

Parameters
int$enableThe flag to enable (1) or disable (0) Apache.
Returns
string The generated action to enable or disable Apache. @global object $bearsamppBins Provides access to system binaries and their configurations.

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

189 {
190 global $bearsamppBins;
191
192 return TplApp::getActionRun(Action::ENABLE, array($bearsamppBins->getApache()->getName(), $enable)) . PHP_EOL .
194 }
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 301 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 312 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 406 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.

Parameters
string$versionThe version to switch to.
Returns
string The generated action to switch the Apache version. @global object $bearsamppBins Provides access to system binaries and their configurations.

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

206 {
207 global $bearsamppBins;
208
209 return TplApp::getActionRun(Action::SWITCH_VERSION, array($bearsamppBins->getApache()->getName(), $version)) . PHP_EOL .
211 }
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.

Returns
string The generated menu items and actions for Apache. @global object $bearsamppLang Provides language support for retrieving language-specific values.

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

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,
82 array($isEnabled ? Config::DISABLED : Config::ENABLED),
83 array($bearsamppLang->getValue(Lang::MENU_ENABLE), $isEnabled ? TplAestan::GLYPH_CHECK : ''),
84 false,
85 get_called_class()
86 );
87 $resultItems .= $tplEnable[TplApp::SECTION_CALL] . PHP_EOL;
88 $resultActions .= $tplEnable[TplApp::SECTION_CONTENT] . PHP_EOL;
89
90 if ($isEnabled) {
91 $resultItems .= TplAestan::getItemSeparator() . PHP_EOL;
92
93 // Versions
94 $tplVersions = TplApp::getMenu($bearsamppLang->getValue(Lang::VERSIONS), self::MENU_VERSIONS, get_called_class());
95 $resultItems .= $tplVersions[TplApp::SECTION_CALL] . PHP_EOL;
96 $resultActions .= $tplVersions[TplApp::SECTION_CONTENT] . PHP_EOL;
97
98 // Service
99 $tplService = TplApp::getMenu($bearsamppLang->getValue(Lang::SERVICE), self::MENU_SERVICE, get_called_class());
100 $resultItems .= $tplService[TplApp::SECTION_CALL] . PHP_EOL;
101 $resultActions .= $tplService[TplApp::SECTION_CONTENT] . PHP_EOL;
102
103 // Debug
104 $tplDebug = TplApp::getMenu($bearsamppLang->getValue(Lang::DEBUG), self::MENU_DEBUG, get_called_class());
105 $resultItems .= $tplDebug[TplApp::SECTION_CALL] . PHP_EOL;
106 $resultActions .= $tplDebug[TplApp::SECTION_CONTENT] . PHP_EOL;
107
108 // Modules
109 $tplModules = TplApp::getMenu($bearsamppLang->getValue(Lang::MODULES), self::MENU_MODULES, get_called_class());
110 $resultItems .= $tplModules[TplApp::SECTION_CALL] . PHP_EOL;
111 $resultActions .= $tplModules[TplApp::SECTION_CONTENT] . PHP_EOL;
112
113 // Alias
114 $tplAlias = TplApp::getMenu($bearsamppLang->getValue(Lang::ALIASES), self::MENU_ALIAS, get_called_class());
115 $resultItems .= $tplAlias[TplApp::SECTION_CALL] . PHP_EOL;
116 $resultActions .= $tplAlias[TplApp::SECTION_CONTENT] . PHP_EOL;
117
118 // Vhosts
119 $tplVhosts = TplApp::getMenu($bearsamppLang->getValue(Lang::VIRTUAL_HOSTS), self::MENU_VHOSTS, get_called_class());
120 $resultItems .= $tplVhosts[TplApp::SECTION_CALL] . PHP_EOL;
121 $resultActions .= $tplVhosts[TplApp::SECTION_CONTENT] . PHP_EOL;
122
123 // Conf
124 $resultItems .= TplAestan::getItemNotepad(basename($bearsamppBins->getApache()->getConf()), $bearsamppBins->getApache()->getConf()) . PHP_EOL;
125
126 // Access log
127 $resultItems .= TplAestan::getItemNotepad($bearsamppLang->getValue(Lang::MENU_ACCESS_LOGS), $bearsamppBins->getApache()->getAccessLog()) . PHP_EOL;
128
129 // Rewrite log
130 $resultItems .= TplAestan::getItemNotepad($bearsamppLang->getValue(Lang::MENU_REWRITE_LOGS), $bearsamppBins->getApache()->getRewriteLog()) . PHP_EOL;
131
132 // Error log
133 $resultItems .= TplAestan::getItemNotepad($bearsamppLang->getValue(Lang::MENU_ERROR_LOGS), $bearsamppBins->getApache()->getErrorLog()) . PHP_EOL;
134 }
135
136 return $resultItems . PHP_EOL . $resultActions;
137 }
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.

Returns
string The generated menu items and actions for Apache aliases. @global object $bearsamppBins Provides access to system binaries and their configurations.

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

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

424 {
426
427 $tplAddAlias = TplApp::getActionMulti(
428 self::ACTION_ADD_ALIAS,
429 null,
431 false,
432 get_called_class()
433 );
434
435 // Items
436 $items = $tplAddAlias[TplApp::SECTION_CALL] . PHP_EOL .
437 TplAestan::getItemSeparator() . PHP_EOL;
438
439 // Actions
440 $actions = PHP_EOL . $tplAddAlias[TplApp::SECTION_CONTENT];
441
442 foreach ($bearsamppBins->getApache()->getAlias() as $alias) {
443 $tplEditAlias = TplApp::getActionMulti(
444 self::ACTION_EDIT_ALIAS,
445 array($alias),
446 array(sprintf($bearsamppLang->getValue(Lang::MENU_EDIT_ALIAS), $alias), TplAestan::GLYPH_FILE),
447 false,
448 get_called_class()
449 );
450
451 // Items
452 $items .= $tplEditAlias[TplApp::SECTION_CALL] . PHP_EOL;
453
454 // Actions
455 $actions .= PHP_EOL . PHP_EOL . $tplEditAlias[TplApp::SECTION_CONTENT];
456 }
457
458 return $items . $actions;
459 }
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.

Returns
string The generated menu items and actions for Apache debug. @global object $bearsamppLang Provides language support for retrieving language-specific values.

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

326 {
327 global $bearsamppLang;
328
333 ) . PHP_EOL .
338 ) . PHP_EOL .
343 ) . PHP_EOL .
348 ) . PHP_EOL .
353 ) . PHP_EOL .
358 ) . PHP_EOL .
363 ) . PHP_EOL;
364 }
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.

Returns
string The generated menu items and actions for Apache modules. @global object $bearsamppBins Provides access to system binaries and their configurations.

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

374 {
375 global $bearsamppBins;
376 $items = '';
377 $actions = '';
378
379 foreach ($bearsamppBins->getApache()->getModulesFromConf() as $module => $switch) {
380 $tplSwitchApacheModule = TplApp::getActionMulti(
381 self::ACTION_SWITCH_MODULE,
382 array($module, $switch),
383 array($module, ($switch == ActionSwitchApacheModule::SWITCH_ON ? TplAestan::GLYPH_CHECK : '')),
384 false,
385 get_called_class()
386 );
387
388 // Item
389 $items .= $tplSwitchApacheModule[TplApp::SECTION_CALL] . PHP_EOL;
390
391 // Action
392 $actions .= PHP_EOL . $tplSwitchApacheModule[TplApp::SECTION_CONTENT];
393 }
394
395 return $items . $actions;
396 }

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.

Returns
string The generated menu items and actions for Apache service. @global object $bearsamppLang Provides language support for retrieving language-specific values. @global object $bearsamppBins Provides access to system binaries and their configurations.

@global object $bearsamppRoot Provides access to the root path of the application.

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

223 {
225
226 $tplChangePort = TplApp::getActionMulti(
227 self::ACTION_CHANGE_PORT,
228 null,
230 false,
231 get_called_class()
232 );
233
234 $result = TplAestan::getItemActionServiceStart($bearsamppBins->getApache()->getService()->getName()) . PHP_EOL .
235 TplAestan::getItemActionServiceStop($bearsamppBins->getApache()->getService()->getName()) . PHP_EOL .
236 TplAestan::getItemActionServiceRestart($bearsamppBins->getApache()->getService()->getName()) . PHP_EOL .
237 TplAestan::getItemSeparator() . PHP_EOL .
240 array($bearsamppBins->getApache()->getName(), $bearsamppBins->getApache()->getPort()),
241 array(sprintf($bearsamppLang->getValue(Lang::MENU_CHECK_PORT), $bearsamppBins->getApache()->getPort()), TplAestan::GLYPH_LIGHT)
242 ) . PHP_EOL .
245 array($bearsamppBins->getApache()->getName(), $bearsamppBins->getApache()->getSslPort(), true),
246 array(sprintf($bearsamppLang->getValue(Lang::MENU_CHECK_PORT), $bearsamppBins->getApache()->getSslPort()) . ' (SSL)', TplAestan::GLYPH_RED_LIGHT)
247 ) . PHP_EOL .
248 $tplChangePort[TplApp::SECTION_CALL] . PHP_EOL .
249 TplAestan::getItemNotepad($bearsamppLang->getValue(Lang::MENU_UPDATE_ENV_PATH), Path::getRootPath() . '/nssmEnvPaths.dat') . PHP_EOL;
250
251 $isInstalled = $bearsamppBins->getApache()->getService()->isInstalled();
252 if (!$isInstalled) {
253 $tplInstallService = TplApp::getActionMulti(
254 self::ACTION_INSTALL_SERVICE,
255 null,
257 $isInstalled,
258 get_called_class()
259 );
260
261 $result .= $tplInstallService[TplApp::SECTION_CALL] . PHP_EOL . PHP_EOL .
262 $tplInstallService[TplApp::SECTION_CONTENT] . PHP_EOL;
263 } else {
264 $tplRemoveService = TplApp::getActionMulti(
265 self::ACTION_REMOVE_SERVICE,
266 null,
268 !$isInstalled,
269 get_called_class()
270 );
271
272 $result .= $tplRemoveService[TplApp::SECTION_CALL] . PHP_EOL . PHP_EOL .
273 $tplRemoveService[TplApp::SECTION_CONTENT] . PHP_EOL;
274 }
275
276 $result .= $tplChangePort[TplApp::SECTION_CONTENT] . PHP_EOL;
277
278 return $result;
279 }
$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.

Returns
string The generated menu items and actions for Apache versions. @global object $bearsamppBins Provides access to system binaries and their configurations.

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

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

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.

Returns
string The generated menu items and actions for Apache Vhosts. @global object $bearsamppBins Provides access to system binaries and their configurations.

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

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

494 {
496
497 $tplAddVhost = TplApp::getActionMulti(
498 self::ACTION_ADD_VHOST,
499 null,
501 false,
502 get_called_class()
503 );
504
505 // Items
506 $items = $tplAddVhost[TplApp::SECTION_CALL] . PHP_EOL .
507 TplAestan::getItemSeparator() . PHP_EOL;
508
509 // Actions
510 $actions = PHP_EOL . $tplAddVhost[TplApp::SECTION_CONTENT];
511
512 foreach ($bearsamppBins->getApache()->getVhosts() as $vhost) {
513 $tplEditVhost = TplApp::getActionMulti(
514 self::ACTION_EDIT_VHOST,
515 array($vhost),
516 array(sprintf($bearsamppLang->getValue(Lang::MENU_EDIT_VHOST), $vhost), TplAestan::GLYPH_FILE),
517 false,
518 get_called_class()
519 );
520
521 // Items
522 $items .= $tplEditVhost[TplApp::SECTION_CALL] . PHP_EOL;
523
524 // Actions
525 $actions .= PHP_EOL . PHP_EOL . $tplEditVhost[TplApp::SECTION_CONTENT];
526 }
527
528 return $items . $actions;
529 }
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.

Returns
string The generated menu items and actions for Apache. @global object $bearsamppBins Provides access to system binaries and their configurations.

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

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: