require __DIR__ . '/../vendor/autoload.php'; // 声明全局变量 define('DS', DIRECTORY_SEPARATOR); define('ROOT_PATH', __DIR__ . DS . '..' . DS); define("PUBLIC_PATH", __DIR__ . DS ); // 判断是否安装程序 if (!is_file(ROOT_PATH . 'config' . DS . 'install' . DS . 'lock' . DS . 'install.lock')) { exit(header("location:/install.php")); } try { // if (!empty($_GET['pageId'])) { // $redis = new \Redis(); // $redis->connect('127.0.0.1', 6379); // $key = GetUserIP(); // $url = array( // 'pageId'=>trim($_GET['pageId']), // 'tid'=>trim($_GET['tid']), // 'lbid'=>trim($_GET['lbid']), // ); // $redis->set($key, json_encode($url)); // $expireTimeInSeconds = 24 * 60 * 60; // $redis->expire($key, $expireTimeInSeconds); // } if (!empty(trim($_GET['mark_id']))) { $redis = new \Redis(); $redis->connect('127.0.0.1', 6379); $key =GetUserIP(); $ptdata=array( 'ad_type'=>'wb', 'callback'=>trim($_GET['mark_id'])?trim($_GET['mark_id']):'' ); $redis->set($key, json_encode($ptdata)); $redis->expire($key, 36000); } } catch (Exception $e) { } function GetUserIP() { if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $arr = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); return $arr[0]; } else { return $_SERVER['REMOTE_ADDR']; } } // 执行HTTP应用并响应 $http = (new App())->http; $response = $http->run(); $response->send(); $http->end($response);