Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
composer
composer
提交
bbea3e52
composer
项目概览
镜像
/
composer
/
composer
10 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
composer
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
bbea3e52
编写于
6月 09, 2023
作者:
J
Jordi Boggiano
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '2.5'
上级
29134d5a
7b03fa1b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
65 addition
and
53 deletion
+65
-53
CHANGELOG.md
CHANGELOG.md
+8
-0
src/Composer/Autoload/ClassLoader.php
src/Composer/Autoload/ClassLoader.php
+45
-51
src/Composer/EventDispatcher/EventDispatcher.php
src/Composer/EventDispatcher/EventDispatcher.php
+8
-0
src/Composer/Repository/PlatformRepository.php
src/Composer/Repository/PlatformRepository.php
+4
-2
未找到文件。
CHANGELOG.md
浏览文件 @
bbea3e52
### [2.5.8] 2023-06-09
*
Fixed regression in edge cases where root package gets added to a repository already during the install process (#11495)
*
Fixed EventDispatcher on windows picking bat files when using "@php binary" (#11490)
*
Fixed ICU CDLR version parsing failing the whole process when ICU cannot initialize the resource bundle (#11492)
*
Fixed type declarations on ClassLoader (#11500)
### [2.5.7] 2023-05-24
*
Fixed regression preventing autoloading the dependencies of metapackages when running --no-dev (#11481)
...
...
@@ -1724,6 +1731,7 @@
*
Initial release
[
2.5.8
]:
https://github.com/composer/composer/compare/2.5.7...2.5.8
[
2.5.7
]:
https://github.com/composer/composer/compare/2.5.6...2.5.7
[
2.5.6
]:
https://github.com/composer/composer/compare/2.5.5...2.5.6
[
2.5.5
]:
https://github.com/composer/composer/compare/2.5.4...2.5.5
...
...
src/Composer/Autoload/ClassLoader.php
浏览文件 @
bbea3e52
...
...
@@ -45,35 +45,34 @@ class ClassLoader
/** @var \Closure(string):void */
private
static
$includeFile
;
/** @var
?string
*/
/** @var
string|null
*/
private
$vendorDir
;
// PSR-4
/**
* @var array[]
* @psalm-var array<string, array<string, int>>
* @var array<string, array<string, int>>
*/
private
$prefixLengthsPsr4
=
array
();
/**
* @var array[]
* @psalm-var array<string, array<int, string>>
* @var array<string, list<string>>
*/
private
$prefixDirsPsr4
=
array
();
/**
* @var array[]
* @psalm-var array<string, string>
* @var list<string>
*/
private
$fallbackDirsPsr4
=
array
();
// PSR-0
/**
* @var array[]
* @psalm-var array<string, array<string, string[]>>
* List of PSR-0 prefixes
*
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
*
* @var array<string, array<string, list<string>>>
*/
private
$prefixesPsr0
=
array
();
/**
* @var array[]
* @psalm-var array<string, string>
* @var list<string>
*/
private
$fallbackDirsPsr0
=
array
();
...
...
@@ -81,8 +80,7 @@ class ClassLoader
private
$useIncludePath
=
false
;
/**
* @var string[]
* @psalm-var array<string, string>
* @var array<string, string>
*/
private
$classMap
=
array
();
...
...
@@ -90,21 +88,20 @@ class ClassLoader
private
$classMapAuthoritative
=
false
;
/**
* @var bool[]
* @psalm-var array<string, bool>
* @var array<string, bool>
*/
private
$missingClasses
=
array
();
/** @var
?string
*/
/** @var
string|null
*/
private
$apcuPrefix
;
/**
* @var
self[]
* @var
array<string, self>
*/
private
static
$registeredLoaders
=
array
();
/**
* @param
?string
$vendorDir
* @param
string|null
$vendorDir
*/
public
function
__construct
(
$vendorDir
=
null
)
{
...
...
@@ -113,7 +110,7 @@ public function __construct($vendorDir = null)
}
/**
* @return
string[]
* @return
array<string, list<string>>
*/
public
function
getPrefixes
()
{
...
...
@@ -125,8 +122,7 @@ public function getPrefixes()
}
/**
* @return array[]
* @psalm-return array<string, array<int, string>>
* @return array<string, list<string>>
*/
public
function
getPrefixesPsr4
()
{
...
...
@@ -134,8 +130,7 @@ public function getPrefixesPsr4()
}
/**
* @return array[]
* @psalm-return array<string, string>
* @return list<string>
*/
public
function
getFallbackDirs
()
{
...
...
@@ -143,8 +138,7 @@ public function getFallbackDirs()
}
/**
* @return array[]
* @psalm-return array<string, string>
* @return list<string>
*/
public
function
getFallbackDirsPsr4
()
{
...
...
@@ -152,8 +146,7 @@ public function getFallbackDirsPsr4()
}
/**
* @return string[] Array of classname => path
* @psalm-return array<string, string>
* @return array<string, string> Array of classname => path
*/
public
function
getClassMap
()
{
...
...
@@ -161,8 +154,7 @@ public function getClassMap()
}
/**
* @param string[] $classMap Class to filename map
* @psalm-param array<string, string> $classMap
* @param array<string, string> $classMap Class to filename map
*
* @return void
*/
...
...
@@ -179,24 +171,25 @@ public function addClassMap(array $classMap)
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param
string[]
|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
* @param string
$prefix The prefix
* @param
list<string>
|string $paths The PSR-0 root directories
* @param bool
$prepend Whether to prepend the directories
*
* @return void
*/
public
function
add
(
$prefix
,
$paths
,
$prepend
=
false
)
{
$paths
=
(
array
)
$paths
;
if
(
!
$prefix
)
{
if
(
$prepend
)
{
$this
->
fallbackDirsPsr0
=
array_merge
(
(
array
)
$paths
,
$paths
,
$this
->
fallbackDirsPsr0
);
}
else
{
$this
->
fallbackDirsPsr0
=
array_merge
(
$this
->
fallbackDirsPsr0
,
(
array
)
$paths
$paths
);
}
...
...
@@ -205,19 +198,19 @@ public function add($prefix, $paths, $prepend = false)
$first
=
$prefix
[
0
];
if
(
!
isset
(
$this
->
prefixesPsr0
[
$first
][
$prefix
]))
{
$this
->
prefixesPsr0
[
$first
][
$prefix
]
=
(
array
)
$paths
;
$this
->
prefixesPsr0
[
$first
][
$prefix
]
=
$paths
;
return
;
}
if
(
$prepend
)
{
$this
->
prefixesPsr0
[
$first
][
$prefix
]
=
array_merge
(
(
array
)
$paths
,
$paths
,
$this
->
prefixesPsr0
[
$first
][
$prefix
]
);
}
else
{
$this
->
prefixesPsr0
[
$first
][
$prefix
]
=
array_merge
(
$this
->
prefixesPsr0
[
$first
][
$prefix
],
(
array
)
$paths
$paths
);
}
}
...
...
@@ -226,9 +219,9 @@ public function add($prefix, $paths, $prepend = false)
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param
string[]
|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
* @param string
$prefix The prefix/namespace, with trailing '\\'
* @param
list<string>
|string $paths The PSR-4 base directories
* @param bool
$prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
...
...
@@ -236,17 +229,18 @@ public function add($prefix, $paths, $prepend = false)
*/
public
function
addPsr4
(
$prefix
,
$paths
,
$prepend
=
false
)
{
$paths
=
(
array
)
$paths
;
if
(
!
$prefix
)
{
// Register directories for the root namespace.
if
(
$prepend
)
{
$this
->
fallbackDirsPsr4
=
array_merge
(
(
array
)
$paths
,
$paths
,
$this
->
fallbackDirsPsr4
);
}
else
{
$this
->
fallbackDirsPsr4
=
array_merge
(
$this
->
fallbackDirsPsr4
,
(
array
)
$paths
$paths
);
}
}
elseif
(
!
isset
(
$this
->
prefixDirsPsr4
[
$prefix
]))
{
...
...
@@ -256,18 +250,18 @@ public function addPsr4($prefix, $paths, $prepend = false)
throw
new
\
InvalidArgumentException
(
"A non-empty PSR-4 prefix must end with a namespace separator."
);
}
$this
->
prefixLengthsPsr4
[
$prefix
[
0
]][
$prefix
]
=
$length
;
$this
->
prefixDirsPsr4
[
$prefix
]
=
(
array
)
$paths
;
$this
->
prefixDirsPsr4
[
$prefix
]
=
$paths
;
}
elseif
(
$prepend
)
{
// Prepend directories for an already registered namespace.
$this
->
prefixDirsPsr4
[
$prefix
]
=
array_merge
(
(
array
)
$paths
,
$paths
,
$this
->
prefixDirsPsr4
[
$prefix
]
);
}
else
{
// Append directories for an already registered namespace.
$this
->
prefixDirsPsr4
[
$prefix
]
=
array_merge
(
$this
->
prefixDirsPsr4
[
$prefix
],
(
array
)
$paths
$paths
);
}
}
...
...
@@ -276,8 +270,8 @@ public function addPsr4($prefix, $paths, $prepend = false)
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param
string[]
|string $paths The PSR-0 base directories
* @param string
$prefix The prefix
* @param
list<string>
|string $paths The PSR-0 base directories
*
* @return void
*/
...
...
@@ -294,8 +288,8 @@ public function set($prefix, $paths)
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param
string[]
|string $paths The PSR-4 base directories
* @param string
$prefix The prefix/namespace, with trailing '\\'
* @param
list<string>
|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
...
...
@@ -481,9 +475,9 @@ public function findFile($class)
}
/**
* Returns the currently registered loaders
index
ed by their corresponding vendor directories.
* Returns the currently registered loaders
key
ed by their corresponding vendor directories.
*
* @return
self[]
* @return
array<string, self>
*/
public
static
function
getRegisteredLoaders
()
{
...
...
src/Composer/EventDispatcher/EventDispatcher.php
浏览文件 @
bbea3e52
...
...
@@ -351,6 +351,14 @@ protected function doDispatch(Event $event)
if
(
$matched
&&
!
file_exists
(
$match
[
0
]))
{
$finder
=
new
ExecutableFinder
;
if
(
$pathToExec
=
$finder
->
find
(
$match
[
0
]))
{
if
(
Platform
::
isWindows
())
{
$execWithoutExt
=
Preg
::
replace
(
'{\.(exe|bat|cmd|com)$}i'
,
''
,
$pathToExec
);
// prefer non-extension file if it exists when executing with PHP
if
(
file_exists
(
$execWithoutExt
))
{
$pathToExec
=
$execWithoutExt
;
}
unset
(
$execWithoutExt
);
}
$pathAndArgs
=
$pathToExec
.
substr
(
$pathAndArgs
,
strlen
(
$match
[
0
]));
}
}
...
...
src/Composer/Repository/PlatformRepository.php
浏览文件 @
bbea3e52
...
...
@@ -333,8 +333,10 @@ protected function initialize(): void
// Add a separate version for the CLDR library version
if
(
$this
->
runtime
->
hasClass
(
'ResourceBundle'
))
{
$cldrVersion
=
$this
->
runtime
->
invoke
([
'ResourceBundle'
,
'create'
],
[
'root'
,
'ICUDATA'
,
false
])
->
get
(
'Version'
);
$this
->
addLibrary
(
'icu-cldr'
,
$cldrVersion
,
'ICU CLDR project version'
);
$resourceBundle
=
$this
->
runtime
->
invoke
([
'ResourceBundle'
,
'create'
],
[
'root'
,
'ICUDATA'
,
false
]);
if
(
$resourceBundle
!==
null
)
{
$this
->
addLibrary
(
'icu-cldr'
,
$resourceBundle
->
get
(
'Version'
),
'ICU CLDR project version'
);
}
}
if
(
$this
->
runtime
->
hasClass
(
'IntlChar'
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录