@@ -36,17 +36,9 @@ export interface Hooks {
36
36
37
37
export type DatabaseType = 'sqlite' | 'mysql' | 'custom' ;
38
38
39
- export interface BootOptions {
39
+ export interface BootRequestHandlerOptions {
40
40
createPhpRuntime : ( ) => Promise < number > ;
41
41
onPHPInstanceCreated ?: ( php : PHP ) => Promise < void > ;
42
- /**
43
- * Mounting and Copying is handled via hooks for starters.
44
- *
45
- * In the future we could standardize the
46
- * browser-specific and node-specific mounts
47
- * in the future.
48
- */
49
- hooks ?: Hooks ;
50
42
/**
51
43
* PHP SAPI name to be returned by get_sapi_name(). Overriding
52
44
* it is useful for running programs that check for this value,
@@ -59,12 +51,6 @@ export interface BootOptions {
59
51
*/
60
52
siteUrl : string ;
61
53
documentRoot ?: string ;
62
- /** SQL file to load instead of installing WordPress. */
63
- dataSqlPath ?: string ;
64
- /** Zip with the WordPress installation to extract in /wordpress. */
65
- wordPressZip ?: File | Promise < File > | undefined ;
66
- /** Preloaded SQLite integration plugin. */
67
- sqliteIntegrationPluginZip ?: File | Promise < File > ;
68
54
spawnHandler ?: ( processManager : PHPProcessManager ) => SpawnHandler ;
69
55
/**
70
56
* PHP.ini entries to define before running any code. They'll
@@ -116,6 +102,23 @@ export interface BootOptions {
116
102
cookieStore ?: CookieStore | false ;
117
103
}
118
104
105
+ export interface BootOptions extends BootRequestHandlerOptions {
106
+ /**
107
+ * Mounting and Copying is handled via hooks for starters.
108
+ *
109
+ * In the future we could standardize the
110
+ * browser-specific and node-specific mounts
111
+ * in the future.
112
+ */
113
+ hooks ?: Hooks ;
114
+ /** SQL file to load instead of installing WordPress. */
115
+ dataSqlPath ?: string ;
116
+ /** Zip with the WordPress installation to extract in /wordpress. */
117
+ wordPressZip ?: File | Promise < File > | undefined ;
118
+ /** Preloaded SQLite integration plugin. */
119
+ sqliteIntegrationPluginZip ?: File | Promise < File > ;
120
+ }
121
+
119
122
/**
120
123
* Boots a WordPress instance with the given options.
121
124
*
@@ -190,7 +193,7 @@ export async function bootWordPress(options: BootOptions) {
190
193
return requestHandler ;
191
194
}
192
195
193
- export async function bootRequestHandler ( options : BootOptions ) {
196
+ export async function bootRequestHandler ( options : BootRequestHandlerOptions ) {
194
197
const spawnHandler = options . spawnHandler ?? sandboxedSpawnHandlerFactory ;
195
198
async function createPhp (
196
199
requestHandler : PHPRequestHandler ,
0 commit comments