From ed38cd441b4a618bcfefea68476262e4c584c3f7 Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Thu, 27 Dec 2012 14:02:54 -0500 Subject: [PATCH] Revert "Bug 7167: Followup: Removes useless global variables" This reverts commit 754392ed88a22aac43172d7e12f4621dae8d8484. --- C4/Update/Database.pm | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/C4/Update/Database.pm b/C4/Update/Database.pm index 608e73b794..5a0d392393 100644 --- a/C4/Update/Database.pm +++ b/C4/Update/Database.pm @@ -41,18 +41,12 @@ C4::Update::Database.pm =cut -our $dbh = C4::Context->dbh; +my $VERSIONS_PATH = C4::Context->config('intranetdir') . '/installer/data/mysql/versions'; -=head2 get_versions_path +my $version; +my $list; - return the path to the version files - -=cut - -sub get_versions_path { - return C4::Context->config('intranetdir') . '/installer/data/mysql/versions'; - -} +my $dbh = C4::Context->dbh; =head2 get_filepath @@ -63,7 +57,7 @@ sub get_versions_path { sub get_filepath { my ( $version ) = @_; - my @files = File::Find::Rule->file->name( "$version.sql", "$version.pl" ) ->in( ( get_versions_path() ) ); + my @files = File::Find::Rule->file->name( "$version.sql", "$version.pl" ) ->in( ( $VERSIONS_PATH ) ); if ( scalar @files != 1 ) { die "This version ($version) returned has ".scalar @files." corresponding, need only 1"; @@ -175,7 +169,7 @@ sub execute_version { sub list_versions_available { my @versions; - my @files = File::Find::Rule->file->name( "*.sql", "*.pl" ) ->in( ( get_versions_path() ) ); + my @files = File::Find::Rule->file->name( "*.sql", "*.pl" ) ->in( ( $VERSIONS_PATH ) ); for my $f ( @files ) { my @file_infos = fileparse( $f, qr/\.[^.]*/ ); -- 2.39.5