/** * Get the domain minus any subdomain. * * @return string */ public static function base_domain() { $base = \Appconf::saasy('App Settings', 'base_domain'); if ($base) { return $base; } $parts = explode('.', $_SERVER['HTTP_HOST']); if (count($parts) === 3) { array_shift($parts); } return join('.', $parts); }