Skip to content

Commit 5af0dd2

Browse files
committed
Fix output build (broken ini)
1 parent 18c4f93 commit 5af0dd2

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/Workflow/Task/AssemblyTargetTask.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,27 @@ public function __invoke(Configuration $config): void
3434
{
3535
Task::info('Assembly target %s', [$this->target->output]);
3636

37-
$targetStream = @\fopen($this->targetPathname, 'wb+');
37+
$stream = @\fopen($this->targetPathname, 'wb+');
3838

3939
Task::notify('Created output file %s', [
4040
$this->targetPathname,
4141
]);
4242

43-
if ($targetStream === false) {
43+
if ($stream === false) {
4444
throw new \RuntimeException(\sprintf(
4545
'Unable to create target binary "%s"',
4646
$this->targetPathname,
4747
));
4848
}
4949

50-
\flock($targetStream, \LOCK_EX);
50+
\flock($stream, \LOCK_EX);
5151

52-
$this->appendSfxArchive($targetStream, $config);
53-
$this->appendPhpConfig($targetStream, $config);
54-
$this->appendSource($targetStream, $config);
52+
$this->appendSfxArchive($stream, $config);
53+
$this->appendPhpConfig($stream, $config);
54+
$this->appendSource($stream, $config);
5555

56-
\flock($targetStream, \LOCK_UN);
57-
\fclose($targetStream);
56+
\flock($stream, \LOCK_UN);
57+
\fclose($stream);
5858
}
5959

6060
/**
@@ -99,6 +99,8 @@ private function appendPhpConfig(mixed $stream, Configuration $config): string
9999
target: $this->target,
100100
));
101101

102+
$ini = \trim($ini);
103+
102104
\fwrite($stream, "\xfd\xf6\x69\xe6");
103105
\fwrite($stream, \pack('N', \strlen($ini)));
104106
\fwrite($stream, $ini);
@@ -132,8 +134,6 @@ private function appendSfxArchive(mixed $stream, Configuration $config): void
132134
\stream_copy_to_stream($archiveStream, $stream);
133135
\fclose($archiveStream);
134136

135-
Task::notify(' prefix has been written', [
136-
Path::simplify($config, $this->sfxPathname),
137-
]);
137+
Task::notify('Prefix has been written');
138138
}
139139
}

src/Workflow/Task/CollectInterpreterConfigTask.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ public function __invoke(Configuration $config): string
5555
};
5656
}
5757

58-
return $ini . "\n";
58+
return $ini;
5959
}
6060
}

0 commit comments

Comments
 (0)