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
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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