diff --git a/packages/playground/wordpress/src/boot.ts b/packages/playground/wordpress/src/boot.ts index 4a75eb2bfe..111a0cd75f 100644 --- a/packages/playground/wordpress/src/boot.ts +++ b/packages/playground/wordpress/src/boot.ts @@ -283,18 +283,3 @@ export function getFileNotFoundActionForWordPress( uri: '/index.php', }; } - -/** - * Check if the given directory handle directory is a Playground directory. - * - * @param fileExists Function A function that checks if a file exists relative to an assumed directory. - * @returns Promise Whether the directory looks like a Playground directory. - */ -export async function looksLikePlaygroundDirectory( - fileExists: (relativePath: string) => Promise -) { - const results = await Promise.all( - ['wp-config.php', 'wp-content/database/.ht.sqlite'].map(fileExists) - ); - return results.every(Boolean); -} diff --git a/packages/playground/wordpress/src/index.ts b/packages/playground/wordpress/src/index.ts index 7bb16ea785..65f8787c13 100644 --- a/packages/playground/wordpress/src/index.ts +++ b/packages/playground/wordpress/src/index.ts @@ -1,11 +1,7 @@ import { PHP, UniversalPHP } from '@php-wasm/universal'; import { joinPaths, phpVar } from '@php-wasm/util'; import { unzipFile } from '@wp-playground/common'; -export { - bootWordPress, - getFileNotFoundActionForWordPress, - looksLikePlaygroundDirectory, -} from './boot'; +export { bootWordPress, getFileNotFoundActionForWordPress } from './boot'; export { getLoadedWordPressVersion } from './version-detect'; export * from './version-detect'; @@ -388,6 +384,21 @@ export async function unzipWordPress(php: PHP, wpZip: File) { } } +/** + * Check if the given directory handle directory is a Playground directory. + * + * @param fileExists Function A function that checks if a file exists relative to an assumed directory. + * @returns Promise Whether the directory looks like a Playground directory. + */ +export async function looksLikePlaygroundDirectory( + fileExists: (relativePath: string) => Promise +) { + const results = await Promise.all( + ['wp-config.php', 'wp-content/database/.ht.sqlite'].map(fileExists) + ); + return results.every(Boolean); +} + function isCleanDirContainingSiteMetadata(path: string, php: PHP) { const files = php.listFiles(path); if (files.length === 0) {