<?php //echo 111;exit;
$conf_basedir	= "../../";	//相对主目录的位置
$conf_where		= "admin";	//选择调用相应模块
//$directory		= basename(dirname(__FILE__));	//定义当前所在的目录，引入模块公用函数
cmsApiLog($_GET);
if(!$_GET['city']) {
    $result = array('result'=>'error','msg'=>'缺少城市参数:city');
    //echo json_encode($result);
    echo serialize($result);
    exit;
}

$web_auth = "esfadmin";
$_SESSION[$web_auth]["now_city"] = $_GET['city'];
include_once($conf_basedir."base.inc.php");
include_once (WEB_MODULE."/cms_api/CmsApi.php");
$sell_server = new Server(NS_SELL,"","ary","gbk");
//cmsApiLog($_GET);
//$server = new Server(NS_RENT,"","ary","gbk");
//print_r($_SESSION);
$method = $_GET['method'];
if(!in_array($method,CmsApi::$methods)) {
    $result = array('result'=>'error','msg'=>'该方法不存在！');
    //echo json_encode($result);
    echo serialize($result);
    exit;
}

//var_dump($sell_server);
echo CmsApi::$method();

function cmsApiLog($content) {
        $msg = '['.  date("Y-m-d H:i:s").']'.' '.serialize($content)."\r\n";
        //$msg = '['.  date("Y-m-d H:i:s").']'.' '.iconv('GBK','UTF-8',urldecode($content))."\r\n";
        $filename = CORE_ROOT.'log/cmsapi_'.date("Y-m-d").'.log';
        $filename = '/database/webroot/esfadmin/../core/log/cmsapi_'.date("Y-m-d").'.log';
        @file_put_contents($filename, $msg,FILE_APPEND);
    }
?>