Skip to content

Commit 7db8ffe

Browse files
authored
Merge pull request #227 from mlocati/empty-emails
Support package.xml files with empty author emails
2 parents 70fb1b9 + c28fb8b commit 7db8ffe

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

features/pecl/install-extensions.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Feature: download and install PECL extensions
2020
| apc | APC |
2121
| apcu | apcu |
2222
| mongo | mongo |
23+
| tensor | tensor |
2324
| zstd | zstd |
2425

2526
Scenario Outline: Does NOT install extensions from PECL repository having wrong version in source code

src/Package/PHP/Util/XML/Loader.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,19 @@ public function load($path, $versionOverride = null)
100100
$package['authors'] = [];
101101

102102
foreach ($authors as $author) {
103-
$package['authors'][] = [
104-
'name' => (string) $author->name,
105-
'email' => (string) $author->email,
103+
$tmp = [
104+
'name' => trim((string) $author->name),
105+
'email' => trim((string) $author->email),
106106
];
107+
if ($tmp['name'] === '') {
108+
unset($tmp['name']);
109+
}
110+
if ($tmp['email'] === '') {
111+
unset($tmp['email']);
112+
}
113+
if ($tmp !== []) {
114+
$package['authors'][] = $tmp;
115+
}
107116
}
108117
}
109118

124 KB
Binary file not shown.

tests/pecl-website/web/index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ static function ($errno, $errstr, $errfile, $errline): void {
6767
'/get/oci8/2.0.8' => "{$assetsDir}/oci8-2.0.8.tgz",
6868
'/get/sqlsrv' => "{$assetsDir}/sqlsrv-5.9.0beta2.tgz",
6969
'/get/swoole' => "{$assetsDir}/swoole-4.6.2.tgz",
70+
'/get/tensor' => "{$assetsDir}/tensor-2.1.4.tgz",
7071
'/get/yaml' => "{$assetsDir}/yaml-2.2.1.tgz",
7172
'/get/zstd' => "{$assetsDir}/zstd-0.10.0.tgz",
7273
];

0 commit comments

Comments
 (0)