author | Anthony Ly <anthonyly.com@gmail.com> |
Wed, 12 Dec 2012 18:57:40 -0800 | |
changeset 199 | 9ff3c84d7b27 |
parent 194 | 32102edaa81b |
child 204 | 09a1c134465b |
permissions | -rw-r--r-- |
136 | 1 |
<?php |
2 |
/** |
|
3 |
* Atom Publishing Protocol support for WordPress |
|
4 |
* |
|
5 |
* @version 1.0.5-dc |
|
6 |
*/ |
|
7 |
||
8 |
/** |
|
9 |
* WordPress is handling an Atom Publishing Protocol request. |
|
10 |
* |
|
11 |
* @var bool |
|
12 |
*/ |
|
13 |
define('APP_REQUEST', true); |
|
14 |
||
15 |
/** Set up WordPress environment */ |
|
16 |
require_once('./wp-load.php'); |
|
17 |
||
18 |
/** Atom Publishing Protocol Class */ |
|
19 |
require_once(ABSPATH . WPINC . '/atomlib.php'); |
|
20 |
||
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
21 |
/** Atom Server **/ |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
22 |
require_once(ABSPATH . WPINC . '/class-wp-atom-server.php'); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
23 |
|
136 | 24 |
/** Admin Image API for metadata updating */ |
25 |
require_once(ABSPATH . '/wp-admin/includes/image.php'); |
|
26 |
||
27 |
$_SERVER['PATH_INFO'] = preg_replace( '/.*\/wp-app\.php/', '', $_SERVER['REQUEST_URI'] ); |
|
28 |
||
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
29 |
// Allow for a plugin to insert a different class to handle requests. |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
30 |
$wp_atom_server_class = apply_filters('wp_atom_server_class', 'wp_atom_server'); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
31 |
$wp_atom_server = new $wp_atom_server_class; |
136 | 32 |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
33 |
// Handle the request |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
34 |
$wp_atom_server->handle_request(); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
35 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
36 |
exit; |
136 | 37 |
|
38 |
/** |
|
39 |
* Writes logging info to a file. |
|
40 |
* |
|
41 |
* @since 2.2.0 |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
42 |
* @deprecated 3.4.0 |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
43 |
* @deprecated Use error_log() |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
44 |
* @link http://www.php.net/manual/en/function.error-log.php |
136 | 45 |
* |
46 |
* @param string $label Type of logging |
|
47 |
* @param string $msg Information describing logging reason. |
|
48 |
*/ |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
49 |
function log_app( $label, $msg ) { |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
50 |
_deprecated_function( __FUNCTION__, '3.4', 'error_log()' ); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
51 |
if ( ! empty( $GLOBALS['app_logging'] ) ) |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
52 |
error_log( $label . ' - ' . $msg ); |
136 | 53 |
} |