定制 mnsami/composer-custom-directory-installer 二次开发

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

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

mnsami/composer-custom-directory-installer

最新稳定版本:2.0.0

Composer 安装命令:

composer require mnsami/composer-custom-directory-installer

包简介

A composer plugin, to help install packages of different types in custom paths.

README 文档

README

A composer plugin to install different types of Composer packages in custom directories outside the default vendor folder.

This is not another composer-installer library for supporting non-composer package types i.e. application .. etc. This is only to add the flexibility of installing composer packages outside the vendor folder. This package only supports composer package types,

https://getcomposer.org/doc/04-schema.md#type

The type of the package. It defaults to library.

Package types are used for custom installation logic. If you have a package that needs some special logic, you can define a custom type. This could be a symfony-bundle, a wordpress-plugin or a typo3-module. These types will all be specific to certain projects, and they will need to provide an installer capable of installing packages of that type.

How to use

  • Include the composer plugin into your composer.json require section::
  "require":{
    "php": ">=5.3",
    "mnsami/composer-custom-directory-installer": "1.1.*",
    "monolog/monolog": "*"
  }
  • In the extra section define the custom directory you want to the package to be installed in::
  "extra":{
    "installer-paths":{
      "./monolog/": ["monolog/monolog"]
      }
    }

by adding the installer-paths part, you are telling composer to install the monolog package inside the monolog folder in your root directory.

  • As an added new feature, we have added more flexibility in defining your download directory same like the composer/installers, in other words you can use variables like {$vendor} and {$name} in your installer-path section::
  "extra": {
    "installer-paths": {
      "./customlibs/{$vendor}/db/{$name}": ["doctrine/orm"]
    }
  }

the above will manage to install the doctrine/orm package in the root folder of your project, under customlibs.

Note

Composer type: project is not supported in this installer, as packages with type project only make sense to be used with application shells like symfony/framework-standard-edition, to be required by another package.

统计信息

  • 总下载量: 4.76M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 144
  • 点击次数: 1
  • 依赖项目数: 69
  • 推荐数: 0

GitHub 信息

  • Stars: 139
  • Watchers: 7
  • Forks: 24
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04