TYPO3 / CmsComposerInstallers

TYPO3 CMS Composer Installer
GNU General Public License v2.0
58 stars 39 forks source link

Improve usability: fail gracefully on existing symlinks #57

Closed 7elix closed 8 years ago

7elix commented 8 years ago

Hi Helmut,

the composer installer fails with fatal in case web/index.php or web/typo3 already exist. Do you see a reason for the fatal in case the symlinks are set up correctly?

I think about adding a second check to Filsystem->symlink checks beside file_exists that compare the current symlink target to the intended symlink target.

Good or nah?

    public function symlink($source, $target, $copyOnFailure = true, $makeRelative = true)
    {
        if (!file_exists($source)) {
            throw new \InvalidArgumentException('The symlink source "' . $source . '" is not available.');
        }
        if (file_exists($target)) {
            throw new \InvalidArgumentException('The symlink target "' . $target . '" already exists.');
helhum commented 8 years ago

I think about adding a second check to Filsystem->symlink checks beside file_exists that compare the current symlink target to the intended symlink target. Good or nah?

Yes, would be a good idea in general.

Things to consider:

@7elix are you interested in helping out in this area?

helhum commented 8 years ago

oh, btw. this is a duplicate of #35

I close this as duplicate