Added support for absolute paths for PublicDirectory configuration value.

This commit is contained in:
Dario Solera 2011-01-04 09:02:39 +00:00
parent 191d903b2d
commit 9acaf35935
5 changed files with 14 additions and 6 deletions

View file

@ -16,5 +16,5 @@ using System.Reflection;
// //
// You can specify all the values or you can default the Revision and Build Numbers // You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("3.0.4.566")] [assembly: AssemblyVersion("3.0.4.567")]
[assembly: AssemblyFileVersion("3.0.4.566")] [assembly: AssemblyFileVersion("3.0.4.567")]

View file

@ -156,7 +156,15 @@ namespace ScrewTurn.Wiki {
/// Gets the Public Directory of the Wiki. /// Gets the Public Directory of the Wiki.
/// </summary> /// </summary>
public static string PublicDirectory { public static string PublicDirectory {
get { return RootDirectory + PublicDirectoryName + Path.DirectorySeparatorChar; } get {
string pubDirName = PublicDirectoryName;
if(Path.IsPathRooted(pubDirName)) return pubDirName;
else {
string path = Path.Combine(RootDirectory, pubDirName);
if(!path.EndsWith(Path.DirectorySeparatorChar.ToString())) path += Path.DirectorySeparatorChar;
return path;
}
}
} }
/// <summary> /// <summary>

View file

@ -20,7 +20,7 @@
WARNING: DO NOT MODIFY THE NAMES OF THE FOLLOWING KEYS: ONLY EDIT THEIR VALUES! WARNING: DO NOT MODIFY THE NAMES OF THE FOLLOWING KEYS: ONLY EDIT THEIR VALUES!
--> -->
<!-- Set this item with your "data" directory path, which MUST have write permissions for the ASP.NET <!-- Set this item with your "data" directory path, which MUST have write permissions for the ASP.NET
worker process. This path must be relative to the Root Directory path. This parameter is mandatory. --> worker process. This path can be relative to the application root, or it can be an absolute path. This parameter is mandatory. -->
<add key="PublicDirectory" value="public\" /> <add key="PublicDirectory" value="public\" />
<!-- Set this item with your preferred password, used for the root administrator (username 'admin'). <!-- Set this item with your preferred password, used for the root administrator (username 'admin').
This parameter is mandatory. --> This parameter is mandatory. -->

View file

@ -20,7 +20,7 @@
WARNING: DO NOT MODIFY THE NAMES OF THE FOLLOWING KEYS: ONLY EDIT THEIR VALUES! WARNING: DO NOT MODIFY THE NAMES OF THE FOLLOWING KEYS: ONLY EDIT THEIR VALUES!
--> -->
<!-- Set this item with your "data" directory path, which MUST have write permissions for the ASP.NET <!-- Set this item with your "data" directory path, which MUST have write permissions for the ASP.NET
worker process. This path must be relative to the Root Directory path. This parameter is mandatory. --> worker process. This path can be relative to the application root, or it can be an absolute path. This parameter is mandatory. -->
<add key="PublicDirectory" value="public\" /> <add key="PublicDirectory" value="public\" />
<!-- Set this item with your preferred password, used for the root administrator (username 'admin'). <!-- Set this item with your preferred password, used for the root administrator (username 'admin').
This parameter is mandatory. --> This parameter is mandatory. -->

View file

@ -18,7 +18,7 @@
WARNING: DO NOT MODIFY THE NAMES OF THE FOLLOWING KEYS: ONLY EDIT THEIR VALUES! WARNING: DO NOT MODIFY THE NAMES OF THE FOLLOWING KEYS: ONLY EDIT THEIR VALUES!
--> -->
<!-- Set this item with your "data" directory path, which MUST have write permissions for the ASP.NET <!-- Set this item with your "data" directory path, which MUST have write permissions for the ASP.NET
worker process. This path must be relative to the Root Directory path. This parameter is mandatory. --> worker process. This path can be relative to the application root, or it can be an absolute path. This parameter is mandatory. -->
<add key="PublicDirectory" value="public\" /> <add key="PublicDirectory" value="public\" />
<!-- Set this item with your preferred password, used for the root administrator (username 'admin'). <!-- Set this item with your preferred password, used for the root administrator (username 'admin').
This parameter is mandatory. --> This parameter is mandatory. -->