function ddt() { $debug = Debug::get_instance(); $args = func_get_args(); $trace = debug_backtrace(); $split = true; $echo = true; @ob_end_clean(); $debug_trace = $debug->trace(); foreach ($debug_trace as $t) { @($traced[] = (empty($t['class']) ? $t['file'] : $t['class']) . '::' . $t['function'] . '::' . $t['line']); } $args[] = $traced; $debug->dump($args, compact('trace', 'split', 'echo')); if (!empty($debug->output)) { dout(); } die('<div style="margin-top: 25px;font-size: 10px;color: #500;">-Debug die-</div>'); }
global $DEBUG; if ($DEBUG) { echo $text; } } $INPUTFILE = 'http://www.ea3hkb.com/wp-content/uploads/YSFHosts.txt'; echo "Loading YSF servers..."; $LINES = file($INPUTFILE); echo "done.\n"; $SERVERS = array(); //var_dump($LINES); foreach ($LINES as $i => $line) { //var_dump($line); if (preg_match('/^(\\xefbbbf)?#/', $line)) { dout("INPUT: Comment line index[{$i}]\n"); continue; } $line = trim($line); if (empty($line)) { dout("INPUT: Empty line index[{$i}]\n"); continue; } $hits = preg_split('/\\s+/', $line); if (is_numeric($hits[1])) { $SERVERS[] = $hits; } } printf("DELETE FROM rr where zone = %d and name = '_ysf._udp' and type = 'SRV';\n", $DOMAINID); foreach ($SERVERS as $server) { printf("INSERT INTO rr (`zone`, `name`, `type`, `data`, `ttl`) VALUES (%d, '_ysf._udp', 'SRV', '10 0 %d %s.', 300);\n", $DOMAINID, $server[1], $server[0]); }
} if (!$link_cache[$link]['downloaded']) { $new_count++; dout("Sending link to download: " . $link); if (jdremote_download($link)) { $link_cache[$link]['downloaded'] = true; $link_cache[$link]['downloaded_time'] = time(); } else { $new_fail_count++; dout("... FAILED."); } } else { $skipped_count++; } } dout("Site crawl results: " . $new_count . " new links, of which " . $new_fail_count . " could not be sent to JD. " . $skipped_count . " links where skipped."); } if ($new_count + $new_fail_count + $skipped_count == 0) { dlog(dout("No threads or all threads failed.", true)); } else { dlog('New: ' . $new_count . ' Fail: ' . $new_fail_count . ' Skipped: ' . $skipped_count); } dout("Writing link cache..."); file_put_contents('data/cache', serialize($link_cache)); dout("Saving site data..."); datafile_write($sites); dout("Sending start to JD."); jdremote_start(); jdremote_close(); dout("FINISHED.");