DevToolsPathResolver

Class
Final: Yes

Resolves canonical paths for the DevTools package itself.

Table of Contents

Constants

 = 'bin/dev-tools'
 = 'resources'
 = \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'fast-forward' . \DIRECTORY_SEPARATOR . 'dev-tools'

Methods

getBinaryCommand()

Returns the packaged DevTools binary command with a subcommand.

 : string
getBinaryPath()

Returns the packaged DevTools binary path.

 : string
getPackagePath()

Returns the DevTools package directory or a path under it.

 : string
getResourcesPath()

Returns the packaged resources directory or a path under it.

 : string
isInstalledAsDependency()

Detects whether the provided path belongs to an installed vendor copy of DevTools.

 : bool
isRepositoryCheckout()

Detects whether the provided path belongs to the DevTools repository checkout itself.

 : bool
Constants

Constants

BINARY

Public
public string BINARY = 'bin/dev-tools'

Description

the relative path to the packaged DevTools binary

RESOURCES

Public
public string RESOURCES = 'resources'

Description

the resources directory segment within the package

VENDOR_PACKAGE_PATH

Private
private string VENDOR_PACKAGE_PATH = \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'fast-forward' . \DIRECTORY_SEPARATOR . 'dev-tools'

Description

the vendor install path fragment used when DevTools runs as a dependency

Methods

getBinaryCommand()

Public Static

Returns the packaged DevTools binary command with a subcommand.

public static getBinaryCommand( string  $command) : string
Parameters
$command : string

Description

the DevTools subcommand to append

Return values
string

getBinaryPath()

Public Static

Returns the packaged DevTools binary path.

public static getBinaryPath() : string
Return values
string

getPackagePath()

Public Static

Returns the DevTools package directory or a path under it.

public static getPackagePath([ string  $path = '']) : string
Parameters
$path : string = ''

Description

the optional relative segment to append under the package directory

Return values
string

getResourcesPath()

Public Static

Returns the packaged resources directory or a path under it.

public static getResourcesPath([ string  $path = '']) : string
Parameters
$path : string = ''

Description

the optional relative segment to append under resources

Return values
string

isInstalledAsDependency()

Public Static

Detects whether the provided path belongs to an installed vendor copy of DevTools.

public static isInstalledAsDependency([ string  $packagePath = '']) : bool
Parameters
$packagePath : string = ''

Description

an optional path within the package; defaults to the package root

Return values
bool

isRepositoryCheckout()

Public Static

Detects whether the provided path belongs to the DevTools repository checkout itself.

public static isRepositoryCheckout([ string  $packagePath = '']) : bool
Parameters
$packagePath : string = ''

Description

an optional path within the package; defaults to the package root

Return values
bool