Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getInstallPath() returns only relative path #307

Closed
aimeos opened this issue Jun 10, 2016 · 3 comments
Closed

getInstallPath() returns only relative path #307

aimeos opened this issue Jun 10, 2016 · 3 comments
Milestone

Comments

@aimeos
Copy link
Contributor

aimeos commented Jun 10, 2016

There's an inconsistency to composer regarding getInstallPath():
Composer returns the absolute path while the composer installers only return the relative path:
https://github.com/composer/installers/blob/master/src/Composer/Installers/BaseInstaller.php#L36

Thus, this code fails because symlink links to a non-existing directory:

$repository = $event->getComposer()->getRepositoryManager();
$t3package = $repository->findPackage( 'aimeos/aimeos-typo3', '*' );
$package = $repository->findPackage( 'aimeos/ai-typo3', '*' );

$t3path = $installer->getInstallPath( $t3package );
$path = dirname( $installer->getInstallPath( $package ) );
symlink( $path, $t3path . '/Resources/Private/Extensions' );

$t3path is absolute as expected, but $path is relative (e.g. "ext" instead of "/path/to/ext")

@sbuzonas
Copy link

What is the issue here?

@aimeos
Copy link
Contributor Author

aimeos commented Jul 26, 2016

Like we've written: For packages in ./vendor/ composer returns an absolute path to packages, the installer returns only a relative path to the base directory when using getInstallPath()

@sbuzonas
Copy link

Oh, I understand now. The example uses two packages with package types supported here, so in theory they should do the same thing sans the obvious path differences...

sbuzonas pushed a commit to sbuzonas/composer-installers that referenced this issue Jul 27, 2016
grasmash added a commit to grasmash/installers that referenced this issue Oct 22, 2018
@Seldaek Seldaek added this to the 2.0 milestone Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants