Skip to content

Releases: roots/bedrock-autoloader

v2.0.0-beta.1

v2.0.0-beta.1 Pre-release
Pre-release

Choose a tag to compare

@retlehs retlehs released this 10 Mar 16:33
f53c9ba

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\Autoloader by @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

1.1.0

Choose a tag to compare

@retlehs retlehs released this 09 Mar 23:15
4cf0860

What's Changed

New

  • Add bedrock_autoloader_load_plugins filter to selectively exclude plugins from autoloading (#37)

Fixed

  • Fix autoloader failure when plugins directory does not exist (#30)
  • Fix countPlugins counting non-plugin directories (#26)
  • Fix autoloader when plugins directory is a symlink (#12)
  • Move synthetic activation hooks from plugins_loaded to init to prevent fatals on first load (#23)
  • Harden filter output sanitization and prune stale pending activations (#37)

Maintenance

  • Exclude non-essential files in .gitattributes (#27)
  • Test on PHP version 8.0 (#28)
  • Fix URLs that point to 404 (#32)

New Contributors

Full Changelog: 1.0.4...1.1.0

1.0.4

Choose a tag to compare

@retlehs retlehs released this 04 Dec 15:59
f508348

Defer pluginHooks() to the plugins_loaded hook (#25)

1.0.3

Choose a tag to compare

@retlehs retlehs released this 20 May 00:58
885f2a5
Remove plugin header (#20)

1.0.2

Choose a tag to compare

@retlehs retlehs released this 16 May 15:00
39dab98
Merge pull request #16 from aaemnnosttv/patch-1

Remove code outside of class definition

1.0.1

Choose a tag to compare

@retlehs retlehs released this 16 May 12:34
Fix invalid array access notice on 7.4

1.0.0

Choose a tag to compare

@retlehs retlehs released this 16 May 12:34
e1c980e
Merge pull request #15 from roots/use-WPMU_PLUGIN_DIR-in-path

Use WPMU_PLUGIN_DIR