From 5a0083932ff2acd0c9b01099da482a0835294881 Mon Sep 17 00:00:00 2001 From: bjorn Date: Wed, 19 Jan 2022 09:20:57 +0100 Subject: [PATCH 1/6] Add Other include method for index and update. --- scaffold/web/index.php | 0 scaffold/web/update.php | 3 +++ 2 files changed, 3 insertions(+) create mode 100644 scaffold/web/index.php create mode 100644 scaffold/web/update.php diff --git a/scaffold/web/index.php b/scaffold/web/index.php new file mode 100644 index 0000000..e69de29 diff --git a/scaffold/web/update.php b/scaffold/web/update.php new file mode 100644 index 0000000..5b6c8a0 --- /dev/null +++ b/scaffold/web/update.php @@ -0,0 +1,3 @@ + Date: Wed, 19 Jan 2022 09:26:59 +0100 Subject: [PATCH 2/6] Add symlink for default site and add index and update.php to scaffolding --- composer.json | 16 +++++++++++++--- scaffold/web/index.php | 3 +++ scaffold/web/update.php | 2 +- src/ComposerScripts.php | 1 + 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index d017cf1..aca676d 100644 --- a/composer.json +++ b/composer.json @@ -30,10 +30,10 @@ ], "require": { "composer/installers": "^1.9", - "drupal/core-composer-scaffold": "*", - "drupal/drupal": "*", "drupal/core": "*", + "drupal/core-composer-scaffold": "*", "drupal/core-dev": "*", + "drupal/drupal": "*", "drush/drush": "^10.3.6 || ^11.x-dev", "phpspec/prophecy-phpunit": "*", "symfony/var-dumper": "^4.4 | ^5.1" @@ -41,7 +41,13 @@ "minimum-stability": "dev", "prefer-stable": true, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "composer/installers": true, + "drupal/core-vendor-hardening": true, + "drupal/core-project-message": true, + "drupal/core-composer-scaffold": true + } }, "scripts": { "post-root-package-install": [ @@ -60,6 +66,10 @@ "drupal-scaffold": { "locations": { "web-root": "web/" + }, + "file-mapping": { + "[web-root]/index.php": "scaffold/web/index.php", + "[web-root]/update.php": "scaffold/web/update.php" } }, "installer-paths": { diff --git a/scaffold/web/index.php b/scaffold/web/index.php index e69de29..5b6c8a0 100644 --- a/scaffold/web/index.php +++ b/scaffold/web/index.php @@ -0,0 +1,3 @@ + Date: Wed, 19 Jan 2022 10:09:20 +0100 Subject: [PATCH 3/6] Update symlink to link to correct directory --- src/ComposerScripts.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ComposerScripts.php b/src/ComposerScripts.php index 5c4550d..5a06bca 100644 --- a/src/ComposerScripts.php +++ b/src/ComposerScripts.php @@ -50,8 +50,8 @@ public static function postDrupalScaffold() { // See https://www.drupal.org/project/drupal/issues/3188703 // See https://www.drupal.org/project/drupal/issues/1792310 chdir('web'); - shell_exec('patch -p1 <../scaffold/scaffold-patch-index-php.patch'); - shell_exec('patch -p1 <../scaffold/scaffold-patch-update-php.patch'); +// shell_exec('patch -p1 <../scaffold/scaffold-patch-index-php.patch'); +// shell_exec('patch -p1 <../scaffold/scaffold-patch-update-php.patch'); // Symlink the top-level vendor folder into the Drupal core git repo. chdir('..'); @@ -65,9 +65,13 @@ public static function postDrupalScaffold() { mkdir('web/sites/simpletest/browser_output', 0777, TRUE); } +// if (!file_exists('web/sites/default/files')) { +// mkdir('web/sites/default', 0777, TRUE); +// } + // Symlink the simpletest folder into the Drupal core git repo. static::makeSymlink('../../../web/sites/simpletest', 'repos/drupal/sites/simpletest'); - static::makeSymlink( 'repos/drupal/sites/default', '../../../web/sites/default'); + static::makeSymlink( '../../../repos/drupal/sites/default/files', 'web/sites/default/files'); } /** @@ -82,6 +86,8 @@ public static function postDrupalScaffold() { * The new link to create. */ protected static function makeSymlink($target, $link) { + var_dump($target); + var_dump($link); if (file_exists($link)) { if (!is_link($link)) { print("WARNING: {$link} exists already and is not a symlink.\n"); From 7ca81136b274d056e3f5fb21c16d7213f1520bd5 Mon Sep 17 00:00:00 2001 From: bjorn Date: Wed, 19 Jan 2022 11:22:03 +0100 Subject: [PATCH 4/6] Allow scaffolding from this package --- composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composer.json b/composer.json index aca676d..b05dd4c 100644 --- a/composer.json +++ b/composer.json @@ -64,6 +64,9 @@ }, "extra": { "drupal-scaffold": { + "allowed-packages": [ + "joachim-n/drupal-core-development-project" + ], "locations": { "web-root": "web/" }, From e9cf1364bf08a9c220c0a42a7d0dcdee14f8a32b Mon Sep 17 00:00:00 2001 From: bjorn Date: Wed, 19 Jan 2022 14:23:10 +0100 Subject: [PATCH 5/6] Cleanup of some tries --- composer.json | 3 --- src/ComposerScripts.php | 4 ---- 2 files changed, 7 deletions(-) diff --git a/composer.json b/composer.json index b05dd4c..aca676d 100644 --- a/composer.json +++ b/composer.json @@ -64,9 +64,6 @@ }, "extra": { "drupal-scaffold": { - "allowed-packages": [ - "joachim-n/drupal-core-development-project" - ], "locations": { "web-root": "web/" }, diff --git a/src/ComposerScripts.php b/src/ComposerScripts.php index 5a06bca..ff2fbf6 100644 --- a/src/ComposerScripts.php +++ b/src/ComposerScripts.php @@ -50,8 +50,6 @@ public static function postDrupalScaffold() { // See https://www.drupal.org/project/drupal/issues/3188703 // See https://www.drupal.org/project/drupal/issues/1792310 chdir('web'); -// shell_exec('patch -p1 <../scaffold/scaffold-patch-index-php.patch'); -// shell_exec('patch -p1 <../scaffold/scaffold-patch-update-php.patch'); // Symlink the top-level vendor folder into the Drupal core git repo. chdir('..'); @@ -86,8 +84,6 @@ public static function postDrupalScaffold() { * The new link to create. */ protected static function makeSymlink($target, $link) { - var_dump($target); - var_dump($link); if (file_exists($link)) { if (!is_link($link)) { print("WARNING: {$link} exists already and is not a symlink.\n"); From d667be7d78fb0e1e9766d11b76dfa4f85f6eea5a Mon Sep 17 00:00:00 2001 From: bjorn Date: Wed, 19 Jan 2022 14:31:13 +0100 Subject: [PATCH 6/6] Remove comment line --- src/ComposerScripts.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/ComposerScripts.php b/src/ComposerScripts.php index ff2fbf6..2a26992 100644 --- a/src/ComposerScripts.php +++ b/src/ComposerScripts.php @@ -62,11 +62,6 @@ public static function postDrupalScaffold() { if (!file_exists('web/sites/simpletest/browser_output')) { mkdir('web/sites/simpletest/browser_output', 0777, TRUE); } - -// if (!file_exists('web/sites/default/files')) { -// mkdir('web/sites/default', 0777, TRUE); -// } - // Symlink the simpletest folder into the Drupal core git repo. static::makeSymlink('../../../web/sites/simpletest', 'repos/drupal/sites/simpletest'); static::makeSymlink( '../../../repos/drupal/sites/default/files', 'web/sites/default/files');