定制 crustum/plugin-manifest 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

crustum/plugin-manifest

Composer 安装命令:

composer require crustum/plugin-manifest

包简介

Plugin Manifest System - Install plugin assets, configs, migrations, and bootstrap code to CakePHP applications

README 文档

README

The PluginManifest plugin provides a standardized way for CakePHP plugins to install and publish assets (config files, migrations, templates, environment variables, and bootstrap code) to the main application.

This plugin enables plugin developers to distribute optional configuration files, migrations, and other assets that users can selectively install when needed.

The plugin uses interface-based registration where plugins implement ManifestInterface, making asset distribution simple and developer-friendly with interactive selection, dry-run mode, and smart duplicate prevention.

Features

Plugins implement the ManifestInterface with a static manifest() method to define their publishable assets. The system supports multiple operation types including copying files, appending to bootstrap, merging configurations, installing migrations, and adding environment variables.

Migration handling is smart, automatically adding plugin namespaces to prevent class conflicts while preserving timestamps for correct ordering. Configuration merging preserves all user comments and file structure, ensuring customizations are never lost.

The interactive mode prompts users to select what to install, or you can install by plugin, tag, or all assets at once. Dry run mode lets you preview changes before applying them. The system uses marker and content-based duplicate detection and tracks installed assets with operation-specific rules. All generated code uses modern short array syntax.

Requirements

  • PHP 8.1+
  • CakePHP 5.1+

Documentation

For complete documentation, usage examples, and tutorials, see the docs directory of this repository.

Quick Example

Each trait method returns an array of assets, so use array_merge() to combine them:

use Crustum\PluginManifest\Manifest\ManifestInterface;
use Crustum\PluginManifest\Manifest\ManifestTrait;

class YourPlugin extends BasePlugin implements ManifestInterface
{
    use ManifestTrait;

    public static function manifest(): array
    {
        $pluginPath = dirname(__DIR__) . DS;

        return array_merge(
            static::manifestConfig(
                $pluginPath . 'config' . DS . 'app.php',
                CONFIG . 'your_plugin.php',
                false
            ),
            static::manifestMigrations(
                $pluginPath . 'config' . DS . 'Migrations',
                CONFIG . 'Migrations'
            ),
            static::manifestBootstrapAppend(
                "Plugin::load('YourPlugin');",
                '// YourPlugin bootstrap'
            ),
            static::manifestEnvVars(
                [
                    'YOUR_PLUGIN_KEY' => 'default_value',
                ],
                '# YourPlugin Configuration'
            ),
            static::manifestConfigMerge(
                'YourPlugin',
                [
                    'enabled' => true,
                    'timeout' => 30,
                ]
            )
        );
    }
}

Then install with:

bin/cake manifest install --plugin YourPlugin

License

Licensed under the MIT License. Redistributions of the source code included in this repository must retain the copyright notice found in each file.

crustum/plugin-manifest 适用场景与选型建议

crustum/plugin-manifest 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 511 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 11 月 28 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 crustum/plugin-manifest 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 crustum/plugin-manifest 我们能提供哪些服务?
定制开发 / 二次开发

基于 crustum/plugin-manifest 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 511
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 21
  • 依赖项目数: 5
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-28