Files
tinker_tickets/config/requirements.php
T
jaredandClaude Sonnet 5 1e972fe7dc Add memory_limit/max_execution_time sanity checks (#106)
config/requirements.php only checked PHP version and 6 extensions. A
deployment on a host with a low default memory_limit (e.g. shared-
hosting-style 128M) passed the startup requirements check cleanly and
only surfaced as a mysterious failure under real load — a large CSV
export, an oversized dashboard query on a big install.

Added min_memory_limit_mb (256) and min_max_execution_time (30s)
thresholds to config/requirements.php, checked as warnings (not hard
failures, since a low limit doesn't break every request) in both
scripts/check_requirements.php (CI) and api/health.php (production
monitoring). -1/0 (unlimited) always passes.

Verified the ini-size parsing and warning logic directly with
low/high/unlimited memory_limit and max_execution_time values.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MGDKHiU5RJdo3dqQUDow3X
2026-09-08 11:58:20 -04:00

36 lines
1.4 KiB
PHP

<?php
/**
* Runtime requirements — single source of truth.
*
* Consumed by:
* - scripts/check_requirements.php (CI: fails the build if unmet)
* - api/health.php (production: surfaces drift to monitoring)
*
* This exists because a PHP upgrade once silently dropped the ldap extension,
* which broke avatars with no visible error. Keep this list in sync with the
* extensions the code actually relies on.
*/
return [
// Minimum supported PHP version (production runs 8.4).
'min_php_version' => '8.2',
// Extensions the application requires to function.
'required_extensions' => [
'ldap', // api/user_avatar.php — lldap avatar lookups
'mysqli', // helpers/Database.php — all data access
'curl', // helpers/NotificationHelper.php, SynapseHelper.php — Matrix
'mbstring', // multibyte string handling
'fileinfo', // api/upload_attachment.php — MIME validation
'json', // request/response encoding (bundled, but assert anyway)
],
// Sanity-check thresholds (warnings, not hard failures). A host with a low
// default memory_limit passes a bare extension/version check cleanly and
// only surfaces as a mysterious failure under real load — a large CSV
// export, an oversized dashboard query on a big install.
'min_memory_limit_mb' => 256,
'min_max_execution_time' => 30, // seconds; 0 (unlimited) always passes
];