Revision 65b2387a
Von Moritz Bunkus vor mehr als 5 Jahren hinzugefügt
SL/DB/BackgroundJob.pm | ||
---|---|---|
11 | 11 |
use SL::DB::Manager::BackgroundJob; |
12 | 12 |
|
13 | 13 |
use SL::System::Process; |
14 |
use SL::YAML; |
|
14 | 15 |
|
15 | 16 |
__PACKAGE__->meta->initialize; |
16 | 17 |
|
... | ... | |
76 | 77 |
sub data_as_hash { |
77 | 78 |
my $self = shift; |
78 | 79 |
|
79 |
$self->data(YAML::Dump($_[0])) if @_; |
|
80 |
$self->data(SL::YAML::Dump($_[0])) if @_;
|
|
80 | 81 |
|
81 | 82 |
return {} if !$self->data; |
82 | 83 |
return $self->data if ref($self->{data}) eq 'HASH'; |
83 |
return YAML::Load($self->{data}) if !ref($self->{data}); |
|
84 |
return SL::YAML::Load($self->{data}) if !ref($self->{data});
|
|
84 | 85 |
return {}; |
85 | 86 |
} |
86 | 87 |
|
87 | 88 |
sub set_data { |
88 | 89 |
my ($self, %data) = @_; |
89 | 90 |
|
90 |
$self->data(YAML::Dump({ |
|
91 |
$self->data(SL::YAML::Dump({
|
|
91 | 92 |
%{ $self->data_as_hash }, |
92 | 93 |
%data, |
93 | 94 |
})); |
Auch abrufbar als: Unified diff
Module: gebundletes YAML durch dünnen Wrapper über YAML::XS & YAML ersetzt