symfony2admingenerator / GeneratorBundle

Admingenerator for Symfony. Parse YAML files to build customized backend.
MIT License
67 stars 29 forks source link

Targeted dir must be a parent to the reference path. #244

Open ioleo opened 8 years ago

ioleo commented 8 years ago

I'm getting Targeted dir must be a parent to the reference path. error on line:

Filesystem/RelativePathComputer.php#L33

My enviroment: Windows 10 bower, php, node, ruby installed globally

The problem is I have vendors on RAMDISK (for performance) and /vendor dir is only a symlink to actual directory on RAMDISK.

When I renamed symlink to vendor2 and copy-pasted vendors from ramdisk - the issue was fixed.

Is there any way we could avoid raising this exception in this case?

sescandell commented 8 years ago

@loostro I think the easiet way to handle all this specific cases is to add an option "target" so we don't automatically compute the target dir, but let the user define the one he wants.

What do you think?

bobvandevijver commented 8 years ago

I think it is better to use the Symfony Filesystem component for this as the errors lies in the fact that string comparison is used here. When using the Filesystem, we should be able to compute the correct answer, not depending on symlinks.

Thoughts?

ioleo commented 8 years ago

I'll try replaceing it locally with symfony2 filesystem component and see if it works. Will do a PR if it does.

sescandell commented 8 years ago

@bobvandevijver I think you are talking about makePathRelative method?

Let's try it...

bobvandevijver commented 8 years ago

Maybe in combination with the Finder component, to find if the given directory can be found inside the parent directory. Not use about the performance impact though, but I guess this is only needed during cache warmup?

sescandell commented 8 years ago

@bobvandevijver actually only in a command to install bower packages... performance doesn't matter here.

sescandell commented 8 years ago

Is anyone working on that?