@@ -37,22 +37,10 @@ export const importWxr: StepHandler<ImportWxrStep<File>> = async (
37
37
progress ?
38
38
) => {
39
39
progress ?. tracker ?. setCaption ( 'Importing content' ) ;
40
- try {
41
- const dataLiberationPlugin = await fetch ( dataLiberationPluginUrl ) ;
42
- await playground . writeFile (
43
- '/internal/shared/data-liberation.phar' ,
44
- new Uint8Array ( await dataLiberationPlugin . arrayBuffer ( ) )
45
- ) ;
46
- await writeFile ( playground , {
47
- path : '/tmp/import.wxr' ,
48
- data : file ,
49
- } ) ;
50
- } catch ( e ) {
51
- console . log ( 'oops' ) ;
52
- console . log ( e ) ;
53
- console . error ( e ) ;
54
- throw e ;
55
- }
40
+ await writeFile ( playground , {
41
+ path : '/tmp/import.wxr' ,
42
+ data : file ,
43
+ } ) ;
56
44
const docroot = await playground . documentRoot ;
57
45
playground . onMessage ( ( messageString ) => {
58
46
const message = JSON . parse ( messageString ) as any ;
@@ -68,6 +56,8 @@ export const importWxr: StepHandler<ImportWxrStep<File>> = async (
68
56
require ${ phpVar ( docroot ) } . '/wp-load.php';
69
57
require ${ phpVar ( docroot ) } . '/wp-admin/includes/admin.php';
70
58
59
+ // Defines the constants expected by the Box .phar stub when "cli" is used
60
+ // as the SAPI name.
71
61
// @TODO: Don't use the "cli" SAPI string and don't allow composer to run platform checks.
72
62
if(!defined('STDERR')) {
73
63
define('STDERR', fopen('php://stderr', 'w'));
@@ -78,7 +68,8 @@ export const importWxr: StepHandler<ImportWxrStep<File>> = async (
78
68
if(!defined('STDOUT')) {
79
69
define('STDOUT', fopen('php://stdout', 'w'));
80
70
}
81
- require '/internal/shared/data-liberation.phar';
71
+ // Preloaded by the Blueprint compile() function
72
+ require '/internal/shared/data-liberation-core.phar';
82
73
83
74
$admin_id = get_users(array('role' => 'Administrator') )[0]->ID;
84
75
wp_set_current_user( $admin_id );
0 commit comments