Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b6b7b9f433 | |||
| fb99b101d8 | |||
| 0ce7efc978 | |||
| 11bdfbba19 | |||
| 9694831638 | |||
| 8d14a3ef2c | |||
| 2f3d9c9509 | |||
| 6e8f3b6e13 | |||
| b9cbdbd9a7 | |||
| ebf35356a8 | |||
| 7eca99e249 | |||
| 837bb83d48 | |||
| 054ac78970 | |||
| 5982a868ea |
+2
-2
@@ -11,5 +11,5 @@ using System.Resources;
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
[assembly: AssemblyFileVersion("7.7.5")]
|
||||
[assembly: AssemblyInformationalVersion("7.7.5")]
|
||||
[assembly: AssemblyFileVersion("7.7.7")]
|
||||
[assembly: AssemblyInformationalVersion("7.7.7")]
|
||||
@@ -6,7 +6,7 @@ namespace Umbraco.Core.Configuration
|
||||
{
|
||||
public class UmbracoVersion
|
||||
{
|
||||
private static readonly Version Version = new Version("7.7.5");
|
||||
private static readonly Version Version = new Version("7.7.7");
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current version of Umbraco.
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using log4net.Appender;
|
||||
using log4net.Util;
|
||||
|
||||
namespace Umbraco.Core.Logging
|
||||
{
|
||||
/// <summary>
|
||||
/// This class will do the exact same thing as the RollingFileAppender that comes from log4net
|
||||
/// With the extension, that it is able to do automatic cleanup of the logfiles in the directory where logging happens
|
||||
///
|
||||
/// By specifying the properties MaxLogFileDays and BaseFilePattern, the files will automaticly get deleted when
|
||||
/// the logger is configured(typically when the app starts). To utilize this appender swap out the type of the rollingFile appender
|
||||
/// that ships with Umbraco, to be Umbraco.Core.Logging.RollingFileCleanupAppender, and add the maxLogFileDays and baseFilePattern elements
|
||||
/// to the configuration i.e.:
|
||||
///
|
||||
/// <example>
|
||||
/// <appender name="rollingFile" type="Log4netAwesomeness.CustomRollingFileAppender, Log4netAwesomeness">
|
||||
/// <file type="log4net.Util.PatternString" value="App_Data\Logs\UmbracoTraceLog.%property{log4net:HostName}.txt" />
|
||||
/// <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
|
||||
/// <appendToFile value="true" />
|
||||
/// <rollingStyle value="Date" />
|
||||
/// <maximumFileSize value="5MB" />
|
||||
/// <maxLogFileDays value="5"/>
|
||||
/// <basefilePattern value="UmbracoTraceLog.*.txt.*"/>
|
||||
/// <layout type="log4net.Layout.PatternLayout">
|
||||
/// <conversionPattern value=" %date [P%property{processId}/D%property{appDomainId}/T%thread] %-5level %logger - %message%newline" />
|
||||
/// </layout>
|
||||
/// <layout type="log4net.Layout.PatternLayout">
|
||||
/// <conversionPattern value=" %date [P%property{processId}/D%property{appDomainId}/T%thread] %-5level %logger - %message%newline" />
|
||||
/// </layout>
|
||||
/// <encoding value="utf-8" />
|
||||
/// </appender>
|
||||
/// </example>
|
||||
/// </summary>
|
||||
public class RollingFileCleanupAppender : RollingFileAppender
|
||||
{
|
||||
public int MaxLogFileDays { get; set; }
|
||||
public string BaseFilePattern { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// This override will delete logs older than the specified amount of days
|
||||
/// </summary>
|
||||
/// <param name="fileName"></param>
|
||||
/// <param name="append"></param>
|
||||
protected override void OpenFile(string fileName, bool append)
|
||||
{
|
||||
bool cleanup = true;
|
||||
// Validate settings and input
|
||||
if (MaxLogFileDays <= 0)
|
||||
{
|
||||
LogLog.Warn(typeof(RollingFileCleanupAppender), "Parameter 'MaxLogFileDays' needs to be a positive integer, aborting cleanup");
|
||||
cleanup = false;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(BaseFilePattern))
|
||||
{
|
||||
LogLog.Warn(typeof(RollingFileCleanupAppender), "Parameter 'BaseFilePattern' is empty, aborting cleanup");
|
||||
cleanup = false;
|
||||
}
|
||||
// grab the directory we are logging to, as this is were we will search for older logfiles
|
||||
var logFolder = Path.GetDirectoryName(fileName);
|
||||
if (Directory.Exists(logFolder) == false)
|
||||
{
|
||||
LogLog.Warn(typeof(RollingFileCleanupAppender), string.Format("Directory '{0}' for logfiles does not exist, aborting cleanup", logFolder));
|
||||
cleanup = false;
|
||||
}
|
||||
// If everything is validated, we can do the actual cleanup
|
||||
if (cleanup)
|
||||
{
|
||||
Cleanup(logFolder);
|
||||
}
|
||||
|
||||
base.OpenFile(fileName, append);
|
||||
}
|
||||
|
||||
private void Cleanup(string directoryPath)
|
||||
{
|
||||
// only take files that matches the pattern we are using i.e. UmbracoTraceLog.*.txt.*
|
||||
string[] logFiles = Directory.GetFiles(directoryPath, BaseFilePattern);
|
||||
LogLog.Debug(typeof(RollingFileCleanupAppender), string.Format("Found {0} files that matches the baseFilePattern: '{1}'", logFiles.Length, BaseFilePattern));
|
||||
|
||||
foreach (var logFile in logFiles)
|
||||
{
|
||||
DateTime lastAccessTime = System.IO.File.GetLastWriteTimeUtc(logFile);
|
||||
// take the value from the config file
|
||||
if (lastAccessTime < DateTime.Now.AddDays(-MaxLogFileDays))
|
||||
{
|
||||
LogLog.Debug(typeof(RollingFileCleanupAppender), string.Format("Deleting file {0} as its lastAccessTime is older than {1} days speficied by MaxLogFileDays", logFile, MaxLogFileDays));
|
||||
base.DeleteFile(logFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -188,7 +188,7 @@ namespace Umbraco.Core.Models
|
||||
Language,
|
||||
|
||||
/// <summary>
|
||||
/// Document
|
||||
/// Document Blueprint
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.DocumentBlueprint, typeof(IContent))]
|
||||
[FriendlyName("DocumentBlueprint")]
|
||||
|
||||
@@ -117,6 +117,8 @@ namespace Umbraco.Core
|
||||
{
|
||||
case UmbracoObjectTypes.Document:
|
||||
return Document;
|
||||
case UmbracoObjectTypes.DocumentBlueprint:
|
||||
return DocumentBluePrint;
|
||||
case UmbracoObjectTypes.Media:
|
||||
return Media;
|
||||
case UmbracoObjectTypes.Member:
|
||||
@@ -161,6 +163,8 @@ namespace Umbraco.Core
|
||||
{
|
||||
case Document:
|
||||
return UmbracoObjectTypes.Document;
|
||||
case DocumentBluePrint:
|
||||
return UmbracoObjectTypes.DocumentBlueprint;
|
||||
case Media:
|
||||
return UmbracoObjectTypes.Media;
|
||||
case Member:
|
||||
|
||||
@@ -366,6 +366,7 @@
|
||||
<Compile Include="HashGenerator.cs" />
|
||||
<Compile Include="IEmailSender.cs" />
|
||||
<Compile Include="IHttpContextAccessor.cs" />
|
||||
<Compile Include="Logging\RollingFileCleanupAppender.cs" />
|
||||
<Compile Include="Models\EntityBase\EntityPath.cs" />
|
||||
<Compile Include="Models\EntityBase\IDeletableEntity.cs" />
|
||||
<Compile Include="Models\IUserControl.cs" />
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<umb-control-group label="@general_url">
|
||||
<input id="url" class="umb-editor input-block-level" type="text" style="margin-bottom: 10px;" ng-model="model.embed.url" ng-keyup="$event.keyCode == 13 ? vm.showPreview() : null" required />
|
||||
<input type="button" ng-click="vm.showPreview()" class="btn" localize="value" value="@general_retrieve" />
|
||||
<input type="button" ng-click="vm.showPreview()" class="btn" value="@general_retrieve" localize="value" />
|
||||
</umb-control-group>
|
||||
|
||||
<umb-control-group>
|
||||
@@ -12,15 +12,15 @@
|
||||
|
||||
<div ng-show="model.embed.supportsDimensions">
|
||||
<umb-control-group label="@general_width">
|
||||
<input type="text" ng-model="model.embed.width" on-blur="vm.changeSize('width')" />
|
||||
<input type="number" pattern="[0-9]*" min="0" ng-model="model.embed.width" on-blur="vm.changeSize('width')" />
|
||||
</umb-control-group>
|
||||
|
||||
<umb-control-group label="@general_height">
|
||||
<input type="text" ng-model="model.embed.height" on-blur="vm.changeSize('height')" />
|
||||
<input type="number" pattern="[0-9]*" min="0" ng-model="model.embed.height" on-blur="vm.changeSize('height')" />
|
||||
</umb-control-group>
|
||||
|
||||
<umb-control-group label="@general_constrain">
|
||||
<input id="constrain" type="checkbox" ng-model="model.embed.constrain" />
|
||||
<input id="constrain" type="checkbox" ng-model="model.embed.constrain" />
|
||||
</umb-control-group>
|
||||
</div>
|
||||
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@
|
||||
<umb-overlay
|
||||
ng-if="vm.childNodeSelectorOverlay.show"
|
||||
model="vm.childNodeSelectorOverlay"
|
||||
position="center"
|
||||
position="target"
|
||||
view="vm.childNodeSelectorOverlay.view">
|
||||
</umb-overlay>
|
||||
|
||||
|
||||
@@ -299,7 +299,7 @@
|
||||
ng-if="editorOverlay.show"
|
||||
model="editorOverlay"
|
||||
view="editorOverlay.view"
|
||||
position="center">
|
||||
position="target">
|
||||
</umb-overlay>
|
||||
|
||||
<umb-overlay
|
||||
|
||||
@@ -1026,9 +1026,9 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\x86\*.* "$(TargetDir)x86\"
|
||||
<WebProjectProperties>
|
||||
<UseIIS>True</UseIIS>
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>7750</DevelopmentServerPort>
|
||||
<DevelopmentServerPort>7770</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>http://localhost:7750</IISUrl>
|
||||
<IISUrl>http://localhost:7770</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
|
||||
@@ -422,7 +422,7 @@
|
||||
<key alias="showPageOnSend">Hvilken side skal vises etter at skjemaet er sendt</key>
|
||||
<key alias="size">Størrelse</key>
|
||||
<key alias="sort">Sorter</key>
|
||||
<key alias="submit">Submit</key> <!-- TODO: Translate this -->
|
||||
<key alias="submit">Send</key>
|
||||
<key alias="type">Type</key>
|
||||
<key alias="typeToSearch">Søk...</key>
|
||||
<key alias="up">Opp</key>
|
||||
@@ -439,6 +439,17 @@
|
||||
<key alias="yes">Ja</key>
|
||||
<key alias="folder">Mappe</key>
|
||||
<key alias="searchResults">Søkeresultater</key>
|
||||
<key alias="reorder">Sorter</key>
|
||||
<key alias="reorderDone">Avslutt sortering</key>
|
||||
<key alias="preview">Eksempel</key>
|
||||
<key alias="changePassword">Bytt passord</key>
|
||||
<key alias="to">til</key>
|
||||
<key alias="listView">Listevisning</key>
|
||||
<key alias="saving">Lagrer...</key>
|
||||
<key alias="current">nåværende</key>
|
||||
<key alias="embed">Innbygging</key>
|
||||
<key alias="retrieve">Hent</key>
|
||||
<key alias="selected">valgt</key>
|
||||
</area>
|
||||
<area alias="graphicheadline">
|
||||
<key alias="backgroundcolor">Bakgrunnsfarge</key>
|
||||
|
||||
@@ -586,7 +586,6 @@
|
||||
<key alias="sort">Sortér</key>
|
||||
<key alias="status">Status</key>
|
||||
<key alias="submit">Indsend</key>
|
||||
<!-- TODO: Translate this -->
|
||||
<key alias="type">Type</key>
|
||||
<key alias="typeToSearch">Skriv for at søge...</key>
|
||||
<key alias="up">Op</key>
|
||||
@@ -612,6 +611,7 @@
|
||||
<key alias="saving">Gemmer...</key>
|
||||
<key alias="current">nuværende</key>
|
||||
<key alias="embed">Indlejring</key>
|
||||
<key alias="retrieve">Hent</key>
|
||||
<key alias="selected">valgt</key>
|
||||
</area>
|
||||
|
||||
|
||||
@@ -637,6 +637,7 @@
|
||||
<key alias="saving">Saving...</key>
|
||||
<key alias="current">current</key>
|
||||
<key alias="embed">Embed</key>
|
||||
<key alias="retrieve">Retrieve</key>
|
||||
<key alias="selected">selected</key>
|
||||
</area>
|
||||
|
||||
|
||||
@@ -637,6 +637,7 @@
|
||||
<key alias="saving">Saving...</key>
|
||||
<key alias="current">current</key>
|
||||
<key alias="embed">Embed</key>
|
||||
<key alias="retrieve">Retrieve</key>
|
||||
<key alias="selected">selected</key>
|
||||
</area>
|
||||
<area alias="colors">
|
||||
|
||||
@@ -411,7 +411,7 @@
|
||||
<key alias="showPageOnSend">Vilken sida skall visas när formuläret är skickat</key>
|
||||
<key alias="size">Storlek</key>
|
||||
<key alias="sort">Sortera</key>
|
||||
<key alias="submit">Submit</key> <!-- TODO: Translate this -->
|
||||
<key alias="submit">Skicka</key>
|
||||
<key alias="type">Skriv</key>
|
||||
<key alias="typeToSearch">Skriv för att söka...</key>
|
||||
<key alias="up">Upp</key>
|
||||
@@ -426,8 +426,17 @@
|
||||
<key alias="width">Bredd</key>
|
||||
<key alias="view">Titta på</key>
|
||||
<key alias="yes">Ja</key>
|
||||
<key alias="reorder">Reorder</key>
|
||||
<key alias="reorderDone">I am done reordering</key>
|
||||
<key alias="reorder">Sortera</key>
|
||||
<key alias="reorderDone">Avsluta sortering</key>
|
||||
<key alias="preview">Förhandsvisning</key>
|
||||
<key alias="changePassword">Ändra lösenord</key>
|
||||
<key alias="to">till</key>
|
||||
<key alias="listView">Listvy</key>
|
||||
<key alias="saving">Sparar...</key>
|
||||
<key alias="current">nuvarande</key>
|
||||
<key alias="embed">Inbäddning</key>
|
||||
<key alias="retrieve">Hämta</key>
|
||||
<key alias="selected">valgt</key>
|
||||
</area>
|
||||
<area alias="graphicheadline">
|
||||
<key alias="backgroundcolor">Bakgrundsfärg</key>
|
||||
|
||||
@@ -86,7 +86,16 @@ namespace Umbraco.Web.Scheduling
|
||||
finally
|
||||
{
|
||||
if (tempContext != null)
|
||||
{
|
||||
// because we created an http context and assigned it to UmbracoContext,
|
||||
// the batched messenger does batch instructions, but since there is no
|
||||
// request, we need to explicitely tell it to flush the batch of instrs.
|
||||
var batchedMessenger = ServerMessengerResolver.Current.Messenger as BatchedDatabaseServerMessenger;
|
||||
if (batchedMessenger != null)
|
||||
batchedMessenger.FlushBatch();
|
||||
|
||||
tempContext.Dispose(); // nulls the ThreadStatic context
|
||||
}
|
||||
}
|
||||
|
||||
return true; // repeat
|
||||
|
||||
Reference in New Issue
Block a user