PHP 클래스 Wikimedia\Composer\MergePlugin

When installed, this plugin will look for a "merge-plugin" key in the composer configuration's "extra" section. The value of this setting can be either a single value or an array of values. Each value is treated as a glob() pattern identifying additional composer.json style configuration files to merge into the configuration for the current compser execution. The "require", "require-dev", "repositories", "extra" and "suggest" sections of the found configuration files will be merged into the root package configuration as though they were directly included in the top-level composer.json file. If included files specify conflicting package versions for "require" or "require-dev", the normal Composer dependency solver process will be used to attempt to resolve the conflict. Specifying the 'replace' key as true will change this default behaviour so that the last-defined version of a package will win, allowing for force-overrides of package defines. By default the "extra" section is not merged. This can be enabled with the 'merge-extra' key by setting it to true. In normal mode, when the same key is found in both the original and the imported extra section, the version in the original config is used and the imported version is skipped. If 'replace' mode is active, this behaviour changes so the imported version of the key is used, replacing the version in the original config.
저자: Bryan Davis ([email protected])
상속: implements Composer\Plugin\PluginInterface, implements Composer\EventDispatcher\EventSubscriberInterface
파일 보기 프로젝트 열기: wikimedia/composer-merge-plugin 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$composer Composer\Composer
$loaded string[] Files that have already been fully processed
$loadedNoDev string[] Files that have already been partially processed
$logger Wikimedia\Composer\Logger
$state Wikimedia\Composer\Merge\PluginState

공개 메소드들

메소드 설명
activate ( Composer\Composer $composer, Composer\IO\IOInterface $io )
getSubscribedEvents ( )
onDependencySolve ( Composer\Installer\InstallerEvent $event ) Handle an event callback for pre-dependency solving phase of an install or update by adding any duplicate package dependencies found during initial merge processing to the request that will be processed by the dependency solver.
onInit ( Composer\EventDispatcher\Event $event ) Handle an event callback for initialization.
onInstallUpdateOrDump ( Composer\Script\Event $event ) Handle an event callback for an install, update or dump command by checking for "merge-plugin" in the "extra" data and merging package contents if found.
onPostInstallOrUpdate ( Composer\Script\Event $event ) Handle an event callback following an install or update command. If our plugin was installed during the run then trigger an update command to process any merge-patterns in the current config.
onPostPackageInstall ( Composer\Installer\PackageEvent $event ) Handle an event callback following installation of a new package by checking to see if the package that was installed was our plugin.

보호된 메소드들

메소드 설명
mergeFile ( Composer\Package\RootPackageInterface $root, string $path ) Read a JSON file and merge its contents
mergeFiles ( array $patterns, boolean $required = false ) Find configuration files matching the configured glob patterns and merge their contents with the master package.

메소드 상세

activate() 공개 메소드

public activate ( Composer\Composer $composer, Composer\IO\IOInterface $io )
$composer Composer\Composer
$io Composer\IO\IOInterface

getSubscribedEvents() 공개 정적인 메소드

public static getSubscribedEvents ( )

mergeFile() 보호된 메소드

Read a JSON file and merge its contents
protected mergeFile ( Composer\Package\RootPackageInterface $root, string $path )
$root Composer\Package\RootPackageInterface
$path string

mergeFiles() 보호된 메소드

Find configuration files matching the configured glob patterns and merge their contents with the master package.
protected mergeFiles ( array $patterns, boolean $required = false )
$patterns array List of files/glob patterns
$required boolean Are the patterns required to match files?

onDependencySolve() 공개 메소드

Handle an event callback for pre-dependency solving phase of an install or update by adding any duplicate package dependencies found during initial merge processing to the request that will be processed by the dependency solver.
public onDependencySolve ( Composer\Installer\InstallerEvent $event )
$event Composer\Installer\InstallerEvent

onInit() 공개 메소드

Handle an event callback for initialization.
public onInit ( Composer\EventDispatcher\Event $event )
$event Composer\EventDispatcher\Event

onInstallUpdateOrDump() 공개 메소드

Handle an event callback for an install, update or dump command by checking for "merge-plugin" in the "extra" data and merging package contents if found.
public onInstallUpdateOrDump ( Composer\Script\Event $event )
$event Composer\Script\Event

onPostInstallOrUpdate() 공개 메소드

Handle an event callback following an install or update command. If our plugin was installed during the run then trigger an update command to process any merge-patterns in the current config.
public onPostInstallOrUpdate ( Composer\Script\Event $event )
$event Composer\Script\Event

onPostPackageInstall() 공개 메소드

Handle an event callback following installation of a new package by checking to see if the package that was installed was our plugin.
public onPostPackageInstall ( Composer\Installer\PackageEvent $event )
$event Composer\Installer\PackageEvent

프로퍼티 상세

$composer 보호되어 있는 프로퍼티

protected Composer,Composer $composer
리턴 Composer\Composer

$loaded 보호되어 있는 프로퍼티

Files that have already been fully processed
protected string[] $loaded
리턴 string[]

$loadedNoDev 보호되어 있는 프로퍼티

Files that have already been partially processed
protected string[] $loadedNoDev
리턴 string[]

$logger 보호되어 있는 프로퍼티

protected Logger,Wikimedia\Composer $logger
리턴 Wikimedia\Composer\Logger

$state 보호되어 있는 프로퍼티

protected PluginState,Wikimedia\Composer\Merge $state
리턴 Wikimedia\Composer\Merge\PluginState