Skip to content

getInstallPath() returns only relative path #307

@aimeos

Description

@aimeos

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions