2007-01-23 20:38:07 -05:00
|
|
|
<?php
|
2008-05-25 11:50:15 -04:00
|
|
|
/**
|
|
|
|
* Atom Publishing Protocol support for WordPress
|
2007-01-23 20:38:07 -05:00
|
|
|
*
|
2008-05-25 11:50:15 -04:00
|
|
|
* @version 1.0.5-dc
|
2007-01-23 20:38:07 -05:00
|
|
|
*/
|
2007-02-22 14:44:16 -05:00
|
|
|
|
2008-05-25 11:50:15 -04:00
|
|
|
/**
|
|
|
|
* WordPress is handling an Atom Publishing Protocol request.
|
|
|
|
*
|
|
|
|
* @var bool
|
|
|
|
*/
|
2007-01-23 20:38:07 -05:00
|
|
|
define('APP_REQUEST', true);
|
|
|
|
|
2008-05-25 11:50:15 -04:00
|
|
|
/** Set up WordPress environment */
|
2008-05-21 01:59:27 -04:00
|
|
|
require_once('./wp-load.php');
|
2008-05-25 11:50:15 -04:00
|
|
|
|
|
|
|
/** Atom Publishing Protocol Class */
|
2007-08-27 15:52:58 -04:00
|
|
|
require_once(ABSPATH . WPINC . '/atomlib.php');
|
2008-05-25 11:50:15 -04:00
|
|
|
|
2012-03-01 16:15:44 -05:00
|
|
|
/** Atom Server **/
|
|
|
|
require_once(ABSPATH . WPINC . '/class-wp-atom-server.php');
|
|
|
|
|
2009-02-27 13:37:02 -05:00
|
|
|
/** Admin Image API for metadata updating */
|
|
|
|
require_once(ABSPATH . '/wp-admin/includes/image.php');
|
|
|
|
|
2007-09-01 15:32:54 -04:00
|
|
|
$_SERVER['PATH_INFO'] = preg_replace( '/.*\/wp-app\.php/', '', $_SERVER['REQUEST_URI'] );
|
2007-01-23 20:38:07 -05:00
|
|
|
|
2012-03-01 16:35:15 -05:00
|
|
|
// Allow for a plugin to insert a different class to handle requests.
|
|
|
|
$wp_atom_server_class = apply_filters('wp_atom_server_class', 'wp_atom_server');
|
|
|
|
$wp_atom_server = new $wp_atom_server_class;
|
|
|
|
|
|
|
|
// Handle the request
|
|
|
|
$wp_atom_server->handle_request();
|
|
|
|
|
|
|
|
exit;
|
|
|
|
|
2008-05-25 11:50:15 -04:00
|
|
|
/**
|
2008-09-22 04:06:48 -04:00
|
|
|
* Writes logging info to a file.
|
2008-05-25 11:50:15 -04:00
|
|
|
*
|
2008-09-22 04:06:48 -04:00
|
|
|
* @since 2.2.0
|
2012-02-16 19:02:42 -05:00
|
|
|
* @deprecated 3.4.0
|
|
|
|
* @deprecated Use error_log()
|
|
|
|
* @link http://www.php.net/manual/en/function.error-log.php
|
2008-05-25 11:50:15 -04:00
|
|
|
*
|
|
|
|
* @param string $label Type of logging
|
|
|
|
* @param string $msg Information describing logging reason.
|
|
|
|
*/
|
2012-02-16 19:02:42 -05:00
|
|
|
function log_app( $label, $msg ) {
|
|
|
|
_deprecated_function( __FUNCTION__, '3.4', 'error_log()' );
|
|
|
|
if ( ! empty( $GLOBALS['app_logging'] ) )
|
2012-05-13 17:41:40 -04:00
|
|
|
error_log( $label . ' - ' . $msg );
|
2007-01-23 20:38:07 -05:00
|
|
|
}
|