Get the base of data.

@param Composer         $composer The composer
@param null|IOInterface $io       The composer input/output

@return array
184910
private static function getConfigBase(Composer $composer, $io = null)
    {
        $globalPackageConfig = self::getGlobalConfig($composer, 'composer', $io);
        $globalConfig = self::getGlobalConfig($composer, 'config', $io);
        $packageConfig = $composer->getPackage()->getConfig();
        $packageConfig = isset($packageConfig['foxy']) && \is_array($packageConfig['foxy'])
            ? $packageConfig['foxy']
            : array();

        return array_merge($globalPackageConfig, $globalConfig, $packageConfig);
    }
280161
private function getIgnoreFilters(Composer $composer): array
    {
        $extra = $composer->getPackage()->getExtra();

        return array_map(
            function (string $rule) : ViolationFilterInterface {
                $filters = [
                    new ExactPackageFilter($rule),
                    new PatternPackageFilter($rule)
                ];

                if (preg_match('#/$#', $rule)) {
                    $filters[] = new VendorFilter($rule);
                }

                return new ViolationFilterChain(...$filters);
            },
            $extra['dependency-guard']['ignore'] ?? []
        );
    }
667206
public static function readComposerLock(): array
    {
        if (self::$composerLockCache !== null) {
            return self::$composerLockCache;
        }

        if (!file_exists(FLOW_PATH_ROOT . 'composer.lock')) {
            return [];
        }

        $json = file_get_contents(FLOW_PATH_ROOT . 'composer.lock');
        $composerLock = json_decode($json, true);
        $composerPackageVersions = isset($composerLock['packages']) ? $composerLock['packages'] : [];
        $composerPackageDevVersions = isset($composerLock['packages-dev']) ? $composerLock['packages-dev'] : [];
        self::$composerLockCache = array_merge($composerPackageVersions, $composerPackageDevVersions);

        return self::$composerLockCache;
    }
898208
public function getFileList( PackageInterface $package, $map ) {
    $directory = $this->getDirectory( $package );
    $result    = [];

    try {

      foreach( $map as $source => $destination ) {
        if( !is_dir( $directory . $source ) ) $result[ $directory . $source ] = Autoload::DIRECTORY . $destination;
        else {

          $iterator = new \RecursiveIteratorIterator(
            new \RecursiveDirectoryIterator( $directory . $source, \RecursiveDirectoryIterator::SKIP_DOTS ),
            \RecursiveIteratorIterator::SELF_FIRST
          );

          foreach( $iterator as $item ) {
            /** @var SplFileInfo $item */
            if( !$item->isDir() ) {
              $result[ $item->getRealPath() ] = Autoload::DIRECTORY . $destination . DIRECTORY_SEPARATOR . call_user_func( [ $iterator, 'getSubPathName' ] );
            }
          }
        }
      }

    } catch( \Throwable $e ) {
      $this->io->writeError( "Spoom\\Composer: Skip {$package->getPrettyName()} public copy, due to an error" );
    }

    return $result;
  }
1130745
public function activate(Composer $composer, IOInterface $io) {
    $this->composer = $composer;
    $this->io = $io;
    $this->eventDispatcher = $composer->getEventDispatcher();
    ProcessExecutor::setTimeout(3600);
    $this->executor = new ProcessExecutor($this->io);
  }
561853
public function get_readers($interface = null) {
        $this->init();
        $return = array();
        foreach ($this->readers as $plugin => $reader) {
            if (empty($interface) || ($reader instanceof $interface)) {
                $return[$plugin] = $reader;
            }
        }

        return $return;
    }
991840
public function activate(Composer $composer, IOInterface $io)
    {
        $this->config = Config::load($io, $composer->getConfig());
        $this->composer = $composer;
        $this->io = $io;
    }
14837
public static function getComposerMap() {
        $composerMap = array();
        foreach (self::getComposers() as $composer)
            $composerMap[call_user_func(array($composer, "getKind"))] = $composer;
        return $composerMap;
    }
442542
public function activate(Composer $composer, IOInterface $io)
    {
        $this->assetsInstaller = new AssetsInstaller($composer, $io);
    }
426005
public static function fromComposer(IOInterface $io)
    {
        $input = new ArrayInput([]);
        $input->setInteractive($io->isInteractive());

        if ($io instanceof ConsoleIO) {
            $ref = new \ReflectionProperty($io, 'output');
            $ref->setAccessible(true);
            $output = $ref->getValue($io);
            if ($output instanceof ConsoleOutputInterface) {
                $output = $output->getErrorOutput();
            }
        } else {
            $output = new NullOutput();
        }

        return new static($input, $output);
    }
736374
protected function convertComposerContent($composer, $resource, $identifier)
    {
        $composer = JsonFile::parseJson($composer, $resource);
        $resource = $this->getApiUrl().'/repos/'.$this->owner.'/'.$this->repository.'/commits/'.urlencode($identifier);
        $composer = Util::addComposerTime($composer, 'commit.committer.date', $resource, $this);

        if (!isset($composer['support']['source'])) {
            $label = array_search($identifier, $this->getTags(), true) ?: array_search($identifier, $this->getBranches(), true) ?: $identifier;
            $composer['support']['source'] = sprintf('https://%s/%s/%s/tree/%s', $this->originUrl, $this->owner, $this->repository, $label);
        }
        if (!isset($composer['support']['issues']) && $this->hasIssues) {
            $composer['support']['issues'] = sprintf('https://%s/%s/%s/issues', $this->originUrl, $this->owner, $this->repository);
        }

        return $composer;
    }
634544
private function getFilteredLinks(Composer $composer)
    {
        $links = array_values($composer->getPackage()->getRequires());

        // only pick up packages in our filter, if a filter has been set.
        if ($this->hasFilterForPackages()) {
            $packagesFilter = $this->packagesFilter;
            $links = array_filter($links, function (Link $link) use ($packagesFilter) {
                return in_array($link->getTarget(), $packagesFilter);
            });
        }

        return array_values($links);
    }
183085
protected function getComposerData()
    {
        if (null == $this->composerData) {
            $json = file_get_contents($this->getComposerFile());
            $this->composerData = json_decode($json);

            if (null === $this->composerData) {
                throw new ComposerParseException(
                    "Error parsing file {$this->getComposerFile()}"
                );
            }
        }

        return $this->composerData;
    }
759600
public function activate(Composer $composer, IOInterface $io)
    {
        $rootPackage = $composer->getPackage();
        if (isset($rootPackage)) {
            // Ensure we get the root package rather than its alias.
            while ($rootPackage instanceof AliasPackage) {
                $rootPackage = $rootPackage->getAliasOf();
            }

            // Make sure the root package can override the available scripts.
            if (method_exists($rootPackage, 'setScripts')) {
                $scripts = $rootPackage->getScripts();
                $scripts['post-update-cmd']['c33s-construction-kit-installer'] = 'C33s\ConstructionKit\ConstructionKitBuildingBlocksDetector::refreshBuildingBlocks';
                $rootPackage->setScripts($scripts);
            }
        }
    }
588340
protected function getEmbeddedComposer($siteDir, $composerFilename, $vendorDir)
    {
        $classloader = $this->getApplication()->getClassloader();
        $builder = new EmbeddedComposerBuilder($classloader, $siteDir);

        return $builder
            ->setComposerFilename($composerFilename)
            ->setVendorDirectory($vendorDir)
            ->build();
    }
187899
public static function addInstallers(Config $config, Composer $composer, IOInterface $io)
    {
        $im = $composer->getInstallationManager();

        $im->addInstaller(new BowerInstaller($config, $io, $composer, Assets::createType('bower')));
        $im->addInstaller(new AssetInstaller($config, $io, $composer, Assets::createType('npm')));
    }
1281213
public static function getComposerInfo($libery = 'jfusion/framework')
	{
		$lib = null;
		$installed = __DIR__ . '/../../../composer/installed.json';
		if (file_exists($installed)) {
			$json = json_decode(file_get_contents($installed));
			foreach($json as $node) {
				if ($node->name === $libery) {
					$lib = $node;
					break;
				}
			}
		}
		return $lib;
	}