From 28e3195e36b7cc40c9c7218569cf677369b02e56 Mon Sep 17 00:00:00 2001 From: Davide Franco Date: Mon, 13 Jun 2011 20:21:01 +0200 Subject: [PATCH] bacula-web: Removed useless human_file_size function from bweb.inc.php --- gui/bacula-web/includes/bweb.inc.php | 36 +--------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/gui/bacula-web/includes/bweb.inc.php b/gui/bacula-web/includes/bweb.inc.php index d4b877d3e5..60c1182fd4 100644 --- a/gui/bacula-web/includes/bweb.inc.php +++ b/gui/bacula-web/includes/bweb.inc.php @@ -112,41 +112,7 @@ class Bweb extends DB { { $this->db_link->disconnect(); } - - // Return humanized size with default unit of GB - // if auto provide for unit argument, automaticaly decide which unit - function human_file_size( $size, $decimal = 2, $unit = 'auto' ) - { - $unit_id = 0; - $lisible = false; - $units = array('B','KB','MB','GB','TB'); - $hsize = $size; - - switch( $unit ) - { - case 'auto'; - while( !$lisible ) { - if ( $hsize >= 1024 ) { - $hsize = $hsize / 1024; - $unit_id += 1; - } - else - $lisible = true; - } // end while - break; - - default: - $p = array_search( $unit, $units); - $hsize = $hsize / pow(1024,$p); - break; - } // end switch - - $hsize = sprintf("%." . $decimal . "f", $hsize); - $hsize = $hsize . ' ' . $units[$unit_id]; - return $hsize; - } // end function - - + function GetDbSize() { $database_size = 0; -- 2.39.5