//运行目录
define("FCPATH", str_replace("\\", "/", dirname(__FILE__)));
//加载核心类
require_once FCPATH.'/include/class.main.php';
//加载配置文件
require_once FCPATH . '/save/config.php';
define("ROOT_PATH", $CONFIG["ROOT_PATH"]? $CONFIG["ROOT_PATH"] : GlobalBase::is_root());
//输出json格式文件
header('content-type:application/json;charset=utf8'); //header("Content-Disposition:attachment;filename='json.js'");
//循环取传入参数,支持POST和GET
foreach ($_REQUEST as $k => $v) {
$$k = trim(urldecode($v));
}
//参数初始化
$cb = isset($cb) && $cb ? $cb : '';
$tp = isset($tp) && $tp ? $tp : '';
$url = isset($url) && $url ? $url : '';
$wd = isset($wd) && $wd ? $wd : '';
$line = isset($line) && $line ? $line : '0';
$id = isset($id) ? $id : '';
$flag = isset($flag) ? $flag : '';
$app = isset($app) ? $app : 'xysoft';
$dd = isset($dd) && $dd ? $dd : 0;
$loadjs = isset($loadjs) ? $loadjs : 0;
//全局变量,输出信息
$info = array('success' => 0, 'code' => 0);
//公用函数,API接口
if ($tp == 'getnum') {
echo sizeof($jx_url);
exit;
}
if ($tp == 'set') {
setcookie("url_num", $line, time() + 3600 * timecookie);
exit;
}
if ($tp == 'getset') {
exit(isset($_COOKIE["url_num"]) ? $_COOKIE["url_num"] : '0');
}
//全局变量,读写缓存
$cache = new Main_Cache(array("cachetype" => $CONFIG["chche_config"]["type"], "cacheDir" => "./cache", "cacheprot" => $CONFIG["chche_config"]["prot"], 'cacheTime' => GlobalBase::is_time($CONFIG["chche_config"]["time"])));
//加载防火墙规则
Blacklist::parse($CONFIG["BLACKLIST"]);
switch ($tp) {
//取配置参数及线路列表
case 'getparm' :
require_once FCPATH . '/save/yun.data.php';
$info['success'] = 1;
$info['type'] = 'getparm';
$info['app'] = server::lsUserAgen($CONFIG["play"]['all']['AppName']);
$CONFIG["play"]['define']['jx_link'] = $CONFIG["jx_link"];
$CONFIG["play"]['define']['jx_url'] = $CONFIG["jx_url"];
$CONFIG["play"]['define']['live_url'] = $CONFIG["live_url"];
$CONFIG["play"]['define']['jx_link'] = $CONFIG["jx_link"];
$CONFIG["play"]['define']['url_jmp'] = $YUN_DATA["url_jmp"];
$CONFIG["play"]['define']['timeout'] = $CONFIG["timeout"];
我来回答