定制 sandersander/composer-link 二次开发

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

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

sandersander/composer-link

Composer 安装命令:

composer require sandersander/composer-link

包简介

Adds ability to link local packages for development with composer

README 文档

README

phpunit Packagist Downloads

Adds ability to link local packages in composer for development.

This plugin won't alter your composer.json or composer.lock file, while maintaining the composer abilities to manage/upgrade your packages.

Requirements

  • PHP >= 8.2
  • Composer >= 2.6

Installation

This plugin can be installed globally or per project

Globally

composer global require sandersander/composer-link

Per project:

composer require --dev sandersander/composer-link

Usage

The following three commands are made available by this plugin link, unlink and linked. When the plugin is installed globally you can prefix the commands with global as example composer global linked and install global packages.

To link a package you can use the link commands, you can also link a global package. When linked to a global package absolute paths are used, when using a relative path composer-link resolves it to the absolute path.

composer link ../path/to/package
composer link ../path/to/package-one ../path/to/package-two
composer global link ../path/to/package

It's also possible to use a wildcard in your path, note that this will install all packages found in the directory ../packages If you don't want to link all the packages but only the ones originally installed you can pass the --only-installed flag.

composer link ../packages/*
composer link ../packages/* --only-installed

Composer link will automatically install/update the required packages from the linked package, you can prevent this behavior by adding the --without-dependencies flag.

When the composer link or composer unlink are used all packages defined in require-dev of the root package are installed by default, this can be prevented by using the --no-dev flag

To unlink the package you can use the unlink command

composer unlink ../path/to/package
composer unlink ../packages/*
composer unlink ../path/to/package-one ../path/to/package-two
composer global unlink ../path/to/package

You can also unlink all package with the following command

composer unlink-all

To see all linked packages in your project you can use the linked command

composer linked
composer global linked

Configuration

It is also possible to predefine linked packages in your composer.json file. This is useful for projects that always require certain local packages to be linked.

{
    "extra": {
        "composer-link": {
            "paths": [
                "../path-to-package"
            ]
        }
    }
}

The packages defined in paths will be automatically linked when running composer install or composer update. You can still use the composer unlink command to temporarily unlink these packages.

Development

The following tools are available for development. It's also possible to link this package to your global for testing changes.

composer run lint               # Lints all files 
composer run test               # Runs unit tests
composer run phpmd              # Runs phpmd
composer run phpstan            # Runs phpstan
composer run test-integration   # Runs integration tests for linux, this requires docker

sandersander/composer-link 适用场景与选型建议

sandersander/composer-link 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 457.37k 次下载、GitHub Stars 达 94, 最近一次更新时间为 2022 年 03 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 sandersander/composer-link 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 457.37k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 98
  • 点击次数: 16
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 94
  • Watchers: 4
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-03-30