1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
<?php
# -- BEGIN LICENSE BLOCK ---------------------------------------
#
# This file is part of Dotclear 2.
#
# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK -----------------------------------------
require dirname(__FILE__).'/../inc/prepend.php';
if (isset($_SERVER['PATH_INFO'])) {
$blog_id = trim($_SERVER['PATH_INFO']);
$blog_id = preg_replace('#^/#','',$blog_id);
} elseif (!empty($_GET['b'])) {
$blog_id = $_GET['b'];
}
if (empty($blog_id)) {
header('Content-Type: text/plain');
http::head(412);
echo 'No blog ID given';
exit;
}
# Avoid plugins warnings, set a default blog
$core->setBlog($blog_id);
# Loading plugins
$core->plugins->loadModules(DC_PLUGINS_ROOT);
# Start XML-RPC server
$server = new dcXmlRpc($core,$blog_id);
$server->serve();
|