Composerは常に最新バージョンのDrupalコアをインストールします。8.7ではなく8.6が必要です。
どうすればこれを達成できますか?
--no-installオプションを使用してdrupal-projectを作成します。
composer create-project drupal-composer/drupal-project:8.x-dev my_site_name_dir --no-interaction --no-install
ディレクトリをmy_site_name_dirに変更し、composer.jsonファイルのバージョン制約を編集します。
"require": {
...
"drupal/core": "8.6.*",
...
},
また、
"require-dev": {
"webflo/drupal-core-require-dev": "8.6.*"
},
webflo/drupal-core-require-devは、スタンドアロンパッケージとしてdrupal/coreのrequire-dev依存関係を提供します。 Drupalコアと同じリリースサイクルとバージョン管理スキームに従います。Drupalコアと同じバージョン制約を使用する必要があります。
composer install
を実行します
私の間違いは正しいwebflo/drupal-core-require-devバージョンをdrupal/coreバージョンと一緒に設定していなかったため、composer.jsonは次のようになります。
{
"name": "drupal-composer/drupal-project",
"description": "Project template for Drupal 8 projects with composer",
"type": "project",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "",
"role": ""
}
],
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
],
"require": {
"php": ">=5.6",
"composer/installers": "^1.2",
"cweagans/composer-patches": "^1.6.5",
"drupal-composer/drupal-scaffold": "^2.5",
"drupal/console": "^1.0.2",
"drupal/core": "8.6.17",
"drush/drush": "^9.0.0",
"vlucas/phpdotenv": "^2.4",
"webflo/drupal-Finder": "^1.0.0",
"webmozart/path-util": "^2.3",
"zaporylie/composer-drupal-optimizations": "^1.0"
},
"require-dev": {
"webflo/drupal-core-require-dev": "8.6.17"
},
"conflict": {
"drupal/drupal": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true
},
"autoload": {
"classmap": [
"scripts/composer/ScriptHandler.php"
],
"files": ["load.environment.php"]
},
"scripts": {
"pre-install-cmd": [
"DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
],
"pre-update-cmd": [
"DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
],
"post-install-cmd": [
"DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
],
"post-update-cmd": [
"DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
]
},
"extra": {
"composer-exit-on-patch-failure": true,
"patchLevel": {
"drupal/core": "-p2"
},
"installer-paths": {
"web/core": ["type:drupal-core"],
"web/libraries/{$name}": ["type:drupal-library"],
"web/modules/contrib/{$name}": ["type:drupal-module"],
"web/profiles/contrib/{$name}": ["type:drupal-profile"],
"web/themes/contrib/{$name}": ["type:drupal-theme"],
"drush/Commands/{$name}": ["type:drupal-drush"]
},
"drupal-scaffold": {
"initial": {
".editorconfig": "../.editorconfig",
".gitattributes": "../.gitattributes"
}
}
}
}