Skip to content

Use CakePHP HTTP streams on CakePHP 6 - #43

Merged
ADmad merged 1 commit into
ADmad:cake6from
josbeir:fix/cake6-http-streams
Nov 14, 2026
Merged

ADmad merged 1 commit into
ADmad:cake6from
josbeir:fix/cake6-http-streams

Conversation

@josbeir

@josbeir josbeir commented Nov 14, 2026

Copy link
Copy Markdown

Current CakePHP 6 development builds no longer install laminas/laminas-diactoros. Glide still instantiates its Stream class when serving transformed images and original files, causing Class "Laminas\Diactoros\Stream" not found on a fresh installation.

Use Cake\Http\Stream in the response factory and original-file middleware. Update the stream assertion and verify transformed PNG dimensions, content type and length, plus byte-for-byte original-file responses.

Validation on PHP 8.5.12 and CakePHP 6.x-dev at 0b8a615, without Diactoros installed:

  • Reproduced 8 errors and 1 failure before the fix.
  • PHPUnit: 19 tests / 50 assertions pass with both Glide 3.2.0 and 4.2.0 using --display-all-issues --fail-on-all-issues.
  • CakePHP 6 PHPCS, PHPStan level 8, and Psalm 7 pass with no errors.
  • composer validate --strict and git diff --check pass.

@ADmad
ADmad merged commit 191c26c into ADmad:cake6 Nov 14, 2026
6 checks passed
@josbeir
josbeir deleted the fix/cake6-http-streams branch November 14, 2026 15:35
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.

2 participants