]> git.mxchange.org Git - friendica.git/blob - src/Module/ReallySimpleDiscovery.php
Remove deprecated App::getHostName() - process methods to DI::baseUrl()->getHostName()
[friendica.git] / src / Module / ReallySimpleDiscovery.php
1 <?php
2
3 namespace Friendica\Module;
4
5 use Friendica\BaseModule;
6 use Friendica\DI;
7 use Friendica\Util\XML;
8
9 /**
10  * Prints the rsd.xml
11  * @see http://danielberlinger.github.io/rsd/
12  */
13 class ReallySimpleDiscovery extends BaseModule
14 {
15         public static function rawContent(array $parameters = [])
16         {
17                 header('Content-Type: text/xml');
18
19                 $app = DI::app();
20                 $xml = null;
21                 echo XML::fromArray([
22                         'rsd' => [
23                                 '@attributes' => [
24                                         'version' => '1.0',
25                                         'xmlns'   => 'http://archipelago.phrasewise.com/rsd',
26                                 ],
27                                 'service'     => [
28                                         'engineName' => 'Friendica',
29                                         'engineLink' => 'http://friendica.com',
30                                         'apis'       => [
31                                                 'api' => [
32                                                         '@attributes' => [
33                                                                 'name'      => 'Twitter',
34                                                                 'preferred' => 'true',
35                                                                 'apiLink'   => $app->getBaseURL(),
36                                                                 'blogID'    => '',
37                                                         ],
38                                                         'settings'    => [
39                                                                 'docs'    => [
40                                                                         'http://status.net/wiki/TwitterCompatibleAPI',
41                                                                 ],
42                                                                 'setting' => [
43                                                                         '@attributes' => [
44                                                                                 'name' => 'OAuth',
45                                                                         ],
46                                                                         'false',
47                                                                 ],
48                                                         ],
49                                                 ]
50                                         ],
51                                 ],
52                         ],
53                 ], $xml);
54                 exit();
55         }
56 }