From 318ea27c8d570397de5922ea015d7a928deee148 Mon Sep 17 00:00:00 2001 From: Daniel Pakuschewski Date: Sun, 18 Sep 2011 13:24:56 -0300 Subject: [PATCH] File::info() return the file size. --- lib/Cake/Test/Case/Utility/FileTest.php | 2 +- lib/Cake/Utility/File.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Test/Case/Utility/FileTest.php b/lib/Cake/Test/Case/Utility/FileTest.php index 6caad2839..2ec65437f 100644 --- a/lib/Cake/Test/Case/Utility/FileTest.php +++ b/lib/Cake/Test/Case/Utility/FileTest.php @@ -74,7 +74,7 @@ class FileTest extends CakeTestCase { $result = $this->File->info(); $expecting = array( 'dirname' => dirname(__FILE__), 'basename' => basename(__FILE__), - 'extension' => 'php', 'filename' =>'FileTest' + 'extension' => 'php', 'filename' =>'FileTest', 'filesize' => filesize($file) ); $this->assertEquals($expecting, $result); diff --git a/lib/Cake/Utility/File.php b/lib/Cake/Utility/File.php index 6f3c2c02e..11d409d6d 100644 --- a/lib/Cake/Utility/File.php +++ b/lib/Cake/Utility/File.php @@ -290,6 +290,9 @@ class File { if (!isset($this->info['filename'])) { $this->info['filename'] = $this->name(); } + if (!isset($this->info['filesize'])) { + $this->info['filesize'] = $this->size(); + } return $this->info; }