[Documentation] When using autoload/files the path must be absolute #880

Closed
wants to merge 1 commit into
from

Projects

None yet

5 participants

@jeremymarc

No description provided.

This pull request passes (merged db07f2c into 6adc81c).

Owner
Seldaek commented Jul 5, 2012

Where did you get this info from?

When running with a relative path I'm getting :
 [InvalidArgumentException]          
 from and to must be absolute paths

In https://github.com/hason/composer/blob/master/src/Composer/Util/Filesystem.php there is :

if (!$this->isAbsolutePath($from) || !$this->isAbsolutePath($to)) {
throw new \InvalidArgumentException('from and to must be absolute paths');
}
public function isAbsolutePath($path)
{
return substr($path, 0, 1) === '/' || substr($path, 1, 1) === ':';
}

Contributor
stof commented Jul 5, 2012

@jeremymarc but the install path of the package is prepended to the files before calling this method in the AutoloadGenerator.

Contributor
stof commented Jul 5, 2012

and btw, the package definition is not able to provide an absolute path itself anyway as it does not know where the package is installed.

Contributor
stof commented Jul 7, 2012

this PR is wrong, but it seems that the file autoloading is broken for the main package.

Contributor

I'm also getting this error when attempting to use the "files" option.

Contributor
stof commented Jul 8, 2012

@taylorotwell are you using files in your root package or in a dependency ?

Contributor

Root package.

On Jul 8, 2012, at 5:07 AM, Christophe Coevoetreply@reply.github.com wrote:

@taylorotwell are you using files in your root package or in a dependency ?


Reply to this email directly or view it on GitHub:
#880 (comment)

Contributor

Just a note that this information could have changed after my patch to fix file uploading. You shouldn't have to use an absolute path like that anymore. File auto loading is specified just like PSR-0 or class-map.

@Seldaek Seldaek closed this in 2af2c27 Aug 18, 2012
Owner
Seldaek commented Aug 18, 2012

It seems to work fine as is, so I'm closing this.

@digitalkaoz digitalkaoz pushed a commit to digitalkaoz/composer that referenced this pull request Nov 22, 2013
@Seldaek Seldaek Add regression test for files autoload in root package, fixes #880 1794e5d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment