Make WordPress Core

Changeset 19935 for trunk/xmlrpc.php


Ignore:
Timestamp:
02/17/2012 12:02:42 AM (13 years ago)
Author:
nacin
Message:

Deprecate ancient "debugging" tools.

  • logIO() and the global $xmlrpc_logging in XML-RPC.
  • log_app() and the global $app_logging in APP.
  • debug_fwrite(), debug_fopen(), debug_fclose(), and $debug.

see #20051.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc.php

    r19801 r19935  
    5555include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');
    5656
    57 // Turn off all warnings and errors.
    58 // error_reporting(0);
    59 
    6057/**
    6158 * Posts submitted via the xmlrpc interface get that title
     
    6562$post_default_title = "";
    6663
    67 /**
    68  * Whether to enable XMLRPC Logging.
    69  *
    70  * @name xmlrpc_logging
    71  * @var int|bool
    72  */
    73 $xmlrpc_logging = 0;
    74 
    75 /**
    76  * logIO() - Writes logging info to a file.
    77  *
    78  * @uses $xmlrpc_logging
    79  * @package WordPress
    80  * @subpackage Logging
    81  *
    82  * @param string $io Whether input or output
    83  * @param string $msg Information describing logging reason.
    84  * @return bool Always return true
    85  */
    86 function logIO($io,$msg) {
    87     global $xmlrpc_logging;
    88     if ($xmlrpc_logging) {
    89         $fp = fopen("../xmlrpc.log","a+");
    90         $date = gmdate("Y-m-d H:i:s ");
    91         $iot = ($io == "I") ? " Input: " : " Output: ";
    92         fwrite($fp, "\n\n".$date.$iot.$msg);
    93         fclose($fp);
    94     }
    95     return true;
    96 }
    97 
    98 if ( isset($HTTP_RAW_POST_DATA) )
    99     logIO("I", $HTTP_RAW_POST_DATA);
    100 
    10164// Allow for a plugin to insert a different class to handle requests.
    10265$wp_xmlrpc_server_class = apply_filters('wp_xmlrpc_server_class', 'wp_xmlrpc_server');
     
    10568// Fire off the request
    10669$wp_xmlrpc_server->serve_request();
     70
     71exit;
     72
     73/**
     74 * logIO() - Writes logging info to a file.
     75 *
     76 * @deprecated 3.4.0
     77 * @deprecated Use error_log()
     78 *
     79 * @param string $io Whether input or output
     80 * @param string $msg Information describing logging reason.
     81 */
     82function logIO( $io, $msg ) {
     83    _deprecated_function( __FUNCTION__, '3.4', 'error_log()' );
     84    if ( ! empty( $GLOBALS['xmlrpc_logging'] ) )
     85        error_log( $io . ' - ' . $msg );
     86}
Note: See TracChangeset for help on using the changeset viewer.