Skip to content

[DX] Make assets:install smarter with symlinks #11297

@weaverryan

Description

@weaverryan

Currently, you either use assets:install to get a hard copy or assets:install --symlink to get a symbolic link. In reality, we always want a symbolic link, unless we're on a system that doesn't support it. Currently, I see:

  1. People use hard copy (which is the default) then wonder why their CSS files aren't updating

  2. In ezPublish, I think they default to symlinks. So a user on Windows (or at least a Vagrant box with a Windows host machine, where apparently you need some special setup to get symlinks to work in the VM) has a bad time. This happened to the PHP managing editor at SitePoint (@Swader) and he definitely had no fun :).

I propose that we make assets:install smarter:

A) Create a symlink, unless symlinks aren't supported. In that case, fall back to a hard copy

B) If hard-copy is used, we should print out a message about this (there is a message now that you're using the "hard copy" option, but this can be clearer).

C) If using symlinks fails for some reason (even if we detect that symlinks are supported), we should fall back to hard-copy and tell the user about it. I think this is what happens on a Vagrant UNIX box that's backed by Symfony. @pborreli tells me that the Vagrant box needs special config and to be run as root for these to work. I want to catch these failures and help the user.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXDX = Developer eXperience (anything that improves the experience of using Symfony)FrameworkBundle

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions