- Timestamp:
- 07/08/09 03:28:23 (1 year ago)
- Files:
-
- fFilesystem.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
fFilesystem.php
r600 r631 Hide Line Numbers 10 10 * @link http://flourishlib.com/fFilesystem 11 11 * 12 * @version 1.0.0b6 12 * @version 1.0.0b7 13 * @changes 1.0.0b7 Fixed ::formatFilesize() to work when `$bytes` equals zero [wb, 2009-07-08] 13 14 * @changes 1.0.0b6 Changed replacement values in preg_replace() calls to be properly escaped [wb, 2009-06-11] 14 15 * @changes 1.0.0b5 Changed ::formatFilesize() to use proper uppercase letters instead of lowercase [wb, 2009-06-02] … … 236 237 $suffixes = array('B', 'KB', 'MB', 'GB', 'TB'); 237 238 $sizes = array(1, 1024, 1048576, 1073741824, 1099511627776); 238 $suffix = floor(log($bytes)/6.9314718);239 $suffix = (!$bytes) ? 0 : floor(log($bytes)/6.9314718); 239 240 return number_format($bytes/$sizes[$suffix], $decimal_places) . $suffixes[$suffix]; 240 241 }
