Skip to content

[site:install] installs directly to the /sites directory when a sites.php file is present #2333

Closed

Description

@jludwig

Problem/Motivation

When a sites.php file is present, the command site:install will place the site install files directly into the sites directory, which is quite awkward. This is because drupal_install() calls DrupalKernel::findSitePath() to find out the site path, which ends up using $_GET, which will contain info on where you called the script in your filesystem.

How to Reproduce

I'm sure you'll find this on any versions, but here is what I'm using:

Drupal version: 8.1.1
Console version: 1.0.0-alpha2

Here's what happens:

``$ drupal chain --file=~/console/chain/site-install.yml

// site:install
Starting Drupal 8 install process

[OK] Your Drupal 8 installation was completed successfully``

Then this will be what the sites folder looks like:

$ ls sites default development.services.yml example.settings.local.php example.sites.php files settings.php sites.php

Solution

While playing around, I found that you could get it to work by hardsetting $_GET to something you want, but that is extremely dirty and could have many unwanted consequences.

One workaround that is to move sites.php to somewhere like sites.php.bak before the install process, then back to sites.php when it is done. It would help with site install scripting if this was done automatically.

Activity

  1. jludwig commented on May 27, 2016

    @jludwig
    ContributorAuthor

    The PR #2335 addresses this issue.

  2. jludwig commented on Jun 13, 2016

    @jludwig
    ContributorAuthor

    The PR was merged in. Closing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions