code/Subsite.php
/**
	 * Return the domain of this site
	 *
	 * @return string The full domain name of this subsite (without protocol prefix)
	 */
Return the domain of this site
@return string The full domain name of this subsite (without protocol prefix)
Return the domain of this site @return string The full domain name of this subsite ( without protocol prefix )
function domain() {
		if($this->ID) {
			$domains = DataObject::get("SubsiteDomain", "\"SubsiteID\" = $this->ID", "\"IsPrimary\" DESC",
				"", 1);
			if($domains) {
				$domain = $domains->First()->Domain;
				$domain = preg_replace("/\\.\\*\$/",".$_SERVER[HTTP_HOST]", $domain);
				$domain = preg_replace("/^\\*\\./","subsite.", $domain);
				$domain = str_replace('.www.','.', $domain);
				return $domain;
			}
		} else {
			return $_SERVER['HTTP_HOST'];
		}
	}
function domain ( ) { if ( $ this -> ID ) { $ domains = DataObject :: get ( " SubsiteDomain " , " \" SubsiteID \"  =  $ this -> ID " , " \" IsPrimary \"  DESC " , " " , 1 ) ; if ( $ domains ) { $ domain = $ domains -> First ( ) -> Domain ; $ domain = preg_replace ( " / \\ . \\ * \$ / " , " . $ _SERVER [ HTTP_HOST ] " , $ domain ) ; $ domain = preg_replace ( " /^ \\ * \\ ./ " , " subsite. " , $ domain ) ; $ domain = str_replace ( '.www.' , '.' , $ domain ) ; return $ domain ; } } else { return $ _SERVER [ 'HTTP_HOST' ] ; } }
Return the domain of this site
 @return string The full domain name of this subsite (without protocol prefix)
Return the domain of this site @return string The full domain name of this subsite ( without protocol prefix )
// If there are wildcards in the primary domain (not recommended), make some // educated guesses about what to replace them with // SubsiteID = 0 is often used to refer to the main site, just return $_SERVER['HTTP_HOST']