Neos\Flow\Package\PackageManager::derivePackageKey PHP Метод

derivePackageKey() защищенный Метод

The order of importance is: - package install path - first found autoload namespace - composer name
protected derivePackageKey ( string $composerName, string $packageType = null, string $packagePath = null, string $autoloadNamespace = null ) : string
$composerName string
$packageType string
$packagePath string
$autoloadNamespace string
Результат string
    protected function derivePackageKey($composerName, $packageType = null, $packagePath = null, $autoloadNamespace = null)
    {
        $packageKey = '';
        if ($packageType !== null && ComposerUtility::isFlowPackageType($packageType)) {
            $lastSegmentOfPackagePath = substr(trim($packagePath, '/'), strrpos(trim($packagePath, '/'), '/') + 1);
            if (strpos($lastSegmentOfPackagePath, '.') !== false) {
                $packageKey = $lastSegmentOfPackagePath;
            }
        }
        if ($autoloadNamespace !== null && ($packageKey === null || $this->isPackageKeyValid($packageKey) === false)) {
            $packageKey = str_replace('\\', '.', $autoloadNamespace);
        }
        if ($packageKey === null || $this->isPackageKeyValid($packageKey) === false) {
            $packageKey = str_replace('/', '.', $composerName);
        }
        $packageKey = trim($packageKey, '.');
        $packageKey = preg_replace('/[^A-Za-z0-9.]/', '', $packageKey);
        return $packageKey;
    }