2024.8.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_EDIT_ALIAS = 'editAlias'
 
const ACTION_EDIT_VHOST = 'editVhost'
 
const ACTION_ENABLE = 'enableApache'
 
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()

static TplAppApache::getActionAddAlias ( )
static

Generates the action to add an Apache alias.

Returns
string The generated action to add an Apache alias.

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

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

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

◆ getActionAddVhost()

static TplAppApache::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 498 of file class.tpl.app.apache.php.

499 {
500 return TplApp::getActionRun(Action::ADD_VHOST) . PHP_EOL .
502 }
const ADD_VHOST

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

◆ getActionChangeApachePort()

static TplAppApache::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 271 of file class.tpl.app.apache.php.

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

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

◆ getActionEditAlias()

static TplAppApache::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 445 of file class.tpl.app.apache.php.

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

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

◆ getActionEditVhost()

static TplAppApache::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 510 of file class.tpl.app.apache.php.

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

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

◆ getActionEnableApache()

static TplAppApache::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 181 of file class.tpl.app.apache.php.

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

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

◆ getActionInstallApacheService()

static TplAppApache::getActionInstallApacheService ( )
static

Generates the action to install the Apache service.

Returns
string The generated action to install the Apache service.

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

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

◆ getActionRemoveApacheService()

static TplAppApache::getActionRemoveApacheService ( )
static

Generates the action to remove the Apache service.

Returns
string The generated action to remove the Apache service.

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

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

◆ getActionSwitchApacheModule()

static TplAppApache::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 379 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.

◆ getActionSwitchApacheVersion()

static TplAppApache::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 197 of file class.tpl.app.apache.php.

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

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

◆ getMenuApache()

static TplAppApache::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 62 of file class.tpl.app.apache.php.

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

References $bearsamppBins, $bearsamppLang, Lang\ALIASES, Lang\DEBUG, Config\DISABLED, Lang\DOWNLOAD_MORE, Config\ENABLED, TplApp\getActionMulti(), TplAestan\getItemLink(), TplAestan\getItemNotepad(), TplAestan\getItemSeparator(), TplApp\getMenu(), Util\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.

◆ getMenuApacheAlias()

static TplAppApache::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 394 of file class.tpl.app.apache.php.

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

◆ getMenuApacheDebug()

static TplAppApache::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 308 of file class.tpl.app.apache.php.

309 {
310 global $bearsamppLang;
311
315 ) . PHP_EOL .
319 ) . PHP_EOL .
323 ) . PHP_EOL .
327 ) . PHP_EOL .
331 ) . PHP_EOL .
335 ) . PHP_EOL .
339 ) . PHP_EOL;
340 }
const DEBUG_APACHE
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_APACHE_VERSION_NUMBER
const DEBUG_APACHE_LOADED_MODULES

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.

◆ getMenuApacheModules()

static TplAppApache::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 349 of file class.tpl.app.apache.php.

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

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

◆ getMenuApacheService()

static TplAppApache::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 213 of file class.tpl.app.apache.php.

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

References $bearsamppBins, $bearsamppLang, $bearsamppRoot, $result, Action\CHECK_PORT, TplApp\getActionMulti(), TplApp\getActionRun(), TplAestan\getItemActionServiceRestart(), TplAestan\getItemActionServiceStart(), TplAestan\getItemActionServiceStop(), TplAestan\getItemNotepad(), TplAestan\getItemSeparator(), 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.

◆ getMenuApacheVersions()

static TplAppApache::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 142 of file class.tpl.app.apache.php.

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

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

◆ getMenuApacheVhosts()

static TplAppApache::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 459 of file class.tpl.app.apache.php.

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

◆ process()

static TplAppApache::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 47 of file class.tpl.app.apache.php.

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

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

Referenced by TplApp\getSectionMenuLeft().

+ Here is the caller graph for this function:

Field Documentation

◆ ACTION_ADD_ALIAS

const TplAppApache::ACTION_ADD_ALIAS = 'addAlias'

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

◆ ACTION_ADD_VHOST

const TplAppApache::ACTION_ADD_VHOST = 'addVhost'

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

◆ ACTION_CHANGE_PORT

const TplAppApache::ACTION_CHANGE_PORT = 'changeApachePort'

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

◆ ACTION_EDIT_ALIAS

const TplAppApache::ACTION_EDIT_ALIAS = 'editAlias'

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

◆ ACTION_EDIT_VHOST

const TplAppApache::ACTION_EDIT_VHOST = 'editVhost'

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

◆ ACTION_ENABLE

const TplAppApache::ACTION_ENABLE = 'enableApache'

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

◆ ACTION_INSTALL_SERVICE

const TplAppApache::ACTION_INSTALL_SERVICE = 'installApacheService'

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

◆ ACTION_REMOVE_SERVICE

const TplAppApache::ACTION_REMOVE_SERVICE = 'removeApacheService'

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

◆ ACTION_SWITCH_MODULE

const TplAppApache::ACTION_SWITCH_MODULE = 'switchApacheModule'

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

◆ ACTION_SWITCH_VERSION

const TplAppApache::ACTION_SWITCH_VERSION = 'switchApacheVersion'

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

◆ MENU

const TplAppApache::MENU = 'apache'

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

◆ MENU_ALIAS

const TplAppApache::MENU_ALIAS = 'apacheAlias'

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

◆ MENU_DEBUG

const TplAppApache::MENU_DEBUG = 'apacheDebug'

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

◆ MENU_MODULES

const TplAppApache::MENU_MODULES = 'apacheModules'

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

◆ MENU_SERVICE

const TplAppApache::MENU_SERVICE = 'apacheService'

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

◆ MENU_VERSIONS

const TplAppApache::MENU_VERSIONS = 'apacheVersions'

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

◆ MENU_VHOSTS

const TplAppApache::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: