Files
zoneminder/web/api/app/Controller/Component
Isaac ConnorandClaude Opus 5.5 2353e6b137 refactor: remove PHP 4/5/7 compatibility code
PHP 8.0 is now the minimum, so these branches can no longer run:

- functions.php: str_starts_with/str_ends_with/str_contains polyfills;
  zm_random_bytes() fallbacks to mcrypt and openssl (random_bytes() is
  always there).
- auth.php: the password_hash() check in migrateHash().
- session.php: pre-7.3 setcookie()/session_set_cookie_params() forms
  without samesite, and the pre-5.4 is_session_started().
- stream.php: blocking sem_acquire() for PHP < 5.6.1, and the PHP < 5.6
  half of the 64 bit event id unpack check (the 32 bit PHP_INT_SIZE half
  stays).
- database.php: the magic quotes branch of dbEscape();
  get_magic_quotes_gpc() was removed in PHP 8.
- logger.php: the PHP >= 5.2 guards around error_get_last().
- Event.php, ImageComponent.php: the PHP < 4.3.10 sprintf('%.3f').
- image.php: the imagedestroy() branch for PHP < 8.

database.php keeps its PHP_VERSION_ID >= 80100 check, as 8.0 is still
supported.

Tests: tests/php/test_php_minimum.php checks the declared minimum in
composer.json, the platform check, the rpm and deb dependencies, and that
no PHP 4/5/7 version check is left in the web code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 23:05:05 -05:00
..