/
DocsCommands.php
245 lines (222 loc) · 5.35 KB
/
DocsCommands.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<?php
namespace Drush\Commands\core;
use Drush\Commands\DrushCommands;
/**
* Topic commands.
* Any commandfile may add topics.
* Set 'topic' => TRUE to indicate the command is a topic (REQUIRED)
* Begin the topic name with the name of the commandfile (just like
* any other command).
*/
class DocsCommands extends DrushCommands {
/**
* README.md
*
* @command docs-readme
* @hidden
* @topic
*/
public function readme() {
self::printFile(DRUSH_BASE_PATH. '/README.md');
}
/**
* Drush's support for Git Bisect.
*
* @command docs-bisect
* @hidden
* @topic
*/
public function bisect() {
self::printFile(DRUSH_BASE_PATH. '/examples/git-bisect.example.sh');
}
/**
* Bashrc customization examples for Drush.
*
* @command docs-bashrc
* @hidden
* @topic
*/
public function bashrc() {
self::printFile(DRUSH_BASE_PATH. '/examples/example.bashrc\'');
}
/**
* Configuration overview with examples from example.drushrc.php.
*
* @command docs-configuration
* @hidden
* @topic
*/
public function config() {
self::printFile(DRUSH_BASE_PATH. '/examples/example.drushrc.php');
}
/**
* Drupal configuration export instructions, including customizing configuration by environment.
*
* @command docs-config-exporting
* @hidden
* @topic
*/
public function configExport() {
self::printFile(DRUSH_BASE_PATH. '/docs/config-exporting.md');
}
/**
* Drupal configuration filter instructions for changing yml files during import/export.
*
* @command docs-config-filter
* @hidden
* @topic
*/
public function configFilter() {
self::printFile(DRUSH_BASE_PATH. '/docs/config-filter.md');
}
/**
* Site aliases overview on creating your own aliases for commonly used Drupal sites with examples from example.aliases.drushrc.php.
*
* @command docs-aliases
* @hidden
* @topic
*/
public function siteAliases() {
self::printFile(DRUSH_BASE_PATH. '/examples/example.aliases.drushrc.php');
}
/**
* Bastion server configuration: remotely operate on a Drupal sites behind a firewall.
*
* @command docs-bastion
* @hidden
* @topic
*/
public function bastion() {
self::printFile(DRUSH_BASE_PATH. '/docs/bastion.md');
}
/**
* Bootstrap explanation: how Drush starts up and prepares the Drupal environment for use with the command.
*
* @command docs-bootstrap
* @hidden
* @topic
*/
public function bootstrap() {
self::printFile(DRUSH_BASE_PATH. '/docs/bootstrap.md');
}
/**
* Crontab instructions for running your Drupal cron tasks via `drush cron`.
*
* @command docs-cron
* @hidden
* @topic
*/
public function cron() {
self::printFile(DRUSH_BASE_PATH. '/docs/cron.md');
}
/**
* A script consisting of simple sequences of Drush statements.
*
* @command docs-scripts
* @hidden
* @topic
*/
public function scripts() {
self::printFile(DRUSH_BASE_PATH. '/docs/shellscripts.md');
}
/**
* Creating your own aliases for commonly used Drush commands.
*
* @command docs-shell-aliases
* @hidden
* @topic
*/
public function shellAliases() {
self::printFile(DRUSH_BASE_PATH. '/docs/shellaliases.md');
}
/**
* Instructions on creating your own Drush commands.
*
* @command docs-commands
* @hidden
* @topic
*/
public function commands() {
self::printFile(DRUSH_BASE_PATH. '/docs/commands.md');
}
/**
* Drush API
*
* @command docs-api
* @hidden
* @topic
*/
public function api() {
self::printFile(DRUSH_BASE_PATH. 'docs//drush.api.php');
}
/**
* Contexts overview explaining how Drush manages command line options and configuration file settings.
*
* @command docs-context
* @hidden
* @topic
*/
public function context() {
self::printFile(DRUSH_BASE_PATH. 'docs/context.md');
}
/**
* Example Drush script.
*
* @command docs-examplescript
* @hidden
* @topic
*/
public function exampleScript() {
self::printFile(DRUSH_BASE_PATH. '/examples/helloworld.script');
}
/**
* Example Drush command file.
*
* @command docs-examplecommand
* @hidden
* @topic
*/
public function exampleCommand() {
self::printFile(DRUSH_BASE_PATH. '/examples/sandwich.drush.inc');
}
/**
* Example commandfile that extends sql-sync to enable development modules in the post-sync hook.
*
* @command docs-example-sync-extension
* @hidden
* @topic
*/
public function syncEnable() {
self::printFile(DRUSH_BASE_PATH. '/examples/sync_enable.drush.inc');
}
/**
* Example Drush commandfile that extends sql-sync to allow transfer of the sql dump file via http rather than ssh and rsync.
*
* @command docs-example-sync-via-http
* @hidden
* @topic
*/
public function syncHttp() {
self::printFile(DRUSH_BASE_PATH. '/examples/sync_via_http.drush.inc');
}
/**
* Example policy file.
*
* @command docs-policy
* @hidden
* @topic
*/
public function policy() {
self::printFile(DRUSH_BASE_PATH. '/examples/policy.drush.inc');
}
/**
* Strict option handling, and how commands that use it differ from regular Drush commands.
*
* @command docs-strict-options
* @hidden
* @topic
*/
public function strictOptions() {
self::printFile(DRUSH_BASE_PATH. '/docs/strict-options.md');
}
}