定制 daffie/drupal-core-pgsql-module-remover 二次开发

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

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

daffie/drupal-core-pgsql-module-remover

Composer 安装命令:

composer require daffie/drupal-core-pgsql-module-remover

包简介

Composer plugin that removes the pgsql module from Drupal core so a contrib/custom module named 'pgsql' can be used.

README 文档

README

A Composer plugin that removes the pgsql module from Drupal core after every composer install / composer update.

Why

Drupal requires module machine names to be globally unique. Core ships a module named pgsql (at web/core/modules/pgsql), which collides with any contrib or custom module that also wants the pgsql name — Drupal's extension discovery finds two pgsql.info.yml files and errors out.

This plugin deletes core's pgsql module directory so the name is free for the replacement module. It works the same whether your project is built from drupal/core, drupal/recommended-project, or drupal/cms, since all three install the same drupal/core package.

Installation

A stable 1.0.1 release is tagged, so no minimum-stability changes are needed — Composer resolves it out of the box:

composer require daffie/drupal-core-pgsql-module-remover:^1.0

Composer 2.2+ blocks plugins that aren't explicitly allowed. Add the plugin to config.allow-plugins in your project's composer.json, otherwise it will never run:

{
    "config": {
        "allow-plugins": {
            "daffie/drupal-core-pgsql-module-remover": true
        }
    }
}

This entry is required for every version, including the tagged stable release — it is gated the same as any other plugin. Without it:

  • composer install fails with a PluginManager error (contains a Composer plugin which is blocked by your allow-plugins config).
  • On composer require the package is still added, but the plugin is silently skipped, so web/core/modules/pgsql is not removed.

You can also add the entry from the command line:

composer config allow-plugins.daffie/drupal-core-pgsql-module-remover true

How it works

The plugin subscribes to Composer's post-install-cmd and post-update-cmd events. On each run it locates the installed drupal/core package, resolves its install path, and deletes <core>/modules/pgsql if present. The operation is idempotent — if the directory is already gone, it does nothing.

⚠️ Warning: this also removes the PostgreSQL database driver

Core's pgsql module contains the PostgreSQL database driver (core/modules/pgsql/src/Driver/Database/pgsql). Deleting the module removes that driver. Only use this plugin if:

  • your replacement pgsql module provides its own PostgreSQL driver, or
  • the site does not use PostgreSQL.

License

GPL-2.0-or-later

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2026-07-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固