line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Context::Loader::DB; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Created on: 2016-01-18 13:31:41 |
4
|
|
|
|
|
|
|
# Create by: Ivan Wills |
5
|
|
|
|
|
|
|
# $Id$ |
6
|
|
|
|
|
|
|
# $Revision$, $HeadURL$, $Date$ |
7
|
|
|
|
|
|
|
# $Revision$, $Source$, $Date$ |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
69012
|
use Moose; |
|
2
|
|
|
|
|
466632
|
|
|
2
|
|
|
|
|
13
|
|
10
|
2
|
|
|
2
|
|
14922
|
use namespace::autoclean; |
|
2
|
|
|
|
|
8189
|
|
|
2
|
|
|
|
|
13
|
|
11
|
2
|
|
|
2
|
|
592
|
use version; |
|
2
|
|
|
|
|
1930
|
|
|
2
|
|
|
|
|
15
|
|
12
|
2
|
|
|
2
|
|
150
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
133
|
|
13
|
2
|
|
|
2
|
|
623
|
use Data::Dumper qw/Dumper/; |
|
2
|
|
|
|
|
6701
|
|
|
2
|
|
|
|
|
115
|
|
14
|
2
|
|
|
2
|
|
523
|
use English qw/ -no_match_vars /; |
|
2
|
|
|
|
|
3706
|
|
|
2
|
|
|
|
|
14
|
|
15
|
2
|
|
|
2
|
|
1294
|
use Data::Context::Util qw/do_require/; |
|
2
|
|
|
|
|
6009
|
|
|
2
|
|
|
|
|
102
|
|
16
|
2
|
|
|
2
|
|
1482
|
use JSON::XS; |
|
2
|
|
|
|
|
12210
|
|
|
2
|
|
|
|
|
239
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = version->new('0.0.1'); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
extends 'Data::Context::Loader'; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub changed { |
23
|
1
|
|
|
1
|
1
|
18343
|
return 0; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__ |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 NAME |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Data::Context::Loader::DB - Loads a config from a table in a database |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 VERSION |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
This documentation refers to Data::Context::Loader::DB version 0.0.1 |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 SYNOPSIS |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
use Data::Context::Loader::DB; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# Load data from table |
46
|
|
|
|
|
|
|
my $file = Data::Context::Loader::DB->new( |
47
|
|
|
|
|
|
|
table => '', |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 DESCRIPTION |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Loads configs found by L<Data::Context::Finder::DB> and performs checks to |
53
|
|
|
|
|
|
|
see if the configs have changed. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 C<changed ()> |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Name the section accordingly. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 C<loader ($str)> |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 C<load ()> |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 DIAGNOSTICS |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 CONFIGURATION AND ENVIRONMENT |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 DEPENDENCIES |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 INCOMPATIBILITIES |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 BUGS AND LIMITATIONS |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
There are no known bugs in this module. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Please report problems to Ivan Wills (ivan.wills@gmail.com). |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Patches are welcome. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 AUTHOR |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Ivan Wills - (ivan.wills@gmail.com) |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Copyright (c) 2016 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077). |
90
|
|
|
|
|
|
|
All rights reserved. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
This module is free software; you can redistribute it and/or modify it under |
93
|
|
|
|
|
|
|
the same terms as Perl itself. See L<perlartistic>. This program is |
94
|
|
|
|
|
|
|
distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
95
|
|
|
|
|
|
|
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
96
|
|
|
|
|
|
|
PARTICULAR PURPOSE. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=cut |