Documentation

PluginState
in package

Mutable plugin state

Tags
author

Bryan Davis bd808@bd808.com

Table of Contents

$composer  : Composer
$devMode  : bool
$dumpAutoloader  : bool
$duplicateLinks  : array<string|int, mixed>
$firstInstall  : bool
$ignore  : bool
$includes  : array<string|int, mixed>
$locked  : bool
$mergeDev  : bool
Whether to merge the -dev sections.
$mergeExtra  : bool
Whether to merge the extra section.
$mergeExtraDeep  : bool
Whether to merge the extra section in a deep / recursive way.
$mergeScripts  : bool
Whether to merge the scripts section.
$optimizeAutoloader  : bool
$recurse  : bool
$replace  : bool
$requires  : array<string|int, mixed>
__construct()  : mixed
addDuplicateLinks()  : mixed
Add duplicate packages
forceUpdate()  : true
Should an update be forced?
getDuplicateLinks()  : array<string|int, mixed>
Get duplicate packages
getIncludes()  : array<string|int, mixed>
Get list of filenames and/or glob patterns to include
getRequires()  : array<string|int, mixed>
Get list of filenames and/or glob patterns to require
ignoreDuplicateLinks()  : bool
Should duplicate links be ignored?
isDevMode()  : bool
Should devMode settings be processed?
isFirstInstall()  : bool
Is this the first time that the plugin has been installed?
isLocked()  : bool
Was a lockfile present when the plugin was installed?
loadSettings()  : mixed
Load plugin settings
recurseIncludes()  : bool
Should includes be recursively processed?
replaceDuplicateLinks()  : bool
Should duplicate links be replaced in a 'last definition wins' order?
setDevMode()  : mixed
Set the devMode flag
setDumpAutoloader()  : mixed
Set the dumpAutoloader flag
setFirstInstall()  : mixed
Set the first install flag
setLocked()  : mixed
Set the locked flag
setOptimizeAutoloader()  : mixed
Set the optimizeAutoloader flag
shouldDumpAutoloader()  : bool
Is the autoloader file supposed to be written out?
shouldMergeDev()  : bool
Should devMode settings be merged?
shouldMergeExtra()  : bool
Should the extra section be merged?
shouldMergeExtraDeep()  : bool
Should the extra section be merged deep / recursively?
shouldMergeScripts()  : bool
Should the scripts section be merged?
shouldOptimizeAutoloader()  : bool
Should the autoloader be optimized?

Properties

$dumpAutoloader

protected bool $dumpAutoloader = false
protected array<string|int, mixed> $duplicateLinks = array()

$includes

protected array<string|int, mixed> $includes = array()

$mergeDev

Whether to merge the -dev sections.

protected bool $mergeDev = true

$mergeExtra

Whether to merge the extra section.

protected bool $mergeExtra = false

By default, the extra section is not merged and there will be many cases where the merge of the extra section is performed too late to be of use to other plugins. When enabled, merging uses one of two strategies - either 'first wins' or 'last wins'. When enabled, 'first wins' is the default behaviour. If Replace mode is activated then 'last wins' is used.

$mergeExtraDeep

Whether to merge the extra section in a deep / recursive way.

protected bool $mergeExtraDeep = false

By default the extra section is merged with array_merge() and duplicate keys are ignored. When enabled this allows to merge the arrays recursively using the following rule: Integer keys are merged, while array values are replaced where the later values overwrite the former.

This is useful especially for the extra section when plugins use larger structures like a 'patches' key with the packages as sub-keys and the patches as values.

When 'replace' mode is activated the order of array merges is exchanged.

$mergeScripts

Whether to merge the scripts section.

protected bool $mergeScripts = false

$optimizeAutoloader

protected bool $optimizeAutoloader = false

$requires

protected array<string|int, mixed> $requires = array()

Methods

Add duplicate packages

public addDuplicateLinks(string $type, array<string|int, mixed> $packages) : mixed
Parameters
$type : string

Package type

$packages : array<string|int, mixed>
Return values
mixed

forceUpdate()

Should an update be forced?

public forceUpdate() : true
Return values
true

If packages are not locked

Get duplicate packages

public getDuplicateLinks(string $type) : array<string|int, mixed>
Parameters
$type : string

Package type

Return values
array<string|int, mixed>

getIncludes()

Get list of filenames and/or glob patterns to include

public getIncludes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRequires()

Get list of filenames and/or glob patterns to require

public getRequires() : array<string|int, mixed>
Return values
array<string|int, mixed>

Should duplicate links be ignored?

public ignoreDuplicateLinks() : bool
Return values
bool

isDevMode()

Should devMode settings be processed?

public isDevMode() : bool
Return values
bool

isFirstInstall()

Is this the first time that the plugin has been installed?

public isFirstInstall() : bool
Return values
bool

isLocked()

Was a lockfile present when the plugin was installed?

public isLocked() : bool
Return values
bool

loadSettings()

Load plugin settings

public loadSettings() : mixed
Return values
mixed

recurseIncludes()

Should includes be recursively processed?

public recurseIncludes() : bool
Return values
bool

Should duplicate links be replaced in a 'last definition wins' order?

public replaceDuplicateLinks() : bool
Return values
bool

setDevMode()

Set the devMode flag

public setDevMode(bool $flag) : mixed
Parameters
$flag : bool
Return values
mixed

setDumpAutoloader()

Set the dumpAutoloader flag

public setDumpAutoloader(bool $flag) : mixed
Parameters
$flag : bool
Return values
mixed

setFirstInstall()

Set the first install flag

public setFirstInstall(bool $flag) : mixed
Parameters
$flag : bool
Return values
mixed

setLocked()

Set the locked flag

public setLocked(bool $flag) : mixed
Parameters
$flag : bool
Return values
mixed

setOptimizeAutoloader()

Set the optimizeAutoloader flag

public setOptimizeAutoloader(bool $flag) : mixed
Parameters
$flag : bool
Return values
mixed

shouldDumpAutoloader()

Is the autoloader file supposed to be written out?

public shouldDumpAutoloader() : bool
Return values
bool

shouldMergeDev()

Should devMode settings be merged?

public shouldMergeDev() : bool
Return values
bool

shouldMergeExtra()

Should the extra section be merged?

public shouldMergeExtra() : bool

By default, the extra section is not merged and there will be many cases where the merge of the extra section is performed too late to be of use to other plugins. When enabled, merging uses one of two strategies - either 'first wins' or 'last wins'. When enabled, 'first wins' is the default behaviour. If Replace mode is activated then 'last wins' is used.

Return values
bool

shouldMergeExtraDeep()

Should the extra section be merged deep / recursively?

public shouldMergeExtraDeep() : bool

By default the extra section is merged with array_merge() and duplicate keys are ignored. When enabled this allows to merge the arrays recursively using the following rule: Integer keys are merged, while array values are replaced where the later values overwrite the former.

This is useful especially for the extra section when plugins use larger structures like a 'patches' key with the packages as sub-keys and the patches as values.

When 'replace' mode is activated the order of array merges is exchanged.

Return values
bool

shouldMergeScripts()

Should the scripts section be merged?

public shouldMergeScripts() : bool

By default, the scripts section is not merged.

Return values
bool

shouldOptimizeAutoloader()

Should the autoloader be optimized?

public shouldOptimizeAutoloader() : bool
Return values
bool

Search results