Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LibraryInstaller.php

function LibraryInstaller::getPackageBasePath

Returns the base path of the package without target-dir path

It is used for BC as getInstallPath tends to be overridden by installer plugins but not getPackageBasePath

Return value

string

3 calls to LibraryInstaller::getPackageBasePath()
Installer::uninstall in vendor/composer/installers/src/Composer/Installers/Installer.php
@inheritDoc
LibraryInstaller::removeCode in vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php
@phpstan-return PromiseInterface<void|null>|null
LibraryInstaller::uninstall in vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php
@inheritDoc

File

vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php, line 261

Class

LibraryInstaller
Package installation manager.

Namespace

Composer\Installer

Code

protected function getPackageBasePath(PackageInterface $package) {
    $installPath = $this->getInstallPath($package);
    $targetDir = $package->getTargetDir();
    if ($targetDir) {
        return Preg::replace('{/*' . str_replace('/', '/+', preg_quote($targetDir)) . '/?$}', '', $installPath);
    }
    return $installPath;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal