From 809ea2eb49bc00c6c3cad0e4544581947cf9f3e3 Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Wed, 2 Mar 2022 09:41:40 +0100 Subject: [PATCH] =?UTF-8?q?:bulb:=20N=C2=B04854=20Add=20phpdoc=20to=20util?= =?UTF-8?q?s::*Module*=20methods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/utils.inc.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/application/utils.inc.php b/application/utils.inc.php index 3e4203146..f64cf306d 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -1960,11 +1960,15 @@ class utils } /** - * Returns the relative (to MODULESROOT) path of the root directory of the module containing the file where the call to - * this function is made - * or an empty string if no such module is found (or not called within a module file) - * @param number $iCallDepth The depth of the module in the callstack. Zero when called directly from within the module - * @return string + * **Warning** : returned result can be invalid as we're using backtrace to find the module dir name + * + * @param int $iCallDepth The depth of the module in the callstack. Zero when called directly from within the module + * + * @return string the relative (to MODULESROOT) path of the root directory of the module containing the file where the call to + * this function is made + * or an empty string if no such module is found (or not called within a module file) + * + * @uses \debug_backtrace() */ public static function GetCurrentModuleDir($iCallDepth) { @@ -1989,9 +1993,14 @@ class utils } /** + * **Warning** : as this method uses {@see GetCurrentModuleDir} it produces hazardous results. + * You should better uses directly {@see GetAbsoluteUrlModulesRoot} and add the module dir name yourself ! See N°4573 + * * @return string the base URL for all files in the current module from which this method is called * or an empty string if no such module is found (or not called within a module file) * @throws \Exception + * + * @uses GetCurrentModuleDir */ public static function GetCurrentModuleUrl() {