Skip to content

Commit

Permalink
Issue #1295: enhance code comments and POD
Browse files Browse the repository at this point in the history
  • Loading branch information
bschmalhofer committed Oct 8, 2021
1 parent f0f97aa commit e27bd21
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ sub new {
# Call new() on Base.pm to execute the common code.
my $Self = $Type->SUPER::new(%Param);

# create a new directory every new day
my $ArticleContentPath = $Self->BuildArticleContentPath();
my $ArticleDir = "$Self->{ArticleDataDir}/$ArticleContentPath/";

mkpath( $ArticleDir, 0, 0770 ); ## no critic qw(ValuesAndExpressions::ProhibitLeadingZeros)

# Check write permissions.
Expand Down Expand Up @@ -320,6 +320,8 @@ sub ArticleWriteAttachment {
# prepare/filter ArticleID
$Param{ArticleID} = quotemeta( $Param{ArticleID} );
$Param{ArticleID} =~ s/\0//g;

# define path
my $ContentPath = $Self->_ArticleContentPathGet(
ArticleID => $Param{ArticleID},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ sub ArticleAttachment {
return;
}

# the final delimiter is part of the prefix
sub _ArticlePrefix {
my ($Self, $ArticleID) = @_;

Expand Down
3 changes: 3 additions & 0 deletions Kernel/System/Ticket/Article/Backend/MIMEBase/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ Generate a base article content path for article storage in the file system.
my $ArticleContentPath = $BackendObject->BuildArticleContentPath();
This is useful in file system based storage backends because there shouldn't be too many entries in a directory.
A different content path, in the form YYYY/MM/DD is generated for every day.
=cut

sub BuildArticleContentPath {
Expand Down

0 comments on commit e27bd21

Please sign in to comment.