Download the PHP package wp-spaghetti/bedrock-autoloader-mu without Composer
On this page you can find all versions of the php package wp-spaghetti/bedrock-autoloader-mu. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wp-spaghetti/bedrock-autoloader-mu
More information about wp-spaghetti/bedrock-autoloader-mu
Files in wp-spaghetti/bedrock-autoloader-mu
Package bedrock-autoloader-mu
Short Description Self-contained Bedrock MU-Plugin Autoloader, auto-synced daily from roots/bedrock
License MIT
Homepage https://github.com/wp-spaghetti/bedrock-autoloader-mu
Informations about the package bedrock-autoloader-mu
Bedrock MU-Plugin Autoloader
Self-contained Bedrock autoloader for must-use plugins. This package is automatically synchronized daily from roots/bedrock and roots/bedrock-autoloader.
Why this package?
The original roots/bedrock-autoloader requires the library to be loaded before the mu-plugin wrapper executes. This creates a chicken-and-egg problem in standard WordPress environments where mu-plugins load before regular plugins.
This package solves that by:
- Combining the Autoloader class and wrapper into a single self-contained file
- Auto-syncing daily from upstream sources
- Installing directly in
mu-pluginsroot (not a subdirectory) - Working out-of-the-box with WordPress
mu-pluginsdirectory - Requiring no external dependencies at runtime
Installation
Method 1: Via Composer with Auto-Copy Helper (Recommended)
Install the package:
Add this to your project root composer.json:
The helper class will automatically copy bedrock-autoloader.php to mu-plugins/ root on install and update.
Method 2: Via Composer with Direct Download
Install the package to manage versions via Composer, then download the file directly:
Add this to your project root composer.json:
Note: Adjust the path
wp-content/mu-plugins/bedrock-autoloader.phpaccording to your project structure.
Usage
Once installed, the autoloader will automatically load all subdirectories in wp-content/mu-plugins/ as plugins.
Example structure after installation:
How It Works
- Composer installs the package in
mu-plugins/bedrock-autoloader-mu/ - Your post-install script copies
dist/bedrock-autoloader.phptomu-plugins/root - WordPress loads
mu-plugins/bedrock-autoloader.phpdirectly - The autoloader loads all other mu-plugin subdirectories
Auto-Sync
This repository automatically syncs the following files every day at 2 AM UTC:
- Autoloader.php - The autoloader class
- bedrock-autoloader.php - The wrapper file
The combined file is generated and saved in the dist/ directory to prevent it from being autoloaded by itself.
When changes are detected, a new version tag is automatically created with format v1.0.YYYYMMDD.
Troubleshooting
File not copied to mu-plugins root
Make sure:
- You've added the scripts to your project root
composer.json(not the package's composer.json) - Your
installer-pathscorrectly points to your mu-plugins directory - The helper class can write to the mu-plugins directory (check permissions)
Different project structure
If your project has a custom structure, adjust the paths in your scripts. The helper class copies the file relative to the vendor directory, so you may need to use a custom shell script instead:
Contributing
For your contributions please use:
See CONTRIBUTING for detailed guidelines.
Sponsor
Credits
Based on the original work by Roots:
License
MIT License - See LICENSE file for details.
Original code © Roots
Self-contained package © Frugan
All versions of bedrock-autoloader-mu with dependencies
composer-runtime-api Version ^2.0
composer/installers Version ^1.0 || ^2.0
