1
1
$ErrorActionPreference = " Stop"
2
+ $ProgressPreference = " SilentlyContinue"
2
3
3
4
$PHP_VERSIONS = @ (" 8.2.25" , " 8.3.13" )
4
5
@@ -238,6 +239,18 @@ function download-file {
238
239
return $cached_path
239
240
}
240
241
242
+ function unzip-file {
243
+ param ([string ] $file , [string ] $destination )
244
+
245
+ # expand-archive doesn't respect script-local ProgressPreference
246
+ # https://github.com/PowerShell/Microsoft.PowerShell.Archive/issues/77
247
+ $oldProgressPref = $global :ProgressPreference
248
+ $global :ProgressPreference = " SilentlyContinue"
249
+ Expand-Archive - Path $file - DestinationPath $destination >> $log_file 2>&1
250
+ $global :ProgressPreference = $oldProgressPref
251
+ }
252
+
253
+
241
254
function append-file-utf8 {
242
255
param ([string ] $line , [string ] $file )
243
256
@@ -250,7 +263,7 @@ function download-sdk {
250
263
write-download
251
264
$file = download- file " https://github.com/php/php-sdk-binary-tools/archive/refs/tags/php-sdk-$PHP_SDK_VER .zip" " php-sdk"
252
265
write-extracting
253
- Expand-Archive - Path $file - DestinationPath $pwd >> $log_file 2>&1
266
+ unzip - file $file $pwd
254
267
Move-Item " php-sdk-binary-tools-php-sdk-$PHP_SDK_VER " $SOURCES_PATH
255
268
write-done
256
269
}
@@ -286,7 +299,7 @@ function build-yaml {
286
299
write-download
287
300
$file = download- file " https://github.com/yaml/libyaml/archive/$LIBYAML_VER .zip" " yaml"
288
301
write-extracting
289
- Expand-Archive - Path $file - DestinationPath $pwd >> $log_file 2>&1
302
+ unzip - file $file $pwd
290
303
Move-Item " libyaml-$LIBYAML_VER " libyaml >> $log_file 2>&1
291
304
Push-Location libyaml
292
305
@@ -310,7 +323,7 @@ function build-pthreads4w {
310
323
write-download
311
324
$file = download- file " https://github.com/pmmp/DependencyMirror/releases/download/mirror/pthreads4w-code-v$PTHREAD_W32_VER .zip" " pthreads4w"
312
325
write-extracting
313
- Expand-Archive - Path $file - DestinationPath $pwd >> $log_file 2>&1
326
+ unzip - file $file $pwd
314
327
Move-Item " pthreads4w-code-*" pthreads4w >> $log_file 2>&1
315
328
Push-Location pthreads4w
316
329
@@ -334,7 +347,7 @@ function build-leveldb {
334
347
write-download
335
348
$file = download- file " https://github.com/pmmp/leveldb/archive/$LEVELDB_MCPE_VER .zip"
336
349
write-extracting
337
- Expand-Archive - Path $file - DestinationPath $pwd >> $log_file 2>&1
350
+ unzip - file $file $pwd
338
351
Move-Item leveldb-* leveldb >> $log_file 2>&1
339
352
Push-Location leveldb
340
353
@@ -362,7 +375,7 @@ function build-libdeflate {
362
375
write-download
363
376
$file = download- file " https://github.com/ebiggers/libdeflate/archive/$LIBDEFLATE_VER .zip"
364
377
write-extracting
365
- Expand-Archive - Path $file - DestinationPath $pwd >> $log_file 2>&1
378
+ unzip - file $file $pwd
366
379
Move-Item libdeflate-* libdeflate >> $log_file 2>&1
367
380
Push-Location libdeflate
368
381
@@ -390,7 +403,7 @@ function download-php {
390
403
391
404
$file = download- file " https://github.com/php/php-src/archive/$PHP_GIT_REV .zip" " php"
392
405
write-extracting
393
- Expand-Archive - Path $file - DestinationPath $pwd >> $log_file 2>&1
406
+ unzip - file $file $pwd
394
407
Move-Item " php-src-$PHP_GIT_REV " php- src >> $log_file 2>&1
395
408
write-done
396
409
}
@@ -402,7 +415,7 @@ function get-extension-zip {
402
415
write-download
403
416
$file = download- file $url " php-ext-$name "
404
417
write-extracting
405
- Expand-Archive - Path $file - DestinationPath $pwd >> $log_file 2>&1
418
+ unzip - file $file $pwd
406
419
write-done
407
420
}
408
421
0 commit comments