Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LightningService

Hierarchy

Index

Constructors

constructor

Properties

Readonly $PATH

$PATH: string
returns

Path to be used in $PATH for current platform.

getter

Readonly $PATHs

$PATHs: {}
remarks

Platforms can be omitted.

returns

Valid path to be used in $PATH for each platform.

getter

Type declaration

_lightningServices

_lightningServices: LightningServices

_logger

_logger: any

_site

_site: Site

Readonly bin

bin: {} | undefined
returns

Paths to binaries for service on current platform.

getter

Readonly binVersion

binVersion: string
remarks

The version format should be parsable by semver, but does not need to be compliant.

returns

Version of the binary included with the service.

Readonly bins

bins: {}
remarks

Platforms can be omitted.

returns

Path to binaries for each platform.

getter

Type declaration

Readonly configPath

configPath: string
remarks

In most cases, this path will be where the Handlebars config templates are compiled to.

returns

Path to config path that the service will consume.

getter

Readonly configTemplatePath

configTemplatePath: string | null
returns

Path to the config templates included with the service.

getter

Readonly configVariables

configVariables: ConfigVariables
returns

Object containing variables to be replaced in config templates using Handlebars.

getter

Readonly env

env: ProcessEnv
remarks

These environment variables are used when Local calls WP-CLI directly.

returns

Object containing environment variables for the process.

getter

Optional Readonly label

label: string

Examples: Nginx PHP MySQL

returns

Label of the service that's suitable for use in a UI

Readonly logsPath

logsPath: string
remarks

Path will typically be in the site's 'logs' directory adjacent to the 'app' directory.

returns

Path to log directory the service.

getter

Readonly port

port: Local.SitePort | null
see

LocalSiteJSON.ports

returns

First allocated port for service.

getter

Readonly ports

ports: {} | null
see

LocalSiteJSON.ports

returns

Allocated ports on site for current service.

getter

Readonly requiredPorts

requiredPorts: {}
see

LocalSiteJSON.ports

returns

Port identifiers and number of ports needed. Keys should be uppercase.

getter

Type declaration

  • [portKey: string]: Local.SitePort

Readonly runPath

runPath: string
remarks

Generally used for 'tmp' directories, 'data' directories, and other things you'd find in '/var/run'.

returns

Path to 'run' directory for service.

getter

Readonly serviceName

serviceName: string
remarks

Should be lowercase with no spaces and special characters.

Examples: nginx php mysql

returns

Name of the service.

Readonly siteConfigTemplatePath

siteConfigTemplatePath: string
returns

Path to config templates after they've been copied to the site directory.

getter

Readonly siteShellStartupBat

siteShellStartupBat: string
remarks

Only used by PHP service attached to site at this time.

returns

Batch script be added to the Site Shell Entry startup script.

getter

Readonly siteShellStartupPOSIX

siteShellStartupPOSIX: string
remarks

Only used by PHP service attached to site at this time.

returns

Shell script to be added to the Site Shell Entry startup script.

getter

Readonly socket

socket: string | null
returns

Path to socket for service on current platform.

getter

Methods

Optional preprovision

  • preprovision(): Promise<void>
  • Ran before a service is started for the first time.

    remarks

    This is commonly used for setting up data directories or whatever is necessary to allow a service to start for the first time.

    Returns Promise<void>

    Promise

Optional provision

  • provision(): Promise<void>
  • Ran after a service is started for the first time.

    remarks

    Used for setting up MySQL databases, users, etc.

    Returns Promise<void>

    Promise

start

Optional stop

  • stop(): Promise<void>
  • Do things before a service is stopped. Can be used for dumping databases prior to completely stopping the process.

    Returns Promise<void>

    Promise

toJSON

  • toJSON(): Pick<LightningService, "_site" | "serviceName" | "binVersion" | "configTemplatePath" | "siteConfigTemplatePath" | "bins" | "bin" | "$PATH" | "$PATHs" | "socket" | "port" | "ports" | "env" | "configVariables" | "configPath" | "runPath" | "logsPath">
  • Get properties and computed getters from instance. This is handy for passing the service info from the main thread to the renderer thread.

    Returns Pick<LightningService, "_site" | "serviceName" | "binVersion" | "configTemplatePath" | "siteConfigTemplatePath" | "bins" | "bin" | "$PATH" | "$PATHs" | "socket" | "port" | "ports" | "env" | "configVariables" | "configPath" | "runPath" | "logsPath">

    Properties and computed getters from instance.

Generated using TypeDoc