Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 108 lines (94 sloc) 3.247 kb
e61a7ce5 » michelvaldrighi
2004-05-23 work in progress: replacement for xmlrpc.php, using IXR
1 <?php
a6a1522a » ryan
2008-05-25 File file level phpdoc from jacobsantos. see #7037
2 /**
3 * XML-RPC protocol support for WordPress
4 *
5 * @package WordPress
6 */
7
8 /**
9 * Whether this is a XMLRPC Request
10 *
11 * @var bool
12 */
cb093369 » ryan
2006-01-13 Make the xmlrpc user the current user. fixes #2273
13 define('XMLRPC_REQUEST', true);
77aaa245 » westi
2010-10-26 No Admin Bar for XML-RPC requests.
14 define('WP_SHOW_ADMIN_BAR' , false);
cb093369 » ryan
2006-01-13 Make the xmlrpc user the current user. fixes #2273
15
16 // Some browser-embedded clients send cookies. We don't want them.
17 $_COOKIE = array();
18
321c3107 » ryan
2007-09-03 Remove trailing whitespace
19 // A bug in PHP < 5.2.2 makes $HTTP_RAW_POST_DATA not set by default,
f432ed64 » rob1n
2007-05-11 Fix for PHP version 5.2.2 where $HTTP_RAW_POST_DATA isn't set. fixes …
20 // but we can do it ourself.
21 if ( !isset( $HTTP_RAW_POST_DATA ) ) {
22 $HTTP_RAW_POST_DATA = file_get_contents( 'php://input' );
23 }
24
a6a1522a » ryan
2008-05-25 File file level phpdoc from jacobsantos. see #7037
25 // fix for mozBlog and other cases where '<?xml' isn't on the very first line
60ccea94 » ryan
2006-01-30 Check if HTTP_RAW_POST_DATA is set to avoid undefined var warning. Pr…
26 if ( isset($HTTP_RAW_POST_DATA) )
27 $HTTP_RAW_POST_DATA = trim($HTTP_RAW_POST_DATA);
e61a7ce5 » michelvaldrighi
2004-05-23 work in progress: replacement for xmlrpc.php, using IXR
28
a6a1522a » ryan
2008-05-25 File file level phpdoc from jacobsantos. see #7037
29 /** Include the bootstrap for setting up WordPress environment */
5b811357 » ryan
2008-05-21 Allow wp-config.php to exist one level up from WordPress root directo…
30 include('./wp-load.php');
af8c37fd » matt
2005-11-07 Add RSD support. See http://archipelago.phrasewise.com/rsd
31
321c3107 » ryan
2007-09-03 Remove trailing whitespace
32 if ( isset( $_GET['rsd'] ) ) { // http://archipelago.phrasewise.com/rsd
9ce729e6 » rob1n
2007-06-02 Content-Type, not Content-type, as headers are case sensitive. Props …
33 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
af8c37fd » matt
2005-11-07 Add RSD support. See http://archipelago.phrasewise.com/rsd
34 ?>
849a0d29 » ryan
2006-08-30 Use get_option instead of get_settings. Just 'cause.
35 <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
af8c37fd » matt
2005-11-07 Add RSD support. See http://archipelago.phrasewise.com/rsd
36 <rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
37 <service>
38 <engineName>WordPress</engineName>
39 <engineLink>http://wordpress.org/</engineLink>
40 <homePageLink><?php bloginfo_rss('url') ?></homePageLink>
41 <apis>
509df644 » ryan
2009-07-04 Add 'rpc' context to siteurl which obeys ADMIN and LOGIN forced SSL. …
42 <api name="WordPress" blogID="1" preferred="true" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
43 <api name="Movable Type" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
44 <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
45 <api name="Blogger" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
46 <api name="Atom" blogID="" preferred="false" apiLink="<?php echo apply_filters('atom_service_url', site_url('wp-app.php/service', 'rpc') ) ?>" />
af8c37fd » matt
2005-11-07 Add RSD support. See http://archipelago.phrasewise.com/rsd
47 </apis>
48 </service>
49 </rsd>
50 <?php
51 exit;
52 }
53
770613e7 » ryan
2007-05-25 Admin includes reorg. see #4334
54 include_once(ABSPATH . 'wp-admin/includes/admin.php');
a7322e87 » michelvaldrighi
2004-09-17 big oopsie related to moving the xmlrpc.php file: somehow it got repl…
55 include_once(ABSPATH . WPINC . '/class-IXR.php');
2bc71061 » westi
2010-11-02 Rename new classes to match our coding standards. Fixes #15280.
56 include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');
e61a7ce5 » michelvaldrighi
2004-05-23 work in progress: replacement for xmlrpc.php, using IXR
57
58 // Turn off all warnings and errors.
a7322e87 » michelvaldrighi
2004-09-17 big oopsie related to moving the xmlrpc.php file: somehow it got repl…
59 // error_reporting(0);
e61a7ce5 » michelvaldrighi
2004-05-23 work in progress: replacement for xmlrpc.php, using IXR
60
a6a1522a » ryan
2008-05-25 File file level phpdoc from jacobsantos. see #7037
61 /**
62 * Posts submitted via the xmlrpc interface get that title
63 * @name post_default_title
64 * @var string
65 */
66 $post_default_title = "";
67
68 /**
69 * Whether to enable XMLRPC Logging.
70 *
71 * @name xmlrpc_logging
72 * @var int|bool
73 */
80b3445c » michelvaldrighi
2004-09-14 fixed comment_status screwup, removed debug stuff, screwed up big tim…
74 $xmlrpc_logging = 0;
e61a7ce5 » michelvaldrighi
2004-05-23 work in progress: replacement for xmlrpc.php, using IXR
75
a6a1522a » ryan
2008-05-25 File file level phpdoc from jacobsantos. see #7037
76 /**
77 * logIO() - Writes logging info to a file.
78 *
79 * @uses $xmlrpc_logging
80 * @package WordPress
81 * @subpackage Logging
82 *
83 * @param string $io Whether input or output
84 * @param string $msg Information describing logging reason.
85 * @return bool Always return true
86 */
e61a7ce5 » michelvaldrighi
2004-05-23 work in progress: replacement for xmlrpc.php, using IXR
87 function logIO($io,$msg) {
88 global $xmlrpc_logging;
89 if ($xmlrpc_logging) {
a7322e87 » michelvaldrighi
2004-09-17 big oopsie related to moving the xmlrpc.php file: somehow it got repl…
90 $fp = fopen("../xmlrpc.log","a+");
e61a7ce5 » michelvaldrighi
2004-05-23 work in progress: replacement for xmlrpc.php, using IXR
91 $date = gmdate("Y-m-d H:i:s ");
92 $iot = ($io == "I") ? " Input: " : " Output: ";
93 fwrite($fp, "\n\n".$date.$iot.$msg);
94 fclose($fp);
95 }
96 return true;
97 }
98
75ec5426 » markjaquith
2006-10-04 avoid $HTTP_RAW_POST_DATA notices. props mgeisler and Nazgul. fixes #…
99 if ( isset($HTTP_RAW_POST_DATA) )
a6a1522a » ryan
2008-05-25 File file level phpdoc from jacobsantos. see #7037
100 logIO("I", $HTTP_RAW_POST_DATA);
101
b3054b31 » westi
2010-09-23 Complete the move to a seperate class file for #14820 props filosofo.
102 // Allow for a plugin to insert a different class to handle requests.
103 $wp_xmlrpc_server_class = apply_filters('wp_xmlrpc_server_class', 'wp_xmlrpc_server');
104 $wp_xmlrpc_server = new $wp_xmlrpc_server_class;
9b79d3d5 » ryan
2010-01-26 Integrate wpmu_blogger_getUsersBlogs() directly into xmlrpc.php. see …
105
b3054b31 » westi
2010-09-23 Complete the move to a seperate class file for #14820 props filosofo.
106 // Fire off the request
461f029e » westi
2009-08-08 Seperate out the XML-RPC server active behaviour from object construc…
107 $wp_xmlrpc_server->serve_request();
b3054b31 » westi
2010-09-23 Complete the move to a seperate class file for #14820 props filosofo.
108 ?>
Something went wrong with that request. Please try again.