Skip to content

Commit

Permalink
Initial commit for the 9.x branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsacksick committed May 27, 2021
1 parent 35d7fd0 commit 03769be
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 24 deletions.
28 changes: 28 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# Copy and rename this file to .env at root of this project.
#

# A common use case is to supply database credentials via the environment. Edit settings.php
# like so:
#
# $databases['default']['default'] = [
# 'database' => $_ENV['MYSQL_DATABASE'],
# 'driver' => 'mysql',
# 'host' => $_ENV['MYSQL_HOSTNAME'],
# 'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
# 'password' => $_ENV['MYSQL_PASSWORD'],
# 'port' => $_ENV['MYSQL_PORT'],
# 'prefix' => '',
# 'username' => $_ENV['MYSQL_USER'],
# ];
#
# Uncomment and populate as needed.
# MYSQL_DATABASE=
# MYSQL_HOSTNAME=
# MYSQL_PASSWORD=
# MYSQL_PORT=
# MYSQL_USER=

# Another common use case is to set Drush's --uri via environment.
# DRUSH_OPTIONS_URI=http://example.com

8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/web/modules/contrib/
/web/themes/contrib/
/web/profiles/contrib/
/web/libraries/

# Ignore sensitive information
/web/sites/*/settings.php
Expand All @@ -19,5 +20,10 @@

# Ignore files generated by PhpStorm
/.idea/
/.vscode/
/.editorconfig
/.gitattributes
/.gitattributes

# Ignore .env files as they are personal
/.env

35 changes: 17 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@
"sort-packages": true
},
"require": {
"php": ">=7.1",
"php": ">=7.3",
"ext-curl": "*",
"composer/installers": "^1.2",
"cweagans/composer-patches": "^1.6.5",
"drupal/core": "^8.9.0",
"drupal/core-composer-scaffold": "^8.9.0",
"drupal/commerce": "^2.0",
"drupal/search_api": "^1.0",
"composer/installers": "^1.9",
"cweagans/composer-patches": "^1.7",
"drupal/core": "^9.1",
"drupal/core-composer-scaffold": "^9.1",
"drupal/commerce": "^2.24",
"drupal/search_api": "^1.19",
"drupal/swiftmailer": "^2.0",
"drupal/token": "^1.0",
"drupalcommerce/commerce_base": "dev-8.x-1.x",
"drush/drush": "^9.7.1 | ^10.0.0",
"oomphinc/composer-installers-extender": "^2.0",
"webflo/drupal-finder": "^1.0.0",
"drupal/token": "^1.9",
"drupalcommerce/commerce_base": "9.x-dev",
"drush/drush": "^10.3",
"vlucas/phpdotenv": "^5.1",
"webflo/drupal-finder": "^1.2",
"webmozart/path-util": "^2.3"
},
"require-dev": {
"drupal/core-dev": "^8.9.0",
"zaporylie/composer-drupal-optimizations": "^1.1"
"drupal/core-dev": "^9.1",
"zaporylie/composer-drupal-optimizations": "^1.2"
},
"conflict": {
"drupal/drupal": "*"
Expand All @@ -56,7 +56,8 @@
"autoload": {
"classmap": [
"scripts/composer/ScriptHandler.php"
]
],
"files": ["load.environment.php"]
},
"scripts": {
"drupal-scaffold": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold",
Expand Down Expand Up @@ -88,9 +89,7 @@
"npm-asset"
],
"installer-paths": {
"web/core": [
"type:drupal-core"
],
"web/core": ["type:drupal-core"],
"web/libraries/{$name}": [
"type:drupal-library",
"type:bower-asset",
Expand Down
18 changes: 18 additions & 0 deletions load.environment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

/**
* This file is included very early. See autoload.files in composer.json and
* https://getcomposer.org/doc/04-schema.md#files
*/

use Dotenv\Dotenv;

/**
* Load any .env file. See /.env.example.
*
* Drupal has no official method for loading environment variables and uses
* getenv() in some places.
*/
$dotenv = Dotenv::createUnsafeImmutable(__DIR__);
$dotenv->safeLoad();

10 changes: 5 additions & 5 deletions scripts/composer/ScriptHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use Composer\Script\Event;
use Composer\Semver\Comparator;
use Drupal\Core\Site\Settings;
use DrupalFinder\DrupalFinder;
use Symfony\Component\Filesystem\Filesystem;
use Webmozart\PathUtil\Path;
Expand Down Expand Up @@ -40,11 +41,10 @@ public static function createRequiredFiles(Event $event) {
$fs->copy($drupalRoot . '/sites/default/default.settings.php', $drupalRoot . '/sites/default/settings.php');
require_once $drupalRoot . '/core/includes/bootstrap.inc';
require_once $drupalRoot . '/core/includes/install.inc';
$settings['config_directories'] = [
CONFIG_SYNC_DIRECTORY => (object) [
'value' => Path::makeRelative($drupalFinder->getComposerRoot() . '/config/sync', $drupalRoot),
'required' => TRUE,
],
new Settings([]);
$settings['settings']['config_sync_directory'] = (object) [
'value' => Path::makeRelative($drupalFinder->getComposerRoot() . '/config/sync', $drupalRoot),
'required' => TRUE,
];
drupal_rewrite_settings($settings, $drupalRoot . '/sites/default/settings.php');
$fs->chmod($drupalRoot . '/sites/default/settings.php', 0666);
Expand Down

0 comments on commit 03769be

Please sign in to comment.