Skip to content

Add pub/get.php worker shim (issues #2, #3)#6

Open
acourtiol wants to merge 1 commit into
opengento:mainfrom
acourtiol:feat/get-php-worker
Open

Add pub/get.php worker shim (issues #2, #3)#6
acourtiol wants to merge 1 commit into
opengento:mainfrom
acourtiol:feat/get-php-worker

Conversation

@acourtiol
Copy link
Copy Markdown

@acourtiol acourtiol commented May 11, 2026

Closes #2, closes #3 (the media half).

What

Adds the missing third pub-dir worker shim, alongside pub/index.php (App\Http) and pub/static.php (App\StaticResource):

// pub/get.php
\$frankengento = \Opengento\Application\App\Media::class;
include 'worker.php';

This routes media on-demand processing through the FrankenPHP worker pool, reusing the hot ObjectManager instead of a full per-request Magento bootstrap (~150–250 ms savings per missing-media fallback).

Companion PR

The App\Media class itself lands at opengento/magento2-application#1 — that PR must merge first, then this one references it via the opengento/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

  • Product Image Cache generation failure #2 (product image cache 404): in the current state, pub/get.php is left as stock Magento. When magento2-base ships a pub/get.php and 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 proper FRANKENPHP_WORKER_ENABLE env. Owning the file via extra.map + routing it through the worker fixes both symptoms.
  • Make all entry points benefits of shared bootsrap #3 (shared bootstrap for all entry points): closes the media half. The error-page entry points (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

Comment thread composer.json
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.
@acourtiol acourtiol force-pushed the feat/get-php-worker branch from e453534 to 06bbb77 Compare May 11, 2026 07:34
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.

Make all entry points benefits of shared bootsrap Product Image Cache generation failure

2 participants