Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/SapiKvOps.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ public function pttl(string $key): int

public function flush(): bool
{
// ephpm_kv_flush_all() was added after the original SAPI surface
// (ePHPm v0.1.2). Guard it so the drop-in still works on older
// runtimes: flush is simply unavailable there (wp_cache_flush()
// returns false and entries age out via TTL) rather than fataling
// the request with "Call to undefined function".
if (!\function_exists('ephpm_kv_flush_all')) {
return false;
}
return (bool) \ephpm_kv_flush_all();
}
}
Loading