composer/installers — pull request #100 by acoulton (2013-08-26 14:40:28+00:00)
Title: Installing binaries throws exception because installers incorrectly return relative paths

Composer cannot install declared binaries for a package that uses custom installers. Attempting to do so throws an InvalidArgumentException from [Composer/Util/Filesystem:201](https://github.com/composer/composer/blob/master/src/Composer/Util/Filesystem.php#L201) with the message "From {path} and to {path} must be absolute paths".

This is because the inherited Composer LibraryInstaller returns absolute paths from getInstallPath (having first called realpath() to get the absolute path to the configured vendor directory), but the installers in the composer/installers return relative paths.

The same issue has been reported on composer/composer#1589 although that one appeared to be with his own custom installer rather than one from this package. I've not been able to reproduce the issue @xrstf mentioned there with autoload_namespaces following this change - composer seems to handle marking the paths as being relative to $baseDir.

He's right that the [composer docs](https://github.com/composer/composer/blob/master/doc/articles/custom-installers.md) say the path should be relative, but I have verified this is not the case with the standard installer.

I have implemented a test case that proves the exception, and a second commit which fixes it by returning absolute paths and fixing all the other tests that expect relative ones. I couldn't see a way to test without actually attempting to install a fake package with binaries, and based my new test case on what I could see in composer/composer and composer/installers - not sure if that's how you'd want to handle it but it does work.

I'm pushing the commits separately so that you see travis builds on each. I guess you'll want to have a bit of a look at this, as although it's in theory a small change and tested I'm not familiar enough with composer internals to guarantee this won't break something outside the test coverage...