日期:2014-05-17 浏览次数:20450 次
<?php
/**
* index.php MyLocalShop 入口
*
* @copyright (C)2013-2014 MyLocalShop
* @license http://www.baidu.com/
* @lastmodify 2013-01-07
*/
/**
* 网站根目录路径
* @var string
*/
define('LOCALSHOP_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR);
//echo LOCALSHOP_PATH;
require_once LOCALSHOP_PATH.'/base.php';
$mls = new MLS();
$mls->Load('front/includes/', 'dindex.phdp'); // 这是错误的,但为什么这里同样正确显示?
$mls->Load('front/includes/', 'index.php'); // 这个才是真正文件名
?>
<?php
/**
* 显示整个网站的目录树结构
* @author Administrator
*
*/
function dir_list() {
return array(
'admin' => array(
'css',
'images',
'includes' => array(
'libs'
),
'js'
),
'common' => array(
'config' => array(
'admin' => array(
'config.php'
),
'front' => array(
'config.php'
),
'config.php',
'dir_list.php'
),
'includes' => array(
'libs'
),
'js',
'languages' => array(
'en_US' => array(
'admin' => array(
'common.php'
),
'front' => array(
'common.php'
)
),
'zh_CN' => array(
'admin' => array(
'common.php'
),
'front' => array(
'common.php'
)
)
),
'templates' => array(
'Templates.php'
)
),
'front' => array(
'css',
'images',
'includes' => array(
'libs'
),
'js'
),
//'base.php',
//'index.php'
);
}
?>
<?php
/**
* MyLocalShop 框架入口
* @author Administrator
*
*/
require_once LOCALSHOP_PATH.'/common/config/dir_list.php';
class MLS {
/**
* 私有函数。判断是否存在该目录或文件,有则返回true,无则返回false
* @param string $target 目录或文件
* @return 若判断为文件类型则返回"beFile",若判断为目录类型则返回"beDir";若既不是文件也不是目录则返回 false。
*/
private function hasDirectoryOrFile($target) {
$dirs = MLS::load_all_directory();
foreach ($dirs as $key => $value) {
if (in_array($target, $value)) {
$suffix = substr($target, -1, 4);
if ($suffix === '.php')
/*if (strrchr('.php', $target) || strrchr('.html', $target) || strrchr('.htm', $target) || st