SiteSpecParser
class SiteSpecParser (View source)
Parse a string that contains a site specification.
Site specifications contain some of the following elements:
- user
- host
- path
- uri (multisite selector)
Properties
protected string | $multisiteDirectoryRoot |
Methods
Parse a site specification
Determine if the provided specification is valid. Note that this tests only for syntactic validity; to see if the specification is usable, call 'parse()', which will also filter out specifications for local sites that specify a multidev site that does not exist.
Determine whether or not the provided name is an alias name.
No description
No description
Return the set of regular expression patterns that match the available site specification formats.
Run through all of the available regex patterns and determine if any match the provided specification.
Inflate the provided array so that it always contains the required elements.
Take the data from the matches from the regular expression and plug them into the result array per the info in the provided map.
Validate the provided result. If the result is local, then it must have a 'root'. If it does not, then fill in the root that was provided to us in our consturctor.
Details
array
parse(string $spec, string $root = '')
Parse a site specification
bool
validSiteSpec(string $spec)
Determine if the provided specification is valid. Note that this tests only for syntactic validity; to see if the specification is usable, call 'parse()', which will also filter out specifications for local sites that specify a multidev site that does not exist.
bool
isAliasName(string $aliasName)
Determine whether or not the provided name is an alias name.
setMultisiteDirectoryRoot($location)
No description
getMultisiteDirectoryRoot($root)
No description
protected array
patterns()
Return the set of regular expression patterns that match the available site specification formats.
protected array
match($spec)
Run through all of the available regex patterns and determine if any match the provided specification.
protected array
defaults($result = [])
Inflate the provided array so that it always contains the required elements.
protected array
mapResult(array $map, array $matches)
Take the data from the matches from the regular expression and plug them into the result array per the info in the provided map.
protected array
fixAndCheckUsability(array $result, $root)
Validate the provided result. If the result is local, then it must have a 'root'. If it does not, then fill in the root that was provided to us in our consturctor.