Skip to content

Commit 51ef5e6

Browse files
committed
proper updates for "url" type downloads
1 parent 20b670e commit 51ef5e6

File tree

2 files changed

+2
-33
lines changed

2 files changed

+2
-33
lines changed

config/source.json

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"type": "url",
1212
"url": "https://pecl.php.net/get/amqp",
1313
"path": "php-src/ext/amqp",
14-
"filename": "amqp.tgz",
1514
"license": {
1615
"type": "file",
1716
"path": "LICENSE"
@@ -21,7 +20,6 @@
2120
"type": "url",
2221
"url": "https://pecl.php.net/get/APCu",
2322
"path": "php-src/ext/apcu",
24-
"filename": "apcu.tgz",
2523
"license": {
2624
"type": "file",
2725
"path": "LICENSE"
@@ -31,7 +29,6 @@
3129
"type": "url",
3230
"url": "https://pecl.php.net/get/ast",
3331
"path": "php-src/ext/ast",
34-
"filename": "ast.tgz",
3532
"license": {
3633
"type": "file",
3734
"path": "LICENSE"
@@ -88,7 +85,6 @@
8885
"type": "url",
8986
"url": "https://pecl.php.net/get/dio",
9087
"path": "php-src/ext/dio",
91-
"filename": "dio.tgz",
9288
"license": {
9389
"type": "file",
9490
"path": "LICENSE"
@@ -98,7 +94,6 @@
9894
"type": "url",
9995
"url": "https://pecl.php.net/get/ev",
10096
"path": "php-src/ext/ev",
101-
"filename": "ev.tgz",
10297
"license": {
10398
"type": "file",
10499
"path": "LICENSE"
@@ -118,7 +113,6 @@
118113
"type": "url",
119114
"url": "https://pecl.php.net/get/ds",
120115
"path": "php-src/ext/ds",
121-
"filename": "ds.tgz",
122116
"license": {
123117
"type": "file",
124118
"path": "LICENSE"
@@ -155,7 +149,6 @@
155149
"type": "url",
156150
"url": "https://pecl.php.net/get/grpc",
157151
"path": "php-src/ext/grpc",
158-
"filename": "grpc.tgz",
159152
"license": {
160153
"type": "file",
161154
"path": [
@@ -167,7 +160,6 @@
167160
"type": "url",
168161
"url": "https://pecl.php.net/get/imagick",
169162
"path": "php-src/ext/imagick",
170-
"filename": "imagick.tgz",
171163
"license": {
172164
"type": "file",
173165
"path": "LICENSE"
@@ -177,7 +169,6 @@
177169
"type": "url",
178170
"url": "https://pecl.php.net/get/imap",
179171
"path": "php-src/ext/imap",
180-
"filename": "imap.tgz",
181172
"license": {
182173
"type": "file",
183174
"path": [
@@ -199,7 +190,6 @@
199190
"ext-maxminddb": {
200191
"type": "url",
201192
"url": "https://pecl.php.net/get/maxminddb",
202-
"filename": "ext-maxminddb.tgz",
203193
"license": {
204194
"type": "file",
205195
"path": "LICENSE"
@@ -209,7 +199,6 @@
209199
"type": "url",
210200
"url": "https://pecl.php.net/get/memcache",
211201
"path": "php-src/ext/memcache",
212-
"filename": "memcache.tgz",
213202
"license": {
214203
"type": "file",
215204
"path": "LICENSE"
@@ -228,7 +217,6 @@
228217
"type": "url",
229218
"url": "https://pecl.php.net/get/simdjson",
230219
"path": "php-src/ext/simdjson",
231-
"filename": "simdjson.tgz",
232220
"license": {
233221
"type": "file",
234222
"path": "LICENSE"
@@ -248,7 +236,6 @@
248236
"type": "url",
249237
"url": "https://pecl.php.net/get/ssh2",
250238
"path": "php-src/ext/ssh2",
251-
"filename": "ssh2.tgz",
252239
"license": {
253240
"type": "file",
254241
"path": "LICENSE"
@@ -258,7 +245,6 @@
258245
"type": "url",
259246
"url": "https://pecl.php.net/get/trader",
260247
"path": "php-src/ext/trader",
261-
"filename": "trader.tgz",
262248
"license": {
263249
"type": "file",
264250
"path": "LICENSE"
@@ -268,7 +254,6 @@
268254
"type": "url",
269255
"url": "https://pecl.php.net/get/uuid",
270256
"path": "php-src/ext/uuid",
271-
"filename": "uuid.tgz",
272257
"license": {
273258
"type": "file",
274259
"path": "LICENSE"
@@ -278,7 +263,6 @@
278263
"type": "url",
279264
"url": "https://pecl.php.net/get/uv",
280265
"path": "php-src/ext/uv",
281-
"filename": "uv.tgz",
282266
"license": {
283267
"type": "file",
284268
"path": "LICENSE"
@@ -297,7 +281,6 @@
297281
"ext-zip": {
298282
"type": "url",
299283
"url": "https://pecl.php.net/get/zip",
300-
"filename": "ext-zip.tgz",
301284
"license": {
302285
"type": "file",
303286
"path": "LICENSE"
@@ -405,7 +388,6 @@
405388
"type": "url",
406389
"url": "https://pecl.php.net/get/igbinary",
407390
"path": "php-src/ext/igbinary",
408-
"filename": "igbinary.tgz",
409391
"license": {
410392
"type": "file",
411393
"path": "COPYING"
@@ -432,7 +414,6 @@
432414
"type": "url",
433415
"url": "https://pecl.php.net/get/inotify",
434416
"path": "php-src/ext/inotify",
435-
"filename": "inotify.tgz",
436417
"license": {
437418
"type": "file",
438419
"path": "LICENSE"
@@ -837,7 +818,6 @@
837818
"type": "url",
838819
"url": "https://pecl.php.net/get/memcached",
839820
"path": "php-src/ext/memcached",
840-
"filename": "memcached.tgz",
841821
"license": {
842822
"type": "file",
843823
"path": "LICENSE"
@@ -878,7 +858,6 @@
878858
"type": "url",
879859
"url": "https://pecl.php.net/get/msgpack",
880860
"path": "php-src/ext/msgpack",
881-
"filename": "msgpack.tgz",
882861
"license": {
883862
"type": "file",
884863
"path": "LICENSE"
@@ -981,7 +960,6 @@
981960
"type": "url",
982961
"url": "https://pecl.php.net/get/opentelemetry",
983962
"path": "php-src/ext/opentelemetry",
984-
"filename": "opentelemetry.tgz",
985963
"license": {
986964
"type": "file",
987965
"path": "LICENSE"
@@ -991,7 +969,6 @@
991969
"type": "url",
992970
"url": "https://pecl.php.net/get/parallel",
993971
"path": "php-src/ext/parallel",
994-
"filename": "parallel.tgz",
995972
"license": {
996973
"type": "file",
997974
"path": "LICENSE"
@@ -1000,7 +977,6 @@
1000977
"pcov": {
1001978
"type": "url",
1002979
"url": "https://pecl.php.net/get/pcov",
1003-
"filename": "pcov.tgz",
1004980
"license": {
1005981
"type": "file",
1006982
"path": "LICENSE"
@@ -1010,7 +986,6 @@
1010986
"type": "url",
1011987
"url": "https://pecl.php.net/get/pdo_sqlsrv",
1012988
"path": "php-src/ext/pdo_sqlsrv",
1013-
"filename": "pdo_sqlsrv.tgz",
1014989
"license": {
1015990
"type": "file",
1016991
"path": "LICENSE"
@@ -1046,7 +1021,6 @@
10461021
"type": "url",
10471022
"url": "https://pecl.php.net/get/protobuf",
10481023
"path": "php-src/ext/protobuf",
1049-
"filename": "protobuf.tgz",
10501024
"license": {
10511025
"type": "file",
10521026
"path": "LICENSE"
@@ -1108,7 +1082,6 @@
11081082
"type": "url",
11091083
"url": "https://pecl.php.net/get/redis",
11101084
"path": "php-src/ext/redis",
1111-
"filename": "redis.tgz",
11121085
"license": {
11131086
"type": "file",
11141087
"path": [
@@ -1148,7 +1121,6 @@
11481121
"type": "url",
11491122
"url": "https://pecl.php.net/get/sqlsrv",
11501123
"path": "php-src/ext/sqlsrv",
1151-
"filename": "sqlsrv.tgz",
11521124
"license": {
11531125
"type": "file",
11541126
"path": "LICENSE"
@@ -1214,7 +1186,6 @@
12141186
"type": "url",
12151187
"url": "https://pecl.php.net/get/xhprof",
12161188
"path": "php-src/ext/xhprof-src",
1217-
"filename": "xhprof.tgz",
12181189
"license": {
12191190
"type": "file",
12201191
"path": "LICENSE"
@@ -1224,7 +1195,6 @@
12241195
"type": "url",
12251196
"url": "https://pecl.php.net/get/xlswriter",
12261197
"path": "php-src/ext/xlswriter",
1227-
"filename": "xlswriter.tgz",
12281198
"license": {
12291199
"type": "file",
12301200
"path": "LICENSE"
@@ -1245,7 +1215,6 @@
12451215
"type": "url",
12461216
"url": "https://pecl.php.net/get/yac",
12471217
"path": "php-src/ext/yac",
1248-
"filename": "yac.tgz",
12491218
"license": {
12501219
"type": "file",
12511220
"path": "LICENSE"

src/SPC/store/Downloader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,7 @@ private static function downloadByType(string $type, string $name, array $conf,
689689
self::downloadFile($name, $url, $filename, $conf['path'] ?? $conf['extract'] ?? null, $download_as);
690690
break;
691691
case 'url': // Direct download URL
692-
$url = $conf['url'];
693-
$filename = $conf['filename'] ?? basename($conf['url']);
692+
[$url, $filename] = self::getLatestUrlInfo($name, $conf);
694693
self::downloadFile($name, $url, $filename, $conf['path'] ?? $conf['extract'] ?? null, $download_as);
695694
break;
696695
case 'git': // Git repo
@@ -700,6 +699,7 @@ private static function downloadByType(string $type, string $name, array $conf,
700699
LockFile::lockSource($name, [
701700
'source_type' => SPC_SOURCE_LOCAL,
702701
'dirname' => $conf['dirname'],
702+
'url' => null,
703703
'path' => $conf['path'] ?? null,
704704
'move_path' => $conf['path'] ?? $conf['extract'] ?? null,
705705
'lock_as' => $download_as,

0 commit comments

Comments
 (0)