Adds the main file definitions from the root package.

@param Config           $config
@param PackageInterface $package
@param string           $section

@return PackageInterface
882
public static function addMainFiles(Config $config, PackageInterface $package, $section = 'main-files')
    {
        if ($package instanceof Package) {
            $packageExtra = $package->getExtra();
            $rootMainFiles = $config->getArray($section);

            foreach ($rootMainFiles as $packageName => $files) {
                if ($packageName === $package->getName()) {
                    $packageExtra['bower-asset-main'] = $files;

                    break;
                }
            }

            $package->setExtra($packageExtra);
        }

        return $package;
    }
12702
protected function setPatchedPackageData(PackageInterface $package, array $patchesAppliedData)
    {
        $extra = $package->getExtra();
        $extra['patches_applied'] = $patchesAppliedData;
        $package->setExtra($extra);
        $this->composer->getRepositoryManager()->getLocalRepository()->write();
    }
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'];
	}
970181
protected function installLoader(PackageInterface $package)
    {
        $source = $this->getLoaderFilePackagePath($package);
        $target = $this->getLoaderFileInstallPath($package);

        copy($source, $target);
    }
1167276
public function getLoaderFilePackagePath(PackageInterface $package)
    {
        $installPath = $this->getInstallPath($package);

        if ($installPath === false) {
            return false;
        }

        $config      = $this->getInstallerConfig($package);
        $packagePath = $installPath . $config['loader'];

        return $packagePath;
    }
956606
private function findSubPackages(PackageInterface $package): Generator
    {
        $readMes = new \Symfony\Component\Finder\Finder();
        $readMes->files()
                ->in($package->getPaths())
                ->depth(1)
                ->name('readme.md');

        // If no sub-folders have a readme, there aren't any sub-packages here.
        if (!$readMes->count()) {
            return;
        }
        yield from $this->scanNamespaceForPackages($package, $package);
    }
645982
private function doApplicationConfigExtend(Config $config)
    {
        $config_directories = ConfigDirectory::getDirectories(
            null,
            $this->baseRepository,
            $this->context,
            $this->environment
        );

        foreach ($config_directories as $directory) {
            if (is_dir($directory)) {
                $config->extend($directory, $this->overrideConfig);
            }
        }
    }
1063827
def add_section(self, section):
        
        self.config.read(self.filepath)
        self.config.add_section(section)
        with open(self.filepath, "w") as f:
            self.config.write(f)
1075203
public static function isAsset(PackageInterface $package, array $configPackages = array())
    {
        $projectConfig = self::getProjectActivation($package, $configPackages);
        $enabled = false !== $projectConfig;

        return $enabled && (static::hasExtraActivation($package)
            || static::hasPluginDependency($package->getRequires())
            || static::hasPluginDependency($package->getDevRequires())
            || true === $projectConfig);
    }
59695
public static function createFromEdgeRcFile($section = 'default', $path = null)
    {
        if ($section === null) {
            $section = 'default';
        }

        $ini = self::parseEdgeRcFile($path);

        if (!isset($ini[$section])) {
            throw new ConfigException("Section \"$section\" does not exist!");
        }

        $auth = new static();
        $auth->setAuth(
            $ini[$section]['client_token'],
            $ini[$section]['client_secret'],
            $ini[$section]['access_token']
        );

        if (isset($ini[$section]['host'])) {
            $auth->setHost($ini[$section]['host']);
        }

        if (isset($ini[$section]['max-size'])) {
            $auth->setMaxBodySize($ini[$section]['max-size']);
        }

        return $auth;
    }
607164
public function setCurrentPackage($package)
    {
        if (!$package instanceof AbstractPackage) {
            $package = $this->packageResolver->getPackage($package);
        }

        $this->packageResolver->setCurrentPackage($package);

        return $this;
    }
292137
private function addAutoloadTo(RootPackageInterface $package)
    {
        $autoload = $package->getAutoload();
        $autoload = array_merge_recursive($autoload, [ 'classmap' => $this->getImposterAutoloads() ]);

        $package->setAutoload($autoload);
    }
1012276
protected function removePackageVendorSymlink(PackageInterface $package)
    {
        if (
            $this->config->isSymlinkEnabled()
            && $this->filesystem->removeSymlink($this->getPackageVendorSymlink($package))
        ) {
            $this->io->write(array(
                '  - Deleting symlink for <info>' . $package->getPrettyName() . '</info> '
                . '(<fg=yellow>' . $package->getPrettyVersion() . '</fg=yellow>)',
                ''
            ));

            $symlinkParentDirectory = dirname($this->getPackageVendorSymlink($package));
            $this->filesystem->removeEmptyDirectory($symlinkParentDirectory);
        }
    }
697654
final protected function define(PackageDefinition $package)
    {
        $package->name('content');

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

        $contentDefinition = new ContentPackageDefinition($this->getIocContainer()->get(ContentConfig::class), $package, $this->getIocContainer());

        $this->defineContent($contentDefinition);
    }
821797
public function append($section, array $config)
    {
        $config = array_merge([
            'config' => null,
            'view' => null,
            'script' => null,
            'menu' => null,
            'style' => null,
            'form' => null,
            'meta' => null,
            'position' => 0
        ], $config);

        if($html = $this->renderByType($config)){

            $this->inject($section, $html);

        }
    }
196362
protected function addPackageAliases(PackageInterface $package, $aliasNormalized)
    {
        $alias = new AliasPackage($package, $aliasNormalized, $this->rootPackageVersion);
        $this->addPackage($alias);

        if (false === strpos('dev-', $aliasNormalized)) {
            $alias = new AliasPackage($package, $aliasNormalized.'-dev', $this->rootPackageVersion);
            $this->addPackage($alias);
        }

        return $package;
    }
935205
public function writelnInstalledPackage(PackageInterface $package)
    {
        $this->output->writeln(sprintf('bower <info>%s</info> <fg=cyan>%s</fg=cyan>',
            str_pad($package->getName() . '#' . $package->getVersion(), 21, ' ', STR_PAD_RIGHT),
            str_pad('install', 10, ' ', STR_PAD_LEFT)
        ));
    }