本文整理汇总了PHP中XoopsLoad::loadModule方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsLoad::loadModule方法的具体用法?PHP XoopsLoad::loadModule怎么用?PHP XoopsLoad::loadModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsLoad
的用法示例。
在下文中一共展示了XoopsLoad::loadModule方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
function load($name, $type = "core")
{
static $loaded;
$name = strtolower($name);
$type = empty($type) ? "core" : $type;
if (isset($loaded[$type][$name])) {
return $loaded[$type][$name];
}
if (class_exists($name)) {
return true;
}
$isloaded = false;
switch ($type) {
case "framework":
$isloaded = XoopsLoad::loadFramework($name);
break;
case "class":
case "core":
$type = "core";
$isloaded = XoopsLoad::loadCore($name);
break;
default:
$isloaded = XoopsLoad::loadModule($name, $type);
break;
}
$loaded[$type][$name] = $isloaded;
return $loaded[$type][$name];
}
示例2: load
/**
* @param $name
* @param string $type
*
* @return bool
*/
static function load($name, $type = "core")
{
static $loaded;
static $deprecated;
if (!isset($deprecated)) {
$deprecated = array('uploader' => 'xoopsmediauploader', 'utility' => 'xoopsutility', 'captcha' => 'xoopscaptcha', 'cache' => 'xoopscache', 'file' => 'xoopsfile', 'model' => 'xoopsmodelfactory', 'calendar' => 'xoopscalendar', 'userutility' => 'xoopsuserutility');
}
$name = strtolower($name);
if (in_array($type, array('core', 'class')) && array_key_exists($name, $deprecated)) {
if (isset($GLOBALS['xoopsLogger'])) {
$GLOBALS['xoopsLogger']->addDeprecated("xoops_load('{$name}') is deprecated, use xoops_load('{$deprecated[$name]}')");
} else {
trigger_error("xoops_load('{$name}') is deprecated, use xoops_load('{$deprecated[$name]}')", E_USER_WARNING);
}
$name = $deprecated[$name];
}
$type = empty($type) ? 'core' : $type;
if (isset($loaded[$type][$name])) {
return $loaded[$type][$name];
}
if (class_exists($name, false)) {
$loaded[$type][$name] = true;
return true;
}
$isloaded = false;
switch ($type) {
case 'framework':
$isloaded = XoopsLoad::loadFramework($name);
break;
case 'class':
case 'core':
$type = 'core';
$isloaded = XoopsLoad::loadCore($name);
break;
default:
$isloaded = XoopsLoad::loadModule($name, $type);
break;
}
$loaded[$type][$name] = $isloaded;
return $loaded[$type][$name];
}