line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catalyst::Helper::Model::DBI; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5313
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
43
|
|
4
|
1
|
|
|
1
|
|
4
|
use File::Spec; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
139
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.32'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Catalyst::Helper::Model::DBI - Helper for DBI Models |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
script/create.pl model DBI DBI dsn user password |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 DESCRIPTION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Helper for DBI Model. |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head2 METHODS |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=over 4 |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=item mk_compclass |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Reads the database and makes a main model class |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=item mk_comptest |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Makes tests for the DBI Model. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=back |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub mk_compclass { |
37
|
0
|
|
|
0
|
1
|
|
my ( $self, $helper, $dsn, $user, $pass ) = @_; |
38
|
0
|
|
0
|
|
|
|
$helper->{dsn} = $dsn || ''; |
39
|
0
|
|
0
|
|
|
|
$helper->{user} = $user || ''; |
40
|
0
|
|
0
|
|
|
|
$helper->{pass} = $pass || ''; |
41
|
0
|
|
|
|
|
|
my $file = $helper->{file}; |
42
|
0
|
|
|
|
|
|
$helper->render_file( 'dbiclass', $file ); |
43
|
0
|
|
|
|
|
|
return 1; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 SEE ALSO |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
L<Catalyst::Manual>, L<Catalyst::Test>, L<Catalyst::Request>, |
49
|
|
|
|
|
|
|
L<Catalyst::Response>, L<Catalyst::Helper> |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 AUTHOR |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Alex Pavlovic, C<alex.pavlovic@taskforce-1.com> |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 LICENSE |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
This library is free software . You can redistribute it and/or modify |
58
|
|
|
|
|
|
|
it under the same terms as perl itself. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=cut |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
__DATA__ |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__dbiclass__ |
66
|
|
|
|
|
|
|
package [% class %]; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
use strict; |
69
|
|
|
|
|
|
|
use warnings; |
70
|
|
|
|
|
|
|
use parent 'Catalyst::Model::DBI'; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
__PACKAGE__->config( |
73
|
|
|
|
|
|
|
dsn => '[% dsn %]', |
74
|
|
|
|
|
|
|
user => '[% user %]', |
75
|
|
|
|
|
|
|
password => '[% pass %]', |
76
|
|
|
|
|
|
|
options => {}, |
77
|
|
|
|
|
|
|
); |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 NAME |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
[% class %] - DBI Model Class |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 SYNOPSIS |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
See L<[% app %]> |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 DESCRIPTION |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
DBI Model Class. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head1 AUTHOR |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
[% author %] |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 LICENSE |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
This library is free software, you can redistribute it and/or modify |
98
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=cut |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
1; |