function drush_sitealias_valid_alias_format

8.0.x sitealias.inc drush_sitealias_valid_alias_format($alias)
6.x sitealias.inc drush_sitealias_valid_alias_format($alias)
7.x sitealias.inc drush_sitealias_valid_alias_format($alias)
5.x sitealias.inc drush_sitealias_valid_alias_format($alias)
master sitealias.inc drush_sitealias_valid_alias_format($alias)

Returns TRUE if $alias is a valid format for an alias name.

Mirrors the allowed formats shown below for drush_sitealias_get_record.

2 calls to drush_sitealias_valid_alias_format()
drush_parse_args in includes/command.inc
Parse console arguments.
drush_sitealias_check_arg_and_site_set in includes/sitealias.inc
Check to see if the user specified an alias in an arguement, or via site-set. If so, return the name of the alias.

File

includes/sitealias.inc, line 176
The site alias API.

Code

function drush_sitealias_valid_alias_format($alias) {
  return ((strpos($alias, ',') !== false) || ((strpos($alias, '@') === FALSE ? 0 : 1) + (strpos($alias, '/') === FALSE ? 0 : 1) + (strpos($alias, '#') === FALSE ? 0 : 1) >= 2) || ($alias{0} == '#') || ($alias{0} == '@'));
}