PHP Class Wikimedia\Composer\Merge\PluginState

Author: Bryan Davis ([email protected])
Show file Open project: wikimedia/composer-merge-plugin Class Usage Examples

Protected Properties

Property Type Description
$composer Composer\Composer
$devMode boolean
$dumpAutoloader boolean
$duplicateLinks array
$firstInstall boolean
$includes array
$locked boolean
$mergeDev boolean Whether to merge the -dev sections.
$mergeExtra boolean 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 boolean 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.
$optimizeAutoloader boolean
$recurse boolean
$replace boolean
$requires array

Public Methods

Method Description
__construct ( Composer\Composer $composer )
addDuplicateLinks ( string $type, array $packages ) Add duplicate packages
forceUpdate ( ) : true Should an update be forced?
getDuplicateLinks ( string $type ) : array Get duplicate packages
getIncludes ( ) : array Get list of filenames and/or glob patterns to include
getRequires ( ) : array Get list of filenames and/or glob patterns to require
isDevMode ( ) : boolean Should devMode settings be processed?
isFirstInstall ( ) : boolean Is this the first time that the plugin has been installed?
isLocked ( ) : boolean Was a lockfile present when the plugin was installed?
loadSettings ( ) Load plugin settings
recurseIncludes ( ) : boolean Should includes be recursively processed?
replaceDuplicateLinks ( ) : boolean Should duplicate links be replaced in a 'last definition wins' order?
setDevMode ( boolean $flag ) Set the devMode flag
setDumpAutoloader ( boolean $flag ) Set the dumpAutoloader flag
setFirstInstall ( boolean $flag ) Set the first install flag
setLocked ( boolean $flag ) Set the locked flag
setOptimizeAutoloader ( boolean $flag ) Set the optimizeAutoloader flag
shouldDumpAutoloader ( ) : boolean Is the autoloader file supposed to be written out?
shouldMergeDev ( ) : boolean Should devMode settings be merged?
shouldMergeExtra ( ) : boolean Should the extra section be merged?
shouldMergeExtraDeep ( ) : boolean Should the extra section be merged deep / recursively?
shouldOptimizeAutoloader ( ) : boolean Should the autoloader be optimized?

Method Details

__construct() public method

public __construct ( Composer\Composer $composer )
$composer Composer\Composer

forceUpdate() public method

Should an update be forced?
public forceUpdate ( ) : true
return true If packages are not locked

getIncludes() public method

Get list of filenames and/or glob patterns to include
public getIncludes ( ) : array
return array

getRequires() public method

Get list of filenames and/or glob patterns to require
public getRequires ( ) : array
return array

isDevMode() public method

Should devMode settings be processed?
public isDevMode ( ) : boolean
return boolean

isFirstInstall() public method

Is this the first time that the plugin has been installed?
public isFirstInstall ( ) : boolean
return boolean

isLocked() public method

Was a lockfile present when the plugin was installed?
public isLocked ( ) : boolean
return boolean

loadSettings() public method

Load plugin settings
public loadSettings ( )

recurseIncludes() public method

Should includes be recursively processed?
public recurseIncludes ( ) : boolean
return boolean

setDevMode() public method

Set the devMode flag
public setDevMode ( boolean $flag )
$flag boolean

setDumpAutoloader() public method

Set the dumpAutoloader flag
public setDumpAutoloader ( boolean $flag )
$flag boolean

setFirstInstall() public method

Set the first install flag
public setFirstInstall ( boolean $flag )
$flag boolean

setLocked() public method

Set the locked flag
public setLocked ( boolean $flag )
$flag boolean

setOptimizeAutoloader() public method

Set the optimizeAutoloader flag
public setOptimizeAutoloader ( boolean $flag )
$flag boolean

shouldDumpAutoloader() public method

Is the autoloader file supposed to be written out?
public shouldDumpAutoloader ( ) : boolean
return boolean

shouldMergeDev() public method

Should devMode settings be merged?
public shouldMergeDev ( ) : boolean
return boolean

shouldMergeExtra() public method

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.
public shouldMergeExtra ( ) : boolean
return boolean

shouldMergeExtraDeep() public method

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.
public shouldMergeExtraDeep ( ) : boolean
return boolean

shouldOptimizeAutoloader() public method

Should the autoloader be optimized?

Property Details

$composer protected property

protected Composer,Composer $composer
return Composer\Composer

$devMode protected property

protected bool $devMode
return boolean

$dumpAutoloader protected property

protected bool $dumpAutoloader
return boolean

$firstInstall protected property

protected bool $firstInstall
return boolean

$includes protected property

protected array $includes
return array

$locked protected property

protected bool $locked
return boolean

$mergeDev protected property

Whether to merge the -dev sections.
protected bool $mergeDev
return boolean

$mergeExtra protected property

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.
protected bool $mergeExtra
return boolean

$mergeExtraDeep protected property

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.
protected bool $mergeExtraDeep
return boolean

$optimizeAutoloader protected property

protected bool $optimizeAutoloader
return boolean

$recurse protected property

protected bool $recurse
return boolean

$replace protected property

protected bool $replace
return boolean

$requires protected property

protected array $requires
return array