* Refactor the magic method to support call static method. Only static

methods of classes declared in a zen file or an ext zen file or a tao
file or an ext tao file can be called.
This commit is contained in:
Guan Xiying
2022-10-20 10:28:35 +08:00
parent 1cbb4546fd
commit 86df3868fb
2 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -666,8 +666,10 @@ class control extends baseControl
{
global $app;
$moduleName = $app->getModuleName();
$zenClass = $moduleName . 'Zen';
$zenClass = 'ext' . $moduleName . 'Zen';
if(is_callable("{$zenClass}::{$method}")) return call_user_func_array("{$zenClass}::{$method}", $arguments);
$zenClass = $moduleName . 'Zen';
if(is_callable("{$zenClass}::{$method}")) return call_user_func_array("{$zenClass}::{$method}", $arguments);
$app->triggerError("the module {$moduleName} has no {$method} method", __FILE__, __LINE__, $exit = true);