387 Star 846 Fork 340

Yc Chan / iWshop

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
index.php 1.59 KB
一键复制 编辑 原始数据 按行查看 历史
ycchen 提交于 2017-08-24 11:08 . 配置文件分离
<?php
/**
* iWshop入口
* @description Hope You Do Good But Not Evil
* @copyright Copyright 2014-2015 <ycchen@iwshop.cn>
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chenyong Cai <ycchen@iwshop.cn>
* @package Wshop
* @link http://www.iwshop.cn
*/
require_once 'library/sqlSafe.php';
// Config Defines
require_once APP_PATH . 'app/config/app_config_defines.php';
// 判断安装,生产环境可以注释这一段以提高性能
if (is_dir(APP_PATH . 'public/install/') && !is_file(APP_PATH . 'public/install/install.lock')) {
header('Location:/public/install/');
}
try {
if (PHP_SAPI == 'cli') {
if ($argc > 0 && !empty($argv)) {
if (!empty($argv[1])) {
$GLOBALS['controller'] = $argv[1];
}
if (!empty($argv[2])) {
$GLOBALS['action'] = $argv[2];
}
}
}
// Config
require_once APP_PATH . 'app/config/app_config_dev.php';
// Include Paths
require_once 'config/sys_includes.php';
// ClassLoader
require_once 'system/ClassLoader.php';
// App
require_once 'system/App.php';
// Contoller
require_once 'system/Controller.php';
// Model
require_once 'system/Model.php';
// Smarty
require_once 'lib/Smarty/Smarty.class.php';
// 实例化入口
$App = App::getInstance();
// @see URL /?/Controller/Action/@queryString
$App->parseRequest();
} catch (Exception $ex) {
// 错误处理 写入日志或者跳转错误页面
Util::log($ex->getMessage());
echo $ex->getMessage();
}
PHP
1
https://gitee.com/yc-chan/iWshop.git
git@gitee.com:yc-chan/iWshop.git
yc-chan
iWshop
iWshop
dev

搜索帮助