本文整理汇总了PHP中WeUtility::rootPath方法的典型用法代码示例。如果您正苦于以下问题:PHP WeUtility::rootPath方法的具体用法?PHP WeUtility::rootPath怎么用?PHP WeUtility::rootPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WeUtility
的用法示例。
在下文中一共展示了WeUtility::rootPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createModuleSite
public static function createModuleSite($name)
{
$classname = "{$name}ModuleSite";
if (!class_exists($classname)) {
$file = WeUtility::rootPath() . "/{$name}/site.php";
if (!is_file($file)) {
trigger_error('ModuleSite Definition File Not Found ' . $file, E_USER_WARNING);
return null;
}
require $file;
}
if (!class_exists($classname)) {
trigger_error('ModuleSite Definition Class Not Found', E_USER_WARNING);
return null;
}
$o = new $classname();
$o->module = $GLOBALS['_W']['account']['modules'][$GLOBALS['_W']['modules'][$name]['mid']];
$o->weid = $GLOBALS['_W']['weid'];
$o->inMobile = defined('IN_MOBILE');
if ($o instanceof WeModuleSite) {
return $o;
} else {
trigger_error('ModuleReceiver Class Definition Error', E_USER_WARNING);
return null;
}
}
示例2: createModuleProcessor
public static function createModuleProcessor($name) {
$classname = "{$name}ModuleProcessor";
if(!class_exists($classname)) {
$file = WeUtility::rootPath() . "/{$name}/processor.php";
if(!is_file($file)) {
trigger_error('ModuleProcessor Definition File Not Found '.$file, E_USER_ERROR);
return null;
}
require $file;
}
if(!class_exists($classname)) {
trigger_error('ModuleProcessor Definition Class Not Found', E_USER_ERROR);
return null;
}
$o = new $classname();
if($o instanceof WeModuleProcessor) {
return $o;
} else {
trigger_error('ModuleProcessor Class Definition Error', E_USER_ERROR);
return null;
}
}