example.aliases.drushrc.php

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

File

examples/example.aliases.drushrc.php
View source
  1. <?php
  2. /**
  3. * Example of valid statements for an alias file. Use this
  4. * file as a guide to creating your own aliases.
  5. *
  6. * Aliases are commonly used to define short names for
  7. * local or remote Drupal installations; however, an alias
  8. * is really nothing more than a collection of option sets.
  9. * A canonical alias named "dev" that points to a local
  10. * Drupal site named "dev.mydrupalsite.com" looks like this:
  11. *
  12. * $aliases['dev'] = array(
  13. * 'root' => '/path/to/drupal',
  14. * 'uri' => 'dev.mydrupalsite.com',
  15. * );
  16. *
  17. * With this alias definition, then the following commands
  18. * are equivalent:
  19. *
  20. * $ drush @dev status
  21. * $ drush --root=/path/to/drupal --uri=dev.mydrupalsite.com status
  22. *
  23. * Any option that can be placed on the drush commandline
  24. * can also appear in an alias definition.
  25. *
  26. * There are several ways to create alias files.
  27. *
  28. * + Put each alias in a separate file called ALIASNAME.alias.drushrc.php
  29. * + Put multiple aliases in a single file called aliases.drushrc.php
  30. * + Put groups of aliases into files called GROUPNAME.aliases.drushrc.php
  31. *
  32. * Drush will search for aliases in any of these files using
  33. * the alias search path. The following locations are examined
  34. * for alias files:
  35. *
  36. * 1. In any path set in $options['alias-path'] in drushrc.php,
  37. * or (equivalently) any path passed in via --alias-path=...
  38. * on the command line.
  39. * 2. If 'alias-path' is not set, then in one of the default
  40. * locations:
  41. * a. /etc/drush
  42. * b. In the drush installation folder
  43. * c. Inside the 'aliases' folder in the drush installation folder
  44. * d. $HOME/.drush
  45. * 3. Inside the sites folder of any bootstrapped Drupal site,
  46. * or any local Drupal site indicated by an alias used as
  47. * a parameter to a command
  48. *
  49. * Files stored in these locations can be used to create aliases
  50. * to local and remote Drupal installations. These aliases can be
  51. * used in place of a site specification on the command line, and
  52. * may also be used in arguments to certain commands such as
  53. * "drush rsync" and "drush sql-sync".
  54. *
  55. * Alias files that are named after the single alias they contain
  56. * may use the syntax for the canoncial alias shown at the top of
  57. * this file, or they may set values in $options, just
  58. * like a drushrc.php configuration file:
  59. *
  60. * $options['uri'] = 'dev.mydrupalsite.com',
  61. * $options['root'] = '/path/to/drupal';
  62. *
  63. * When alias files use this form, then the name of the alias
  64. * is taken from the first part of the alias filename.
  65. *
  66. * To see an example alias definition for the current bootstrapped
  67. * site, use the "site-alias" command with the built-in alias "@self":
  68. *
  69. * $ drush site-alias @self
  70. *
  71. * If you would like to see all of the Drupal sites at a specified
  72. * root directory, use the built-in alias "@sites":
  73. *
  74. * $ drush -r /path/to/drupal site-alias @sites
  75. *
  76. * See 'drush help site-alias' for more options for displaying site
  77. * aliases.
  78. *
  79. * Although most aliases will contain only a few options, a number
  80. * of settings that are commonly used appear below:
  81. *
  82. * - 'uri': This should always be the same as the site's folder name
  83. * in the 'sites' folder.
  84. * - 'root': The Drupal root; must not be specified as a relative path.
  85. * - 'remote-port': If the database is remote and 'db-url' contains
  86. * a tunneled port number, put the actual database port number
  87. * used on the remote machine in the 'remote-port' setting.
  88. * - 'remote-host': The fully-qualified domain name of the remote system
  89. * hosting the Drupal instance. The remote-host option must be
  90. * omitted for local sites, as this option controls whether or not
  91. * rsync parameters are for local or remote machines.
  92. * - 'remote-user': The username to log in as when using ssh or rsync.
  93. * - 'ssh-options': If the target requires special options, such as a non-
  94. * standard port, alternative identity file, or alternative
  95. * authentication method, ssh- options can contain a string of extra
  96. * options that are used with the ssh command, eg "-p 100"
  97. * - 'parent': The name of a parent alias (e.g. '@server') to use as a basis
  98. * for this alias. Any value of the parent will appear in the child
  99. * unless overridden by an item with the same name in the child.
  100. * Multiple inheritance is possible; name multiple parents in the
  101. * 'parent' item separated by commas (e.g. '@server,@devsite').
  102. * - 'db-url': The Drupal 6 database connection string from settings.php.
  103. * For remote databases accessed via an ssh tunnel, set the port
  104. * number to the tunneled port as it is accessed on the local machine.
  105. * If 'db-url' is not provided, then drush will automatically look it
  106. * up, either from settings.php on the local machine, or via backend invoke
  107. * if the target alias specifies a remote server.
  108. * - 'databases': Like 'db-url', but contains the full Drupal 7 databases
  109. * record. Drush will look up the 'databases' record if it is not specified.
  110. * - 'path-aliases': An array of aliases for common rsync targets.
  111. * Relative aliases are always taken from the Drupal root.
  112. * '%drush': The path to the folder where drush is stored. Optional;
  113. * defaults to the folder containing the running script. Always be sure
  114. * to set '%drush' if the path to drush is different on the remote server.
  115. * '%drush-script': The path to the 'drush' script (used by backend invoke);
  116. * default is 'drush' on remote machines, or the full path to drush.php on
  117. * the local machine. Note that you only need to define one of '%drush'
  118. * or '%drush-script', as drush can infer one from the other.
  119. * '%dump': Path to the file that "drush sql-sync" should use to store sql-dump file.
  120. * '%files': Path to 'files' directory. This will be looked up if not specified.
  121. * '%root': A reference to the Drupal root defined in the 'root' item
  122. * in the site alias record.
  123. *
  124. * Some examples appear below. Remove the leading hash signs to enable.
  125. */
  126. #$aliases['stage'] = array(
  127. # 'uri' => 'stage.mydrupalsite.com',
  128. # 'root' => '/path/to/remote/drupal/root',
  129. # 'db-url' => 'pgsql://username:password@dbhost.com:port/databasename',
  130. # 'remote-host' => 'mystagingserver.myisp.com',
  131. # 'remote-user' => 'publisher',
  132. # 'path-aliases' => array(
  133. # '%drush' => '/path/to/drush',
  134. # '%drush-script' => '/path/to/drush/drush',
  135. # '%dump' => '/path/to/live/sql_dump.sql',
  136. # '%files' => 'sites/mydrupalsite.com/files',
  137. # '%custom' => '/my/custom/path',
  138. # ),
  139. # );
  140. #$aliases['dev'] = array(
  141. # 'uri' => 'dev.mydrupalsite.com',
  142. # 'root' => '/path/to/drupal/root',
  143. # );
  144. #$aliases['server'] = array(
  145. # 'remote-host' => 'mystagingserver.myisp.com',
  146. # 'remote-user' => 'publisher',
  147. # );
  148. #$aliases['live'] = array(
  149. # 'parent' => '@server,@dev',
  150. # 'uri' => 'mydrupalsite.com',
  151. # );