File tree 4 files changed +7
-12
lines changed
4 files changed +7
-12
lines changed Original file line number Diff line number Diff line change 1
1
import { RecommendedPHPVersion } from '@wp-playground/common' ;
2
2
// eslint-disable-next-line @nx/enforce-module-boundaries -- ignore test-related interdependencies so we can test.
3
- import { defaultWordPressFileNotFoundActionCallBack } from '@wp-playground/wordpress' ;
3
+ import { getFileNotFoundActionForWordPress } from '@wp-playground/wordpress' ;
4
4
import { loadNodeRuntime } from '..' ;
5
5
import {
6
6
FileNotFoundGetActionCallback ,
@@ -427,8 +427,7 @@ describe.each(SupportedPHPVersions)(
427
427
428
428
describe ( 'WordPress requests' , ( ) => {
429
429
beforeEach ( ( ) => {
430
- getFileNotFoundActionTest =
431
- defaultWordPressFileNotFoundActionCallBack ;
430
+ getFileNotFoundActionTest = getFileNotFoundActionForWordPress ;
432
431
} ) ;
433
432
it ( 'should delegate request for non-existent PHP file to /index.php with query args' , async ( ) => {
434
433
php . writeFile (
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ import playgroundWebMuPlugin from './playground-mu-plugin/0-playground.php?raw';
38
38
import { PHPResponse , PHPWorker } from '@php-wasm/universal' ;
39
39
import {
40
40
bootWordPress ,
41
- defaultWordPressFileNotFoundActionCallBack ,
41
+ getFileNotFoundActionForWordPress ,
42
42
getLoadedWordPressVersion ,
43
43
} from '@wp-playground/wordpress' ;
44
44
import { wpVersionToStaticAssetsDirectory } from '@wp-playground/wordpress-builds' ;
@@ -266,7 +266,7 @@ try {
266
266
) ,
267
267
} ;
268
268
} else {
269
- return defaultWordPressFileNotFoundActionCallBack ( relativeUri ) ;
269
+ return getFileNotFoundActionForWordPress ( relativeUri ) ;
270
270
}
271
271
} ,
272
272
} ) ;
Original file line number Diff line number Diff line change @@ -178,8 +178,7 @@ export async function bootWordPress(options: BootOptions) {
178
178
absoluteUrl : options . siteUrl ,
179
179
rewriteRules : wordPressRewriteRules ,
180
180
getFileNotFoundAction :
181
- options . getFileNotFoundAction ??
182
- defaultWordPressFileNotFoundActionCallBack ,
181
+ options . getFileNotFoundAction ?? getFileNotFoundActionForWordPress ,
183
182
} ) ;
184
183
185
184
const php = await requestHandler . getPrimaryPhp ( ) ;
@@ -268,7 +267,7 @@ async function installWordPress(php: PHP) {
268
267
) ;
269
268
}
270
269
271
- export function defaultWordPressFileNotFoundActionCallBack (
270
+ export function getFileNotFoundActionForWordPress (
272
271
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- maintain consistent FileNotFoundGetActionCallback signature
273
272
relativeUri : string
274
273
) : FileNotFoundAction {
Original file line number Diff line number Diff line change 1
1
import { PHP , UniversalPHP } from '@php-wasm/universal' ;
2
2
import { joinPaths , phpVar } from '@php-wasm/util' ;
3
3
import { unzipFile } from '@wp-playground/common' ;
4
- export {
5
- bootWordPress ,
6
- defaultWordPressFileNotFoundActionCallBack ,
7
- } from './boot' ;
4
+ export { bootWordPress , getFileNotFoundActionForWordPress } from './boot' ;
8
5
export {
9
6
getLoadedWordPressVersion ,
10
7
isSupportedWordPressVersion ,
You can’t perform that action at this time.
0 commit comments