-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v9/dev' into v9/contrib
- Loading branch information
Showing
64 changed files
with
1,566 additions
and
956 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/Umbraco.Core/Configuration/Models/PackageMigrationSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright (c) Umbraco. | ||
// See LICENSE for more details. | ||
|
||
using System.ComponentModel; | ||
|
||
namespace Umbraco.Cms.Core.Configuration.Models | ||
{ | ||
/// <summary> | ||
/// Typed configuration options for package migration settings. | ||
/// </summary> | ||
[UmbracoOptions(Constants.Configuration.ConfigPackageMigration)] | ||
public class PackageMigrationSettings | ||
{ | ||
private const bool StaticRunSchemaAndContentMigrations = true; | ||
private const bool StaticAllowComponentOverrideOfRunSchemaAndContentMigrations = true; | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether package migration steps that install schema and content should run. | ||
/// </summary> | ||
/// <remarks> | ||
/// By default this is true and schema and content defined in a package migration are installed. | ||
/// Using configuration, administrators can optionally switch this off in certain environments. | ||
/// Deployment tools such as Umbraco Deploy can also configure this option to run or not run these migration | ||
/// steps as is appropriate for normal use of the tool. | ||
/// </remarks> | ||
[DefaultValue(StaticRunSchemaAndContentMigrations)] | ||
public bool RunSchemaAndContentMigrations { get; set; } = StaticRunSchemaAndContentMigrations; | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether components can override the configured value for <see cref="RunSchemaAndContentMigrations"/>. | ||
/// </summary> | ||
/// <remarks> | ||
/// By default this is true and components can override the configured setting for <see cref="RunSchemaAndContentMigrations"/>. | ||
/// If an administrator wants explicit control over which environments migration steps installing schema and content can run, | ||
/// they can set this to false. Components should respect this and not override the configuration. | ||
/// </remarks> | ||
[DefaultValue(StaticAllowComponentOverrideOfRunSchemaAndContentMigrations)] | ||
public bool AllowComponentOverrideOfRunSchemaAndContentMigrations { get; set; } = StaticAllowComponentOverrideOfRunSchemaAndContentMigrations; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
src/Umbraco.Core/Configuration/Models/UnattendedSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace Umbraco.Cms.Core.Models | ||
{ | ||
[DataContract] | ||
public class UserData | ||
{ | ||
[DataMember(Name = "name")] | ||
public string Name { get; } | ||
[DataMember(Name = "data")] | ||
public string Data { get; } | ||
|
||
public UserData(string name, string data) | ||
{ | ||
Name = name; | ||
Data = data; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Collections.Generic; | ||
using Umbraco.Cms.Core.Models; | ||
|
||
namespace Umbraco.Cms.Core.Services | ||
{ | ||
public interface IUserDataService | ||
{ | ||
IEnumerable<UserData> GetUserData(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.Runtime.InteropServices; | ||
using System.Threading; | ||
using Umbraco.Cms.Core.Configuration; | ||
using Umbraco.Cms.Core.Models; | ||
using Umbraco.Extensions; | ||
|
||
namespace Umbraco.Cms.Core.Services | ||
{ | ||
public class UserDataService : IUserDataService | ||
{ | ||
private readonly IUmbracoVersion _version; | ||
private readonly ILocalizationService _localizationService; | ||
|
||
public UserDataService(IUmbracoVersion version, ILocalizationService localizationService) | ||
{ | ||
_version = version; | ||
_localizationService = localizationService; | ||
} | ||
|
||
public IEnumerable<UserData> GetUserData() => | ||
new List<UserData> | ||
{ | ||
new("Server OS", RuntimeInformation.OSDescription), | ||
new("Server Framework", RuntimeInformation.FrameworkDescription), | ||
new("Default Language", _localizationService.GetDefaultLanguageIsoCode()), | ||
new("Umbraco Version", _version.SemanticVersion.ToSemanticStringWithoutBuild()), | ||
new("Current Culture", Thread.CurrentThread.CurrentCulture.ToString()), | ||
new("Current UI Culture", Thread.CurrentThread.CurrentUICulture.ToString()), | ||
new("Current Webserver", GetCurrentWebServer()) | ||
}; | ||
|
||
private string GetCurrentWebServer() => IsRunningInProcessIIS() ? "IIS" : "Kestrel"; | ||
|
||
public bool IsRunningInProcessIIS() | ||
{ | ||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) | ||
{ | ||
return false; | ||
} | ||
|
||
string processName = Path.GetFileNameWithoutExtension(Process.GetCurrentProcess().ProcessName); | ||
return (processName.Contains("w3wp") || processName.Contains("iisexpress")); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.