BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
Wikimedia\Composer\Merge\PluginState Class Reference

Public Member Functions

 __construct (Composer $composer)
 
 loadSettings ()
 
 getIncludes ()
 
 getRequires ()
 
 setFirstInstall ($flag)
 
 isFirstInstall ()
 
 setLocked ($flag)
 
 isLocked ()
 
 forceUpdate ()
 
 setDevMode ($flag)
 
 isDevMode ()
 
 shouldMergeDev ()
 
 setDumpAutoloader ($flag)
 
 shouldDumpAutoloader ()
 
 setOptimizeAutoloader ($flag)
 
 shouldOptimizeAutoloader ()
 
 addDuplicateLinks ($type, array $packages)
 
 getDuplicateLinks ($type)
 
 recurseIncludes ()
 
 replaceDuplicateLinks ()
 
 ignoreDuplicateLinks ()
 
 shouldMergeExtra ()
 
 shouldMergeExtraDeep ()
 
 shouldMergeScripts ()
 

Protected Attributes

 $composer
 
 $includes = array()
 
 $requires = array()
 
 $duplicateLinks = array()
 
 $devMode = false
 
 $recurse = true
 
 $replace = false
 
 $ignore = false
 
 $mergeDev = true
 
 $mergeExtra = false
 
 $mergeExtraDeep = false
 
 $mergeScripts = false
 
 $firstInstall = false
 
 $locked = false
 
 $dumpAutoloader = false
 
 $optimizeAutoloader = false
 

Detailed Description

Mutable plugin state

Author
Bryan Davis bd808.nosp@m.@bd8.nosp@m.08.co.nosp@m.m

Constructor & Destructor Documentation

Wikimedia\Composer\Merge\PluginState::__construct ( Composer  $composer)
Parameters
Composer$composer

Member Function Documentation

Wikimedia\Composer\Merge\PluginState::addDuplicateLinks (   $type,
array  $packages 
)

Add duplicate packages

Parameters
string$typePackage type
array$packages
Wikimedia\Composer\Merge\PluginState::forceUpdate ( )

Should an update be forced?

Returns
true If packages are not locked
Wikimedia\Composer\Merge\PluginState::getDuplicateLinks (   $type)

Get duplicate packages

Parameters
string$typePackage type
Returns
array
Wikimedia\Composer\Merge\PluginState::getIncludes ( )

Get list of filenames and/or glob patterns to include

Returns
array
Wikimedia\Composer\Merge\PluginState::getRequires ( )

Get list of filenames and/or glob patterns to require

Returns
array
Wikimedia\Composer\Merge\PluginState::ignoreDuplicateLinks ( )

Should duplicate links be ignored?

Returns
bool
Wikimedia\Composer\Merge\PluginState::isDevMode ( )

Should devMode settings be processed?

Returns
bool
Wikimedia\Composer\Merge\PluginState::isFirstInstall ( )

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

Returns
bool
Wikimedia\Composer\Merge\PluginState::isLocked ( )

Was a lockfile present when the plugin was installed?

Returns
bool
Wikimedia\Composer\Merge\PluginState::loadSettings ( )

Load plugin settings

Wikimedia\Composer\Merge\PluginState::recurseIncludes ( )

Should includes be recursively processed?

Returns
bool
Wikimedia\Composer\Merge\PluginState::replaceDuplicateLinks ( )

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

Returns
bool
Wikimedia\Composer\Merge\PluginState::setDevMode (   $flag)

Set the devMode flag

Parameters
bool$flag
Wikimedia\Composer\Merge\PluginState::setDumpAutoloader (   $flag)

Set the dumpAutoloader flag

Parameters
bool$flag
Wikimedia\Composer\Merge\PluginState::setFirstInstall (   $flag)

Set the first install flag

Parameters
bool$flag
Wikimedia\Composer\Merge\PluginState::setLocked (   $flag)

Set the locked flag

Parameters
bool$flag
Wikimedia\Composer\Merge\PluginState::setOptimizeAutoloader (   $flag)

Set the optimizeAutoloader flag

Parameters
bool$flag
Wikimedia\Composer\Merge\PluginState::shouldDumpAutoloader ( )

Is the autoloader file supposed to be written out?

Returns
bool
Wikimedia\Composer\Merge\PluginState::shouldMergeDev ( )

Should devMode settings be merged?

Returns
bool
Wikimedia\Composer\Merge\PluginState::shouldMergeExtra ( )

Should the extra section be merged?

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.

Returns
bool
Wikimedia\Composer\Merge\PluginState::shouldMergeExtraDeep ( )

Should the extra section be merged deep / recursively?

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.

Returns
bool
Wikimedia\Composer\Merge\PluginState::shouldMergeScripts ( )

Should the scripts section be merged?

By default, the scripts section is not merged.

Returns
bool
Wikimedia\Composer\Merge\PluginState::shouldOptimizeAutoloader ( )

Should the autoloader be optimized?

Returns
bool

Member Data Documentation

bool Wikimedia\Composer\Merge\PluginState::$mergeDev = true
protected

Whether to merge the -dev sections.

bool Wikimedia\Composer\Merge\PluginState::$mergeExtra = false
protected

Whether to merge the extra section.

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.

bool Wikimedia\Composer\Merge\PluginState::$mergeExtraDeep = false
protected

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

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.

bool Wikimedia\Composer\Merge\PluginState::$mergeScripts = false
protected

Whether to merge the scripts section.


The documentation for this class was generated from the following file: