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

Fix search path handling for top-level drush/ directory #1542

Merged
merged 1 commit into from Aug 12, 2015
Merged

Fix search path handling for top-level drush/ directory #1542

merged 1 commit into from Aug 12, 2015

Conversation

apotek
Copy link
Contributor

@apotek apotek commented Aug 7, 2015

This change fixes the search path discovery for top-level drush/ directories.

$searchpath[] = $drupal_root . '../drush';

Translates to path/to/drupal/docroot../drush instead of path/to/drupal/docroot/../drush. This breaks inclusion of drush configuration and commands and aliases within a top-level drupal/drush folder.

The workaround is to use sites/all/drush. However, many users might not want to put custom commands and drush configurations in a web-servable location such as sites/all/drush -- especially custom commands and code. It's far safer to keep these commands and code outside of the server-executable context.

Minimalist fix is to restore the slash that was there in drush 6.

$searchpath[] = $drupal_root . '/../drush';

https://www.drupal.org/u/apotek

This change fixes the search path discovery for top-level drush/ directories.

```php
$searchpath[] = $drupal_root . '../drush';
```

Translates to ```path/to/drupal/docroot../drush``` instead of ```path/to/drupal/docroot/../drush```. This breaks inclusion of drush configuration and commands and aliases within a top-level drupal/drush folder.

The workaround is to use sites/all/drush.  However, many users might not want to put custom commands and drush configurations in a web-servable location such as sites/all/drush -- especially custom commands and code. It's far safer to keep these commands and code outside of the server-executable context.

The fix is to restore the slash that was there in drush 6.

```php
$searchpath[] = $drupal_root . '/../drush';
```

https://www.drupal.org/u/apotek
@apotek apotek changed the title Fix search path handling for top-level drush/ directory 7.x Fix search path handling for top-level drush/ directory Aug 7, 2015
@markdorison
Copy link

I have tested this change and it works as described.

greg-1-anderson added a commit that referenced this pull request Aug 12, 2015
Fix search path handling for top-level drush/ directory
@greg-1-anderson greg-1-anderson merged commit 7db647e into drush-ops:master Aug 12, 2015
@apotek apotek deleted the patch-2 branch August 12, 2015 20:32
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.

None yet

3 participants