Skip to content

compat: replace deprecated apc_*() with apcu_*() in ezcCacheApcBackend#6

Open
se7enxweb wants to merge 1 commit intozetacomponents:masterfrom
se7enxweb:security/fix-apc-to-apcu
Open

compat: replace deprecated apc_*() with apcu_*() in ezcCacheApcBackend#6
se7enxweb wants to merge 1 commit intozetacomponents:masterfrom
se7enxweb:security/fix-apc-to-apcu

Conversation

@se7enxweb
Copy link
Copy Markdown

Reported-by: CJW Network security audit 2026-03-01

Problem

The legacy apc extension was superseded by apcu in PHP 7+. The apc_* function names are unavailable without a compatibility shim, causing fatal undefined function errors at runtime.

Changes

src/backends/apc/apc_backend.php

Old New
apc_store() apcu_store()
apc_fetch() apcu_fetch()
apc_delete() apcu_delete()
apc_clear_cache("user") apcu_clear_cache()
apc_add() apcu_add()
Extension check: 'apc' 'apcu'

The legacy APC extension was replaced by APCu. The apc_* function names
are unavailable under PHP 7+ with only the apcu extension installed,
causing fatal 'undefined function' errors rather than graceful failures.

Changes:
- apc_store()      -> apcu_store()
- apc_fetch()      -> apcu_fetch()
- apc_delete()     -> apcu_delete()
- apc_clear_cache("user") -> apcu_clear_cache()
- apc_add()        -> apcu_add()
- Extension check: 'apc' -> 'apcu'
- Exception message updated to mention APCu

Reported-by: CJW Network security audit 2026-03-01
Fixes: undefined function errors on PHP 7+ without APC shim
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.

1 participant