-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Use Bedrock Autoloader package #519
Conversation
Awesome to finally see this happen! ❤️ Opened a PR against the autoloader repo which still has a few things that only belong here rather than in the package 🙂 |
21bc13c
to
49c8ac5
Compare
@aaemnnosttv merged and updated this PR, thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet!!
@@ -11,233 +11,6 @@ | |||
|
|||
namespace Roots\Bedrock; | |||
|
|||
if (!is_blog_installed()) { | |||
return; | |||
if (is_blog_installed() && class_exists(Autoloader::class)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@aaemnnosttv do you care about this? roots/bedrock-autoloader#7 |
I'm so glad this has finally happened! Great work everybody 🙌 I've explored integrating Bedrock's autoloader into WordPlate. If we load the plugins within the public function __construct()
{
if (isset(self::$instance)) {
return;
}
self::$instance = $this;
require_once ABSPATH . 'wp-includes/plugin.php';
add_filter('pre_option_active_plugins', function () {
$this->relativePath = '/../' . basename(WPMU_PLUGIN_DIR);
if (is_admin()) {
add_filter('show_advanced_plugins', [$this, 'showInAdmin'], 0, 2);
}
$this->loadPlugins();
});
} This would mean we could remove the What are your thoughts on this? |
@vinkla Thank you for taking a look! Im interested in your idea, but note that it cannot live in the constructor as a side-effect. It makes testing difficult and side-effects in constructors is a strong anti-pattern. Ref roots/bedrock-autoloader#4 Working right now so can't respond in full. |
Yes, this has been a pain point for us in WordPlate as well. Testing has been hard. I'll continue digging. |
49c8ac5
to
0f35caa
Compare
Ref #299
https://github.com/roots/bedrock-autoloader