Allow scripts/tests to work with non-standard code structure

Created on 13 October 2020, over 4 years ago
Updated 8 April 2024, about 1 year ago

Problem/Motivation

This is a follow up from 🐛 Wrong DRUPAL_ROOT with non-standard code structure Needs review . For security reasons, site-builders might prefer to locate scripts outside of the application root. Currently this doesn't work because Drupal guesses the app root by running __DIR__. This applies to

  1. All test scripts
  2. /core/scripts/*
  3. /core/lib/Drupal/Core/Command/*

Proposed resolution

Possible ideas:

  1. Environment variable to set app root.
  2. Composer plug-in "drupal-scaffold" has a setting for "web-root" which typically has the value "web/". So this plug-in at least in theory knows the app root and could perhaps pass it in.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

None

Feature request
Status

Active

Version

11.0 🔥

Component
Install 

Last updated about 17 hours ago

No maintainer
Created by

🇬🇧United Kingdom adamps

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024