// +---------------------------------------------------------------------- error_reporting(0); @header("Content-Type: text/html;charset=utf-8"); session_start(); // [ 应用入口文件 ] if (version_compare(PHP_VERSION, '5.4.0', '<')) { die('require PHP > 5.4.0 !'); } // 定义应用目录 define('APP_PATH', __DIR__ . '/application/'); require_once "other/360_safe3.php"; //检查是否安装并获取数据库信息 if (!file_exists(APP_PATH."/index/database.php")){ header("Location:/install"); exit(); } define('CC_Defender', 1); //防CC攻击开关 require_once APP_PATH.'txprotect.php'; function getspider($useragent=''){ if(CC_Defender==2)return false; if(!$useragent){$useragent = $_SERVER['HTTP_USER_AGENT'];} $useragent=strtolower($useragent); if (strpos($useragent, 'baiduspider') !== false){return 'baiduspider';} if (strpos($useragent, 'googlebot') !== false){return 'googlebot';} if (strpos($useragent, 'soso') !== false){return 'soso';} if (strpos($useragent, 'bing') !== false){return 'bing';} if (strpos($useragent, 'yahoo') !== false){return 'yahoo';} if (strpos($useragent, 'sohu-search') !== false){return 'Sohubot';} if (strpos($useragent, 'sogou') !== false){return 'sogou';} if (strpos($useragent, 'youdaobot') !== false){return 'YoudaoBot';} if (strpos($useragent, 'yodaobot') !== false){return 'YodaoBot';} if (strpos($useragent, 'robozilla') !== false){return 'Robozilla';} if (strpos($useragent, 'msnbot') !== false){return 'msnbot';} if (strpos($useragent, 'lycos') !== false){return 'Lycos';} if (strpos($useragent, 'ia_archiver') !== false || strpos($useragent, 'iaarchiver') !== false){return 'alexa';} if (strpos($useragent, 'archive.org_bot') !== false){return 'Archive';} if (strpos($useragent, 'robozilla') !== false){return 'Robozilla';} if (strpos($useragent, 'sitebot') !== false){return 'SiteBot';} if (strpos($useragent, 'mj12bot') !== false){return 'MJ12bot';} if (strpos($useragent, 'gosospider') !== false){return 'gosospider';} if (strpos($useragent, 'gigabot') !== false){return 'Gigabot';} if (strpos($useragent, 'yrspider') !== false){return 'YRSpider';} if (strpos($useragent, 'gigabot') !== false){return 'Gigabot';} if (strpos($useragent, 'jikespider') !== false){return 'jikespider';} if (strpos($useragent, 'addsugarspiderbot') !== false){return 'AddSugarSpiderBot';/*非常少*/} if (strpos($useragent, 'testspider') !== false){return 'TestSpider';} if (strpos($useragent, 'etaospider') !== false){return 'EtaoSpider';} if (strpos($useragent, 'wangidspider') !== false){return 'WangIDSpider';} if (strpos($useragent, 'foxspider') !== false){return 'FoxSpider';} if (strpos($useragent, 'docomo') !== false){return 'DoCoMo';} if (strpos($useragent, 'yandexbot') !== false){return 'YandexBot';} if (strpos($useragent, 'ezooms') !== false){return 'Ezooms';/*个人*/} if (strpos($useragent, 'sinaweibobot') !== false){return 'SinaWeiboBot';} if (strpos($useragent, 'catchbot') !== false){return 'CatchBot';} if (strpos($useragent, 'surveybot') !== false){return 'SurveyBot';} if (strpos($useragent, 'dotbot') !== false){return 'DotBot';} if (strpos($useragent, 'purebot') !== false){return 'Purebot';} if (strpos($useragent, 'ccbot') !== false){return 'CCBot';} if (strpos($useragent, 'mlbot') !== false){return 'MLBot';} if (strpos($useragent, 'adsbot-google') !== false){return 'AdsBot-Google';} if (strpos($useragent, 'ahrefsbot') !== false){return 'AhrefsBot';} if (strpos($useragent, 'spbot') !== false){return 'spbot';} if (strpos($useragent, 'augustbot') !== false){return 'AugustBot';} return false; } if(CC_Defender==1){ if(isset($_GET['rand']) && $_SESSION['cron_session']!=$_GET['rand']){ exit('浏览器不支持COOKIE或者不正常访问!'); } if(!$_SESSION['cron_session'] && $nosecu!=true){ if(!getspider()){ $cron_session=md5(uniqid().rand(1,1000)); $_SESSION['cron_session']=$cron_session; exit(""); } } } //定义模板 $mb = require_once APP_PATH.'index/mb.php'; define('VIEW_LAYER', $mb['mb']); // 开启调试模式 define('APP_DEBUG', false); // 加载框架引导文件 require __DIR__ . '/thinkphp/start.php';