This commit is contained in:
2022-06-13 23:37:17 +08:00
parent d21608a860
commit 0230cb42a2
153 changed files with 62907 additions and 0 deletions

38
includes/lib/AppLoad.php Normal file
View File

@@ -0,0 +1,38 @@
<?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;
}
}
}