perfcom/magento2-non-composer-registration
Composer 安装命令:
composer require perfcom/magento2-non-composer-registration
包简介
This module replaces the NonComposerComponentRegistration file during composer operations.
README 文档
README
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
composer require perfcom/magento2-non-composer-registration
Configuration
Exclude Configuration
For monorepo projects where you need to exclude certain components, create app/etc/NonComposerComponentRegistrationExclude.php:
<?php return [ 'Vendor/ModuleName', 'AnotherVendor/AnotherModule', 'path/to/exclude', // Add more exclusions as needed ];
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:
<?php $registrationFiles = array( '/path/to/app/code/Vendor/Module/registration.php', '/path/to/app/design/frontend/Vendor/Theme/registration.php', // ... more registration files ); foreach ($registrationFiles as $registrationFile) { require_once $registrationFile; }
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
perfcom/magento2-non-composer-registration 适用场景与选型建议
perfcom/magento2-non-composer-registration 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.32k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2025 年 07 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 perfcom/magento2-non-composer-registration 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 perfcom/magento2-non-composer-registration 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.32k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-08