diff --git a/admin/include/functions.php b/admin/include/functions.php index fac387eed..3d8ffa756 100644 --- a/admin/include/functions.php +++ b/admin/include/functions.php @@ -625,32 +625,6 @@ function get_fs_directories($path, $recursive = true) return $dirs; } -/** - * returns the size (in bytes) of a filesystem directory - * - * @since 11 - * @param string path - * @return int - */ -function get_fs_directory_size($path) -{ - $bytestotal = 0; - $path = realpath($path); - - if (!function_exists('exec')) - { - return false; - } - - @exec('du -sk '.$path, $returnarray); - if (is_array($returnarray) and !empty($returnarray[0]) and preg_match('/^(\d+)\s/', $returnarray[0], $matches)) - { - $bytestotal = $matches[1] * 1024; - } - - return $bytestotal; -} - /** * save the rank depending on given categories order * diff --git a/admin/intro.php b/admin/intro.php index ad14b8ccf..c3219a92c 100644 --- a/admin/intro.php +++ b/admin/intro.php @@ -409,24 +409,6 @@ if (isset($result[0]['SUM(filesize)'])) $data_storage['Formats'] = $result[0]['SUM(filesize)']; } -// Windows can't execute get_fs_directory_size correctly -if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') -{ - if (!isset($_SESSION['cachedir_info']) or $_SESSION['cachedir_info']['calculated_on'] < strtotime('5 minutes ago')) - { - $start_time = get_moment(); - - $_SESSION['cachedir_info'] = array( - 'size' => get_fs_directory_size($conf['data_location']), - 'calculated_on' => time(), - ); - - $logger->debug('[admin/intro::'.__LINE__.'] cache size calculated in '.get_elapsed_time($start_time, get_moment()).' ('.$_SESSION['cachedir_info']['size'].' bytes)'); - } - - $data_storage['Cache'] = $_SESSION['cachedir_info']['size'] / 1000; -} - //Calculate total storage $total_storage = 0; foreach ($data_storage as $value)