Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load the autoloader as soon as the Drupal root is identified. #2865

Merged
merged 7 commits into from
Aug 9, 2017

Conversation

greg-1-anderson
Copy link
Member

No description provided.

}

if ($autoloader === TRUE) {
// The autoloader was already requireed. Assume that Drush and Drupal share an autoloader per
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in requireed

// then run the preflight for the root and site contexts again.
if (!empty($alias_record)) {
$remote_host = drush_get_option('remote-host');
if (!isset($remote_host)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edge case: a site alias defined in an alias file in a local Drupal site (identified via --root or the cwd), where the root defined in the alias is different than the root for the Drupal site containing the alias.

This code re-runs the preflight steps that sets up to bootstrap the selected Drupal site. I feel this makes the preflight harder to maintain, and prefer to remove it.

@greg-1-anderson
Copy link
Member Author

This PR makes the preflight process more linear, by removing a seldom-used feature (see comment above). This allows us to bring in the autoloader a little earlier in the preflight, which will allow us to share the same bootstrap classes between the current master branch and #2843.

The tests are all green, but I need to do a bit more testing to see if removing the code here causes any issues should anyone actually be using this feature (which, I think, is fairly unlikely).

@greg-1-anderson
Copy link
Member Author

I added a failing test to show the functionality that is not yet working in this PR.

@greg-1-anderson
Copy link
Member Author

@weitzman was +1 on this earlier in slack. I'm therefore going to go ahead and merge, so that I can rebase #2843 and continue with the bootstrap refactoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants