开端:
<?php
define('ROOT', dirname(__FILE__));
require 'a.config.php';
/*
* 检测是否存在cache_path目录,如果不存在则创建
*/
function check_cache_path(){
$path = $GLOBALS['bccn_config']['cache_path'];
if(!is_dir(ROOT.'/'.$path)){
mkdir(ROOT.'/'.$path);
}
};check_cache_path();
/*
* 检测相关php副本是否存在,如果不存在则创建
*/
function check_php_file(){
$qs = $_SERVER['QUERY_STRING'];
$py_file = $_SERVER['DOCUMENT_ROOT'].$qs;
echo $py_file;
$path = $_SERVER['DOCUMENT_ROOT'].'/'.$GLOBALS['bccn_config']['cache_path'].'/'.substr($qs, 1, strrpos($qs, '/'));
if(!is_dir($path)){
mkdir($path, 777, true);
}
};check_php_file();