Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom file with wp-load loads wp-cli #309

Closed
Koniciuaaa opened this issue Sep 29, 2023 · 1 comment
Closed

Custom file with wp-load loads wp-cli #309

Koniciuaaa opened this issue Sep 29, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Koniciuaaa
Copy link

Koniciuaaa commented Sep 29, 2023

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

@Koniciuaaa Koniciuaaa added the bug Something isn't working label Sep 29, 2023
@QWp6t
Copy link
Sponsor Member

QWp6t commented Mar 18, 2024

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

@QWp6t QWp6t closed this as completed Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants