@@ -80,7 +80,7 @@ export async function startPlaygroundCliServer(spec: RuntimeCreateSpec, mounts:
8080 const wordpressInstallMode = spec . environment . wordpressInstallMode ?? "install-from-existing-files"
8181 const bootstrapIniEntries = runtimeBootstrapPhpIniEntries ( spec )
8282 const useProgrammaticRunner = shouldUseProgrammaticPlaygroundRunner ( spec , options )
83- const requestWorkerEndpoint = useProgrammaticRunner || spec . environment . databaseSetup === "external" ? undefined : {
83+ const requestWorkerEndpoint = useProgrammaticRunner || connectorSecretPassword ( spec ) !== undefined ? undefined : {
8484 route : `/wp-codebox-execute-${ randomBytes ( 12 ) . toString ( "hex" ) } .php` ,
8585 token : randomBytes ( 32 ) . toString ( "base64url" ) ,
8686 payloadDirectory : join ( spec . artifactsDirectory ?? "artifacts" , "playground-internal-shared" ) ,
@@ -480,7 +480,7 @@ require_once ABSPATH . 'wp-settings.php';
480480}
481481
482482function withConnectorSecretEnvironment ( server : PlaygroundCliServer , spec : RuntimeCreateSpec ) : PlaygroundCliServer {
483- const password = spec . environment . databaseSetup === "external" ? spec . secretEnv ?. DB_PASSWORD : undefined
483+ const password = connectorSecretPassword ( spec )
484484 if ( password === undefined ) return server
485485 return {
486486 ...server ,
@@ -493,6 +493,10 @@ function withConnectorSecretEnvironment(server: PlaygroundCliServer, spec: Runti
493493 }
494494}
495495
496+ function connectorSecretPassword ( spec : RuntimeCreateSpec ) : string | undefined {
497+ return spec . environment . databaseSetup === "external" ? spec . secretEnv ?. DB_PASSWORD : undefined
498+ }
499+
496500function distributionBootstrapPhp ( spec : RuntimeCreateSpec ) : string {
497501 const distribution = recipeDistribution ( spec )
498502 if ( ! distribution ) {
0 commit comments