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