SystemdManager
    
            
            in package
            
        
    
            
            implements
                            IServiceManager                    
    
    
Tool for managing services (systemD init daemon)
Table of Contents
Interfaces
- IServiceManager
 - Interface for tools for managing service
 
Properties
- $commandManager : CommandExecutor
 
Methods
- __construct() : mixed
 - Constructor
 - disable() : void
 - Disables service(s)
 - enable() : void
 - Enables service(s)
 - getState() : ServiceState
 - Returns state of the service
 - getStatus() : string
 - Returns status of the service
 - isActive() : bool
 - Checks if the service is active
 - isEnabled() : bool
 - Checks if the service is enabled
 - restart() : void
 - Restarts the service
 - start() : void
 - Starts service(s)
 - stop() : void
 - Stops service(s)
 - formatServiceName() : string
 - Formats the service name
 - formatServiceNames() : string
 - Formats service names
 - isUnit() : bool
 - Checks if service name already contains a unit type
 
Properties
$commandManager read-only
        private
            CommandExecutor
    $commandManager
    
    
    
    
    
    
Methods
__construct()
Constructor
    public
                    __construct(CommandExecutor $commandManager) : mixed
    Parameters
- $commandManager : CommandExecutor
 - 
                    
Command manager
 
disable()
Disables service(s)
    public
                    disable(string|array<string|int, string> $services[, bool $stop = true ]) : void
    Parameters
- $services : string|array<string|int, string>
 - 
                    
Service name(s)
 - $stop : bool = true
 - 
                    
Stop service(s) after disabling
 
Tags
enable()
Enables service(s)
    public
                    enable(string|array<string|int, string> $services[, bool $start = true ]) : void
    Parameters
- $services : string|array<string|int, string>
 - 
                    
Service name(s)
 - $start : bool = true
 - 
                    
Start service(s) after enabling
 
Tags
getState()
Returns state of the service
    public
                    getState(string $serviceName[, bool $withStatus = false ]) : ServiceState
    Parameters
- $serviceName : string
 - 
                    
Service name
 - $withStatus : bool = false
 - 
                    
Include service status?
 
Tags
Return values
ServiceState —Service state
getStatus()
Returns status of the service
    public
                    getStatus(string $serviceName) : string
    Parameters
- $serviceName : string
 - 
                    
Service name
 
Tags
Return values
string —Service status
isActive()
Checks if the service is active
    public
                    isActive(string $serviceName) : bool
    Parameters
- $serviceName : string
 - 
                    
Service name
 
Return values
bool —Is service active?
isEnabled()
Checks if the service is enabled
    public
                    isEnabled(string $serviceName) : bool
    Parameters
- $serviceName : string
 - 
                    
Service name
 
Tags
Return values
bool —Is service enabled?
restart()
Restarts the service
    public
                    restart(string $serviceName) : void
    Parameters
- $serviceName : string
 - 
                    
Service name
 
Tags
start()
Starts service(s)
    public
                    start(string|array<string|int, string> $services) : void
    Parameters
- $services : string|array<string|int, string>
 - 
                    
Service name(s)
 
Tags
stop()
Stops service(s)
    public
                    stop(string|array<string|int, string> $services) : void
    Parameters
- $services : string|array<string|int, string>
 - 
                    
Service name(s)
 
Tags
formatServiceName()
Formats the service name
    private
                    formatServiceName(string $serviceName) : string
    Parameters
- $serviceName : string
 - 
                    
Service name to format
 
Return values
string —Formatted service name
formatServiceNames()
Formats service names
    private
                    formatServiceNames(array<string|int, string> $services) : string
    Parameters
- $services : array<string|int, string>
 - 
                    
Service names
 
Return values
string —Formatted service names
isUnit()
Checks if service name already contains a unit type
    private
                    isUnit(string $serviceName) : bool
    Parameters
- $serviceName : string
 - 
                    
Service name
 
Return values
bool —Service name contains unit type