using System; namespace Umbraco.Cms.Core.Hosting { public interface IHostingEnvironment { string SiteName { get; } /// /// The unique application ID for this Umbraco website. /// /// /// /// The returned value will be the same consistent value for an Umbraco website on a specific server and will the same /// between restarts of that Umbraco website/application on that specific server. /// /// /// The value of this does not necesarily distinguish between unique workers/servers for this Umbraco application. /// Usage of this must take into account that the same may be returned for the same /// Umbraco website hosted on different servers. Similarly the usage of this must take into account that a different /// may be returned for the same Umbraco website hosted on different servers. /// /// string ApplicationId { get; } /// /// Will return the physical path to the root of the application /// string ApplicationPhysicalPath { get; } string LocalTempPath { get; } /// /// The web application's hosted path /// /// /// In most cases this will return "/" but if the site is hosted in a virtual directory then this will return the virtual directory's path such as "/mysite". /// This value must begin with a "/" and cannot end with "/". /// string ApplicationVirtualPath { get; } bool IsDebugMode { get; } /// /// Gets a value indicating whether Umbraco is hosted. /// bool IsHosted { get; } /// /// Gets the main application url. /// Uri ApplicationMainUrl { get; } /// /// Maps a virtual path to a physical path to the application's web root /// /// /// Depending on the runtime 'web root', this result can vary. For example in Net Framework the web root and the content root are the same, however /// in netcore the web root is /www therefore this will Map to a physical path within www. /// string MapPathWebRoot(string path); /// /// Maps a virtual path to a physical path to the application's root (not always equal to the web root) /// /// /// Depending on the runtime 'web root', this result can vary. For example in Net Framework the web root and the content root are the same, however /// in netcore the web root is /www therefore this will Map to a physical path within www. /// string MapPathContentRoot(string path); /// /// Converts a virtual path to an absolute URL path based on the application's web root /// /// The virtual path. Must start with either ~/ or / else an exception is thrown. /// /// This maps the virtual path syntax to the web root. For example when hosting in a virtual directory called "site" and the value "~/pages/test" is passed in, it will /// map to "/site/pages/test" where "/site" is the value of . /// /// /// If virtualPath does not start with ~/ or / /// string ToAbsolute(string virtualPath); /// /// Ensures that the application know its main Url. /// void EnsureApplicationMainUrl(Uri currentApplicationUrl); } }