Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Latest commit

 

History

History
23 lines (16 loc) · 548 Bytes

File metadata and controls

23 lines (16 loc) · 548 Bytes

ExtendedSPLFileInfo

PHP class extends SPLFileInfo

Methods

  • getRealSize() - size of directory contents (recursive) or file if isFile

  • getFileMTime() - MTime of most recent directory contents (recursive) or file if isFile

  • getHumanSize() - human readable filesize, %.2f {$factor}. default from $this->getRealSize()

Usage

$iterator = new FilesystemIterator(dirname(__FILE__));
$iterator->setInfoClass('ExtendedSPLFileInfo');
foreach ($iterator as $file) {
	echo $file->getRealSize() . PHP_EOL;
}