Skip to content

Commit 0ccd1fa

Browse files
authored
Update BuildBinCommand.php
1 parent ba8c812 commit 0ccd1fa

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Commands/BuildBinCommand.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
5252

5353
foreach ([$binFile, $pharFile, $zipFile, $sfxFile] as $file) {
5454
if (is_file($file)) {
55-
unlink($binFile);
55+
unlink($file);
5656
}
5757
}
5858

@@ -82,8 +82,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
8282
$output->writeln("Download php$version.micro.sfx.zip failed");
8383
return self::FAILURE;
8484
}
85-
if (preg_match('/404 Not Found/', $bodyBuffer)) {
86-
$output->writeln("Download php$version.micro.sfx.zip failed, 404 Not Found");
85+
$firstLine = substr($bodyBuffer, 9, strpos($bodyBuffer, "\r\n") - 9);
86+
if (!preg_match('/200 /', $bodyBuffer)) {
87+
$output->writeln("Download php$version.micro.sfx.zip failed, $firstLine");
8788
return self::FAILURE;
8889
}
8990
$bodyLength = (int)$match[1];

0 commit comments

Comments
 (0)