You are here

public function PluginState::loadSettings in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/wikimedia/composer-merge-plugin/src/Merge/PluginState.php \Wikimedia\Composer\Merge\PluginState::loadSettings()

Load plugin settings

File

vendor/wikimedia/composer-merge-plugin/src/Merge/PluginState.php, line 108

Class

PluginState
Mutable plugin state

Namespace

Wikimedia\Composer\Merge

Code

public function loadSettings() {
  $extra = $this->composer
    ->getPackage()
    ->getExtra();
  $config = array_merge(array(
    'include' => array(),
    'require' => array(),
    'recurse' => true,
    'replace' => false,
    'merge-dev' => true,
    'merge-extra' => false,
  ), isset($extra['merge-plugin']) ? $extra['merge-plugin'] : array());
  $this->includes = is_array($config['include']) ? $config['include'] : array(
    $config['include'],
  );
  $this->requires = is_array($config['require']) ? $config['require'] : array(
    $config['require'],
  );
  $this->recurse = (bool) $config['recurse'];
  $this->replace = (bool) $config['replace'];
  $this->mergeDev = (bool) $config['merge-dev'];
  $this->mergeExtra = (bool) $config['merge-extra'];
}