Problem
ProjectGraph already discovers templates/*.php for phpc build --project dry-run (#504 ✅, test/unit/ProjectGraphTest.php). Router renders views with:
include __DIR__ . '/../templates/layout.php';
VM phpc serve keeps sources on disk, so __DIR__ resolves. A relocated native binary (production CGI, #50, #180) may run with a different cwd and no sibling templates/ tree — includes fail silently or with missing-file errors even when link succeeds (#568).
Goal
Documented, testable deploy root so AOT bundles resolve template paths outside the compile tree:
cd examples/003-MiniWebApp
../../phpc build --project .
PHPC_DEPLOY_ROOT=/opt/miniwebapp ./.phpc/bin/app # finds bundled templates
Scope
Out of scope
- PSR-4 autoload (#155)
- nginx/FastCGI wiring (#445)
Acceptance criteria
make docker-build-22 # once
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
bash -lc './script/ci-local.sh --filter DeployRootTest'
# or harness: ./script/docker-ci-local.sh --filter DeployRootTest
Test passes when binary run from a non-source cwd prints expected HTML fragment.
Links
- North star: #78 Phase 3 Web AOT
- Blocked by / pairs with: #568, #180, #485
- Reference app:
examples/003-MiniWebApp/
Problem
ProjectGraphalready discoverstemplates/*.phpforphpc build --projectdry-run (#504 ✅,test/unit/ProjectGraphTest.php).Routerrenders views with:VM
phpc servekeeps sources on disk, so__DIR__resolves. A relocated native binary (production CGI, #50, #180) may run with a different cwd and no siblingtemplates/tree — includes fail silently or with missing-file errors even when link succeeds (#568).Goal
Documented, testable deploy root so AOT bundles resolve template paths outside the compile tree:
Scope
PHPC_DEPLOY_ROOT(or manifest fielddeployRoot) consumed by AOT runtime /SourceBundlerinclude resolverphpc deploy/ #180 copiestemplates/+assets/beside binary using same rootOut of scope
Acceptance criteria
Test passes when binary run from a non-source cwd prints expected HTML fragment.
Links
examples/003-MiniWebApp/