Remove any confusing legacy sizing files; everything in the panel is true MB (1000) not MiB

This commit is contained in:
Dane Everitt 2020-05-08 21:13:39 -07:00
parent 2d95204e9a
commit 6967b76ae6
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 0 additions and 107 deletions

View file

@ -1,28 +0,0 @@
<?php
namespace Pterodactyl\Providers;
use Illuminate\Support\Facades\File;
use Illuminate\Support\ServiceProvider;
class MacroServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*/
public function boot()
{
File::macro('humanReadableSize', function ($path, $precision = 2) {
$size = File::size($path);
static $units = ['B', 'kB', 'MB', 'GB', 'TB'];
$i = 0;
while (($size / 1024) > 0.9) {
$size = $size / 1024;
$i++;
}
return round($size, ($i < 2) ? 0 : $precision) . ' ' . $units[$i];
});
}
}