SilverStripe\MultiDomain\MultiDomainDomain
Class definition for an object representing a configured domain
- Author: Aaron Carlino <aaron@silverstripe.com>
Synopsis
class MultiDomainDomain
extends Object
{
- // members
- protected $hostname;
- protected $url;
- protected $key;
- protected $allowedPaths;
- protected $forcedPaths;
- protected $requestUri;
- protected $httpHost;
- // methods
- public void __construct()
- public string getHostname()
- public string getURL()
- public boolean isActive()
- public boolean isPrimary()
- public string getNativeURL()
- public string getVanityURL()
- public boolean hasURL()
- public string getKey()
- public $this setRequestUri()
- public string getRequestUri()
- public $this setHttpHost()
- public string getHttpHost()
- protected boolean isAllowedPath()
- protected boolean isForcedPath()
- protected static boolean match_url()
Hierarchy
Extends
- SilverStripe\Core\Object
Members
protected
- $allowedPaths
—
array
Paths that are allowed to be accessed on the primary domain - $forcedPaths
—
array
Paths that are forced from the primary domain into a vanity one, outside the resolves_to path - $hostname
—
string
The hostname of the domain, e.g. silverstripe.org - $httpHost
—
string
The request HTTP HOST - $key
—
string
The identifier of the domain, e.g. 'org','com' - $requestUri
—
string
The request URI - $url
—
string
The path that the hostname resolves to
Methods
protected
- isAllowedPath() — Checks a given list of wildcard patterns to see if a path is allowed
- isForcedPath() — Checks a given list of wildcard patterns to see if a path is allowed
- match_url() — Matches a URL against a list of wildcard patterns
public
- __construct() — Constructor. Takes a key for the domain and its array of settings from the config
- getHostname() — Gets the hostname for the domain
- getHttpHost() — Return the current HTTP host, defaulting to retrieving it from the $_SERVER superglobal
- getKey() — Returns the key/identifier for this domain
- getNativeURL() — Gets the native URL for a vanity domain, e.g. /partners/ for .com returns /company/partners when .com is mapped to /company/.
- getRequestUri() — Return the current request URI, defaulting to retrieving it from the $_SERVER superglobal
- getURL() — Gets the path that the hostname resolves to
- getVanityURL() — Gets the vanity URL given a native URL. /company/partners returns /partners/ when .com is mapped to /company/.
- hasURL() — Return true if this domain contains the given URL
- isActive() — Returns true if the domain is currently in the HTTP_HOST
- isPrimary() — Returns true if this domain is the primary domain
- setHttpHost() — Set the HTTP host in the request
- setRequestUri() — Set the request URI