WordPress at Your Fingertips
function is not described

Composer\Installers

BaseInstaller::getInstallPath() public WC 1.0

Return the install path based on package type.

{} It's a method of the class: BaseInstaller{}

No Hooks.

Return

String.

Usage

$BaseInstaller = new BaseInstaller();
$BaseInstaller->getInstallPath( $package, $frameworkType );
$package(PackageInterface) (required)
-
$frameworkType(string)
-

Code of BaseInstaller::getInstallPath() WC 5.5.2

<?php
public function getInstallPath(PackageInterface $package, $frameworkType = '')
{
    $type = $this->package->getType();

    $prettyName = $this->package->getPrettyName();
    if (strpos($prettyName, '/') !== false) {
        list($vendor, $name) = explode('/', $prettyName);
    } else {
        $vendor = '';
        $name = $prettyName;
    }

    $availableVars = $this->inflectPackageVars(compact('name', 'vendor', 'type'));

    $extra = $package->getExtra();
    if (!empty($extra['installer-name'])) {
        $availableVars['name'] = $extra['installer-name'];
    }

    if ($this->composer->getPackage()) {
        $extra = $this->composer->getPackage()->getExtra();
        if (!empty($extra['installer-paths'])) {
            $customPath = $this->mapCustomInstallPaths($extra['installer-paths'], $prettyName, $type, $vendor);
            if ($customPath !== false) {
                return $this->templatePath($customPath, $availableVars);
            }
        }
    }

    $packageType = substr($type, strlen($frameworkType) + 1);
    $locations = $this->getLocations();
    if (!isset($locations[$packageType])) {
        throw new \InvalidArgumentException(sprintf('Package type "%s" is not supported', $type));
    }

    return $this->templatePath($locations[$packageType], $availableVars);
}