Housekeeping -- clean out debug calls.

git-svn-id: http://svn.automattic.com/wordpress/trunk@5307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rob1n 2007-04-24 23:58:51 +00:00
parent 559fa91b8d
commit 56add54053
1 changed files with 1 additions and 26 deletions

View File

@ -672,9 +672,7 @@ function pingback($content, $post_ID) {
include_once(ABSPATH . WPINC . '/class-IXR.php');
// original code by Mort (http://mort.mine.nu:8080)
$log = debug_fopen(ABSPATH . '/pingback.log', 'a');
$post_links = array();
debug_fwrite($log, 'BEGIN ' . date('YmdHis', time()) . "\n");
$pung = get_pung($post_ID);
@ -690,10 +688,6 @@ function pingback($content, $post_ID) {
// http://www.phpfreaks.com/quickcode/Extract_All_URLs_on_a_Page/15.php
preg_match_all("{\b http : [$any] +? (?= [$punc] * [^$any] | $)}x", $content, $post_links_temp);
// Debug
debug_fwrite($log, 'Post contents:');
debug_fwrite($log, $content."\n");
// Step 2.
// Walking thru the links array
// first we get rid of links pointing to sites, not to specific files
@ -717,16 +711,12 @@ function pingback($content, $post_ID) {
do_action_ref_array('pre_ping', array(&$post_links, &$pung));
foreach ( (array) $post_links as $pagelinkedto ) {
debug_fwrite($log, "Processing -- $pagelinkedto\n");
$pingback_server_url = discover_pingback_server_uri($pagelinkedto, 2048);
if ( $pingback_server_url ) {
@ set_time_limit( 60 );
// Now, the RPC call
debug_fwrite($log, "Page Linked To: $pagelinkedto \n");
debug_fwrite($log, 'Page Linked From: ');
$pagelinkedfrom = get_permalink($post_ID);
debug_fwrite($log, $pagelinkedfrom."\n");
// using a timeout of 3 seconds should be enough to cover slow servers
$client = new IXR_Client($pingback_server_url);
@ -738,13 +728,8 @@ function pingback($content, $post_ID) {
if ( $client->query('pingback.ping', $pagelinkedfrom, $pagelinkedto ) )
add_ping( $post_ID, $pagelinkedto );
else
debug_fwrite($log, "Error.\n Fault code: ".$client->getErrorCode()." : ".$client->getErrorMessage()."\n");
}
}
debug_fwrite($log, "\nEND: ".time()."\n****************************\n");
debug_fclose($log);
}
@ -780,16 +765,6 @@ function trackback($trackback_url, $title, $excerpt, $ID) {
$trackback_url['port'] = 80;
$fs = @fsockopen($trackback_url['host'], $trackback_url['port'], $errno, $errstr, 4);
@fputs($fs, $http_request);
/*
$debug_file = 'trackback.log';
$fp = fopen($debug_file, 'a');
fwrite($fp, "\n*****\nRequest:\n\n$http_request\n\nResponse:\n\n");
while(!@feof($fs)) {
fwrite($fp, @fgets($fs, 4096));
}
fwrite($fp, "\n\n");
fclose($fp);
*/
@fclose($fs);
$tb_url = addslashes( $tb_url );
@ -814,4 +789,4 @@ function weblog_ping($server = '', $path = '') {
$client->query('weblogUpdates.ping', get_option('blogname'), $home);
}
?>
?>