line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::LedgerSMB::Admin; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
270959
|
use 5.006; |
|
4
|
|
|
|
|
10
|
|
4
|
4
|
|
|
4
|
|
13
|
use strict; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
72
|
|
5
|
4
|
|
|
4
|
|
11
|
use warnings FATAL => 'all'; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
528
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
App::LedgerSMB::Admin - Easily Manage LedgerSMB Installations |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Version 0.05 |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=cut |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our $VERSION = '0.05'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 SYNOPSIS |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
This module provides the basic routines for managing multiple major versions of |
23
|
|
|
|
|
|
|
LedgerSMB through a consistent toolkit. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
It contains basically two components: |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=over |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=item command line scripts |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=item libraries for writing management programs |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=back |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 BUNDLED CLI PROGRAMS |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head2 lsmb_reload |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Due to improper errors, this currently does not work properly with LedgerSMB |
40
|
|
|
|
|
|
|
1.3. It is expected that it will following the LedgerSMB 1.3.45 release |
41
|
|
|
|
|
|
|
(forthcoming). |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
The lsmb_reload application provides a command line tool for upgrading or |
44
|
|
|
|
|
|
|
rebuilding stored procedures and permissions of a LedgerSMB 1.3 or 1.4 database. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Due to shortcomings in error handling it does not work for LedgerSMB 1.3.44 and |
47
|
|
|
|
|
|
|
below. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
The program supports UNIX sockets as well as TCP/IP for connecting to the |
50
|
|
|
|
|
|
|
LedgerSMB database, and all aspects of the database connection may be controlled |
51
|
|
|
|
|
|
|
through the same environment variables as any other libpq program. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
The following options are supported: |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
--all Reload All Databases |
56
|
|
|
|
|
|
|
--help Print this message and exit |
57
|
|
|
|
|
|
|
--host hostname Database Host |
58
|
|
|
|
|
|
|
--path13 /example/path Path to LedgerSMB 1.3 installation |
59
|
|
|
|
|
|
|
--path14 /example/path2 Path to LedgerSMB 1.4 installation |
60
|
|
|
|
|
|
|
--port 5432 Database Poart |
61
|
|
|
|
|
|
|
--dbname database Reload the specified db, overridden by --all |
62
|
|
|
|
|
|
|
--username postgres Database Superuser to Log In As |
63
|
|
|
|
|
|
|
--prompt-password Prompt for Password (can use PGPASSWORD instead) |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 lsmb_createdb |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Due to improper errors, this currently does not work properly with LedgerSMB |
69
|
|
|
|
|
|
|
1.3. It is expected that it will following the LedgerSMB 1.3.45 release |
70
|
|
|
|
|
|
|
(forthcoming). |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
The lsmb_reload application provides a command line tool for upgrading or |
73
|
|
|
|
|
|
|
rebuilding stored procedures and permissions of a LedgerSMB 1.3 or 1.4 database. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
--help Print this message and exit |
76
|
|
|
|
|
|
|
--host hostname Database Host |
77
|
|
|
|
|
|
|
--path /example/path Path to LedgerSMB installation (required) |
78
|
|
|
|
|
|
|
--chart us/chart/General Chart of Accounts path (relative to sql) |
79
|
|
|
|
|
|
|
--gifi ca/gifi/General Path to GIFI |
80
|
|
|
|
|
|
|
--port 5432 Database Poart |
81
|
|
|
|
|
|
|
--dbname database Create db with the following name (required) |
82
|
|
|
|
|
|
|
--username postgres Database Superuser to Log In As |
83
|
|
|
|
|
|
|
--prompt-password Prompt for Password (can use PGPASSWORD instead) |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 Bundled Libraries |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head2 App::LedgerSMB::Admin |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Provides base version tracking and management routines |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head2 App::LedgerSMB::Admin::Database |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Routines to reload, create, update, backup, and restore databases |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head2 App::LedgerSMB::Admin::Database::Setting |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Look up settings in a LedgerSMB database |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head2 App::LedgerSMB::Admin::User |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Undeveloped, but will include basic user management routines. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS of This Library |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head2 add_paths(%versionhash) |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=cut |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
my %version_paths; |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
sub add_paths{ |
112
|
2
|
50
|
|
2
|
1
|
82
|
shift if $_[0] eq __PACKAGE__; |
113
|
2
|
|
|
|
|
5
|
my %version_hash = @_; |
114
|
2
|
|
|
|
|
7
|
%version_paths = (%version_paths, %version_hash); |
115
|
2
|
|
|
|
|
13
|
return %version_paths; |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head2 path_for($major_version) |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=cut |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
sub path_for{ |
123
|
3
|
50
|
|
3
|
1
|
9
|
shift if $_[0] eq __PACKAGE__; |
124
|
3
|
|
|
|
|
10
|
return $version_paths{$_[0]}; |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=head1 AUTHOR |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
Chris Travers, C<< >> |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=head1 BUGS |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
134
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
135
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=head1 SUPPORT |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
perldoc App::LedgerSMB::Admin |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
You can also look for information at: |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=over 4 |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker (report bugs here) |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
L |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
L |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=item * CPAN Ratings |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
L |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=item * Search CPAN |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
L |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=back |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
Copyright 2014 Chris Travers. |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
This program is distributed under the (Revised) BSD License: |
178
|
|
|
|
|
|
|
L |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without |
181
|
|
|
|
|
|
|
modification, are permitted provided that the following conditions |
182
|
|
|
|
|
|
|
are met: |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
* Redistributions of source code must retain the above copyright |
185
|
|
|
|
|
|
|
notice, this list of conditions and the following disclaimer. |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
* Redistributions in binary form must reproduce the above copyright |
188
|
|
|
|
|
|
|
notice, this list of conditions and the following disclaimer in the |
189
|
|
|
|
|
|
|
documentation and/or other materials provided with the distribution. |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
* Neither the name of Chris Travers's Organization |
192
|
|
|
|
|
|
|
nor the names of its contributors may be used to endorse or promote |
193
|
|
|
|
|
|
|
products derived from this software without specific prior written |
194
|
|
|
|
|
|
|
permission. |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
197
|
|
|
|
|
|
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
198
|
|
|
|
|
|
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
199
|
|
|
|
|
|
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
200
|
|
|
|
|
|
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
201
|
|
|
|
|
|
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
202
|
|
|
|
|
|
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
203
|
|
|
|
|
|
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
204
|
|
|
|
|
|
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
205
|
|
|
|
|
|
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
206
|
|
|
|
|
|
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
=cut |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
1; # End of App::LedgerSMB::Admin |