IQRF PHP service manager

IServiceManager

Interface for tools for managing service

Table of Contents

Methods

disable()  : void
Disables service(s)
enable()  : void
Enables service(s)
exists()  : bool
Checks if the service exists
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
reload()  : void
Reloads the service configuration without interrupting the service
restart()  : void
Restarts the service, the service is started if it is not running
start()  : void
Starts service(s)
stop()  : void
Stops service(s)

Methods

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
throws
NonexistentServiceException

The service does not exist

throws
NotImplementedException

The operation is not supported by the init daemon

throws
ServiceOperationException

The service cannot be disabled (e.g. static unit) or the operation failed

throws
UnsupportedInitSystemException

The init daemon is not supported

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
throws
NonexistentServiceException

The service does not exist

throws
NotImplementedException

The operation is not supported by the init daemon

throws
ServiceOperationException

The service cannot be enabled (e.g. static unit) or the operation failed

throws
UnsupportedInitSystemException

The init daemon is not supported

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
throws
NonexistentServiceException

The service does not exist

throws
NotImplementedException

The operation is not supported by the init daemon

throws
UnsupportedInitSystemException

The init daemon is not supported

Return values
ServiceState —

Service state

reload()

Reloads the service configuration without interrupting the service

public reload(string $serviceName) : void
Parameters
$serviceName : string

Service name

Tags
throws
NonexistentServiceException

The service does not exist

throws
NotImplementedException

The operation is not supported by the init daemon

throws
ServiceOperationException

The operation failed (e.g. the service does not support reloading or is not running)

throws
UnsupportedInitSystemException

The init daemon is not supported


        
On this page

Search results