roots/acorn

Custom file with wp-load loads wp-cli

Koniciuaaa opened this issue · 1 comments

Version

3.0

What did you expect to happen?

I have integration.php file in main wordpress folder.

In the beginning of this file I included wp-load.php

I need to do this instead:
`\Roots\bootloader()->boot(function($app) {

if ($app->hasBeenBootstrapped()) {
    return;
}

return $app->make(\Illuminate\Contracts\Http\Kernel::class)
    ->handle(\Illuminate\Http\Request::capture());

});`

What actually happens?

When I want to run this file by CLI wp-cli is running and file is not running properly.

Steps to reproduce

Run custom file with wp-load.php in the begining

System info

No response

Log output

No response

Please confirm this isn't a support request.

Yes

We only load the wp-cli kernel if the WP_CLI class exists, which presumably is only present if you're running wp-cli, in which case it makes sense that Acorn would load in wp-cli.

image

Your solution for specifying the Http kernel makes sense.

I would not consider this a bug.

We have an issue to document how to specify a separate kernel, similar to what you've done.

I'm going to close this out in favor of roots/docs#507