Minahito
minah****@users*****
2006年 10月 26日 (木) 00:27:03 JST
Index: xoops2jp/html/modules/legacy/admin/actions/ModuleUpdateAction.class.php diff -u xoops2jp/html/modules/legacy/admin/actions/ModuleUpdateAction.class.php:1.1.2.3 xoops2jp/html/modules/legacy/admin/actions/ModuleUpdateAction.class.php:1.1.2.4 --- xoops2jp/html/modules/legacy/admin/actions/ModuleUpdateAction.class.php:1.1.2.3 Thu Oct 19 19:24:48 2006 +++ xoops2jp/html/modules/legacy/admin/actions/ModuleUpdateAction.class.php Thu Oct 26 00:27:03 2006 @@ -36,6 +36,39 @@ function &_getInstaller($dirname) { + // + // Umm... + // + $handler =& xoops_gethandler('module'); + $module =& $handler->getByDirname($dirname); + + if ($module != null) { + $module->loadInfo($dirname, false); + + $info = $module->modinfo; + + if (isset($info['legacy_installer']) && is_array($info['legacy_installer']) && isset($info['legacy_installer']['updater'])) { + $updateInfo = $info['legacy_installer']['updater']; + + $className = $updateInfo['class']; + $filePath = isset($updateInfo['filepath']) ? $updateInfo['filepath'] : XOOPS_MODULE_PATH . "/${dirname}/admin/class/${className}.class.php"; + $namespace = isset($updateInfo['namespace']) ? $updateInfo['namespace'] : ucfirst($dirname); + + if ($namespace != null) { + $className = "${namespace}_${className}"; + } + + if (!class_exists($className) && file_exists($filePath)) { + require_once $filePath; + } + + if (class_exists($className)) { + $installer =& new $className($dirname); + return $installer; + } + } + } + $installer =& new Legacy_ModuleUpdater($dirname); return $installer; }