mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Enabled caching by default in Orchard.Azure.Web cloud service role.
Enabled session state cache provider by default in Orchard.Azure.Wew. Moved all string constants into Constants class. Got rid of unused implicit module feature of Orchard.Azure. Added missing settings banner. Split Orchard.StorageConnectionString role configuration setting up into two separate settings for Media and Settings respectively. Renamed startup task. Removed hard coded connection string and container name from AzureFileSystem, making it truly reusable.
This commit is contained in:
committed by
Sebastien Ros
parent
5872371189
commit
ca34a462b6
@@ -23,6 +23,11 @@ namespace Orchard.Azure.Services.FileSystems {
|
||||
private CloudBlobClient _blobClient;
|
||||
private CloudBlobContainer _container;
|
||||
|
||||
public string StorageConnectionString {
|
||||
get;
|
||||
protected set;
|
||||
}
|
||||
|
||||
public string ContainerName {
|
||||
get;
|
||||
protected set;
|
||||
@@ -42,9 +47,10 @@ namespace Orchard.Azure.Services.FileSystems {
|
||||
}
|
||||
}
|
||||
|
||||
public AzureFileSystem(string containerName, string root, bool isPrivate, IMimeTypeProvider mimeTypeProvider) {
|
||||
public AzureFileSystem(string storageConnectionString, string containerName, string root, bool isPrivate, IMimeTypeProvider mimeTypeProvider) {
|
||||
_isPrivate = isPrivate;
|
||||
_mimeTypeProvider = mimeTypeProvider;
|
||||
StorageConnectionString = storageConnectionString;
|
||||
ContainerName = containerName;
|
||||
_root = String.IsNullOrEmpty(root) ? "" : root + "/";
|
||||
}
|
||||
@@ -54,7 +60,7 @@ namespace Orchard.Azure.Services.FileSystems {
|
||||
return;
|
||||
}
|
||||
|
||||
_storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("Orchard.StorageConnectionString"));
|
||||
_storageAccount = CloudStorageAccount.Parse(StorageConnectionString);
|
||||
_absoluteRoot = Combine(Combine(_storageAccount.BlobEndpoint.AbsoluteUri, ContainerName), _root);
|
||||
|
||||
_blobClient = _storageAccount.CreateCloudBlobClient();
|
||||
|
||||
Reference in New Issue
Block a user