Skip to content

Commit b89c7a4

Browse files
committed
Probe Cloudflare WordPress short bootstrap
1 parent 337d46e commit b89c7a4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/runtime-cloudflare/src/worker.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ async function runBootProbe(phase: string): Promise<Response> {
8282
}
8383
}
8484

85-
if (phase === "seeded-wordpress") {
85+
if (phase === "seeded-shortinit" || phase === "seeded-wordpress") {
8686
const runtime = await bootWordPressRuntime(
8787
"do-not-attempt-installing",
8888
true,
@@ -91,7 +91,9 @@ async function runBootProbe(phase: string): Promise<Response> {
9191
)
9292
try {
9393
const wordpress = (await runtime.php.run({
94-
code: "<?php require '/wordpress/wp-load.php'; echo json_encode(['siteUrl' => get_option('siteurl'), 'wordpressVersion' => get_bloginfo('version')]);",
94+
code: phase === "seeded-shortinit"
95+
? "<?php define('SHORTINIT', true); require '/wordpress/wp-load.php'; echo json_encode(['wordpressVersion' => $wp_version, 'shortInit' => true]);"
96+
: "<?php require '/wordpress/wp-load.php'; echo json_encode(['siteUrl' => get_option('siteurl'), 'wordpressVersion' => get_bloginfo('version')]);",
9597
})).text.trim()
9698
try {
9799
return probeResponse(phase, JSON.parse(wordpress) as Record<string, string>)

0 commit comments

Comments
 (0)