From c8e46648d34e803ae3870e43df25e85820fa88cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Sun, 25 Apr 2021 16:21:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- function.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/function.php b/function.php index eb99bf67..b1e5dc27 100644 --- a/function.php +++ b/function.php @@ -813,6 +813,36 @@ if (!function_exists('router')) { } +if (!function_exists('isService')) { + + + /** + * @param string $name + * @return bool + */ + #[Pure] function isService(string $name): bool + { + return Snowflake::app()->has($name); + } + +} + +if (!function_exists('getService')) { + + + /** + * @param string $name + * @return mixed + * @throws Exception + */ + function getService(string $name): mixed + { + return Snowflake::app()->get($name); + } + +} + + if (!function_exists('jTraceEx')) { /**