Skip to content

Commit f512929

Browse files
committed
Forward extensions to packaged Playground CLI
1 parent a962fe1 commit f512929

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

packages/runtime-playground/src/playground-cli-runner.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export interface PlaygroundCliModule {
3333
wordpressInstallMode?: "install-from-existing-files" | "install-from-existing-files-if-needed" | "do-not-attempt-installing"
3434
"site-url"?: string
3535
phpIniEntries?: Record<string, string>
36+
phpExtension?: string[]
3637
}): Promise<PlaygroundCliServer>
3738
}
3839

@@ -137,6 +138,7 @@ export async function startPlaygroundCliServer(spec: RuntimeCreateSpec, mounts:
137138
} : {}),
138139
wp: localAssetServer?.url ?? wordpressStartupAsset?.wp,
139140
php: spec.environment.phpVersion,
141+
...(spec.environment.extensions?.length ? { phpExtension: spec.environment.extensions.map((extension) => extension.manifest) } : {}),
140142
phpIniEntries: pluginRuntimePhpIniEntries(spec),
141143
"site-url": spec.preview?.siteUrl,
142144
blueprint: playgroundCliBlueprint(spec),

tests/playground-cli-runner-bootstrap-ini.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ try {
3333
phpVersion: "8.4",
3434
wordpressInstallMode: "do-not-attempt-installing",
3535
assets: { wordpressDirectory },
36+
extensions: [{ manifest: "/tmp/sodium/manifest.json" }],
3637
blueprint: {},
3738
},
3839
policy: {
@@ -68,6 +69,7 @@ try {
6869
assert.equal(calls[0].workers, 6)
6970
assert.equal(calls[0].wordpressInstallMode, "do-not-attempt-installing")
7071
assert.deepEqual(calls[0].phpIniEntries, { memory_limit: "512M" })
72+
assert.deepEqual(calls[0].phpExtension, ["/tmp/sodium/manifest.json"])
7173
const sharedMount = calls[0]["mount-before-install"]?.[0]?.hostPath
7274
assert.equal(typeof sharedMount, "string")
7375
const sharedPhpIni = await readFile(join(sharedMount as string, "php.ini"), "utf8")

0 commit comments

Comments
 (0)