Files
usercenter_old/includes/lib/AppLoad.php
2022-06-17 21:45:51 +08:00

39 lines
927 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace lib;
class AppLoad {
/**
* APP 模块加载
*
* @param string $name 文件默认index
* @param string $dir 所在目录(最后请加/
* @return string|void
*/
static public function load($name = 'index',$dir=null){
global $conf;
$filename = ROOT.'app/'.$dir.$name;
define("INDEX_ROOT",ROOT.'app/');
define("STATIC_ROOT",ROOT.'assets/');
if(file_exists($filename.'.php')) {
return $filename.'.php';
}else {
http_response_code(404);
}
}
/**
* 【我也不知道这是干嘛的】(慎重删除)
* @param $template
* @return bool
*/
static public function exists($template){
$filename = TEMPLATE_ROOT.$template.'/index.php';
if(file_exists($filename)){
return true;
}else{
return false;
}
}
}