From 6108a80beecded514edf494c08795c0fea292f07 Mon Sep 17 00:00:00 2001 From: Alexander Polyakov Date: Mon, 8 Dec 2025 13:13:55 +0300 Subject: [PATCH] move extension_loaded to runtime-common --- builtin-functions/kphp-light/stdlib/system-functions.txt | 2 ++ runtime-common/stdlib/system/system-functions.h | 4 ++++ runtime/interface.cpp | 4 ---- runtime/interface.h | 2 -- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/builtin-functions/kphp-light/stdlib/system-functions.txt b/builtin-functions/kphp-light/stdlib/system-functions.txt index 4c7e9c5fa6..4906652001 100644 --- a/builtin-functions/kphp-light/stdlib/system-functions.txt +++ b/builtin-functions/kphp-light/stdlib/system-functions.txt @@ -57,6 +57,8 @@ function escapeshellcmd($cmd ::: string): string; function exec($command ::: string, &$output ::: mixed = [], int &$result_code = TODO): string|false; +function extension_loaded(string $extension): bool; + // === UNSUPPORTED === /** @kphp-extern-func-info stub generation-required */ diff --git a/runtime-common/stdlib/system/system-functions.h b/runtime-common/stdlib/system/system-functions.h index 267a05550a..4caaf7fee0 100644 --- a/runtime-common/stdlib/system/system-functions.h +++ b/runtime-common/stdlib/system/system-functions.h @@ -9,3 +9,7 @@ string f$escapeshellarg(const string& arg) noexcept; string f$escapeshellcmd(const string& cmd) noexcept; + +inline bool f$extension_loaded(const string& /*extension*/) noexcept { + return true; +} diff --git a/runtime/interface.cpp b/runtime/interface.cpp index d4d29db69a..59c882a9ce 100644 --- a/runtime/interface.cpp +++ b/runtime/interface.cpp @@ -2512,7 +2512,3 @@ int64_t f$numa_get_bound_node() { } return numa.get_worker_numa_node(logname_id); } - -bool f$extension_loaded(const string& /*extension*/) { - return true; -} diff --git a/runtime/interface.h b/runtime/interface.h index ffb8c87b71..2d1dd3d547 100644 --- a/runtime/interface.h +++ b/runtime/interface.h @@ -240,5 +240,3 @@ inline void f$kphp_extended_instance_cache_metrics_init(F&& callback) { } int64_t f$numa_get_bound_node(); - -bool f$extension_loaded(const string& extension);