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

8 to master #2373

Closed
wants to merge 226 commits into from
Closed
Show file tree
Hide file tree
Changes from 219 commits
Commits
Show all changes
226 commits
Select commit Hold shift + click to select a range
b64951c
Update Drush Compatibility matrix in the 8.x branch.
greg-1-anderson Mar 9, 2016
d8735de
Add branches list back to .travis.yml; select 8.x branch for testing.
greg-1-anderson Mar 9, 2016
61f05cd
Add a branch regex that matches release tags, just in case Travis lim…
greg-1-anderson Mar 9, 2016
97fd75f
Squashed commit of the following:
weitzman Mar 16, 2016
67b5858
Progress on #2023. Recognize -dv and -vd in the Drush finder script.
weitzman Mar 16, 2016
7f06b99
Handle spaces in /path/to/php for runserver command under Drupal 8.
weitzman Mar 17, 2016
ed4eb36
Fixes PATH export which was broken with commit 62b08fa
Mar 17, 2016
1cd67f8
Clean up @params in batch.inc
ElijahLynn Mar 18, 2016
4ec7cec
Remove --file option form config-edit
weitzman Mar 18, 2016
b9186d4
Fix #2069. config-import --partial works at too low a level.
weitzman Mar 21, 2016
7bbc539
Note a limitation of config-set.
weitzman Mar 21, 2016
769b067
config-edit now calls into config-import command at end instead of ju…
weitzman Mar 21, 2016
e345ae5
Fix #2080. cutie specified wrong path for sqlite DB.
weitzman Mar 22, 2016
ddca1c7
Progress on #2090 - runserver/d8-rs-router.php can't find index.php a…
weitzman Mar 23, 2016
48175f3
Add a shell alias example for saving a sanitized DB dump. #551
weitzman Mar 28, 2016
0673167
Fix test expectation after D6 EOL.
weitzman Mar 28, 2016
7c8e78e
Squashed commit of the following:
weitzman Mar 29, 2016
55481ff
Polyfill for array_column() on PHP version 5.4 and lower.
weitzman Mar 29, 2016
1b335a3
Fix test fail for config-import --partial. It uses a class only avail…
weitzman Mar 29, 2016
f96ab8b
Use a full directory in config-import --partial test.
weitzman Mar 29, 2016
a27d131
Handle and report on any errors when running the sanitize query.
weitzman Mar 30, 2016
cb01a8c
Replacing which with command test for better reliablity.
frederickjh Mar 30, 2016
1230685
Drupal modules are recognized by the presence of an a .info.yml file,…
weitzman Mar 23, 2016
5434952
D6/D7 modules ship with .info files, not .info.yml. Woops.
weitzman Mar 28, 2016
13ca5c7
Addressing issue 2093 by appending basename($source_path) only if $so…
paulmer Mar 23, 2016
d9a8b62
Typo fix for config-edit description.
Apr 1, 2016
4610829
Add Doxygen to batch command callbacks.
weitzman Apr 8, 2016
6315a3b
Fix typos; specify location of module hook implementations in sql_syn…
steveoliver Apr 7, 2016
fb1eacb
Use Drupal 8's batch.storage service when available in batch.inc
Apr 8, 2016
b8c7e87
D8 got rid of batch table.
weitzman Apr 10, 2016
ad9a564
D8 got rid of batch table (again).
weitzman Apr 10, 2016
4dc7a85
D8 got rid of batch table (3rd try).
weitzman Apr 10, 2016
80c3a0d
Allows custom locations to be included in make-lock files.
ncharalampidis Feb 3, 2016
37af9e9
Add support for SSL MySQL connections
acrollet Apr 14, 2016
4077750
Add encouragement to use Composer to examples/policy.drush.inc.
weitzman Apr 20, 2016
c504228
Refactor table selection options so that they can be shown on archive…
weitzman Apr 21, 2016
117bbee
Now that Drupal 6 has reached EOL, -all- contrib modules on drupal.or…
greg-1-anderson Apr 22, 2016
7aa7333
Ignore update_contrib in core requirements test for Drupal 6, since i…
greg-1-anderson Apr 22, 2016
ac24539
Mark pm-updatecode skipped on Drupal 6, as this command does not work…
greg-1-anderson Apr 22, 2016
32c7393
Test php versions 5.4 and 7, instead of 5.5 and 7. This is in alignme…
greg-1-anderson Apr 22, 2016
cc75da0
Explicitly require symfony/console, so we can pin its version to ~2.7…
greg-1-anderson Apr 22, 2016
30a4108
Do not run Drupal 8 tests with php 5.4.
greg-1-anderson Apr 22, 2016
be9785b
Merge pull request #2146 from drush-ops/fix-6
greg-1-anderson Apr 22, 2016
d14fce0
Provide annoted command support for Drush 8.
greg-1-anderson Apr 18, 2016
eb682b9
Fix up help output for annotated commands.
greg-1-anderson Apr 19, 2016
c1a2f63
Ensure that options are passed to the command.
greg-1-anderson Apr 20, 2016
e0157a4
Add tests for annotated commands.
greg-1-anderson Apr 20, 2016
fcb6887
Better handling and testing of help for annotation commands.
greg-1-anderson Apr 20, 2016
965da88
Cache annotated commandfile discovery results.
greg-1-anderson Apr 20, 2016
356fb75
Disable the woot module to avoid cross-contamination of the Drupal te…
greg-1-anderson Apr 20, 2016
55593fa
Be a little more robust about disappearing annotation command files.
greg-1-anderson Apr 20, 2016
7f9c69b
Support ignored-modules for annotated commands.
greg-1-anderson Apr 21, 2016
84af0d3
Extract consolidation/annotated-command classes out for backport, to …
greg-1-anderson Apr 22, 2016
8acb695
Annotated commands tests for Drupal 6.
greg-1-anderson Apr 22, 2016
dd66a85
Fix CommandInfo for php 5.4.
greg-1-anderson Apr 22, 2016
d06e80c
Prep for 8.1.0
weitzman Apr 24, 2016
75ad3e1
Back to dev.
weitzman Apr 24, 2016
c3da343
Fix incorrect backport in runserver.
weitzman Apr 25, 2016
b06e66f
Add consolidation/output-formatters.
greg-1-anderson Apr 30, 2016
95d10cf
Use consolidation/output-formatters with annotated commands, and upda…
greg-1-anderson Apr 30, 2016
d85429a
Update to annotated comands 1.0.0-beta8, and add a test for backend r…
greg-1-anderson May 1, 2016
b0b8eed
Factor annotationcommand_adapter_get_commands_for_commandhandler out …
greg-1-anderson May 2, 2016
c8a940b
Use modules' services file to find commandfile instances.
greg-1-anderson May 2, 2016
7ff575b
Do a full bootstrap when running help, to ensure that the module serv…
greg-1-anderson May 3, 2016
d6efe71
Require a @command annotation for module service command methods, but…
greg-1-anderson May 3, 2016
fbef874
Fix #2151. Use leading slash when calling Drupal methods. Coding stan…
theodorosploumis May 3, 2016
a259b3f
Fix #2161. replace getStorageController() with getStorage().
weitzman May 3, 2016
7dccc57
Fix #2170. config-import dependencies should be an array.
weitzman May 4, 2016
4b00e31
Fix typo.
weitzman May 4, 2016
85b5814
Prep for 8.1.2
weitzman May 5, 2016
b2a456b
Back to dev.
weitzman May 5, 2016
a356903
Merge pull request #1876 from matthijs-va/make-update-fixed-core
jhedstrom May 5, 2016
4828b63
Do command discovery via tagged services rather than service parameters.
greg-1-anderson May 4, 2016
439c478
Support --ignored-modules in tagged services.
greg-1-anderson May 4, 2016
761299f
Check to see if DrupalKernel::addServiceModifier already exists; if s…
greg-1-anderson May 4, 2016
a70b79f
Update to consolidation/annotated-command 1.0.0-beta11.
greg-1-anderson May 6, 2016
ab0b099
Support symfony console commands. Note that we call Command::run() di…
greg-1-anderson May 6, 2016
535c840
Do not rebuild the container; it does not appear to be necessary, and…
greg-1-anderson May 6, 2016
bc03759
Get rid of unnecessary cleanup in annotated command test.
greg-1-anderson May 6, 2016
2690201
Add tests for Symfony Console commands and annotated Symfony Console …
greg-1-anderson May 6, 2016
c288ed8
Taking rebuild container out just caused other problems; perhaps $ker…
greg-1-anderson May 6, 2016
e1f8f77
Merge pull request #2139 from drush-ops/annotation-drush8
greg-1-anderson May 7, 2016
b80bc08
Update to consolidation/output-formatters 1.0.0-beta6
greg-1-anderson May 8, 2016
58d4c13
Remove dead code. Use drush init instead.
weitzman May 10, 2016
bef7232
Fix #2176. Remove dependency on config module for config-import.
weitzman May 17, 2016
fb64860
Fix make tests, deprecate SVN support.
ergonlogic May 18, 2016
6b92d01
Partial revert to fix make tests.
ergonlogic May 18, 2016
14f2d7f
Fixed #2054: Document 'do_recursion' option in Drush Make.
ergonlogic May 18, 2016
57b446d
Fixes #2189: Support 'no-core' tarballs for profile downloads.
ergonlogic May 18, 2016
cf7e32a
Add docs for 'variant' project parameter for Drush Make.
ergonlogic May 18, 2016
04bba87
Don't recurse when we're using a pre-built profile tarball.
ergonlogic May 19, 2016
e0c9b5d
Fix fatal error when using --db-prefix (#2178)
rendered-monkey May 24, 2016
83339d3
Mention --user defaults to 0 (#2201)
helmo May 31, 2016
bb14028
Fix #2198 - fix pointer regarding Composer.
weitzman May 31, 2016
949009d
Test with devel-reinstall instead of devel-download.
greg-1-anderson Jun 6, 2016
0fecd7f
Maintain compatibility with Drush extensions (e.g. drush_ctex_bonus) …
greg-1-anderson Jun 8, 2016
ef23255
Merge pull request #2212 from drush-ops/drush-log-compat-8.x
greg-1-anderson Jun 8, 2016
f91187f
Change sendmail_path to match drupal-composer. Hope this is more reli…
weitzman Jun 22, 2016
ee7f72c
Fix issue with included makefile on git repo. (#2238)
Decipher Jun 27, 2016
2f49420
Fox typo.
weitzman Jul 5, 2016
0fe1026
Add a new config-delete command. Useful for developers.
weitzman Jul 5, 2016
2cb1a61
Fox another type and remove old code comment.
weitzman Jul 7, 2016
95d9a68
Fox typo in code comment.
weitzman Jul 8, 2016
c69fd4d
Fixes #2258 : Disable automated cron on drush requests (#2259)
damiankloip Jul 12, 2016
7039fef
Changed single quotes to double quotes in extra parameters (Sqlpgsql:…
kaszi Jul 12, 2016
a026d1c
'Sanitize query failed' with 'sqlsan --sanitize-password=no' on D8 (#…
steveoliver Jul 12, 2016
16f24da
Unish will now use latest relese of Drupal 8, not tip of 8.0.x
weitzman Jul 12, 2016
eee64e3
Fix #2257 config-pull gets cancelled with no helpful error message.
weitzman Jul 13, 2016
48d7179
Fix #2270. Don't show a warning for Requirements that are just INFO. …
weitzman Jul 13, 2016
7b7490f
Oops - bad equals sign.
weitzman Jul 13, 2016
282aa39
Fix make tests to not rely on sourceforge (#2269)
jhedstrom Jul 13, 2016
2e99342
Fix #2219. twig-compile should find templates in all active themes.
weitzman Jul 13, 2016
79e3288
Try to speed up builds by directory caching at Travis.
weitzman Jul 14, 2016
853f6c4
Fixed method signature in DrupalKernel. (#2202)
mbovan Jul 18, 2016
ad8a0ff
Adds sub-options for xhprof_enable() flags. (#2174)
webbj74 Jul 18, 2016
b8fdb97
Fix #2277 pm-download puts drush commands in wrong location.
weitzman Jul 18, 2016
fec5794
Prep for 8.1.3.
weitzman Jul 18, 2016
93b9a2d
Back to dev
weitzman Jul 19, 2016
2ce823e
Fix #2287 and #1581. Warn about risks of using --no-backup option dur…
weitzman Jul 22, 2016
32e505b
Fix #2110 and #2111 - Always return value from ->drop() method.
weitzman Mar 31, 2016
9ffcecc
Fix SQL hostname for localhost #2017
AdamPS Mar 24, 2016
8b658ea
Test project versions are checked strictly (no numeric equivalence).
jonhattan Jul 26, 2016
71fde22
Use string comparison for release versions.
jonhattan Jul 26, 2016
56e38bb
Fixed condition for hidden files.
Chi-teck Jul 24, 2016
4989fbd
Fix drush_is_nested_directory() and drush_preflight_command_dispatch(…
weitzman Aug 2, 2016
c12fb28
Use DIRECTORY_SEPARATOR in startup.inc. (#2300)
weitzman Aug 2, 2016
7fa503f
Get rid of Drush's own drush.bat.
weitzman Aug 2, 2016
2ab1791
Fix #2302 - dont delete .htaccess during config-pull.
weitzman Aug 5, 2016
4331d9b
Fix #2246. Can't make requests from same dir as drush.phar when renam…
weitzman Aug 5, 2016
6bb741e
Fix #2246 by moving check for Phar discovery during startup.
weitzman Aug 5, 2016
21a63cb
Fix #2210 Ignore .idea dir in git.
weitzman Aug 6, 2016
e021bd0
Fix #2288. Fix SQL hostname for grants in 8.x
weitzman Aug 6, 2016
b6d7308
fix typo in docs.
weitzman Aug 18, 2016
7964327
download theme engines into the sensible default place for theme engi…
Aug 3, 2016
1e84e9a
Fix drush_backend_invoke_concurrent() thinks @self is a different site
tstoeckler Mar 29, 2016
715a0e4
Skip the launcher when using Windows. (#2312)
weitzman Aug 19, 2016
7258ec0
Double quotes around as it can contain spaces.
weitzman Aug 19, 2016
d5e16ea
Some enhancements to Finder and misc Unish fixes for Windows.
weitzman Aug 20, 2016
47ea85e
Specify event-dispatcher in composer.json in order to get a Drupal co…
weitzman Aug 20, 2016
ba719da
Specify PHP 5.4 as platform requirement in composer.json. See https:/…
weitzman Aug 20, 2016
303ca4b
Issue #2320: Fixing typo in includes/preflight.inc. (#2321)
serundeputy Aug 22, 2016
4dad498
Fix #2318. Set cwd when Finder is launching via proc_open().
weitzman Aug 25, 2016
92468a9
Add updb option to sync_enable example. (#2247)
thom8 Aug 25, 2016
c0ba05b
Handle requeue exception in 8.x (#2323)
juampynr Aug 25, 2016
9b2bea7
Progress on Appveyor testing. Still lots of fails.
weitzman Aug 26, 2016
5522726
A few test fixes for Windows.
weitzman Aug 30, 2016
026d798
Add unish.bat for easier testing on Windows.
weitzman Aug 30, 2016
1846e54
Merge pull request #2330 from drush-ops/fix-make-tests2
jhedstrom Aug 30, 2016
cdc8a6d
A few Windows related fixes.
weitzman Aug 31, 2016
d7d7f35
Fix escaping in testDispatchStrictOptions.
weitzman Aug 31, 2016
89c1269
use stdin in test.
weitzman Aug 31, 2016
37b469c
Break up testReleaseNotes for better Windows compat.
weitzman Aug 31, 2016
7fda6c9
No fork test on Windows.
weitzman Sep 1, 2016
10588e4
Appveyor tweak for testMakeBZ2.
weitzman Sep 1, 2016
c6fab52
Bit_bucket fix for Windows.
weitzman Sep 1, 2016
8419577
A bit of work on testDrushFinder() for Windows compat.
weitzman Sep 1, 2016
44c247e
Canonicalize paths for testCommandVersionSpecific().
weitzman Sep 1, 2016
4e6847f
Windows test tweaks.
weitzman Sep 1, 2016
489ee2a
Fix #1788. Remove winrs support.
weitzman Sep 1, 2016
1c6e8d6
Parse error fix.
weitzman Sep 1, 2016
8e5dcff
Skip complete test on Windows.
weitzman Sep 1, 2016
ec3738d
Fix expectation for drush-script.
weitzman Sep 1, 2016
49079bf
Skip end of testDispatchStrictOptions() for Windows.
weitzman Sep 1, 2016
4bb80dd
Simplify \Unish\drushScriptCase::getDrushLocation.
weitzman Sep 1, 2016
651111e
Canonicalize the /path/to/drush.
weitzman Sep 1, 2016
04de92f
standardize etc_drush path in test.
weitzman Sep 2, 2016
3b3f96e
Canonicalize our expected path to drush.php in test.
weitzman Sep 2, 2016
e3eb801
Remove Unish\outputFormatCase::testOutputFormatWithDrupal as it is su…
weitzman Sep 2, 2016
5274766
Uncomment 'Double up percents.' during Windows argument escaping in U…
weitzman Sep 2, 2016
4c0869b
Undo double percents. Did not help.
weitzman Sep 2, 2016
8bea1a3
Handle FALSE in drush_find_drush().
weitzman Sep 2, 2016
4c4010e
Make a copy of the test fixture WootCommands, so that the Drupal 7 mo…
greg-1-anderson Sep 8, 2016
f978f5a
Try explicitly clearing the Drush commandfile cache.
greg-1-anderson Sep 8, 2016
1c34905
The backslash at the beginning of the classname in @return statements…
greg-1-anderson Sep 10, 2016
52796a9
Add a sanity-check assert to the woot commands test.
greg-1-anderson Sep 10, 2016
42283d5
Updated composer.lock, and a few more asserts, to see the first direc…
greg-1-anderson Sep 10, 2016
cf64728
Add some error checking in the recursive_copy function.
greg-1-anderson Sep 10, 2016
f599ead
Only use recursive_copy in annotatedCommandTest on Windows.
greg-1-anderson Sep 10, 2016
9695b7b
Update annotated command test for Drupal 6.
greg-1-anderson Sep 10, 2016
42b11b5
Discover Drush's own annotated commands and convert browse to an anno…
weitzman Aug 19, 2016
0a24401
Get latest consolidation/* packages
weitzman Aug 19, 2016
7b7a490
Fix annotationcommand_adapter_process_command() for the case where th…
greg-1-anderson Aug 20, 2016
834e517
Add support for @bootstrap and @handle-remote-commands annotations. N…
weitzman Sep 5, 2016
11c49bc
Composer.lock changes. Keeps PHP 5.4 compat.
weitzman Sep 5, 2016
affee1b
Add argument completion for annotated commands.
weitzman Sep 5, 2016
43e309d
Fix 2302 .htaccess getting removed during config-pull.
weitzman Sep 13, 2016
b28c7f0
Update URL to search for Drush packages on Packagist.
greg-1-anderson Sep 14, 2016
03098c7
Prep for 8.1.4
weitzman Sep 24, 2016
6c920f4
Back to dev.
weitzman Sep 24, 2016
f033ab5
drush.phar was trying to find launcher.
weitzman Sep 25, 2016
1cf4b2d
Prep for 8.1.5
weitzman Sep 25, 2016
41e3868
Back to dev.
weitzman Sep 25, 2016
befc2ca
Backport Composer support into make-convert command (#2368)
Sep 30, 2016
42ecc7e
Fix #2369. Update drush dependency phpdocumentor/reflection-docblock …
JTubex Sep 30, 2016
411b8ad
Update to Annotated Commands 2.0.0-rc3.
greg-1-anderson Sep 27, 2016
6ed4050
Update to new construction requirements for FormatterManager(), and g…
greg-1-anderson Sep 27, 2016
42d7845
Update to annotated commands rc6, and add the example:table and drupl…
greg-1-anderson Sep 29, 2016
59b5504
Display options added by hooks in help. Hooks are not called yet.
greg-1-anderson Sep 29, 2016
b496424
Validate options added by hooks, so an error is not returned if a use…
greg-1-anderson Sep 29, 2016
9431f5f
Remove the old druplicon. Call the post-command hook from the annotat…
greg-1-anderson Sep 29, 2016
bcfbad7
Appropriately set default option values for options added by hooks.
greg-1-anderson Sep 30, 2016
b213e23
Update to latest annotated command hook APIs.
greg-1-anderson Sep 30, 2016
43596f8
We need to put the command name back onto the head of the arguments i…
greg-1-anderson Sep 30, 2016
53b03e2
Update to annotated-command 2.0.0-rc7 and output-formatters 2.0.0-rc3…
greg-1-anderson Sep 30, 2016
b515c19
Avoid the prompt when using --config-dir during site-install.
weitzman Oct 1, 2016
02aabdf
Remove unnecessary (optional) $ from @option annotations.
greg-1-anderson Oct 1, 2016
fd5b1c7
Fill in the function bodies for the other hook functions.
greg-1-anderson Oct 1, 2016
2a53dff
Update to stable releases of annotated-command and output-formatters.
greg-1-anderson Oct 1, 2016
dc0ac0e
Fix #2364. Source and target databases are the same while port number…
weitzman Oct 1, 2016
52ec988
Fix typo.
weitzman Oct 2, 2016
2db452b
Fix yaml makefile generation - reading looks for patch, not patches. …
NigelCunningham Oct 2, 2016
6d75f28
Add some docblock comments to annotationcommand_adapter.inc.
greg-1-anderson Oct 2, 2016
3ae42c0
Merge pull request #2366 from drush-ops/annotation-command-rc3
greg-1-anderson Oct 2, 2016
96eea45
Merge 8.x branch into master -- use annotation adapter from 8.x to ma…
greg-1-anderson Oct 4, 2016
d23d9af
Remove duplicate 'browseCommands.php'; leave 'BrowseCommands.php'.
greg-1-anderson Oct 4, 2016
9cc45c5
Fix construction of command objects.
greg-1-anderson Oct 5, 2016
955a7a3
Add bootstrap annotation to eval command.
greg-1-anderson Oct 5, 2016
428288c
Add @allow-additional-options annotation.
greg-1-anderson Oct 5, 2016
c0ddcc1
Adjust tests to match new behavior.
greg-1-anderson Oct 5, 2016
9e49f1a
Remove unnecessary commented-out code from make.drush.inc.
greg-1-anderson Oct 5, 2016
6eaaec2
Remove old init.drush.inc commandfile.
greg-1-anderson Oct 5, 2016
2185d52
Remove includes/array_column.inc.
greg-1-anderson Oct 5, 2016
686793f
Correct comments.
greg-1-anderson Oct 5, 2016
161e826
Remove unneeded code.
greg-1-anderson Oct 5, 2016
bce299f
Clean up initialization / DI, and some minro command-related cleanup.
greg-1-anderson Oct 5, 2016
ef609ff
Make sure tests have @command annotation.
greg-1-anderson Oct 5, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion box.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"chmod": "0755",
"compactors": [],
"directories": ["commands", "docs", "examples", "includes", "lib", "misc"],
"files": ["drush.api.php", "drush.complete.sh", "drush.info", "drush.launcher", "drush.php", "drush-services.yml", "drush_logo-black.png", "README.md"],
"files": ["drush.api.php", "drush.complete.sh", "drush.info", "drush.launcher", "drush.php", "drush-services.yml", "drush_logo-black.png", "README.md"],
"finder": [
{
"name": "*.php",
Expand Down
3 changes: 2 additions & 1 deletion commands/core/help.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ function drush_core_help($name = '') {
}

// For speed, only bootstrap up to DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION.
drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION);
drush_bootstrap_max();
drush_get_commands(true);
$implemented = drush_get_commands();
ksort($implemented);
$command_categories = drush_commands_categorize($implemented);
Expand Down
11 changes: 9 additions & 2 deletions commands/core/helpsingle.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,19 @@ function drush_core_helpsingle($commandstring) {
if (!array_key_exists($commandstring, $commands)) {
// If the command cannot be found, then bootstrap so that
// additional commands will be brought in.
// For speed, only bootstrap up to DRUSH_BOOTSTRAP_DRUPAL_SITE.
drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_SITE);
// TODO: We need to do a full bootstrap in order to find module service
// commands. We only need to do this for Drupal 8, though; 7 and earlier
// can stop at DRUSH_BOOTSTRAP_DRUPAL_SITE. Perhaps we could use command
// caching to avoid bootstrapping, if we have collected the commands for
// this site once already.
drush_bootstrap_max();
$commands = drush_get_commands();
}
if (array_key_exists($commandstring, $commands)) {
$command = $commands[$commandstring];

annotationcommand_adapter_add_hook_options($command);

drush_print_help($command);
return TRUE;
}
Expand Down
173 changes: 173 additions & 0 deletions commands/core/init.drush.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
<?php
Copy link
Member

Choose a reason for hiding this comment

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

We already have https://github.com/drush-ops/drush/blob/master/lib/Drush/CommandFiles/InitCommandFile.php. We should not add this old style file back in, I think.


/**
* @file
* Set up local Drush configuration.
*/

use Drush\Log\LogLevel;

/**
* Implementation of hook_drush_command().
*
* @return
* An associative array describing your command(s).
*/
function init_drush_command() {
$items['core-init'] = array(
'description' => 'Enrich the bash startup file with completion and aliases. Copy .drushrc file to ~/.drush',
'aliases' => array('init'),
'bootstrap' => DRUSH_BOOTSTRAP_NONE,
'package' => 'core',
'global-options' => array('editor', 'bg'),
'options' => array(
'edit' => 'Open the new config file in an editor.',
'add-path' => "Always add Drush to the \$PATH in the user's .bashrc file, even if it is already in the \$PATH. Use --no-add-path to skip updating .bashrc with the Drush \$PATH. Default is to update .bashrc only if Drush is not already in the \$PATH.",
),
'examples' => array(
'drush core-init --edit' => 'Enrich Bash and open drush config file in editor.',
'drush core-init --edit --bg' => 'Return to shell prompt as soon as the editor window opens.',
),
);
return $items;
}

/**
* Initialize local Drush configuration
*/
function drush_init_core_init() {
$home = drush_server_home();
$drush_config_dir = $home . "/.drush";
$drush_config_file = $drush_config_dir . "/drushrc.php";
$drush_bashrc = $drush_config_dir . "/drush.bashrc";
$drush_prompt = $drush_config_dir . "/drush.prompt.sh";
$drush_complete = $drush_config_dir . "/drush.complete.sh";
$examples_dir = DRUSH_BASE_PATH . "/examples";
$example_configuration = $examples_dir . "/example.drushrc.php";
$example_bashrc = $examples_dir . "/example.bashrc";
$example_prompt = $examples_dir . "/example.prompt.sh";
$example_complete = DRUSH_BASE_PATH . "/drush.complete.sh";
$bashrc_additions = array();

// Create a ~/.drush directory if it does not yet exist
if (!is_dir($drush_config_dir)) {
drush_mkdir($drush_config_dir);
}

// If there is no ~/.drush/drushrc.php, then copy the
// example Drush configuration file here
if (!is_file($drush_config_file)) {
copy($example_configuration, $drush_config_file);
drush_log(dt("Copied example Drush configuration file to !path", array('!path' => $drush_config_file)), LogLevel::OK);
}

// If there is no ~/.drush/drush.bashrc file, then copy
// the example bashrc file there
if (!is_file($drush_bashrc)) {
copy($example_bashrc, $drush_bashrc);
$pattern = basename($drush_bashrc);
$bashrc_additions["%$pattern%"] = "# Include Drush bash customizations.\n". drush_bash_addition($drush_bashrc);
drush_log(dt("Copied example Drush bash configuration file to !path", array('!path' => $drush_bashrc)), LogLevel::OK);
}

// If there is no ~/.drush/drush.complete.sh file, then copy it there
if (!is_file($drush_complete)) {
copy($example_complete, $drush_complete);
$pattern = basename($drush_complete);
$bashrc_additions["%$pattern%"] = "# Include Drush completion.\n". drush_bash_addition($drush_complete);
drush_log(dt("Copied Drush completion file to !path", array('!path' => $drush_complete)), LogLevel::OK);
}

// If there is no ~/.drush/drush.prompt.sh file, then copy
// the example prompt.sh file here
if (!is_file($drush_prompt)) {
copy($example_prompt, $drush_prompt);
$pattern = basename($drush_prompt);
$bashrc_additions["%$pattern%"] = "# Include Drush prompt customizations.\n". drush_bash_addition($drush_prompt);
drush_log(dt("Copied example Drush prompt file to !path", array('!path' => $drush_prompt)), LogLevel::OK);
}

// Decide whether we want to add our Bash commands to
// ~/.bashrc or ~/.bash_profile
$bashrc = drush_init_find_bashrc($home);

// If Drush is not in the $PATH, then figure out which
// path to add so that Drush can be found globally.
$add_path = drush_get_option('add-path', NULL);
if ((!drush_which("drush") || $add_path) && ($add_path !== FALSE)) {
$drush_path = drush_find_path_to_drush($home);
$drush_path = preg_replace("%^" . preg_quote($home) . "/%", '$HOME/', $drush_path);

$bashrc_additions["%$drush_path%"] = "# Path to Drush, added by 'drush init'.\nexport PATH=\"\$PATH:$drush_path\"\n\n";
}

// Modify the user's bashrc file, adding our customizations.
$bashrc_contents = "";
if (file_exists($bashrc)) {
$bashrc_contents = file_get_contents($bashrc);
}
$new_bashrc_contents = $bashrc_contents;
foreach ($bashrc_additions as $pattern => $addition) {
// Only put in the addition if the pattern does not already
// exist in the bashrc file.
if (!preg_match($pattern, $new_bashrc_contents)) {
$new_bashrc_contents = $new_bashrc_contents . $addition;
}
}
if ($new_bashrc_contents != $bashrc_contents) {
if (drush_confirm(dt(implode('', $bashrc_additions) . "Append the above code to !file?", array('!file' => $bashrc)))) {
file_put_contents($bashrc, "\n\n". $new_bashrc_contents);
drush_log(dt("Updated bash configuration file !path", array('!path' => $bashrc)), LogLevel::OK);
drush_log(dt("Start a new shell in order to experience the improvements (e.g. `bash`)."), LogLevel::OK);
if (drush_get_option('edit')) {
$exec = drush_get_editor();
drush_shell_exec_interactive($exec, $drush_config_file, $drush_config_file);
}
}
else {
return drush_user_abort();
}
}
else {
drush_log(dt('No code added to !path', array('!path' => $bashrc)), LogLevel::OK);
}
}

/**
* Determine which .bashrc file is best to use on this platform.
*/
function drush_init_find_bashrc($home) {
return $home . "/.bashrc";
}

/**
* Determine where Drush is located, so that we can add
* that location to the $PATH
*/
function drush_find_path_to_drush($home) {
// First test: is Drush inside a vendor directory?
// Does vendor/bin exist? If so, use that. We do
// not have a good way to locate the 'bin' directory
// if it has been relocated in the composer.json config
// section.
if ($vendor_pos = strpos(DRUSH_BASE_PATH, "/vendor/")) {
$vendor_dir = substr(DRUSH_BASE_PATH, 0, $vendor_pos + 7);
$vendor_bin = $vendor_dir . '/bin';
if (is_dir($vendor_bin)) {
return $vendor_bin;
}
}

// Fallback is to use the directory that Drush is in.
return DRUSH_BASE_PATH;
}

function drush_bash_addition($file) {
return <<<EOD
if [ -f "$file" ] ; then
source $file
fi


EOD;
}
2 changes: 1 addition & 1 deletion commands/core/site_install.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ function drush_core_site_install($profile = NULL) {
drush_include_engine('drupal', 'site_install');
drush_core_site_install_version($profile, $form_options);

// Post installation run the configuration import.
// Post installation, run the configuration import.
if ($config = drush_get_option('config-dir')) {
// Set the destination site UUID to match the source UUID, to bypass a core fail-safe.
$source_storage = new FileStorage($config);
Expand Down
7 changes: 6 additions & 1 deletion commands/make/make.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,12 @@ function make_drush_command() {
'makefile' => 'Filename of the makefile to convert.',
),
'options' => array(
'format' => 'The format to which the make file should be converted. Accepted values include make, composer, and yml.'
'format' => 'The format to which the make file should be converted. Accepted values include make, composer, and yml.',
/*
Copy link
Member

Choose a reason for hiding this comment

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

Debug code? Why commented out?

'projects' => $projects,
'libraries' => $libraries,
'includes' => 'A list of makefiles to include at build-time.',
*/
),
'required-arguments' => TRUE,
'examples' => array(
Expand Down
16 changes: 6 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,20 @@
"drush.php",
"drush.complete.sh"
],
"config": {
"platform": {
"php": "5.6.0"
}
},
"require": {
"php": ">=5.6.0",
"psr/log": "~1.0",
"psy/psysh": "~0.6",
"symfony/yaml": "~2.3|~3.0",
"symfony/var-dumper": "~2.7|~3.0",
"league/container": "~2",
"consolidation/robo": "dev-master",
"symfony/config": "~2.2",
"consolidation/annotated-command": "~2",
"consolidation/output-formatters": "~2",
"symfony/console": "2.7.*",
"symfony/event-dispatcher": "2.7.*",
"symfony/config": "~2.2",
"symfony/yaml": "~2.3",
"symfony/var-dumper": "~2.7",
"symfony/console": "~2.7",
"symfony/event-dispatcher": "~2.7",
"symfony/finder": "~2.7",
"pear/console_table": "~1.3.0",
"phpdocumentor/reflection-docblock": "^2.0",
"webmozart/path-util": "~2"
Expand Down
Loading