Lines 30-42
$| = 1;
Link Here
|
30 |
my @images = Koha::CoverImages->as_list(); |
30 |
my @images = Koha::CoverImages->as_list(); |
31 |
my $image; |
31 |
my $image; |
32 |
my $i =0; |
32 |
my $i =0; |
33 |
print "Vous avez " . scalar @images . " images. \n"; |
33 |
print "You have " . scalar @images . " images. \n"; |
34 |
|
34 |
|
35 |
my $dbh = C4::Context->dbh; |
35 |
my $dbh = C4::Context->dbh; |
36 |
my $sth = $dbh->prepare("SELECT round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` FROM information_schema.TABLES WHERE table_schema = '$ENV{'KOHADB'}' AND table_name = 'cover_images';"); |
36 |
my $sth = $dbh->prepare("SELECT round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` FROM information_schema.TABLES WHERE table_schema = '$ENV{'KOHADB'}' AND table_name = 'cover_images';"); |
37 |
$sth->execute(); |
37 |
$sth->execute(); |
38 |
my @test = $sth->fetchrow_array(); |
38 |
my @test = $sth->fetchrow_array(); |
39 |
print "La taile de tout les images dans $ENV{'KOHADB'} est de ". $test[0]. "MG avant.\n"; |
39 |
print "The size of all images in $ENV{'KOHADB'} is ". $test[0]. "MG before.\n"; |
40 |
print "[..........] 0-1000 images \r ["; |
40 |
print "[..........] 0-1000 images \r ["; |
41 |
for ( @images ) { |
41 |
for ( @images ) { |
42 |
$i++; |
42 |
$i++; |
Lines 62-68
for ( @images ) {
Link Here
|
62 |
} |
62 |
} |
63 |
} |
63 |
} |
64 |
} |
64 |
} |
65 |
print "\n". $i . " images traité.\n"; |
65 |
print "\n". $i . " processed images.\n"; |
66 |
my $query = "optimize table cover_images"; |
66 |
my $query = "optimize table cover_images"; |
67 |
|
67 |
|
68 |
my $sthOp = $dbh->prepare($query); |
68 |
my $sthOp = $dbh->prepare($query); |
Lines 71-74
$sthOp->execute;
Link Here
|
71 |
|
71 |
|
72 |
$sth->execute(); |
72 |
$sth->execute(); |
73 |
@test = $sth->fetchrow_array(); |
73 |
@test = $sth->fetchrow_array(); |
74 |
print "La taile de tout les images dans $ENV{'KOHADB'} est de ". $test[0]. "MG apres.\n"; |
74 |
print "The size of all images in $ENV{'KOHADB'} is ". $test[0]. "MG after.\n"; |
75 |
- |
|
|