Site Alias Manager
The Site Alias Manager (SAM) service is used to retrieve information about one or all of the site aliases for the current installation.
- An informative example is the browse command
- A commandfile gets access to the SAM by implementing the SiteAliasManagerAwareInterface and useing the SiteAliasManagerAwareTrait trait. Then you gain access via
- If an alias was used for the current request, it is available via $this->siteAliasManager()->getself().
- The SAM generally deals in AliasRecord objects. That is how any given site alias is represented. See its methods for determining things like whether the alias points to a local host or remote host.
- An example site alias file.
- Dynamically alter site aliases.
- The SAM is also available for as a standalone Composer project. More information available in the README there.