-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Feature Request
- Yes, I reviewed the contribution guidelines.
Describe your use case and the problem you are facing
Since WP CLI always initiates a new PHP CLI/WP process, you have the WP overhead for every command, which makes it the slowest part of many pipelines.
Additionally having to specify common commands every time is a chore to write, e.g. --skip-plugins --skip-themes to make it faster.
if wp plugin is-active foo
then
echo "do something"
fi
if wp plugin is-active bar
then
echo "do something else"
fi
wp option update "hello" "world"
Describe the solution you'd like
Since PHP CLI has no/long timeouts, it would make sense to give the option to "launch" a WP instance once and then reuse it.
It would be faster when we launch a WP instance and then just read a file in a while loop like https://serverfault.com/a/1088115 to execute the commands passed subsequently.
This could be an optional thing with --persist=my-instance for example.
Since the WP overhead is between 150-350ms on a barebones WP install and much higher on slow servers or with many plugins, this would save tons of runtime.