Skip to content

#port-1x-s3trait-methods Port setPublicPermissions, listFilesWithUrls, listFiles from 1.x - #11

Merged
steinkel merged 1 commit into
2.next-cake5from
feature/port-1x-s3trait-methods
May 29, 2026
Merged

steinkel merged 1 commit into
2.next-cake5from
feature/port-1x-s3trait-methods

Conversation

@steinkel

Copy link
Copy Markdown
Member

Summary

Ports three S3Trait methods present in the 1.next-cake4 branch (PRs #5 and #7) but missing from 2.next-cake5:

  • setPublicPermissions(string $key) — sets public-read ACL on an S3 object
  • listFilesWithUrls(string $prefix, int $maxKeys) — lists objects and appends a presigned GET URL to each
  • listFiles(string $prefix, int $maxKeys) — lists objects filtered by prefix

Methods are adapted to the 2.next conventions: use getS3Client(), Configure::readOrFail(), and typed closures. AwsException is caught and re-thrown as a plain Exception with a descriptive message.

Test Plan

  • vendor/bin/phpunit tests/TestCase/Util/S3TraitTest.php --no-coverage — 11 tests, 22 assertions, all green
  • vendor/bin/phpcs src/Util/S3Trait.php tests/TestCase/Util/S3TraitTest.php — no violations

@steinkel
steinkel merged commit ac0573e into 2.next-cake5 May 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant