SiteAliasManager
class SiteAliasManager implements SiteAliasManagerInterface, SiteAliasManagerInitializationInterface (View source)
Site Alias manager
Properties
protected | $aliasLoader | ||
protected | $selfSiteAlias | ||
protected | $specParser | ||
protected | $root |
Methods
Constructor for SiteAliasManager
Allow configuration data to be used in replacements in the alias file.
Inject the root of the selected site
Add a search location to our site alias discovery object.
Add search locations to our site alias discovery object.
Return all of the paths where alias files may be found.
Get an alias record by name, or convert a site specification into an alias record via the site alias spec parser. If a simple alias name is provided (e.g. '@alias'), it is interpreted as a sitename, and the default environment for that site is returned.
Get an alias record from a name. Does not accept site specifications.
Given a simple alias name, e.g. '@alias', returns all of the environments in the specified site.
Return the paths to all alias files in all search locations known to the alias manager.
Details
__construct(SiteAliasFileLoader|null $aliasLoader = null, $root = '')
Constructor for SiteAliasManager
setReferenceData($data)
Allow configuration data to be used in replacements in the alias file.
$this
setRoot(string $root)
Inject the root of the selected site
$this
addSearchLocation(string $path)
Add a search location to our site alias discovery object.
$this
addSearchLocations(array $paths)
Add search locations to our site alias discovery object.
string[]
searchLocations()
Return all of the paths where alias files may be found.
SiteAlias|false
get(string $name)
Get an alias record by name, or convert a site specification into an alias record via the site alias spec parser. If a simple alias name is provided (e.g. '@alias'), it is interpreted as a sitename, and the default environment for that site is returned.
SiteAlias
getSelf()
Get the '@self' alias record.
$this
setSelf(SiteAlias $selfSiteAlias)
Force-set the current @self alias.
SiteAlias
getAlias(string $aliasName)
Get an alias record from a name. Does not accept site specifications.
SiteAlias[]|false
getMultiple(string $name = '')
Given a simple alias name, e.g. '@alias', returns all of the environments in the specified site.
If the provided name is a site specification et. al., then this method will return 'false'.
string[]
listAllFilePaths($location = '')
Return the paths to all alias files in all search locations known to the alias manager.