Skip to content

Commit 0173fb4

Browse files
committed
fixes stat cache from #89
1 parent 8413f6f commit 0173fb4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

S3.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ public static function inputFile($file, $md5sum = true)
561561
self::__triggerError('S3::inputFile(): Unable to open input file: '.$file, __FILE__, __LINE__);
562562
return false;
563563
}
564+
clearstatcache(false, $file);
564565
return array('file' => $file, 'size' => filesize($file), 'md5sum' => $md5sum !== false ?
565566
(is_string($md5sum) ? $md5sum : base64_encode(md5_file($file, true))) : '');
566567
}
@@ -634,8 +635,10 @@ public static function putObject($input, $bucket, $uri, $acl = self::ACL_PRIVATE
634635
if (isset($input['size']) && $input['size'] >= 0)
635636
$rest->size = $input['size'];
636637
else {
637-
if (isset($input['file']))
638+
if (isset($input['file'])) {
639+
clearstatcache(false, $input['file']);
638640
$rest->size = filesize($input['file']);
641+
}
639642
elseif (isset($input['data']))
640643
$rest->size = strlen($input['data']);
641644
}

0 commit comments

Comments
 (0)