Issue Bug Closed

#100282Enable _assets Symlinks (junctions) on Windows

Steffen Mächtel 03/24/23, 10:13 updated 05/24/24, 11:59

Description

Composer Install with TYPO3 12 do not create symlinks in Windows Operating System for public/_assets/[symlinks].

We hotfixed it with an Operating System check. Windows can use fileSystem->junction instead of fileSystem->relativeSymlink.

Could Windows Support be integrated in TYPO3 Core for Symlinks?

Class: \TYPO3\CMS\Core\Composer\PackageArtifactBuilder

Method: publishResources

Current code:

            if (!$fileSystem->isSymlinkedDirectory($publicResourcesPath)) {
                $fileSystem->relativeSymlink($fileSystemResourcesPath, $publicResourcesPath);
            }

Hotfix code:

            if (!$fileSystem->isSymlinkedDirectory($publicResourcesPath)) {
                if (Platform::isWindows()) {
                    $fileSystem->junction($fileSystemResourcesPath, $publicResourcesPath);
                } else {
                    $fileSystem->relativeSymlink($fileSystemResourcesPath, $publicResourcesPath);
                }
            }

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.