Add pub/get.php worker shim (issues #2, #3)#6
Open
acourtiol wants to merge 1 commit into
Open
Conversation
thomas-kl1
requested changes
May 11, 2026
e3cf0ef to
e453534
Compare
Ships the missing third pub-dir worker shim alongside pub/index.php
(App\Http) and pub/static.php (App\StaticResource), routing media
on-demand processing through the FrankenPHP worker pool instead of a
fresh per-request Magento bootstrap.
pub/get.php
-> \$frankengento = \Opengento\Application\App\Media::class;
-> include 'worker.php';
The Media app implementation lands in the companion PR at
opengento/magento2-application (see PR description for the link).
composer.json
-------------
- Adds pub/get.php to extra.map so the file is copied into the
project's pub/ directory at install time (same mechanism as the
existing index.php and static.php entries).
- Bumps the require constraints to match the PHP 8.4+ / Magento 2.4.8+
support matrix:
php: (new) ^8.4
magento/magento2-base: * -> ^2.4.8
opengento/module-application: >=0.5 -> >=0.7
The >=0.7 bump assumes opengento/module-application releases a 0.7
after merging the companion PR. Tighten or loosen as appropriate
once the version is published.
Closes opengento#2 and opengento#3.
e453534 to
06bbb77
Compare
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.
Closes #2, closes #3 (the media half).
What
Adds the missing third pub-dir worker shim, alongside
pub/index.php(App\Http) andpub/static.php(App\StaticResource):This routes media on-demand processing through the FrankenPHP worker pool, reusing the hot
ObjectManagerinstead of a full per-request Magento bootstrap (~150–250 ms savings per missing-media fallback).Companion PR
The
App\Mediaclass itself lands at opengento/magento2-application#1 — that PR must merge first, then this one references it via theopengento/module-application: \">=0.7\"constraint bump in composer.json. If you want to review them together I'm happy to amend either side.Why it closes #2 and (the media half of) #3
pub/get.phpis left as stock Magento. Whenmagento2-baseships apub/get.phpand we don't, the file ends up running classic-mode bootstrap on every missing-media request — slow under PLP/PDP image load, and (depending on environment) prone to outright failure if the worker process doesn't have a properFRANKENPHP_WORKER_ENABLEenv. Owning the file viaextra.map+ routing it through the worker fixes both symptoms.pub/errors/*.php,pub/health_check.php,pub/cron.php) are out of scope for this PR — they're either dev-only or trivially lightweight. Happy to follow up on those separately if you'd like.Stacking
App\Mediaclass)