Bugzilla – Attachment 16115 Details for
Bug 7167
updatedatabase improvements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7167: Followup: Removes useless global variables
Bug-7167-Followup-Removes-useless-global-variables.patch (text/plain), 1.78 KB, created by
Jonathan Druart
on 2013-03-14 10:24:42 UTC
(
hide
)
Description:
Bug 7167: Followup: Removes useless global variables
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-03-14 10:24:42 UTC
Size:
1.78 KB
patch
obsolete
>From b62a975b79acaa89ce4c3e5ad0d659f3492837c5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 3 Dec 2012 16:39:10 +0100 >Subject: [PATCH] Bug 7167: Followup: Removes useless global variables > >Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu> >--- > C4/Update/Database.pm | 18 ++++++++++++------ > 1 file changed, 12 insertions(+), 6 deletions(-) > >diff --git a/C4/Update/Database.pm b/C4/Update/Database.pm >index 5a0d392..608e73b 100644 >--- a/C4/Update/Database.pm >+++ b/C4/Update/Database.pm >@@ -41,12 +41,18 @@ C4::Update::Database.pm > > =cut > >-my $VERSIONS_PATH = C4::Context->config('intranetdir') . '/installer/data/mysql/versions'; >+our $dbh = C4::Context->dbh; > >-my $version; >-my $list; >+=head2 get_versions_path > >-my $dbh = C4::Context->dbh; >+ return the path to the version files >+ >+=cut >+ >+sub get_versions_path { >+ return C4::Context->config('intranetdir') . '/installer/data/mysql/versions'; >+ >+} > > =head2 get_filepath > >@@ -57,7 +63,7 @@ my $dbh = C4::Context->dbh; > > sub get_filepath { > my ( $version ) = @_; >- my @files = File::Find::Rule->file->name( "$version.sql", "$version.pl" ) ->in( ( $VERSIONS_PATH ) ); >+ my @files = File::Find::Rule->file->name( "$version.sql", "$version.pl" ) ->in( ( get_versions_path() ) ); > > if ( scalar @files != 1 ) { > die "This version ($version) returned has ".scalar @files." corresponding, need only 1"; >@@ -169,7 +175,7 @@ sub execute_version { > sub list_versions_available { > my @versions; > >- my @files = File::Find::Rule->file->name( "*.sql", "*.pl" ) ->in( ( $VERSIONS_PATH ) ); >+ my @files = File::Find::Rule->file->name( "*.sql", "*.pl" ) ->in( ( get_versions_path() ) ); > > for my $f ( @files ) { > my @file_infos = fileparse( $f, qr/\.[^.]*/ ); >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7167
:
6377
|
6378
|
6379
|
6381
|
6414
|
6415
|
6416
|
6476
|
6477
|
6478
|
6479
|
6722
|
6832
|
7903
|
8178
|
9859
|
9860
|
9861
|
9862
|
10033
|
10034
|
10549
|
10666
|
10667
|
10668
|
10825
|
11129
|
11222
|
11223
|
11224
|
11225
|
11226
|
11227
|
11228
|
11229
|
11230
|
11231
|
11232
|
11235
|
11236
|
11237
|
11238
|
11239
|
11240
|
11241
|
11242
|
11243
|
11244
|
11245
|
11246
|
11571
|
13423
|
13424
|
13425
|
13426
|
13427
|
13428
|
13429
|
13430
|
13431
|
13432
|
13433
|
13434
|
13435
|
13436
|
13437
|
13456
|
13457
|
13509
|
13516
|
13517
|
13518
|
13519
|
13520
|
13521
|
13522
|
13523
|
13524
|
13525
|
13526
|
13527
|
13528
|
13529
|
13733
|
13734
|
13842
|
13845
|
13848
|
13851
|
13852
|
13853
|
13854
|
14310
|
16113
|
16114
| 16115 |
16116
|
16117
|
16596