Breaking Changes
- PHP 8.2+ is now required (#40)
- Namespace changed to
Roots\Bedrock\Autoloader(#42) - Constructor is now side-effect-free with injected mu-plugin path (#43)
New mu-plugins/bedrock-autoloader.php (roots/bedrock#807):
<?php
/**
* Plugin Name: Bedrock Autoloader
* Plugin URI: https://github.com/roots/bedrock-autoloader
* Description: An autoloader that enables standard plugins to be required just like must-use plugins. The autoloaded plugins are included during mu-plugin loading. An asterisk (*) next to the name of the plugin designates the plugins that have been autoloaded.
* Version: 2.0.0
* Author: Roots
* Author URI: https://roots.io/
* License: MIT License
*/
if (is_blog_installed() && class_exists(\Roots\Bedrock\Autoloader\Autoloader::class)) {
$autoloader = new \Roots\Bedrock\Autoloader\Autoloader(WPMU_PLUGIN_DIR);
foreach ($autoloader->boot() as $file) {
include_once $file;
}
$autoloader->markLoaded();
unset($autoloader, $file);
}
What's Changed
- Require PHP 8.2+ and update CI and dependencies by @retlehs in #40
- Add Laravel Pint for code styling by @retlehs in #41
- Change namespace to
Roots\Bedrock\Autoloaderby @retlehs in #42 - Make constructor side-effect-free and inject mu-plugin path by @retlehs in #43
- Fix global variable scope for autoloaded mu-plugins by @retlehs in #44
- Add e2e tests for autoloaded mu-plugins by @retlehs in #45
Full Changelog: 1.1.0...v2.0.0-beta.1