diff options
| author | Eric Johansson (neku) <neku@pomf.se> | 2015-02-05 20:06:08 +0100 |
|---|---|---|
| committer | Eric Johansson (neku) <neku@pomf.se> | 2015-02-05 20:06:08 +0100 |
| commit | b816236168e74309be4a298ff0a4644a732dc9f3 (patch) | |
| tree | 1497dced7d755362dcdfd73b7e11d78b04597f2d /static/classes/UploadedFile.class.php | |
| parent | c359aa20cd0876e1e497aca1ff19e4c54287b6c2 (diff) | |
| parent | fd98101d073805fc42474a00bca640a618f99de6 (diff) | |
Merge pull request #27 from cenci0/master
Minor code refactoring and improvements
Diffstat (limited to 'static/classes/UploadedFile.class.php')
| -rw-r--r-- | static/classes/UploadedFile.class.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/static/classes/UploadedFile.class.php b/static/classes/UploadedFile.class.php index 5b7ba9b..102d6d9 100644 --- a/static/classes/UploadedFile.class.php +++ b/static/classes/UploadedFile.class.php @@ -4,9 +4,9 @@ class UploadedFile { /* Public attributes */ public $name; public $mime; + public $size; public $tempfile; public $error; - public $size; /* Cached checksums */ private $sha1; @@ -14,17 +14,24 @@ class UploadedFile { /** * Generates the SHA1 or returns the cached SHA1 hash for the file. + * + * @return string */ public function get_sha1 () { - if (! $this->sha1) $this->sha1 = sha1_file($this->tempfile); + if (!$this->sha1) + $this->sha1 = sha1_file($this->tempfile); return $this->sha1; } + /** * Generates the CRC32 or returns the cached CRC32 hash for the file. + * + * @return string */ public function get_crc32 () { - if (! $this->crc32) $this->crc32 = hash_file('crc32b', $this->tempfile); + if (!$this->crc32) + $this->crc32 = hash_file('crc32b', $this->tempfile); return $this->crc32; } |
