ZapMachine/kanban/tasks/023-anchor-zap-app-base-dir-to-dir-make-getzaptemplate.md

19 lines
813 B
Markdown
Raw Permalink Normal View History

2026-07-19 22:49:00 +02:00
---
id: 23
title: Anchor ZAP_APP_BASE_DIR to __DIR__, make getZAPTemplate throw
status: done
priority: low
created: 2026-07-17T03:58:37.157613187+02:00
updated: 2026-07-19T21:39:02.781954542+02:00
started: 2026-07-19T21:39:02.783424942+02:00
completed: 2026-07-19T21:39:02.783424942+02:00
tags:
- cleanup
claimed_by: rain-raven
claimed_at: 2026-07-19T21:39:02.781954542+02:00
class: standard
---
From framework review (docs/framework_review.md), P2-8/9. Two fixes in conf/init.php:
1. ZAP_APP_BASE_DIR = realpath('.'.DIRECTORY_SEPARATOR.'..') is cwd-dependent — breaks if entry point is not www/ or cli_scripts/. Use realpath(__DIR__ . '/..') instead.
2. getZAPTemplate returns ERROR_PREFIX . 'No template' string on missing file instead of throwing — inconsistent with other error paths. Make it throw.