Adds configuration section for later processing

@param SupraPackageInterface $package
@param $data
327935
public function addConfigurationSection(SupraPackageInterface $package, $data)
	{
		$overrides = $this->getConfigurationOverrides();

		if (isset($overrides[$package->getName()])) {
			$processor = new Processor();

			$data = $processor->processConfiguration($package->getConfiguration(), array(
				$data,
				$overrides[$package->getName()]
			));
		}

		$this->configurationSections[$package->getName()] = array(
			'package' => $package,
			'data' => $data
		);

		return $data;
	}
205784
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        $this->bootstrap();

        // display info on "composer update" on command line
        echo 'add  ' . $package->getName() . ' to wambo modules';
        echo PHP_EOL;

        $wamboInstallerService = new WamboInstallerService($package);

        $className = $wamboInstallerService->getBootstrapClassName();
        $name = $package->getName();
        $version = $package->getVersion();

        $module = new Module($name, $version, $className);
        $this->moduleRepository->add($module);

        parent::install($repo, $package);
    }
756938
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        $extra = $package->getExtra();

        if (array_key_exists('pxb-config', $extra)) {
            $this->loadModule($package, $extra['pxb-config']);
        }

        parent::install($repo, $package);
    }
608745
public static function registerPackage(PackageInterface $package, $target, AssetsInstallerInterface $installer = null)
    {
        self::$__autoloader->registerPackage($package, $target, $installer);
    }
78067
public function package(string $package, ?string $namespace = null) : void {
        if (is_null($namespace)) {
            list($vendor, $namespace) = explode('/', $package);
        }

        $this->finder->addNamespace($namespace, $package);
    }
475554
protected function guessConfigurator(PackageInterface $package)
    {
        $extra = $package->getExtra();
        if (isset($extra['assets-config-class'])) {
            Config::load($extra['assets-config-class'], true);
        }
//        Config::overload($extra);
        return $this;
    }
1278591
protected function processPackage(Package $package)
    {
        $extra = $package->getExtra();
        $files = isset($extra[self::EXTRA_OPTION_NAME]) ? $extra[self::EXTRA_OPTION_NAME] : null;
        $this->originalFiles[$package->getPrettyName()] = $files;

        if (is_array($files)) {
            $this->addFiles($package, $files);
        }
        if ($package->isRoot()) {
            $this->loadDotEnv($package);
            if (!empty($extra[self::EXTRA_DEV_OPTION_NAME])) {
                $this->addFiles($package, $extra[self::EXTRA_DEV_OPTION_NAME]);
            }
        }

        $aliases = $package->collectAliases();

        $this->builder->mergeAliases($aliases);
        $this->builder->setPackage($package->getPrettyName(), array_filter([
            'name' => $package->getPrettyName(),
            'version' => $package->getVersion(),
            'reference' => $package->getSourceReference() ?: $package->getDistReference(),
            'aliases' => $aliases,
        ]));
    }
167781
public function writelnInfoPackage(PackageInterface $package, $action = '', $message = '')
    {
        $this->output->writeln(sprintf('bower <info>%s</info> <fg=cyan>%s</fg=cyan> %s',
            str_pad($package->getName() . '#' . $package->getRequiredVersion(), 21, ' ', STR_PAD_RIGHT),
            str_pad($action, 10, ' ', STR_PAD_LEFT),
            $message
        ));
    }
15774
protected function requirePackage(Package $package)
    {
        $version = $this->chooseVersion($package);
        passthru(sprintf(
            'composer require %s:%s',
            $package->getName(),
            $version
        ));
        $this->comment('Package ' . $package->getName() . ' installed');
        $versions = $package->getVersions();
        $v = array_get($versions, $version);

        // Run post-process in separate command to load it with new autoloader
        passthru(sprintf(
            'php artisan package:process %s %s',
            $package->getName(),
            base64_encode(serialize($v))
        ));
    }
1065098
public function register(string $path, array $data = [], $package = null)
    {
        $packageResolver = $this->getPackageResolver();

        if ($package && !$package instanceof AbstractPackage) {
            $package = $packageResolver->getPackage($package);
        }

        // Workaround that RouteCreator should always be new one.
        $routerCreator = new RouteCreator($packageResolver);

        $routerCreator
            ->group('root')
            ->setOptions($data)
            ->register(function (RouteCreator $router) use ($path) {
                $router->load($path);
            });

        // TODO: Maybe move this handler to outside that support register() twice wothout side effect.
        foreach ($routerCreator->getRoutes() as $name => $route) {
            $route = $this->routeCreator->handleRoute($route);

            $this->addRouteByConfig(
                $route->getName(),
                $route->getOptions(),
                $package ?: $route->getOption('package')
            );
        }

        return $this;
    }
488338
public function setPackage($package)
    {
        $parts = explode('/', $package);
        if (count($parts) > 2) {
            throw new BuildException('Invalid package name: ' . $package);
        }

        if (count($parts) == 1) {
            $this->channel = 'pear.php.net';
            $this->package = $parts[0];
        } else {
            $this->channel = $parts[0];
            $this->package = $parts[1];
        }
    }
888926
protected function define(PackageDefinition $package)
    {
        $package->name('contact-us');

        $package->metadata([
            'icon' => 'question-circle',
        ]);

        $package->modules([
            'contact-enquiries' => ContactEnquiryModule::class,
        ]);
    }
292137
private function addAutoloadTo(RootPackageInterface $package)
    {
        $autoload = $package->getAutoload();
        $autoload = array_merge_recursive($autoload, [ 'classmap' => $this->getImposterAutoloads() ]);

        $package->setAutoload($autoload);
    }
71648
public function removePackage($package)
    {
        $config = $this->getContent();
        if (isset($config['require'][$package])) {
            unset($config['require'][$package]);
            $this->setContent($config);
        }
    }
762731
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
	{
		parent::install($repo, $package);

		if (getenv('OPUS_DISABLED')) {
			return;
		}

		//
		// Return immediately if we have no information relevant to our installer
		//

		if (!$this->checkFrameworkSupport($package)) {
			return;
		}

		$this->loadInstallationMap();

		$this->copyMap(
			$this->buildPackageMap($package),
			$result
		);

		$this->resolve($result);
		$this->saveInstallationMap($result);
		$this->io->write(PHP_EOL);
	}
735736
protected function installRouting(AbstractPackage $package)
    {
        if (!(new BooleanPrompter)->ask('Do your want to add routing profile to <comment>etc/routing.php</comment>? [Y/n]: ',
            true)) {
            return;
        }

        $pattern = (new TextPrompter)->ask('The URL pattern prefix [<info>/' . $package->name . '</info>]: ',
            '/' . $package->name);

        $routing = <<<ROUTE

// Routing of package: %s
\$router->registerPackage('%s', '%s');

ROUTE;

        $routing = sprintf($routing, $package->name, $package->name, $pattern);

        $target = $this->console->get('path.etc') . '/routing.php';

        $content = file_get_contents($target);
        $content .= $routing;

        file_put_contents($target, $content);

        $this->out()->out('  Added routing profile to <comment>etc/routing.php</comment>');
    }
788614
public function getConfigurationSection($package)
	{
		if (!isset($this->configurationSections[$package])) {
			throw new \Exception(sprintf('There is no configuration section for package "%s"', $package));
		}

		return $this->configurationSections[$package]['data'];
	}