mirror of
https://github.com/friendica/friendica
synced 2025-04-21 23:10:11 +00:00
Activitity pub - first commit with much test code
This commit is contained in:
parent
dcb9bf4136
commit
0a5476591d
2 changed files with 819 additions and 0 deletions
47
src/Module/Inbox.php
Normal file
47
src/Module/Inbox.php
Normal file
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
/**
|
||||
* @file src/Module/Inbox.php
|
||||
*/
|
||||
namespace Friendica\Module;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Util\HTTPSignature;
|
||||
use Friendica\Util\Network;
|
||||
|
||||
/**
|
||||
* ActivityPub Inbox
|
||||
*/
|
||||
class Inbox extends BaseModule
|
||||
{
|
||||
public static function init()
|
||||
{
|
||||
$a = self::getApp();
|
||||
logger('Blubb: init 1');
|
||||
|
||||
$postdata = file_get_contents('php://input');
|
||||
|
||||
$obj = json_decode($postdata);
|
||||
|
||||
if (empty($obj)) {
|
||||
exit();
|
||||
}
|
||||
|
||||
$tempfile = tempnam(get_temppath(), 'activitypub');
|
||||
file_put_contents($tempfile, json_encode(['header' => $_SERVER, 'body' => $obj]));
|
||||
|
||||
logger('Blubb: init ' . $tempfile);
|
||||
exit();
|
||||
// goaway($dest);
|
||||
}
|
||||
|
||||
public static function post()
|
||||
{
|
||||
$a = self::getApp();
|
||||
|
||||
logger('Blubb: post');
|
||||
exit();
|
||||
// goaway($dest);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue