Пример #1
0
        private string GetServerUrl()
        {
            var serverUrl = string.Empty;

            var configurationLoader = new CmsConfigurationLoader();
            var configuration       = configurationLoader.LoadCmsConfiguration();

            if (!string.IsNullOrEmpty(configuration.WebSiteUrl) && configuration.WebSiteUrl.ToLower() != "auto")
            {
                serverUrl = configuration.WebSiteUrl.ToLower().TrimEnd('/');
            }

            return(serverUrl);
        }
Пример #2
0
        private static void Migrate()
        {
            ICmsConfigurationLoader configurationLoader = new CmsConfigurationLoader();
            ICmsConfiguration       cmsConfiguration    = configurationLoader.LoadCmsConfiguration();

            var builder = ApplicationContext.InitializeContainer(null, cmsConfiguration);

            builder.RegisterInstance(cmsConfiguration)
            .As <IConfiguration>()
            .As <IWebConfiguration>()
            .As <ICmsConfiguration>()
            .SingleInstance();
            ContextScopeProvider.RegisterTypes(builder);
            ApplicationContext.LoadAssemblies();

            IVersionChecker        versionChecker = new VersionCheckerStub();
            DefaultMigrationRunner runner         = new DefaultMigrationRunner(new DefaultAssemblyLoader(), cmsConfiguration, versionChecker);

            runner.MigrateStructure(descriptors.Cast <ModuleDescriptor>().ToList());
        }