Add recursive filesize support to FileObject

This commit is contained in:
2012-01-05 00:43:49 +00:00
parent fcd7be1414
commit 885d12ceb7
2 changed files with 5 additions and 9 deletions

View File

@@ -2,22 +2,14 @@
class MediaListing_File extends MediaListing_FileObject {
protected $size;
public function __construct($path) {
if ( ! is_file($path)) {
throw new MediaListing_Exception_NotAFile($path);
}
parent::__construct(parent::TYPE_File, $path);
$this->size = filesize($this->path);
}
public function size() {
return $this->size;
}
}
?>