Neos\Flow\Core\ClassLoader::createNamespaceMapEntry PHP 메소드

createNamespaceMapEntry() 보호된 메소드

Add a namespace to class path mapping to the class loader for resolving classes.
protected createNamespaceMapEntry ( string $namespace, string $classPath, string $mappingType = self::MAPPING_TYPE_PSR0 ) : void
$namespace string A namespace to map to a class path.
$classPath string The class path to be mapped.
$mappingType string The mapping type for this mapping entry. Currently one of self::MAPPING_TYPE_PSR0 or self::MAPPING_TYPE_PSR4 will work. Defaults to self::MAPPING_TYPE_PSR0
리턴 void
    protected function createNamespaceMapEntry($namespace, $classPath, $mappingType = self::MAPPING_TYPE_PSR0)
    {
        $unifiedClassPath = Files::getNormalizedPath($classPath);
        $entryIdentifier = md5($unifiedClassPath . '-' . $mappingType);
        $currentArray =& $this->packageNamespaces;
        foreach (explode('\\', rtrim($namespace, '\\')) as $namespacePart) {
            if (!isset($currentArray[$namespacePart])) {
                $currentArray[$namespacePart] = [];
            }
            $currentArray =& $currentArray[$namespacePart];
        }
        if (!isset($currentArray['_pathData'])) {
            $currentArray['_pathData'] = [];
        }
        $currentArray['_pathData'][$entryIdentifier] = ['mappingType' => $mappingType, 'path' => $unifiedClassPath];
    }