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

Static Public Member Functions

static getActionRestartServices ()
 
static getActionStartServices ()
 
static getActionStopServices ()
 
static process ()
 

Data Fields

const ACTION_RESTART = 'restartServices'
 
const ACTION_START = 'startServices'
 
const ACTION_STOP = 'stopServices'
 

Detailed Description

Class TplAppServices

This class provides methods to generate menu items and actions for managing multiple services within the Bearsampp application. It includes functionalities for starting, stopping, and restarting all services at once.

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

Member Function Documentation

◆ getActionRestartServices()

static TplAppServices::getActionRestartServices ( )
static

Generates the actions to restart all services by stopping and then starting them.

Returns
string The generated actions to restart all services.

Definition at line 109 of file class.tpl.app.services.php.

References getActionStartServices(), and getActionStopServices().

◆ getActionStartServices()

static TplAppServices::getActionStartServices ( )
static

Generates the actions to start all services.

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

Returns
string The generated actions to start all services.

Definition at line 73 of file class.tpl.app.services.php.

74 {
75 global $bearsamppBins;
76 $actions = '';
77
78 foreach ($bearsamppBins->getServices() as $sName => $service) {
79 $actions .= TplService::getActionStart($service->getName()) . PHP_EOL;
80 }
81
82 return $actions;
83 }
global $bearsamppBins
static getActionStart($sName)

References $bearsamppBins, and TplService\getActionStart().

Referenced by getActionRestartServices().

+ Here is the caller graph for this function:

◆ getActionStopServices()

static TplAppServices::getActionStopServices ( )
static

Generates the actions to stop all services.

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

Returns
string The generated actions to stop all services.

Definition at line 92 of file class.tpl.app.services.php.

93 {
94 global $bearsamppBins;
95 $actions = '';
96
97 foreach ($bearsamppBins->getServices() as $sName => $service) {
98 $actions .= TplService::getActionStop($service->getName()) . PHP_EOL;
99 }
100
101 return $actions;
102 }
static getActionStop($sName)

References $bearsamppBins, and TplService\getActionStop().

Referenced by getActionRestartServices().

+ Here is the caller graph for this function:

◆ process()

static TplAppServices::process ( )
static

Generates the main services menu with options to start, stop, and restart all services.

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

Returns
array An array containing the generated menu items and actions for services.

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

32 {
33 global $bearsamppLang;
34
35 $tplStart = TplApp::getActionMulti(
36 self::ACTION_START, null,
38 false, get_called_class()
39 );
40
41 $tplStop = TplApp::getActionMulti(
42 self::ACTION_STOP, null,
44 false, get_called_class()
45 );
46
47 $tplRestart = TplApp::getActionMulti(
48 self::ACTION_RESTART, null,
50 false, get_called_class()
51 );
52
53 // Items
54 $items = $tplStart[TplApp::SECTION_CALL] . PHP_EOL .
55 $tplStop[TplApp::SECTION_CALL] . PHP_EOL .
56 $tplRestart[TplApp::SECTION_CALL] . PHP_EOL;
57
58 // Actions
59 $actions = PHP_EOL . $tplStart[TplApp::SECTION_CONTENT] .
60 PHP_EOL . $tplStop[TplApp::SECTION_CONTENT] .
61 PHP_EOL . $tplRestart[TplApp::SECTION_CONTENT];
62
63 return array($items, $actions);
64 }
global $bearsamppLang
const MENU_START_SERVICES
const MENU_RESTART_SERVICES
const MENU_STOP_SERVICES
const GLYPH_SERVICES_START
const GLYPH_SERVICES_STOP
const GLYPH_SERVICES_RESTART
static getActionMulti($action, $args=array(), $item=array(), $disabled=false, $class=false)
const SECTION_CALL
const SECTION_CONTENT

References $bearsamppLang, TplApp\getActionMulti(), TplAestan\GLYPH_SERVICES_RESTART, TplAestan\GLYPH_SERVICES_START, TplAestan\GLYPH_SERVICES_STOP, Lang\MENU_RESTART_SERVICES, Lang\MENU_START_SERVICES, Lang\MENU_STOP_SERVICES, TplApp\SECTION_CALL, and TplApp\SECTION_CONTENT.

Referenced by TplApp\getSectionMenuLeft().

+ Here is the caller graph for this function:

Field Documentation

◆ ACTION_RESTART

const TplAppServices::ACTION_RESTART = 'restartServices'

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

◆ ACTION_START

const TplAppServices::ACTION_START = 'startServices'

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

◆ ACTION_STOP

const TplAppServices::ACTION_STOP = 'stopServices'

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


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