Download the PHP package perfcom/magento2-non-composer-registration without Composer
On this page you can find all versions of the php package perfcom/magento2-non-composer-registration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download perfcom/magento2-non-composer-registration
More information about perfcom/magento2-non-composer-registration
Files in perfcom/magento2-non-composer-registration
Package magento2-non-composer-registration
Short Description This module replaces the NonComposerComponentRegistration file during composer operations.
License MIT
Informations about the package magento2-non-composer-registration
Magento 2 Non-Composer Registration Plugin
A Composer plugin that dynamically generates the NonComposerComponentRegistration.php file during Composer operations, replacing the static file with a dynamically generated one based on glob patterns.
Installation
Configuration
Exclude Configuration
For monorepo projects where you need to exclude certain components, create app/etc/NonComposerComponentRegistrationExclude.php:
The exclude file should return an array of paths to exclude. The plugin matches these paths against the last two directory segments of the discovered registration files.
Example:
- If a registration file is found at
app/code/Vendor/Module/registration.php - The path checked against exclusions would be
Vendor/Module - To exclude this module, add
'Vendor/Module'to the exclude array
This is particularly useful in monorepo setups where:
- Multiple Magento instances share the same codebase
- Certain modules should only be active in specific environments
- You need to selectively disable modules without removing them from the codebase
How It Works
- Trigger: Plugin runs after
composer installandcomposer update - Backup: Creates backup of existing
NonComposerComponentRegistration.phpif it exists - Scan: Uses glob patterns from
registration_globlist.phpto find registration files - Filter: Applies exclusions from
NonComposerComponentRegistrationExclude.phpif present - Generate: Creates new registration file with all discovered components
- Output: Saves the generated file to
app/etc/NonComposerComponentRegistration.php
Generated File Structure
The plugin generates a PHP file that looks like this:
Commands
The plugin automatically runs during:
composer installcomposer update
No manual commands are required.
Requirements
- PHP 8.0 or higher
- Composer Plugin API ^1.0 or ^2.0
- Magento 2.x
License
MIT License
All versions of magento2-non-composer-registration with dependencies
composer-plugin-api Version ^1.0||^2.0