Revision 276d6551
Von Sven Schöling vor mehr als 3 Jahren hinzugefügt
SL/Layout/Base.pm | ||
---|---|---|
44 | 44 |
} |
45 | 45 |
|
46 | 46 |
sub init_auto_reload_resources_param { |
47 |
return sprintf('?rand=%d-%d-%d', Time::HiRes::gettimeofday(), int(rand 1000000000000)) if $::lx_office_conf{debug}->{auto_reload_resources}; |
|
47 |
if ($::lx_office_conf{debug}->{auto_reload_resources}) { |
|
48 |
return sprintf('?rand=%d-%d-%d', Time::HiRes::gettimeofday(), int(rand 1000000000000)); |
|
49 |
} |
|
50 |
|
|
51 |
if ($::lx_office_conf{debug}{git_commit_reload_resources}) { |
|
52 |
my $git_dir = SL::System::Process::exe_dir() . '/.git'; |
|
48 | 53 |
|
49 |
my $git_dir = SL::System::Process::exe_dir() . '/.git';
|
|
54 |
return '' unless -d $git_dir;
|
|
50 | 55 |
|
51 |
return '' unless -d $git_dir;
|
|
56 |
my $content = eval { scalar(read_file($git_dir . '/HEAD')) };
|
|
52 | 57 |
|
53 |
my $content = eval { scalar(read_file($git_dir . '/HEAD')) };
|
|
58 |
return '' unless ($content // '') =~ m{\Aref: ([^\r\n]+)};
|
|
54 | 59 |
|
55 |
return '' unless ($content // '') =~ m{\Aref: ([^\r\n]+)};
|
|
60 |
$content = eval { scalar(read_file($git_dir . '/' . $1)) };
|
|
56 | 61 |
|
57 |
$content = eval { scalar(read_file($git_dir . '/' . $1)) };
|
|
62 |
return '' unless ($content // '') =~ m{\A([0-9a-fA-F]+)};
|
|
58 | 63 |
|
59 |
return '' unless ($content // '') =~ m{\A([0-9a-fA-F]+)}; |
|
64 |
return '?rand=' . $1; |
|
65 |
} |
|
60 | 66 |
|
61 |
return '?rand=' . $1;
|
|
67 |
return '';
|
|
62 | 68 |
} |
63 | 69 |
|
64 | 70 |
########################################## |
Auch abrufbar als: Unified diff
Layout::Base: git_commit_reload_resources config parameter
Ermöglicht das Ausschalten von git commit Resourcesversionierung das
bisher immer an war.