Returns the extension for the given key by a given packageName

@param string $key
@param string $packageName
@return ArrayList
509847
public function getExtensionsByPackage($key, $packageName) {
		if ($this->packages->has($packageName)) {
			$pkg = $this->packages->get($packageName);
			if ($pkg->has($key)) {
				return $pkg->get($key);
			}
		}
		
		return [];
	}
1113469
public function getAggregatePackageContaining($packageName)
    {
        foreach ($this->packages as $packageNode) {
            if ($packageNode->replaces($packageName)) {
                return $packageNode;
            }
        }

        return null;
    }
390205
public function documentationCommand($packageKey)
    {
        $this->validatePackageKey($packageKey);
        if (!$this->packageManager->isPackageAvailable($packageKey)) {
            $this->outputLine('Package "%s" is not available.', [$packageKey]);
            exit(2);
        }

        $generatedFiles = $this->generatorService->generateDocumentation($packageKey);

        $this->outputLine(implode(PHP_EOL, $generatedFiles));
    }
365017
public final Package<NotDependsOn> findForbiddenByName(final String packageName) {
        final List<Package<NotDependsOn>> list = getForbidden();
        for (final Package<NotDependsOn> pkg : list) {
            if (pkg.getName().equals(packageName)) {
                return pkg;
            }
        }
        return null;
    }
687833
public static function get_by_package($package_name = 'project') {
		if (!file_exists(Config::$migration_directory)) {
			throw new \Exception('Config::$migration_directory is not set to a valid directory');
		}

		/**
		 * Array with results
		 */
		$migrations = [];

		if ($package_name == 'project') {
			$files = scandir(Config::$migration_directory, SCANDIR_SORT_ASCENDING);

			foreach ($files as $key => $file) {
				if ($file[0] == '.') {
					unset($files[$key]);
					continue;
				}

				if ($file == 'db_version') {
					unset($files[$key]);
					continue;
				}

				if (!preg_match("/^\d{8}_\d{6}_.*$/", $file)) {
					unset($files[$key]);
					continue;
				}


				$parts = explode('_', $file);
				foreach ($parts as $key => $part) {
					$parts[$key] = ucfirst($part);
				}

				$classname = 'Migration_' . str_replace('.php', '', implode('_', $parts));
				include_once Config::$migration_directory . '/' . $file;
				$migrations[] = new $classname();
			}
		} else {

			/**
			 * Make a list of all migrations to be execute
			 */
			$packages = \Skeleton\Core\Skeleton::get_all();

			foreach ($packages as $package) {
				if ($package->name != $package_name) {
					continue;
				}
				if (!file_exists($package->migration_path)) {
					continue;
				}
				$files = scandir($package->migration_path, SCANDIR_SORT_ASCENDING);

				foreach ($files as $key => $file) {
					if ($file[0] == '.') {
						unset($files[$key]);
						continue;
					}

					if ($file == 'db_version') {
						unset($files[$key]);
						continue;
					}

					if (!preg_match("/^\d{8}_\d{6}_.*$/", $file)) {
						unset($files[$key]);
						continue;
					}


					$parts = explode('_', $file);
					foreach ($parts as $key => $part) {
						$parts[$key] = ucfirst($part);
					}

					$namespace_parts = explode('-', $package->name);
					foreach ($namespace_parts as $key => $namespace_part) {
						$namespace_parts[$key] = ucfirst($namespace_part);
					}
					$namespace = implode('\\', $namespace_parts);

					$classname = $namespace . '\Migration_' . str_replace('.php', '', implode('_', $parts));
					include_once $package->migration_path . '/' . $file;
					$migrations[] = new $classname();
				}
			}
		}


		return $migrations;
	}
311240
public function getPackages() : PackageCollection
    {
        if (null === $this->packages) {
            $packages = array_merge(
                array(
                    $this->getName() => $this,
                ),
                $this->getInstalledPackagesFile()->getPackages()->toArray()
            );

            $this->packages = new PackageCollection($packages);
        }

        return $this->packages;
    }
777633
private static function _updatePackage($packageName)
	{
		self::_init();
		self::_dispatch('update');
		if (is_null($packageName))
		{
			$package = array();
		}
		elseif (is_string($packageName))
		{
			$package = array($packageName);
		}
		else
		{
			$package = $packageName;
		}
		$installer = self::_getInstaller();
		$installer
			->setUpdate(true)
			->setUpdateWhitelist($package);
		return $installer->run();
	}
1133990
public function getExtensionConfiguration($configurationName)
    {
        $result = null;
        $extensionConfiguration = $this->getFullExtensionConfiguration();

        if (null === $configurationName) {
            $result = $extensionConfiguration;
        } elseif (ArrayUtility::isValidPath($extensionConfiguration, $configurationName, '.')) {
            $result = ArrayUtility::getValueByPath($extensionConfiguration, $configurationName, '.');
        }

        return $result;
    }
387653
protected function findPackageKey($package_name)
    {
        $package_key = null;
        // In most cases the package name is already used as the array key.
        if (isset(static::$packageToCleanup[$package_name])) {
            $package_key = $package_name;
        } else {
            // Handle any mismatch in case between the package name and array key.
            // For example, the array key 'mikey179/vfsStream' needs to be found
            // when composer returns a package name of 'mikey179/vfsstream'.
            foreach (static::$packageToCleanup as $key => $dirs) {
                if (strtolower($key) === $package_name) {
                    $package_key = $key;
                    break;
                }
            }
        }
        return $package_key;
    }
1075321
protected final String getPackageMessage(String packageName, String key) {
    Option<TextBundle> bundle = registry.load(locale, packageName + ".package");
    return bundle.isDefined() ? bundle.get().getText(key) : null;
  }
1193433
public String[] getPaths (String packagePath, String key)
    {
        return getConfig(packagePath).getValue(key, (String[])null);
    }
755555
public function siteCommand($packageKey, $siteName)
    {
        if (!$this->packageManager->isPackageKeyValid($packageKey)) {
            $this->outputLine('Package key "%s" is not valid. Only UpperCamelCase in the format "Vendor.PackageKey", please!', [$packageKey]);
            $this->quit(1);
        }

        if ($this->packageManager->isPackageAvailable($packageKey)) {
            $this->outputLine('Package "%s" already exists.', [$packageKey]);
            $this->quit(1);
        }

        $generatedFiles = $this->generatorService->generateSitePackage($packageKey, $siteName);
        $this->outputLine(implode(PHP_EOL, $generatedFiles));
    }
880297
public function setForPackage($package, $key, $value)
    {
        $packageConfiguration = empty($this->packagesConfiguration[$package]) ? array() : $this->packagesConfiguration[$package];
        Arr::set($packageConfiguration, $key, $value);
        $this->packagesConfiguration[$package] = $packageConfiguration;
        return $this;
    }
296128
public function getPacket(string $key): Packet
    {
        $sql =  'SELECT '
                . '`' . $this->valueField . '`, `' . $this->timestampField . '`,'
                . '`' . $this->lifetimeField . '`, `' . $this->savetimeField . '`'
                . ' FROM `' . $this->table . '`'
                . ' WHERE `' . $this->keyField . '`=' . "'" . $this->db->addEscape($key) . "'";
        try {
            $row = $this->db->getItem($sql);
            return new Packet(
                $row[$this->valueField], 
                $row[$this->lifetimeField], 
                $row[$this->savetimeField], 
                $row[$this->timestampField]
            );
        } catch (\Throwable $e) {
            throw new BadPacketException($e->getMessage(), $e->getCode(), $e);
        }
    }
645287
private function getNeedles($packageName, $packages, $inverted)
    {
        $needles = [$packageName];
        if ($inverted === false) {
            return $needles;
        }

        // Include replaced packages for inverted lookups as they are then the actual starting point to consider
        $mapCb = function (Link $link) {
            return $link->getTarget();
        };
        foreach ($packages as $package) {
            $needles = array_merge(
                $needles,
                array_map($mapCb, $package->getReplaces())
            );
        }

        return $needles;
    }
182107
public static Set<String> scanClassNames(final String packageName) throws IOException
	{
		return scanClassNames(packageName, false, true);
	}
989284
protected static function discoverExtensionComponents($extensionKey)
    {
        // Test if the extension contains a component directory
        $extCompRootDirectory = ExtensionManagementUtility::extPath($extensionKey, 'Components');

        return is_dir($extCompRootDirectory) ? self::discoverExtensionComponentDirectory($extCompRootDirectory) : [];
    }