|
Bearsampp 2026.3.26
API documentation
|
Static Public Member Functions | |
| static | getAllServiceNames () |
| static | getBinFromServiceName ($serviceName, $bearsamppBins) |
| static | getServiceDisplayName ($bin, $service) |
| static | getServicePort ($serviceName, $bearsamppBins) |
| static | getSyntaxCheckCmd ($serviceName, $bearsamppBins=null) |
| static | hasSyntaxCheck ($serviceName) |
| static | processServices ($bearsamppBins, callable $callback) |
| static | restartService ($service) |
| static | startService ($bin, $syntaxCheckCmd=null, $showErrors=true) |
| static | stopService ($service) |
Static Private Member Functions | |
| static | initializeMappings ($bearsamppBins) |
Static Private Attributes | |
| static | $serviceMap = null |
| static | $syntaxCheckMap = null |
Class ServiceHelper
Utility class for service management operations. Provides centralized methods for service lookup, syntax check commands, and common service operations to eliminate code duplication.
Definition at line 17 of file class.serviceHelper.php.
|
static |
Get all service names
Definition at line 161 of file class.serviceHelper.php.
References BinApache\SERVICE_NAME, BinMailpit\SERVICE_NAME, BinMariadb\SERVICE_NAME, BinMemcached\SERVICE_NAME, BinMysql\SERVICE_NAME, BinPostgresql\SERVICE_NAME, and BinXlight\SERVICE_NAME.
|
static |
Get binary instance from service name
| string | $serviceName | The service name |
| object | $bearsamppBins | The bins object |
Definition at line 67 of file class.serviceHelper.php.
References $bearsamppBins, and initializeMappings().
Referenced by getServicePort(), and processServices().
|
static |
Get service display name (Name + Version + Service Name)
| object | $bin | The binary instance |
| object | $service | The service instance |
Definition at line 95 of file class.serviceHelper.php.
Referenced by ActionRestartAllServices\processWindow(), ActionStartAllServices\processWindow(), and ActionStopAllServices\processWindow().
|
static |
Get port for a service
| string | $serviceName | The service name |
| object | $bearsamppBins | The bins object |
Definition at line 200 of file class.serviceHelper.php.
References $bearsamppBins, and getBinFromServiceName().
|
static |
Get syntax check command for a service
| string | $serviceName | The service name |
| object | $bearsamppBins | The bins object (for initialization) |
Definition at line 80 of file class.serviceHelper.php.
References $bearsamppBins, and initializeMappings().
Referenced by processServices().
|
static |
Check if a service has syntax check capability
| string | $serviceName | The service name |
Definition at line 180 of file class.serviceHelper.php.
References BinApache\CMD_SYNTAX_CHECK, BinMariadb\CMD_SYNTAX_CHECK, BinMysql\CMD_SYNTAX_CHECK, BinApache\SERVICE_NAME, BinMariadb\SERVICE_NAME, and BinMysql\SERVICE_NAME.
|
staticprivate |
Initialize service mappings
| object | $bearsamppBins | The bins object |
Definition at line 37 of file class.serviceHelper.php.
References $bearsamppBins, BinApache\CMD_SYNTAX_CHECK, BinMariadb\CMD_SYNTAX_CHECK, BinMysql\CMD_SYNTAX_CHECK, BinApache\SERVICE_NAME, BinMailpit\SERVICE_NAME, BinMariadb\SERVICE_NAME, BinMemcached\SERVICE_NAME, BinMysql\SERVICE_NAME, BinPostgresql\SERVICE_NAME, and BinXlight\SERVICE_NAME.
Referenced by getBinFromServiceName(), getSyntaxCheckCmd(), and processServices().
|
static |
Process all services with a callback function
| object | $bearsamppBins | The bins object |
| callable | $callback | Function to call for each service: function($serviceName, $service, $bin, $syntaxCheckCmd) |
Definition at line 107 of file class.serviceHelper.php.
References $bearsamppBins, getBinFromServiceName(), getSyntaxCheckCmd(), and initializeMappings().
Referenced by ActionRestartAllServices\processWindow(), ActionStartAllServices\processWindow(), and ActionStopAllServices\processWindow().
|
static |
Restart a service
| object | $service | The service instance |
Definition at line 151 of file class.serviceHelper.php.
|
static |
Start a service with optional syntax check
| object | $bin | The binary instance |
| string | null | $syntaxCheckCmd | The syntax check command (optional) |
| bool | $showErrors | Whether to show error messages (default: true) |
Definition at line 129 of file class.serviceHelper.php.
References Util\startService().
Referenced by ActionRestartAllServices\processWindow(), and ActionStartAllServices\processWindow().
|
static |
Stop a service
| object | $service | The service instance |
Definition at line 140 of file class.serviceHelper.php.
Referenced by ActionRestartAllServices\processWindow(), and ActionStopAllServices\processWindow().
|
staticprivate |
Definition at line 23 of file class.serviceHelper.php.
|
staticprivate |
Definition at line 29 of file class.serviceHelper.php.