Revision 65b2387a
Von Moritz Bunkus vor mehr als 5 Jahren hinzugefügt
SL/Menu.pm | ||
---|---|---|
3 | 3 |
use strict; |
4 | 4 |
|
5 | 5 |
use SL::Auth; |
6 |
use YAML (); |
|
7 | 6 |
use File::Spec; |
8 | 7 |
use SL::MoreCommon qw(uri_encode); |
9 |
|
|
10 |
our $yaml_xs; |
|
11 |
BEGIN { |
|
12 |
$yaml_xs = eval { require YAML::XS }; |
|
13 |
} |
|
8 |
use SL::YAML; |
|
14 | 9 |
|
15 | 10 |
our %menu_cache; |
16 | 11 |
|
... | ... | |
29 | 24 |
for my $file (@files) { |
30 | 25 |
my $data; |
31 | 26 |
eval { |
32 |
if ($yaml_xs) { |
|
33 |
$data = YAML::XS::LoadFile(File::Spec->catfile($path, $file)); |
|
34 |
} else { |
|
35 |
$data = YAML::LoadFile(File::Spec->catfile($path, $file)); |
|
36 |
} |
|
27 |
$data = SL::YAML::LoadFile(File::Spec->catfile($path, $file)); |
|
37 | 28 |
1; |
38 | 29 |
} or do { |
39 | 30 |
die "Error while parsing $file: $@"; |
Auch abrufbar als: Unified diff
Module: gebundletes YAML durch dünnen Wrapper über YAML::XS & YAML ersetzt