drupal-composer/drupal-scaffold
最新稳定版本:2.6.1
Composer 安装命令:
composer require drupal-composer/drupal-scaffold
包简介
Composer Plugin for updating the Drupal scaffold files when using drupal/core
README 文档
README
DEPRECATED - DO NOT USE
This project is deprecated. Please use drupal/core-composer-scaffold.
If you are still using this plugin because you are on Drupal 8.7.x or earlier, please note that it is possible to use core-composer-scaffold with older versions of Drupal 8. Start with the template project drupal/recommended-project, and then pin to an earlier version of drupal/core-recommended after the initial create-project is done. Note that it's generally easier to remove composer.lock and vendor first when moving back to older versions of Drupal core.
OLD README FOLLOWS
Composer plugin for automatically downloading Drupal scaffold files (like
index.php, update.php, …) when using drupal/core via Composer.
It is recommended that the vendor directory be placed in its standard location at the project root, outside of the Drupal root; however, the location of the vendor directory and the name of the Drupal root may be placed in whatever location suits the project. Drupal-scaffold will generate the autoload.php file at the Drupal root to require the Composer-generated autoload file in the vendor directory.
Usage
Run composer require drupal-composer/drupal-scaffold:dev-master in your composer
project before installing or updating drupal/core.
Once drupal-scaffold is required by your project, it will automatically update
your scaffold files whenever composer update changes the version of
drupal/core installed.
Configuration
You can configure the plugin with providing some settings in the extra section
of your root composer.json.
{
"extra": {
"drupal-scaffold": {
"source": "https://git.drupalcode.org/project/drupal/raw/{version}/{path}",
"excludes": [
"google123.html",
"robots.txt"
],
"includes": [
"sites/default/example.settings.my.php"
],
"initial": {
"sites/default/default.services.yml": "sites/default/services.yml",
"sites/default/default.settings.php": "sites/default/settings.php"
},
"omit-defaults": false
}
}
}
The source option may be used to specify the URL to download the
scaffold files from; the default source is drupal.org. The literal string
{version} in the source option is replaced with the current version of
Drupal core being updated prior to download.
You can also define source as an array to have fallbacks in case of
any HTTP issues.
{
"extra": {
"drupal-scaffold": {
"source": [
"https://git.drupalcode.org/project/drupal/raw/{version}/{path}",
"https://raw.githubusercontent.com/drupal/drupal/{version}/{path}"
]
}
}
}
With the drupal-scaffold option excludes, you can provide additional paths
that should not be copied or overwritten. The plugin provides no excludes by
default.
Default includes are provided by the plugin:
.csslintrc
.editorconfig
.eslintignore
.eslintrc (Drupal <= 8.2.x)
.eslintrc.json (Drupal >= 8.3.x)
.gitattributes
.ht.router.php (Drupal >= 8.5.x)
.htaccess
index.php
robots.txt
sites/default/default.settings.php
sites/default/default.services.yml
sites/development.services.yml
sites/example.settings.local.php
sites/example.sites.php
update.php
web.config
When setting omit-defaults to true, neither the default excludes nor the
default includes will be provided; in this instance, only those files explicitly
listed in the excludes and includes options will be considered. If
omit-defaults is false (the default), then any items listed in excludes
or includes will be in addition to the usual defaults.
The initial hash lists files that should be copied over only if they do not
exist in the destination. The key specifies the path to the source file, and
the value indicates the path to the destination file.
Limitation
When using Composer to install or update the Drupal development branch, the
scaffold files are always taken from the HEAD of the branch (or, more
specifically, from the most recent development .tar.gz archive). This might
not be what you want when using an old development version (e.g. when the
version is fixed via composer.lock). To avoid problems, always commit your
scaffold files to the repository any time that composer.lock is committed.
Note that the correct scaffold files are retrieved when using a tagged release
of drupal/core (recommended).
Custom command
The plugin by default is only downloading the scaffold files when installing or
updating drupal/core. If you want to call it manually, you have to add the
command callback to the scripts-section of your root composer.json, like this:
{
"scripts": {
"drupal-scaffold": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold"
}
}
After that you can manually download the scaffold files according to your
configuration by using composer drupal:scaffold.
It is assumed that the scaffold files will be committed to the repository, to
ensure that the correct files are used on the CI server (see Limitation,
above). After running composer install for the first time commit the scaffold
files to your repository.
drupal-composer/drupal-scaffold 适用场景与选型建议
drupal-composer/drupal-scaffold 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.12M 次下载、GitHub Stars 达 192, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 drupal-composer/drupal-scaffold 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 drupal-composer/drupal-scaffold 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 9.12M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 198
- 点击次数: 20
- 依赖项目数: 204
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2026-01-04