mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-18 09:17:15 +08:00
path fix.
This commit is contained in:
@ -85,13 +85,15 @@ class Installer extends LibraryInstaller
|
||||
protected function generateDefaultAlias(PackageInterface $package)
|
||||
{
|
||||
$autoload = $package->getAutoload();
|
||||
if (!empty($autoload['psr-0'])) {
|
||||
if (empty($autoload['psr-0'])) {
|
||||
return false;
|
||||
}
|
||||
$fs = new Filesystem;
|
||||
$vendorDir = $fs->normalizePath($this->vendorDir);
|
||||
foreach ($autoload['psr-0'] as $name => $path) {
|
||||
$name = str_replace('\\', '/', trim($name, '\\'));
|
||||
if (!$fs->isAbsolutePath($path)) {
|
||||
$path = $this->vendorDir . '/' . $path;
|
||||
$path = $this->vendorDir . '/' . $package->getName() . '/' . $path;
|
||||
}
|
||||
$path = $fs->normalizePath($path);
|
||||
if (strpos($path . '/', $vendorDir . '/') === 0) {
|
||||
@ -101,8 +103,6 @@ class Installer extends LibraryInstaller
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function removePackage(PackageInterface $package)
|
||||
{
|
||||
|
Reference in New Issue
Block a user