File tree Expand file tree Collapse file tree 5 files changed +53
-54
lines changed
src/Umbraco.AuthorizedServices Expand file tree Collapse file tree 5 files changed +53
-54
lines changed Original file line number Diff line number Diff line change 44using Microsoft . Extensions . Options ;
55using Umbraco . AuthorizedServices . Configuration ;
66using Umbraco . AuthorizedServices . Manifests ;
7- using Umbraco . AuthorizedServices . Migrations ;
87using Umbraco . AuthorizedServices . Services ;
98using Umbraco . AuthorizedServices . Services . Implement ;
109using Umbraco . Cms . Core . Composing ;
1110using Umbraco . Cms . Core . Configuration . Models ;
1211using Umbraco . Cms . Core . DependencyInjection ;
13- using Umbraco . Cms . Core . Notifications ;
1412using Umbraco . Extensions ;
1513
1614namespace Umbraco . AuthorizedServices ;
@@ -66,7 +64,5 @@ public void Compose(IUmbracoBuilder builder)
6664 builder . Services . AddUnique < ITokenStorage , DatabaseTokenStorage > ( ) ;
6765
6866 builder . Services . AddSingleton < JsonSerializerFactory > ( ) ;
69-
70- builder . AddNotificationHandler < UmbracoApplicationStartingNotification , DatabaseMigrationHandler > ( ) ;
7167 }
7268}
Original file line number Diff line number Diff line change 1- using System . Diagnostics ;
1+ using System . Reflection ;
2+ using Umbraco . Cms . Core . Semver ;
3+ using Umbraco . Extensions ;
24
35namespace Umbraco . AuthorizedServices ;
46
57public static class Constants
68{
9+ internal const string PackageName = "Umbraco Authorized Services" ;
10+
711 public const string PluginName = "UmbracoAuthorizedServices" ;
812
913 public const string Separator = "-" ;
1014
11- public static readonly string InformationalVersion = FileVersionInfo . GetVersionInfo ( typeof ( Constants ) . Assembly . Location ) . ProductVersion ! ;
15+ public static readonly string InformationalVersion = GetInformationalVersion ( ) ;
16+
17+ private static string GetInformationalVersion ( )
18+ {
19+ Assembly assembly = typeof ( Constants ) . Assembly ;
20+ AssemblyInformationalVersionAttribute ? assemblyInformationalVersionAttribute = assembly . GetCustomAttribute < AssemblyInformationalVersionAttribute > ( ) ;
21+ if ( assemblyInformationalVersionAttribute is not null &&
22+ SemVersion . TryParse ( assemblyInformationalVersionAttribute . InformationalVersion , out SemVersion ? semVersion ) )
23+ {
24+ return semVersion ! . ToSemanticStringWithoutBuild ( ) ;
25+ }
26+ else
27+ {
28+ AssemblyName assemblyName = assembly . GetName ( ) ;
29+ if ( assemblyName . Version is not null )
30+ {
31+ return assemblyName . Version . ToString ( 3 ) ;
32+ }
33+ }
34+
35+ return string . Empty ;
36+ }
1237
1338 public static class Trees
1439 {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ public void Filter(List<PackageManifest> manifests)
1010 {
1111 AllowPackageTelemetry = true ,
1212 Version = Constants . InformationalVersion ,
13- PackageName = "Umbraco Authorized Services" ,
13+ PackageName = Constants . PackageName ,
1414 BundleOptions = BundleOptions . None ,
1515 Scripts = new [ ]
1616 {
Original file line number Diff line number Diff line change 1+ using Umbraco . Cms . Core . Packaging ;
2+
3+ namespace Umbraco . AuthorizedServices . Migrations ;
4+
5+ /// <summary>
6+ /// Defines the migration plan for the Authorized Services package.
7+ /// </summary>
8+ public class AuthorizedServicesMigrationPlan : PackageMigrationPlan
9+ {
10+ /// <summary>
11+ /// Initializes a new instance of the <see cref="AuthorizedServicesMigrationPlan" /> class.
12+ /// </summary>
13+ public AuthorizedServicesMigrationPlan ( )
14+ : base ( Constants . PackageName , Constants . Migrations . MigrationPlan )
15+ { }
16+
17+ /// <inheritdoc />
18+ public override bool IgnoreCurrentState => false ;
19+
20+ /// <inheritdoc />
21+ protected override void DefinePlan ( )
22+ {
23+ To < AddDatabaseTokenStorageTable > ( Constants . Migrations . TargetState ) ;
24+ }
25+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments