example.drushrc.php

  1. 8.0.x examples/example.drushrc.php
  2. 6.x examples/example.drushrc.php
  3. 7.x examples/example.drushrc.php
  4. 3.x examples/example.drushrc.php
  5. 4.x examples/example.drushrc.php
  6. 5.x examples/example.drushrc.php
  7. master examples/example.drushrc.php

File

examples/example.drushrc.php
View source
  1. <?php
  2. /**
  3. * Examples of valid statements for a Drush runtime config (drushrc) file.
  4. * Use this file to cut down on typing out lengthy and repetitive command line
  5. * options in the Drush commands you use and to avoid mistakes.
  6. *
  7. * Rename this file to drushrc.php and optionally copy it to one of the places
  8. * listed below in order of precedence:
  9. *
  10. * 1. Drupal site folder (e.g. sites/{default|example.com}/drushrc.php).
  11. * 2. Drupal sites/all/drush folder.
  12. * 3. In any location, as specified by the --config (-c) option.
  13. * 4. User's .drush folder (i.e. ~/.drush/drushrc.php).
  14. * 5. System wide configuration folder (e.g. /etc/drush/drushrc.php).
  15. * 6. Drush installation folder.
  16. *
  17. * If a configuration file is found in any of the above locations, it will be
  18. * loaded and merged with other configuration files in the search list.
  19. *
  20. * If you have some configuration options that are specific to a particular
  21. * version of Drush, then you may place them in a file called drush5rc.php.
  22. * The version-specific file is loaded in addition to, and after, the general-
  23. * purpose drushrc file. Version-specific configuration files can be placed
  24. * in any of the locations specified above.
  25. *
  26. * IMPORTANT NOTE regarding configuration file on Windows:
  27. *
  28. * For Windows 7, Windows Vista, Windows Server 2008 and later versions is the
  29. * system window configuration folder C:\ProgramData\Drush. For previous
  30. * versions of Windows is the folder C:\Documents and Settings\All Users\Drush.
  31. *
  32. * IMPORTANT NOTE on configuration file loading:
  33. *
  34. * At its core, Drush works by "bootstrapping" the Drupal environment in very
  35. * much the same way that is done during a normal page request from the web
  36. * server, so most Drush commands run in the context of a fully-initialized
  37. * website.
  38. *
  39. * Configuration files are loaded in the reverse order they are shown above. All
  40. * configuration files are loaded in the first bootstrapping phase, but
  41. * a configuration file in a specific Drupal site folder other than the default
  42. * (eg, sites/example.com/drushrc.php) will not be loaded unless a specific
  43. * Drupal site is selected. However, it _will_ be loaded if a site is selected
  44. * (either via the current working directory or by use of the --uri option),
  45. * even if the Drush command being run does not bootstrap to the Drupal Site
  46. * phase.
  47. *
  48. * IMPORTANT NOTE for users upgrading from Drush 4:
  49. *
  50. * Drush 5 no longer looks for aliases, configs or command files in the Drupal
  51. * root folder, so if you previously used drushrc.php files in the Drupal root
  52. * you will need to move the file to sites/all/drush/drushrc.php.
  53. *
  54. * The Drush commands 'rsync' and 'sql-sync' are special cases. These commands
  55. * will load the configuration file for the site specified by the source
  56. * parameter; however, they do not load the configuration file for the site
  57. * specified by the destination parameter, nor do they load configuration files
  58. * for remote sites.
  59. *
  60. * See `drush topic docs-bootstrap` for more information on how bootstrapping
  61. * affects the loading of Drush configuration files.
  62. */
  63. // Specify a particular multisite.
  64. # $options['l'] = 'http://example.com/subdir';
  65. // Specify your Drupal core base directory (useful if you use symlinks).
  66. # $options['r'] = '/home/USER/workspace/drupal-6';
  67. /**
  68. * Useful shell aliases:
  69. *
  70. * Drush shell aliases act similar to git aliases. For best results, define
  71. * aliases in one of the drushrc file locations between #3 through #6 above.
  72. * More information on shell aliases can be found via:
  73. * `drush topic docs-shell-aliases` on the command line.
  74. *
  75. * @see https://git.wiki.kernel.org/index.php/Aliases#Advanced
  76. */
  77. # $options['shell-aliases']['pull'] = '!git pull'; // We've all done it.
  78. # $options['shell-aliases']['pulldb'] = '!git pull && drush updatedb';
  79. # $options['shell-aliases']['noncore'] = 'pm-list --no-core';
  80. # $options['shell-aliases']['wipe'] = 'cache-clear all';
  81. # $options['shell-aliases']['unsuck'] = 'pm-disable -y overlay,dashboard';
  82. # $options['shell-aliases']['offline'] = 'variable-set -y --always-set maintenance_mode 1';
  83. # $options['shell-aliases']['online'] = 'variable-delete -y --exact maintenance_mode';
  84. # $options['shell-aliases']['dis-all'] = '!drush -y dis `drush pml --status=enabled --type=module --no-core --pipe`';
  85. # $options['shell-aliases']['self-alias'] = 'site-alias @self --with-db --alias-name=new';
  86. // Add a 'pm-clone' to simplify git cloning from drupal.org.
  87. # $options['shell-aliases']['pm-clone'] = 'pm-download --gitusername=YOURUSERNAME --package-handler=git_drupalorg';
  88. // You can create a local cache of all projects checked out using
  89. // --package-handler=git_drupalorg; this can be faster for repeated
  90. // downloads, but can be dangerous. See: http://randyfay.com/node/119
  91. # $options['cache'] = TRUE;
  92. /**
  93. * Historical (deprecated) aliases:
  94. *
  95. * The following aliases were supported in Drush 4, but removed in Drush 5. To
  96. * keep using them, uncomment the following lines or copy them to your drushrc
  97. * file.
  98. */
  99. # $options['shell-aliases']['script'] = 'php-script';
  100. # $options['shell-aliases']['sync'] = 'core-rsync';
  101. # $options['shell-aliases']['installsite'] = 'site-install';
  102. # $options['shell-aliases']['is'] = 'site-install';
  103. # $options['shell-aliases']['wd'] = 'watchdog-delete';
  104. # $options['shell-aliases']['enable'] = 'pm-enable';
  105. # $options['shell-aliases']['disable'] = 'pm-disable';
  106. # $options['shell-aliases']['uninstall'] = 'pm-uninstall';
  107. # $options['shell-aliases']['sm'] = 'pm-list';
  108. # $options['shell-aliases']['refresh'] = 'pm-refresh';
  109. # $options['shell-aliases']['updatecode'] = 'pm-updatecode';
  110. # $options['shell-aliases']['update'] = 'pm-update';
  111. # $options['shell-aliases']['download'] = 'pm-download';
  112. // Load a drushrc.php configuration file from the current working directory.
  113. # $options['config'][] = './drushrc.php';
  114. // Load a drushrc.php configuration file from the directory sites/all/drush,
  115. // relative to the current Drupal site.
  116. # $root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT');
  117. # if ($root) {
  118. # $options['config'][] = $root . "/sites/all/drush/drushrc.php";
  119. # }
  120. /**
  121. * Enable logging and periodic upload of anonymized usage statistics. The Drush
  122. * maintainers use this data to learn which commands and options are most
  123. * See the usage-show and usage-send commands.
  124. */
  125. # $options['drush_usage_log'] = TRUE;
  126. # $options['drush_usage_send'] = TRUE;
  127. /**
  128. * By default, Drush will download projects compatible with the current
  129. * version of Drupal, or, if no Drupal site is specified, then the Drupal-7
  130. * version of the project is downloaded. Set default-major to select a
  131. * different default version.
  132. */
  133. # $options['default-major'] = 6;
  134. // Clone extensions (modules, themes, etc.) from drupal.org via 'pm-download'.
  135. # $options['package-handler'] = 'git_drupalorg';
  136. /**
  137. * Specify folders to search for Drush command files (*.drush.inc). These
  138. * values are always merged with include paths defined on the command line or
  139. * in other configuration files. On the command line, paths may be separated
  140. * by a colon (:) on Unix-based systems or a semi-colon (;) on Windows.
  141. */
  142. # $options['include'] = array('/path/to/commands','/path2/to/more/commands');
  143. /**
  144. * Specify the modules to ignore when searching for command files (*.drush.inc)
  145. * inside a Drupal site.
  146. */
  147. # $options['ignored-modules'] = array('module1', 'module2');
  148. /**
  149. * Specify the folders to search for Drush alias files (*.alias.drushrc.php and
  150. * *.aliases.drushrc.php). These values are always merged with alias paths
  151. * defined on the command line or in other configuration files. On the command
  152. * line, paths may be separated by a colon (:) on Unix-based systems or a
  153. * semi-colon (;) on Windows.
  154. */
  155. # $options['alias-path'] = array('/path/to/aliases','/path2/to/more/aliases');
  156. /**
  157. * Specify the folder where 'sql-sync' should store persistent dump files.
  158. * Keeping the dump files around improves the performance of rsync when the
  159. * database is rsync'ed to a remote system. If a dump directory is not
  160. * specified, then 'sql-sync' will store dumps in temporary files.
  161. */
  162. # $options['dump-dir'] = '/path/to/dumpdir';
  163. /**
  164. * Specify the filename and path where 'sql-dump' should store backups of
  165. * database dumps. The default is to dump to STDOUT, however if this option is
  166. * set in a drushrc.php file, the default behaviour can be achieved by
  167. * specifying a value of FALSE ("--result-file=0" on the command line). Two
  168. * substitution tokens are available: @DATABASE is replaced with the name of the
  169. * database being dumped, and @DATE is replaced with the current time and date
  170. * of the dump of the form: YYYYMMDD_HHMMSS. A value of TRUE ("--result-file=1"
  171. * on the command line) will cause 'sql-dump' to use the same temporary backup
  172. * location as 'pm-updatecode'.
  173. */
  174. # $options['result-file'] = TRUE;
  175. # $options['result-file'] = '/path/to/backup/dir/@DATABASE_@DATE.sql';
  176. // Enable verbose mode.
  177. # $options['v'] = 1;
  178. // Show database passwords in 'status' and 'sql-conf' commands.
  179. # $options['show-passwords'] = 1;
  180. /**
  181. * Specify the logging level for PHP notices. Defaults to "notice". Set to
  182. * "warning" when doing Drush development. Also make sure that error_reporting
  183. * is set to E_ALL in your php configuration file. See `drush status` for the
  184. * path to your php.ini file.
  185. */
  186. # $options['php-notices'] = 'warning';
  187. /**
  188. * Specify options to pass to ssh in backend invoke. The default is to prohibit
  189. * password authentication, and is included here, so you may add additional
  190. * parameters without losing the default configuration.
  191. */
  192. # $options['ssh-options'] = '-o PasswordAuthentication=no';
  193. // Set 'remote-os' to 'Windows' to make Drush use Windows shell escape rules
  194. // for remote sites that do not have an 'os' item set.
  195. # $options['remote-os'] = 'Linux';
  196. // By default, unknown options are disallowed and result in an error. Change
  197. // them to issue only a warning and let command proceed.
  198. # $options['strict'] = FALSE;
  199. /**
  200. * Drush requires at least rsync version 2.6.4 for some functions to work
  201. * correctly. rsync version 2.6.8 or earlier may give the following error
  202. * message: "--remove-source-files: unknown option". To fix this, set
  203. * $options['rsync-version'] = '2.6.8'; (replace with the lowest version of
  204. * rsync installed on any system you are using with Drush). Note that this
  205. * option can also be set in a site alias, which is the preferred solution if
  206. * newer versions of rsync are available on some of the systems you use.
  207. * See: http://drupal.org/node/955092
  208. */
  209. # $options['rsync-version'] = '2.6.9';
  210. /**
  211. * The output charset suitable to pass to the iconv PHP function's out_charset
  212. * parameter.
  213. *
  214. * Drush will convert its output from UTF-8 to the charset specified here. It
  215. * is possible to use //TRANSLIT and //IGNORE charset name suffixes (see iconv
  216. * documentation). If not defined, conversion will not be performed.
  217. */
  218. # $options['output_charset'] = 'ISO-8859-1';
  219. # $options['output_charset'] = 'KOI8-R//IGNORE';
  220. # $options['output_charset'] = 'ISO-8859-1//TRANSLIT';
  221. /**
  222. * Multiple-site execution options:
  223. *
  224. * Some drush commands such as 'sql-sync' are intended for or capable of being
  225. * executed on multiple sites or server environments and will pass along the
  226. * options specified here to all instances of the command being executed.
  227. */
  228. /**
  229. * By default, Drush will prepend the name of the site to the output of any
  230. * multiple-site command execution. To disable this behavior, set the
  231. * "--no-label" option.
  232. */
  233. # $options['no-label'] = TRUE;
  234. /**
  235. * An explicit list of tables which should be included in sql-dump and sql-sync.
  236. */
  237. # $options['tables']['common'] = array('user', 'permissions', 'role_permission', 'role');
  238. /**
  239. * List of tables whose *data* is skipped by the 'sql-dump' and 'sql-sync'
  240. * commands when the "--structure-tables-key=common" option is provided.
  241. * You may add specific tables to the existing array or add a new element.
  242. */
  243. # $options['structure-tables']['common'] = array('cache', 'cache_filter', 'cache_menu', 'cache_page', 'history', 'sessions', 'watchdog');
  244. /**
  245. * List of tables to be omitted entirely from SQL dumps made by the 'sql-dump'
  246. * and 'sql-sync' commands when the "--skip-tables-key=common" option is
  247. * provided on the command line. This is useful if your database contains
  248. * non-Drupal tables used by some other application or during a migration for
  249. * example. You may add new tables to the existing array or add a new element.
  250. */
  251. # $options['skip-tables']['common'] = array('migration_data1', 'migration_data2');
  252. /**
  253. * Override specific entries in Drupal's 'variable' table or settings.php
  254. */
  255. # $options['variables']['site_name'] = 'My Drupal site';
  256. # $options['variables']['theme_default'] = 'minnelli';
  257. # $options['variables']['anonymous'] = 'Visitor';
  258. /**
  259. * Command-specific execution options:
  260. *
  261. * Most execution options can be shared between multiple Drush commands; these
  262. * are specified as top-level elements of the $options array in the prior
  263. * examples above. On the other hand, other options are command-specific, and,
  264. * in some cases, a shared option needs a different configuration depending on
  265. * which command is being executing.
  266. *
  267. * To define options that are only applicable to certain commands, make an entry
  268. * in the $command-specific array as shown below. The name of the command may
  269. * be either the command's full name or any of the command's aliases.
  270. *
  271. * Options defined here will be overridden by options of the same name on the
  272. * command line. Unary flags such as "--verbose" are overridden via special
  273. * "--no-xxx" options (e.g. "--no-verbose").
  274. *
  275. * Limitation: If 'verbose' is set in a command-specific option, it must be
  276. * cleared by '--no-verbose', not '--no-v', and visa-versa.
  277. */
  278. // Ensure all rsync commands use verbose output.
  279. # $command_specific['rsync'] = array('verbose' => TRUE);
  280. // Additional folders to search for scripts.
  281. // Separate by : (Unix-based systems) or ; (Windows).
  282. # $command_specific['script']['script-path'] = 'sites/all/scripts:profiles/myprofile/scripts';
  283. // Always show release notes when running pm-update or pm-updatecode.
  284. # $command_specific['pm-update'] = array('notes' => TRUE);
  285. # $command_specific['pm-updatecode'] = array('notes' => TRUE);
  286. // Set a predetermined username and password when using site-install.
  287. # $command_specific['site-install'] = array('account-name' => 'alice', 'account-pass' => 'secret');
  288. /**
  289. * List of Drush commands or aliases that should override built-in shell
  290. * functions and commands; otherwise, built-ins override Drush commands. Default
  291. * is 'help,dd,sa'. Warning: bad things can happen if you put the wrong thing
  292. * here (e.g. eval, grep), so be cautious. If a Drush command overrides a
  293. * built-in command (e.g. bash help), then you can use the `builtin` operator
  294. * to run the built-in version (e.g. `builtin help` to show bash help instead of
  295. * Drush help.) If a Drush command overrides a shell command (e.g. grep), then
  296. * you can use the regular shell command by typing in the full path to the
  297. * command (e.g. /bin/grep).
  298. */
  299. # $command_specific['core-cli'] = array('override' => 'help,dd,sa');
  300. /**
  301. * Load a drushrc file from the 'drush' folder at the root of the current
  302. * git repository. Example script below by grayside. Customize as desired.
  303. * @see: http://grayside.org/node/93.
  304. */
  305. #exec('git rev-parse --show-toplevel 2> /dev/null', $output);
  306. #if (!empty($output)) {
  307. # $repo = $output[0];
  308. # $options['config'] = $repo . '/drush/drushrc.php';
  309. # $options['include'] = $repo . '/drush/commands';
  310. # $options['alias-path'] = $repo . '/drush/aliases';
  311. #}