Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(0);
- ignore_user_abort(true);
- ini_set('display_errors', 'off');
- ini_set('error_log','error_log.txt');
- header('X-Robots-Tag: noindex');
- // запускать в консоле:
- // wget -r -l 0 -U DorGen --spider --no-cache --no-parent --max-redirect=500 http://дорвей/cache.php
- require_once('php/func.php');
- $pagelist = $db->query("SELECT url, category FROM pages WHERE date < ".$time." AND pars = 0 LIMIT 5;");
- $all_links = array();
- while ($echo = $pagelist->fetchArray()) {
- $all_links[] = $httpscheme.'://'.$host.'/'.$echo['category'].'/'.$echo['url'].'/';
- }
- $links_count = count($all_links);
- $curl_arr = array();
- $master = curl_multi_init();
- for($i = 0; $i < $links_count; $i++) {
- $url = trim($all_links[$i]);
- $curl_arr[$i] = curl_init($url);
- curl_setopt($curl_arr[$i], CURLOPT_HEADER, false);
- curl_setopt($curl_arr[$i], CURLOPT_RETURNTRANSFER, true);
- curl_setopt($curl_arr[$i], CURLOPT_DNS_CACHE_TIMEOUT, 600);
- curl_setopt($curl_arr[$i], CURLOPT_TIMEOUT, 3);
- curl_setopt($curl_arr[$i], CURLOPT_CONNECTTIMEOUT, 2);
- curl_setopt($curl_arr[$i], CURLOPT_USERAGENT, 'Wmsn Doorway Generator');
- curl_setopt($curl_arr[$i], CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($curl_arr[$i], CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($curl_arr[$i], CURLOPT_ENCODING, 'gzip');
- curl_setopt($curl_arr[$i], CURLOPT_FTP_SSL, CURLFTPSSL_TRY);
- curl_multi_add_handle($master, $curl_arr[$i]);
- }
- do {curl_multi_exec($master, $running);} while($running > 0);
- $id = @trim(strip_tags($_GET['id']));
- if (!is_numeric($id)) {$id = 1;}
- $id = $id + 1;
- if ($links_count > 1) {
- echo '<a href="/cache.php?id='.$id.'">'.$id.'</a>';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement