[3.x] Support custom media directories in the realtime compiler - #2587
Merged
Conversation
The serve command resolves the configured media directories and passes them to the server process, so media requests keep the fast path that proxies the file without booting the application. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2587 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 1811 1811
===========================================
Files 184 184
Lines 4494 4494
===========================================
Hits 4494 4494 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Member
Author
|
• QA result: PASS — no issues found.
─ Worked for 5m 33s ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── gpt-5.6-luna xhigh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hyde serveto the server process asHYDE_SERVER_MEDIA_DIRECTORYandHYDE_SERVER_MEDIA_OUTPUT_DIRECTORY, using the existing environment plumbingAssetFileLocatorinstead of hardcoding_mediaandmedia/, so a project using themedia_directoryconfig option gets its media served instead of 404sHyde::getMediaOutputDirectory(), which was hardcoded tomedia/as wellRequests that require the framework boot a fresh application, so resolved configuration cannot be shared with the pre-boot media fast path through application memory. The server process environment is where it can live instead, without paying for a bootstrap on every asset request. The defaults still apply when the server is started directly, such as through the Herd integration, where there is no serve command to resolve them.
Changing the media directory while the server is running is not picked up, since the values are resolved at startup. Restarting the server is the expected response, and this is not documented.
Tests
UnitFramework: 1,922 passed, with the documented PHP 8.5FeaturedImageUnitTestfailure remainingServeCommandunit and feature tests: 53 passed, including a regression test that a custom media directory is resolved into the server environmentphp monorepo/HydeStan/run.php: no errors🤖 Generated with Claude Code