定制 gared/polyless 二次开发

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

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

gared/polyless

Composer 安装命令:

composer require gared/polyless

包简介

Composer plugin that removes unnecessary Symfony polyfill packages

README 文档

README

polyless is a Composer plugin that marks unnecessary symfony/polyfill-* packages as replaced by the root project and removes their package candidates from Composer's pool.

What it does

The current basic implementation disables polyfills when one of these conditions is true:

  • the project's PHP constraint guarantees a version that already contains the feature set of a symfony/polyfill-phpXY package
  • the root project explicitly requires the corresponding extension, for example ext-mbstring for symfony/polyfill-mbstring
  • config.platform.php or configured ext-* platform entries provide the same guarantee

Direct root requirements for a specific symfony/polyfill-* package are left untouched.

Usage

Add this package to your project dev dependencies:

composer require --dev gared/polyless

You need to allow this package to run as a plugin!

After that run:

composer update symfony/polyfill-*

to remove any unnecessary polyfill packages from your project.

Current examples

PHP polyfills

If your project requires PHP 8.5:

{
  "require": {
    "php": "^8.5"
  }
}

then the plugin can replace packages such as:

  • symfony/polyfill-php80
  • symfony/polyfill-php81
  • symfony/polyfill-php82
  • symfony/polyfill-php83
  • symfony/polyfill-php84
  • symfony/polyfill-php85

If your project requires ext-intl, polyfills such as symfony/polyfill-intl-grapheme and symfony/polyfill-intl-normalizer can also be skipped.

Extension polyfills

If you composer.lock contains symfony/polyfill-mbstring you can run the following command to require the ext-mbstring extension instead (of course you need to have the PHP extension installed):

composer require ext-mbstring

this will automatically remove the symfony/polyfill-mbstring package from your project.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固