Skip to content

Commit

Permalink
fixes stat cache from tpyo#89
Browse files Browse the repository at this point in the history
  • Loading branch information
clphillips committed Dec 30, 2014
1 parent 8413f6f commit 0173fb4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion S3.php
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ public static function inputFile($file, $md5sum = true)
self::__triggerError('S3::inputFile(): Unable to open input file: '.$file, __FILE__, __LINE__);
return false;
}
clearstatcache(false, $file);
return array('file' => $file, 'size' => filesize($file), 'md5sum' => $md5sum !== false ?
(is_string($md5sum) ? $md5sum : base64_encode(md5_file($file, true))) : '');
}
Expand Down Expand Up @@ -634,8 +635,10 @@ public static function putObject($input, $bucket, $uri, $acl = self::ACL_PRIVATE
if (isset($input['size']) && $input['size'] >= 0)
$rest->size = $input['size'];
else {
if (isset($input['file']))
if (isset($input['file'])) {
clearstatcache(false, $input['file']);
$rest->size = filesize($input['file']);
}
elseif (isset($input['data']))
$rest->size = strlen($input['data']);
}
Expand Down

0 comments on commit 0173fb4

Please sign in to comment.