mirror of
https://github.com/darold/squidanalyzer.git
synced 2025-08-19 00:48:16 +02:00
Revome the call to date and iconv system command each time a HTML file is genrated, call it just one time if directive Locale is defined at initialisation. Thanks to ammdispose for the report.
This commit is contained in:
parent
7b22d55fec
commit
1466dd37c1
@ -497,6 +497,14 @@ sub _init
|
||||
# Override verbose mode
|
||||
$self->{QuietMode} = 0 if ($debug);
|
||||
|
||||
# Enable local date format if defined, else strftime will be used. The limitation
|
||||
# this behavior is that all dates in HTML files will be the same for performences reasons.
|
||||
if ($self->{Locale}) {
|
||||
my $lang = 'LANG=' . $self->{Locale};
|
||||
$self->{start_date} = `$lang date | iconv -t $Translate{CharSet} 2>/dev/null`;
|
||||
chomp($self->{start_date});
|
||||
}
|
||||
|
||||
# Get the last parsing date for incremental parsing
|
||||
if (-e "$self->{Output}/SquidAnalyzer.current") {
|
||||
my $current = new IO::File;
|
||||
@ -1094,13 +1102,7 @@ sub _print_header
|
||||
{
|
||||
my ($self, $fileout, $menu, $calendar, $sortpos) = @_;
|
||||
|
||||
my $lang = '';
|
||||
if ($self->{Locale}) {
|
||||
$lang = 'LANG=' . $self->{Locale};
|
||||
}
|
||||
my $curdate = `$lang date | iconv -t $Translate{CharSet} 2>/dev/null`;
|
||||
chomp($curdate);
|
||||
my $now = $curdate || strftime("%a %b %e %H:%M:%S %Y", localtime);
|
||||
my $now = $self->{start_date} || strftime("%a %b %e %H:%M:%S %Y", localtime);
|
||||
$sortpos ||= 2;
|
||||
|
||||
print $$fileout qq{
|
||||
|
Loading…
x
Reference in New Issue
Block a user