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 /drush and sites/all/drush folders.
  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. * The Drush commands 'rsync' and 'sql-sync' are special cases. These commands
  49. * will load the configuration file for the site specified by the source
  50. * parameter; however, they do not load the configuration file for the site
  51. * specified by the destination parameter, nor do they load configuration files
  52. * for remote sites.
  53. *
  54. * See `drush topic docs-bootstrap` for more information on how bootstrapping
  55. * affects the loading of Drush configuration files.
  56. */
  57. // Specify a particular multisite.
  58. # $options['l'] = 'http://example.com/subdir';
  59. // Specify your Drupal core base directory (useful if you use symlinks).
  60. # $options['r'] = '/home/USER/workspace/drupal-6';
  61. /**
  62. * Useful shell aliases:
  63. *
  64. * Drush shell aliases act similar to git aliases. For best results, define
  65. * aliases in one of the drushrc file locations between #3 through #6 above.
  66. * More information on shell aliases can be found via:
  67. * `drush topic docs-shell-aliases` on the command line.
  68. *
  69. * @see https://git.wiki.kernel.org/index.php/Aliases#Advanced
  70. */
  71. # $options['shell-aliases']['pull'] = '!git pull'; // We've all done it.
  72. # $options['shell-aliases']['pulldb'] = '!git pull && drush updatedb';
  73. # $options['shell-aliases']['noncore'] = 'pm-list --no-core';
  74. # $options['shell-aliases']['wipe'] = 'cache-clear all';
  75. # $options['shell-aliases']['unsuck'] = 'pm-disable -y overlay,dashboard';
  76. # $options['shell-aliases']['offline'] = 'variable-set -y --always-set maintenance_mode 1';
  77. # $options['shell-aliases']['online'] = 'variable-delete -y --exact maintenance_mode';
  78. # $options['shell-aliases']['dis-all'] = '!drush -y dis `drush pml --status=enabled --type=module --no-core --pipe`';
  79. # $options['shell-aliases']['self-alias'] = 'site-alias @self --with-db --alias-name=new';
  80. # $options['shell-aliases']['site-get'] = '@none php-eval "return drush_sitealias_site_get();"';
  81. // Add a 'pm-clone' to simplify git cloning from drupal.org.
  82. # $options['shell-aliases']['pm-clone'] = 'pm-download --gitusername=YOURUSERNAME --package-handler=git_drupalorg';
  83. // You can create a local cache of all projects checked out using
  84. // --package-handler=git_drupalorg; this can be faster for repeated
  85. // downloads, but can be brittle. See: http://randyfay.com/node/119
  86. # $options['cache'] = TRUE;
  87. // Load a drushrc.php configuration file from the current working directory.
  88. # $options['config'][] = './drushrc.php';
  89. // Load a drushrc.php configuration file from the directory sites/all/drush,
  90. // relative to the current Drupal site.
  91. # $root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT');
  92. # if ($root) {
  93. # $options['config'][] = $root . "/sites/all/drush/drushrc.php";
  94. # }
  95. /**
  96. * Enable logging and periodic upload of anonymized usage statistics. The Drush
  97. * maintainers use this data to learn which commands and options are most
  98. * See the usage-show and usage-send commands.
  99. */
  100. # $options['drush_usage_log'] = TRUE;
  101. # $options['drush_usage_send'] = TRUE;
  102. /**
  103. * By default, Drush will download projects compatible with the current
  104. * version of Drupal, or, if no Drupal site is specified, then the Drupal-7
  105. * version of the project is downloaded. Set default-major to select a
  106. * different default version.
  107. */
  108. # $options['default-major'] = 6;
  109. // Clone extensions (modules, themes, etc.) from drupal.org via 'pm-download'.
  110. # $options['package-handler'] = 'git_drupalorg';
  111. /**
  112. * Specify folders to search for Drush command files (*.drush.inc). These
  113. * values are always merged with include paths defined on the command line or
  114. * in other configuration files. On the command line, paths may be separated
  115. * by a colon (:) on Unix-based systems or a semi-colon (;) on Windows.
  116. */
  117. # $options['include'] = array('/path/to/commands','/path2/to/more/commands');
  118. /**
  119. * Specify the modules to ignore when searching for command files (*.drush.inc)
  120. * inside a Drupal site.
  121. */
  122. # $options['ignored-modules'] = array('module1', 'module2');
  123. /**
  124. * Specify the folders to search for Drush alias files (*.alias.drushrc.php and
  125. * *.aliases.drushrc.php). These values are always merged with alias paths
  126. * defined on the command line or in other configuration files. On the command
  127. * line, paths may be separated by a colon (:) on Unix-based systems or a
  128. * semi-colon (;) on Windows.
  129. */
  130. # $options['alias-path'] = array('/path/to/aliases','/path2/to/more/aliases');
  131. /**
  132. * Specify the folder where 'sql-sync' should store persistent dump files.
  133. * Keeping the dump files around improves the performance of rsync when the
  134. * database is rsync'ed to a remote system. If a dump directory is not
  135. * specified, then 'sql-sync' will store dumps in temporary files.
  136. */
  137. # $options['dump-dir'] = '/path/to/dumpdir';
  138. /**
  139. * Specify the filename and path where 'sql-dump' should store backups of
  140. * database dumps. The default is to dump to STDOUT, however if this option is
  141. * set in a drushrc.php file, the default behaviour can be achieved by
  142. * specifying a value of FALSE ("--result-file=0" on the command line). Two
  143. * substitution tokens are available: @DATABASE is replaced with the name of the
  144. * database being dumped, and @DATE is replaced with the current time and date
  145. * of the dump of the form: YYYYMMDD_HHMMSS. A value of TRUE ("--result-file=1"
  146. * on the command line) will cause 'sql-dump' to use the same temporary backup
  147. * location as 'pm-updatecode'.
  148. */
  149. # $options['result-file'] = TRUE;
  150. # $options['result-file'] = '/path/to/backup/dir/@DATABASE_@DATE.sql';
  151. // Notify user via Notification Center (OSX) or libnotify (Linux) when command
  152. // takes more than 30 seconds. See global options for more configuration.
  153. # $options['notify'] = 30;
  154. // Enable verbose mode.
  155. # $options['v'] = 1;
  156. // Show database passwords in 'status' and 'sql-conf' commands.
  157. # $options['show-passwords'] = 1;
  158. /**
  159. * Specify the logging level for PHP notices. Defaults to "notice". Set to
  160. * "warning" when doing Drush development. Also make sure that error_reporting
  161. * is set to E_ALL in your php configuration file. See `drush status` for the
  162. * path to your php.ini file.
  163. */
  164. # $options['php-notices'] = 'warning';
  165. /**
  166. * Specify options to pass to ssh in backend invoke. The default is to prohibit
  167. * password authentication, and is included here, so you may add additional
  168. * parameters without losing the default configuration.
  169. */
  170. # $options['ssh-options'] = '-o PasswordAuthentication=no';
  171. // Set 'remote-os' to 'Windows' to make Drush use Windows shell escape rules
  172. // for remote sites that do not have an 'os' item set.
  173. # $options['remote-os'] = 'Linux';
  174. // By default, unknown options are disallowed and result in an error. Change
  175. // them to issue only a warning and let command proceed.
  176. # $options['strict'] = FALSE;
  177. /**
  178. * Drush requires at least rsync version 2.6.4 for some functions to work
  179. * correctly. rsync version 2.6.8 or earlier may give the following error
  180. * message: "--remove-source-files: unknown option". To fix this, set
  181. * $options['rsync-version'] = '2.6.8'; (replace with the lowest version of
  182. * rsync installed on any system you are using with Drush). Note that this
  183. * option can also be set in a site alias, which is the preferred solution if
  184. * newer versions of rsync are available on some of the systems you use.
  185. * See: http://drupal.org/node/955092
  186. */
  187. # $options['rsync-version'] = '2.6.9';
  188. /**
  189. * The output charset suitable to pass to the iconv PHP function's out_charset
  190. * parameter.
  191. *
  192. * Drush will convert its output from UTF-8 to the charset specified here. It
  193. * is possible to use //TRANSLIT and //IGNORE charset name suffixes (see iconv
  194. * documentation). If not defined, conversion will not be performed.
  195. */
  196. # $options['output_charset'] = 'ISO-8859-1';
  197. # $options['output_charset'] = 'KOI8-R//IGNORE';
  198. # $options['output_charset'] = 'ISO-8859-1//TRANSLIT';
  199. /**
  200. * Multiple-site execution options:
  201. *
  202. * Some drush commands such as 'sql-sync' are intended for or capable of being
  203. * executed on multiple sites or server environments and will pass along the
  204. * options specified here to all instances of the command being executed.
  205. */
  206. /**
  207. * By default, Drush will prepend the name of the site to the output of any
  208. * multiple-site command execution. To disable this behavior, set the
  209. * "--no-label" option.
  210. */
  211. # $options['no-label'] = TRUE;
  212. /**
  213. * An explicit list of tables which should be included in sql-dump and sql-sync.
  214. */
  215. # $options['tables']['common'] = array('user', 'permissions', 'role_permission', 'role');
  216. /**
  217. * List of tables whose *data* is skipped by the 'sql-dump' and 'sql-sync'
  218. * commands when the "--structure-tables-key=common" option is provided.
  219. * You may add specific tables to the existing array or add a new element.
  220. */
  221. # $options['structure-tables']['common'] = array('cache', 'cache_*', 'history', 'search_*', 'sessions', 'watchdog');
  222. /**
  223. * List of tables to be omitted entirely from SQL dumps made by the 'sql-dump'
  224. * and 'sql-sync' commands when the "--skip-tables-key=common" option is
  225. * provided on the command line. This is useful if your database contains
  226. * non-Drupal tables used by some other application or during a migration for
  227. * example. You may add new tables to the existing array or add a new element.
  228. */
  229. # $options['skip-tables']['common'] = array('migration_*');
  230. /**
  231. * Override specific entries in Drupal's variable/config system or settings.php
  232. */
  233. # $options['variables']['site_name'] = 'My Drupal site';
  234. # $options['variables']['theme_default'] = 'minnelli';
  235. # $options['variables']['anonymous'] = 'Visitor';
  236. /**
  237. * Command-specific execution options:
  238. *
  239. * Most execution options can be shared between multiple Drush commands; these
  240. * are specified as top-level elements of the $options array in the prior
  241. * examples above. On the other hand, other options are command-specific, and,
  242. * in some cases, a shared option needs a different configuration depending on
  243. * which command is being executing.
  244. *
  245. * To define options that are only applicable to certain commands, make an entry
  246. * in the $command-specific array as shown below. The name of the command may
  247. * be either the command's full name or any of the command's aliases.
  248. *
  249. * Options defined here will be overridden by options of the same name on the
  250. * command line. Unary flags such as "--verbose" are overridden via special
  251. * "--no-xxx" options (e.g. "--no-verbose").
  252. *
  253. * Limitation: If 'verbose' is set in a command-specific option, it must be
  254. * cleared by '--no-verbose', not '--no-v', and visa-versa.
  255. */
  256. // Ensure all rsync commands use verbose output.
  257. # $command_specific['rsync'] = array('verbose' => TRUE);
  258. // Prevent drush ssh command from adding a cd to Drupal root before provided command.
  259. # $command_specific['ssh'] = array('cd' => FALSE);
  260. // Additional folders to search for scripts.
  261. // Separate by : (Unix-based systems) or ; (Windows).
  262. # $command_specific['script']['script-path'] = 'sites/all/scripts:profiles/myprofile/scripts';
  263. // Always show release notes when running pm-update or pm-updatecode.
  264. # $command_specific['pm-update'] = array('notes' => TRUE);
  265. # $command_specific['pm-updatecode'] = array('notes' => TRUE);
  266. // Set a predetermined username and password when using site-install.
  267. # $command_specific['site-install'] = array('account-name' => 'alice', 'account-pass' => 'secret');
  268. /**
  269. * Load a drushrc file from the 'drush' folder at the root of the current
  270. * git repository. Example script below by Grayside. Customize as desired.
  271. * @see: http://grayside.org/node/93.
  272. */
  273. #$repo_dir = drush_get_option('root') ? drush_get_option('root') : getcwd();
  274. #if (drush_shell_exec('cd %s && git rev-parse --show-toplevel 2> ' . drupal_bit_bucket(), $repo_dir)) {
  275. # $output = drush_shell_exec_output();
  276. # $repo_top = $output[0];
  277. # $options['config'] = $repo_top . '/drush/drushrc.php';
  278. # $options['include'] = $repo_top . '/drush/commands';
  279. # $options['alias-path'] = $repo_top . '/drush/aliases';
  280. #}