Classes/Console/Install/FolderStructure/ExtensionFactory.php
private function getDirectoryNodeByPath($path)
    {
        $baseNode = [];
        $parts = explode('/', $path);
        $node = &$baseNode;
        foreach ($parts as $part) {
            $node[0] = [
                'name' => $part,
                'type' => DirectoryNode::class,
                'targetPermission' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['folderCreateMask'],
                'children' => [],
            ];
            // Add next directory as children of current node
            $node = &$node[0]['children'];
        }

        return isset($baseNode[0]) ? $baseNode[0] : [];
    }
private function getDirectoryNodeByPath($path)
    {
        $baseNode = [];
        $parts = explode('/', $path);
        $node = &$baseNode;
        foreach ($parts as $part) {
            $node[0] = [
                'name' => $part,
                'type' => DirectoryNode::class,
                'targetPermission' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['folderCreateMask'],
                'children' => [],
            ];
            // Add next directory as children of current node
            $node = &$node[0]['children'];
        }

        return isset($baseNode[0]) ? $baseNode[0] : [];
    }
Build directory nodes by given $path

@param string $path Path to directory
@return array