首页 > 其他 > 详细

mycncart 前台代码跟踪

时间:2017-01-23 19:05:53      阅读:289      评论:0      收藏:0      [点我收藏+]
1.进入根目录的入口文件,index.php

require_once(DIR_SYSTEM . ‘startup.php‘);//最为重要的一步

start(‘catalog‘);//执行了这个方法


2.根目录/mycncart/system/startup.php 文件
在这个文件里,定义了需要php版本,php配置和一些server

spl_autoload_register(‘library‘);//自动加载函数
加载地址为:$file = DIR_SYSTEM . ‘library/‘ . str_replace(‘\\‘, ‘/‘, strtolower($class)) . ‘.php‘;#mycncart/system/library/

引入了enginehe 和helper的一些函数
这个文件中,注意是一些文件加载

3.根目录/mycncart/system/framework.php 文件

registry:注册类和配置类(config)

两个配置文件:system/config
default.php
和前台配置文件默认为catalog.php  他会覆盖default.php 中的配置

$config->get(‘action_default‘);可以得到配置文件的值


4.路由
$controller->dispatch(new Action($config->get(‘action_router‘)), new Action($config->get(‘action_error‘)));


// Route
if (isset($this->request->get[‘route‘]) && $this->request->get[‘route‘] != ‘startup/router‘) {
    $route = $this->request->get[‘route‘];
} else {
    $route = $this->config->get(‘action_default‘);
}

 



mycncart 前台代码跟踪

原文:http://www.cnblogs.com/myvic/p/6344563.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!