<?php
/**
 * [UQcms System] Copyright uqcms.com
 * QQ: 2200631718
 * Author: gj.name
 * This is NOT a freeware
*/  date_default_timezone_set('Asia/Shanghai'); $stime=microtime(true); header("Content-type: text/html; charset=utf-8"); ini_set("session.cookie_httponly", 1); ini_set('session.gc_maxlifetime ', '3600'); ini_set('session.auto_start', '0'); ini_set('session.save_handler', 'files'); ini_set('session.save_path', UQCMS_PATH.'temp'. DIRECTORY_SEPARATOR .'session'); ini_set('session.gc_probability', '1'); ini_set('session.gc_divisor ', '1000'); session_start(); define('IN_UQ', true); define('UQCMS_APP_PATH', UQCMS_PATH.UQCMS_APP. DIRECTORY_SEPARATOR); define('FRAME_PATH', UQCMS_PATH.'UQframework'. DIRECTORY_SEPARATOR); define('SMARTY_TPL', UQCMS_APP_PATH.'templates'. DIRECTORY_SEPARATOR); define('SMARTY_TPL_C', UQCMS_PATH.'temp'. DIRECTORY_SEPARATOR .'templates_c'. DIRECTORY_SEPARATOR .UQCMS_APP); include FRAME_PATH.'core'. DIRECTORY_SEPARATOR .'safe.php'; include FRAME_PATH.'core'. DIRECTORY_SEPARATOR .'common.php'; include FRAME_PATH.'core'. DIRECTORY_SEPARATOR .'common2.php'; spl_autoload_register('autoload'); include FRAME_PATH.'core'. DIRECTORY_SEPARATOR .'route.php'; include FRAME_PATH.'core'. DIRECTORY_SEPARATOR .'control.class.php'; include FRAME_PATH.'core'. DIRECTORY_SEPARATOR .'module.class.php'; class core { function __construct(){ $this->db = db(); } function module($module_name){ static $mod_class = array(); if(isset($mod_class[$module_name])){ return $mod_class[$module_name]; }else{ $file_mod = UQCMS_PATH.'module'. DIRECTORY_SEPARATOR .$module_name.".mod.php"; if(file_exists($file_mod)){ include_once $file_mod; $modExt = $module_name.'_mod'; $mod_class[$module_name] = new $modExt(); }else{ error_404('读取的模块不纯在！'); } } return $mod_class[$module_name]; } function uqcms_page($page_arr){ $now_page = isset($page_arr['page'])?$page_arr['page']:1; $total = isset($page_arr['total'])?$page_arr['total']:100; $page_size = isset($page_arr['page_size'])?$page_arr['page_size']:10; $page_type = isset($page_arr['page_type'])?$page_arr['page_type']:1; $every_page = isset($page_arr['every_page'])?$page_arr['every_page']:5; $page_url = '?'; foreach($_GET as $k=>$v){ if($k != 'page'){ $page_url .= $k.'='.$v.'&'; } } $page_url = $page_url.'page='; $p = new page($page_size, $total, $now_page, $every_page, $page_url); $pg = $p->subPage(); if($page_type == 1){ return $pg['page']; }elseif($page_type == 2){ return $pg['scroll_url']; } } function __destruct(){ } } $app_file_module = UQCMS_APP. DIRECTORY_SEPARATOR .UQCMS_APP.'.public.php'; if(file_exists($app_file_module)){ include $app_file_module; $app_file_name = UQCMS_APP; $public_run = new $app_file_name(); $public_run->index(); } $method = isset($_GET['m'])?$_GET['m']:'index'; $action = isset($_GET['a'])?$_GET['a']:'index'; if(UQCMS_APP == 'api'){ $core = new core(); $result = $core->module($method)->$action('index'); echo json_encode($result); }else{ $include_file = UQCMS_APP_PATH.'controls'. DIRECTORY_SEPARATOR .$method.'.class.php'; if(file_exists($include_file)){ include $include_file; } $action_name = lcfirst($method).'_uqcms'; if(class_exists($action_name)){ $controls = new $action_name(); if(method_exists($controls, $action)){ $controls->$action(); }else{ $controls->display(); } }else{ error_404('该页面不存在404'); } } $etime=microtime(true); $total=$etime-$stime; 