Skip to content

Commit 12a34c1

Browse files
committed
fix(lib): retain empty opcode table runtime stubs
1 parent c645374 commit 12a34c1

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

phpunit/src/EmptyTranslationUnitTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,12 @@ public function value(): int
118118
$this->compiler->prepareFile($source);
119119
$sources = $this->compiler->convert([$source]);
120120

121-
self::assertCount(1, $sources);
122-
self::assertStringContainsString('extension-app.cc', $sources[0]);
123-
self::assertFileExists($sources[0]);
121+
self::assertCount(2, $sources);
122+
self::assertContains($this->compiler->getBuildDir() . '/extension-app.cc', $sources);
123+
self::assertContains($this->compiler->getBuildDir() . '/embedded-opcodes-app.cc', $sources);
124+
foreach ($sources as $generatedSource) {
125+
self::assertFileExists($generatedSource);
126+
}
124127
self::assertFileDoesNotExist($this->compiler->getCppFile($source));
125128
}
126129

src/Build/SourcePipelineTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ public function convert(array $files): array
11141114
// Nano keeps the ordinary statically registered Zend class/module
11151115
// metadata, then adds a direct native process entry beside it.
11161116
$sourceFiles[] = $this->genExtension();
1117-
if ($this->isBuildModeBin() && !$this->isNanoMode()) {
1117+
if ($this->isBuildModeEmbed() && !$this->isNanoMode()) {
11181118
array_push($sourceFiles, ...$this->genEmbeddedOpcodeTable());
11191119
}
11201120
if ($this->isNanoMode()) {

0 commit comments

Comments
 (0)