dex/composer-plug-and-play 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

dex/composer-plug-and-play

Composer 安装命令:

composer require dex/composer-plug-and-play

包简介

Plug and play packages for Composer

README 文档

README

Packagist Version PHP Version Downloads License Tests

Composer Plug and Play lets you develop local packages inside a project without modifying composer.json. Keep your working packages in packages/, run composer plug-and-play, and get a fully resolved Composer environment — without polluting your real lock file.

Table of Contents

Why?

Working with local packages via path repositories in composer.json pollutes the project's composer.json and composer.lock with development-only entries that must not be committed.

Composer Plug and Play keeps this configuration isolated in packages/composer.json and packages/plug-and-play.lock, so your real composer.json stays clean.

Requirements

  • PHP 8.3 or higher
  • Composer 2.3.0 or higher

Installation

composer require dex/composer-plug-and-play

Global installation

You can install Composer Plug and Play globally to use its abilities in all your local projects.

composer global require dex/composer-plug-and-play

Quick Start

  1. Initialize the plug-and-play structure in your project:

    composer plug-and-play:init
  2. Clone or create a package inside packages/:

    git clone git@github.com:your-org/your-package.git packages/your-org/your-package
  3. Run plug-and-play to resolve everything:

    composer plug-and-play

Your package is now available as if installed via Composer, without touching composer.json.

Directories and Files

Composer Plug and Play plugin needs a packages folder in the project root directory where the plug and play structure will live.

packages/                           ← managed by plug-and-play
├── <vendor>/<package>/             ← your local package (cloned or created)
│   ├── composer.json
│   └── ...
├── composer.json                   ← your plug-and-play configuration
├── plug-and-play.json              ← generated merged config (do not commit)
└── plug-and-play.lock              ← generated lock file (do not commit)

composer.json                       ← your real project config (unchanged)
composer.lock                       ← your real lock file (unchanged)
vendor/                             ← standard Composer vendor directory

Commands

All commands use the plug-and-play.json and plug-and-play.lock files as source to project dependencies instead of composer.json and composer.lock original files.

You can use composer pp and composer pp:* as alias for all commands.

Command Description
plug-and-play Installs plug and play dependencies together with project dependencies
plug-and-play:add Require a package into packages/composer.json
plug-and-play:dump Same as composer dump-autoload, but using plug-and-play files
plug-and-play:init Initialize plug and play plugin
plug-and-play:install Same as composer install, but using plug-and-play files
plug-and-play:reset Remove plug-and-play files
plug-and-play:run Same as composer run-script, but using plug-and-play files
plug-and-play:update Same as composer update, but using plug-and-play files

Configuration

You can add additional configuration in packages/composer.json under the extra.composer-plug-and-play key.

Ignore plugged packages

Sometimes you may need to ignore a package that is under development:

{
    "extra": {
        "composer-plug-and-play": {
            "ignore": [
                "vendor-name/package-to-ignore"
            ]
        }
    }
}

Require dev dependencies from plugged packages

When developing a package or library you may need to require its dev dependencies:

{
    "extra": {
        "composer-plug-and-play": {
            "require-dev": [
                "vendor-name/package-to-require-dev"
            ]
        }
    }
}

Autoload dev dependencies from plugged packages

When developing a package or library you may need to autoload its dev dependencies:

{
    "extra": {
        "composer-plug-and-play": {
            "autoload-dev": [
                "vendor-name/package-to-autoload-dev"
            ]
        }
    }
}

Contributing

Contributions are welcome. Please open an issue before submitting a pull request so the change can be discussed first.

composer test     # run all tests
composer format   # format code with Laravel Pint (PSR-12)

License

Composer Plug and Play is licensed under the MIT license. See the license file for more details.

dex/composer-plug-and-play 适用场景与选型建议

dex/composer-plug-and-play 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 44.7k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2020 年 11 月 24 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 dex/composer-plug-and-play 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 44.7k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 15
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-11-24