Lines 41-52
C4::Update::Database.pm
Link Here
|
41 |
|
41 |
|
42 |
=cut |
42 |
=cut |
43 |
|
43 |
|
44 |
my $VERSIONS_PATH = C4::Context->config('intranetdir') . '/installer/data/mysql/versions'; |
44 |
our $dbh = C4::Context->dbh; |
45 |
|
45 |
|
46 |
my $version; |
46 |
=head2 get_versions_path |
47 |
my $list; |
|
|
48 |
|
47 |
|
49 |
my $dbh = C4::Context->dbh; |
48 |
return the path to the version files |
|
|
49 |
|
50 |
=cut |
51 |
|
52 |
sub get_versions_path { |
53 |
return C4::Context->config('intranetdir') . '/installer/data/mysql/versions'; |
54 |
|
55 |
} |
50 |
|
56 |
|
51 |
=head2 get_filepath |
57 |
=head2 get_filepath |
52 |
|
58 |
|
Lines 57-63
my $dbh = C4::Context->dbh;
Link Here
|
57 |
|
63 |
|
58 |
sub get_filepath { |
64 |
sub get_filepath { |
59 |
my ( $version ) = @_; |
65 |
my ( $version ) = @_; |
60 |
my @files = File::Find::Rule->file->name( "$version.sql", "$version.pl" ) ->in( ( $VERSIONS_PATH ) ); |
66 |
my @files = File::Find::Rule->file->name( "$version.sql", "$version.pl" ) ->in( ( get_versions_path() ) ); |
61 |
|
67 |
|
62 |
if ( scalar @files != 1 ) { |
68 |
if ( scalar @files != 1 ) { |
63 |
die "This version ($version) returned has ".scalar @files." corresponding, need only 1"; |
69 |
die "This version ($version) returned has ".scalar @files." corresponding, need only 1"; |
Lines 169-175
sub execute_version {
Link Here
|
169 |
sub list_versions_available { |
175 |
sub list_versions_available { |
170 |
my @versions; |
176 |
my @versions; |
171 |
|
177 |
|
172 |
my @files = File::Find::Rule->file->name( "*.sql", "*.pl" ) ->in( ( $VERSIONS_PATH ) ); |
178 |
my @files = File::Find::Rule->file->name( "*.sql", "*.pl" ) ->in( ( get_versions_path() ) ); |
173 |
|
179 |
|
174 |
for my $f ( @files ) { |
180 |
for my $f ( @files ) { |
175 |
my @file_infos = fileparse( $f, qr/\.[^.]*/ ); |
181 |
my @file_infos = fileparse( $f, qr/\.[^.]*/ ); |
176 |
- |
|
|