function BaseInstaller::getInstallPath
Return the install path based on package type.
4 calls to BaseInstaller::getInstallPath()
- OxidInstaller::getInstallPath in vendor/
composer/ installers/ src/ Composer/ Installers/ OxidInstaller.php - Return the install path based on package type.
- OxidInstaller::getInstallPath in vendor/
composer/ installers/ src/ Composer/ Installers/ OxidInstaller.php - Return the install path based on package type.
- SilverStripeInstaller::getInstallPath in vendor/
composer/ installers/ src/ Composer/ Installers/ SilverStripeInstaller.php - Return the install path based on package type.
- SilverStripeInstaller::getInstallPath in vendor/
composer/ installers/ src/ Composer/ Installers/ SilverStripeInstaller.php - Return the install path based on package type.
2 methods override BaseInstaller::getInstallPath()
- OxidInstaller::getInstallPath in vendor/
composer/ installers/ src/ Composer/ Installers/ OxidInstaller.php - Return the install path based on package type.
- SilverStripeInstaller::getInstallPath in vendor/
composer/ installers/ src/ Composer/ Installers/ SilverStripeInstaller.php - Return the install path based on package type.
File
-
vendor/
composer/ installers/ src/ Composer/ Installers/ BaseInstaller.php, line 33
Class
Namespace
Composer\InstallersCode
public function getInstallPath(PackageInterface $package, string $frameworkType = '') : string {
$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'];
}
$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($frameworkType);
if (!isset($locations[$packageType])) {
throw new \InvalidArgumentException(sprintf('Package type "%s" is not supported', $type));
}
return $this->templatePath($locations[$packageType], $availableVars);
}