2016-04-18 08:35:09 +00:00
|
|
|
<?php
|
|
|
|
|
2022-02-16 04:08:28 +00:00
|
|
|
namespace Code\Module;
|
2016-04-18 08:35:09 +00:00
|
|
|
|
2021-12-02 22:33:36 +00:00
|
|
|
use App;
|
2022-02-16 04:08:28 +00:00
|
|
|
use Code\Web\Controller;
|
|
|
|
use Code\Extend\Hook;
|
|
|
|
use Code\Render\Theme;
|
2022-02-12 20:43:29 +00:00
|
|
|
|
2021-12-02 22:33:36 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
class Hostxrd extends Controller
|
|
|
|
{
|
|
|
|
|
|
|
|
public function init()
|
|
|
|
{
|
|
|
|
session_write_close();
|
|
|
|
header('Access-Control-Allow-Origin: *');
|
|
|
|
header("Content-type: application/xrd+xml");
|
|
|
|
logger('hostxrd', LOGGER_DEBUG);
|
|
|
|
|
2022-02-12 20:43:29 +00:00
|
|
|
$tpl = Theme::get_template('xrd_host.tpl');
|
|
|
|
$x = replace_macros(Theme::get_template('xrd_host.tpl'), array(
|
2021-12-02 23:02:31 +00:00
|
|
|
'$zhost' => App::get_hostname(),
|
|
|
|
'$zroot' => z_root()
|
|
|
|
));
|
|
|
|
$arr = array('xrd' => $x);
|
2022-02-12 08:50:48 +00:00
|
|
|
Hook::call('hostxrd', $arr);
|
2021-12-02 23:02:31 +00:00
|
|
|
|
|
|
|
echo $arr['xrd'];
|
|
|
|
killme();
|
|
|
|
}
|
2016-04-18 08:35:09 +00:00
|
|
|
}
|