Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4c25956
chore: merge resumable changes
yenfryherrerafeliz Feb 10, 2026
b6a48a0
feat: merge and refactor tests
yenfryherrerafeliz Feb 10, 2026
17e7aab
chore: merge integ tests from resumable
yenfryherrerafeliz Feb 10, 2026
4dfbd99
chore: use annotation in tests
yenfryherrerafeliz Feb 12, 2026
1325a3f
chore: add filter checksum helper
yenfryherrerafeliz Feb 12, 2026
82573a0
chore: some unsupported class attributes leftover
yenfryherrerafeliz Feb 12, 2026
31d8335
feat: directory transfer enhancement
yenfryherrerafeliz Feb 23, 2026
c6b052a
chore: fix tests to include getHandlerList method
yenfryherrerafeliz Feb 23, 2026
eca52ae
chore: enhance s3 transfer manager tests for windows support
yenfryherrerafeliz Feb 23, 2026
ae2bf42
chore: enhance resolvesOutsideTargetDirectory to use dir separator
yenfryherrerafeliz Feb 23, 2026
a347716
chore: make directory transfers implements promisor
yenfryherrerafeliz Feb 24, 2026
3b819e8
chore: merge 'master' into s3_transfer_manager_improvements
yenfryherrerafeliz Mar 16, 2026
d58692e
chore: address PR feedback
yenfryherrerafeliz Mar 17, 2026
65712eb
chore: update dataProviders to phpunit10
yenfryherrerafeliz Mar 17, 2026
c124507
chore: typo in expected file path
yenfryherrerafeliz Mar 17, 2026
eef94ab
chore: make test valid for windows and linux
yenfryherrerafeliz Mar 17, 2026
8311ea8
chore: mute warnings
yenfryherrerafeliz Mar 17, 2026
bb114dd
chore: address PR feedback
yenfryherrerafeliz Mar 20, 2026
eb8d875
chore: remove space from constructor
yenfryherrerafeliz Mar 20, 2026
bc801fc
chore: address PR feedback
yenfryherrerafeliz Mar 26, 2026
af345d1
chore: add paginator result
yenfryherrerafeliz Mar 26, 2026
da6386b
chore: address some minor nits
yenfryherrerafeliz Mar 26, 2026
aba173e
chore: changelog entry
yenfryherrerafeliz Mar 30, 2026
e1f2b2e
chore: add empty line
yenfryherrerafeliz Mar 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"type": "enhancement",
"category": "S3",
"description": "Add new features and improvements to S3 Transfer Manager.\n\nNew Features:\n- Resume failed multipart uploads\n- Resume failed multipart downloads\n\nImprovements:\n- FileDownloadHandler now supports concurrent downloads for improved speed\n- Directory operations moved to an independent transfer utility\n- Directory operations now support both single object listeners and directory-level listeners, including a directory progress tracker"
}
]
28 changes: 27 additions & 1 deletion features/s3Transfer/s3TransferManager.feature
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Feature: S3 Transfer Manager
Examples:
| filename | content | checksum_algorithm |
| myfile-test-5-1.txt | This is a test file content #1 | crc32 |
| myfile-test-5-2.txt | This is a test file content #2 | crc32c |
| myfile-test-5-3.txt | This is a test file content #3 | sha256 |
| myfile-test-5-4.txt | This is a test file content #4 | sha1 |

Expand Down Expand Up @@ -139,4 +140,29 @@ Feature: S3 Transfer Manager
| file | size | algorithm | checksum |
| myfile-9-4 | 10485760 | crc32 | vMU7HA== |
| myfile-9-5 | 15728640 | crc32 | gjLQ1Q== |
| myfile-9-6 | 7340032 | crc32 | CKbfZQ== |
| myfile-9-6 | 7340032 | crc32 | CKbfZQ== |

Scenario Outline: Resume multipart download
Given I have a file <file> in S3 that requires multipart download
When I try the download for file <file>, with resume enabled, it fails
Then A resumable file for file <file> must exists
Then We resume the download for file <file> and it should succeed
Examples:
| file |
| resume-download-file-1.txt |
| resume-download-file-2.txt |
| resume-download-file-3.txt |
| resume-download-file-4.txt |

Scenario Outline: Resume multipart upload
Given I have a file <file> on disk that requires multipart upload
When I try to upload the file <file>, with resume enabled, it fails
Then A resumable file for file <file> must exists
Then We resume the upload for file <file> and it should succeed
Then The file <file> in s3 should match the local file
Examples:
| file |
| resume-upload-file-1.txt |
| resume-upload-file-2.txt |
| resume-upload-file-3.txt |
| resume-upload-file-4.txt |
29 changes: 27 additions & 2 deletions src/S3/CalculatesChecksumTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

trait CalculatesChecksumTrait
{
private static $supportedAlgorithms = [
public static array $supportedAlgorithms = [
'crc32c' => true,
'crc32' => true,
'sha256' => true,
Expand Down Expand Up @@ -47,7 +47,13 @@ public static function getEncodedValue($requestedAlgorithm, $value) {
if ($requestedAlgorithm === "crc32") {
$requestedAlgorithm = "crc32b";
}
return base64_encode(Psr7\Utils::hash($value, $requestedAlgorithm, true));

return base64_encode(
Psr7\Utils::hash(Psr7\Utils::streamFor($value),
$requestedAlgorithm,
true
)
);
}

$validAlgorithms = implode(', ', array_keys(self::$supportedAlgorithms));
Expand All @@ -56,4 +62,23 @@ public static function getEncodedValue($requestedAlgorithm, $value) {
. " Valid algorithms supported by the runtime are {$validAlgorithms}."
);
}

/**
* Returns the first checksum available, if available.
*
* @param array $parameters
*
* @return string|null
*/
public static function filterChecksum(array $parameters): ?string
{
foreach (self::$supportedAlgorithms as $algorithm => $_) {
$checksumAlgorithm = "Checksum" . strtoupper($algorithm);
if (isset($parameters[$checksumAlgorithm])) {
return $checksumAlgorithm;
}
}

return null;
}
}
Loading