Register handlers with module

This commit is contained in:
Jeremy Dormitzer 2019-01-29 14:03:10 -05:00
parent 6e4ebe5734
commit c1598dafbf
2 changed files with 12 additions and 0 deletions

View File

@ -3,6 +3,7 @@ namespace ActivityPub;
require_once __DIR__ . '/../vendor/autoload.php';
use ActivityPub\Activities\CreateHandler;
use ActivityPub\Activities\NonActivityHandler;
use ActivityPub\Activities\ValidationHandler;
use ActivityPub\Auth\AuthListener;
@ -93,6 +94,7 @@ class ActivityPub
{
$dispatcher->addSubscriber( $this->module->get( NonActivityHandler::class ) );
$dispatcher->addSubscriber( $this->module->get( ValidationHandler::class ) );
$dispatcher->addSubscriber( $this->module->get( CreateHandler::class );
}
}
?>

View File

@ -1,6 +1,9 @@
<?php
namespace ActivityPub\Config;
use ActivityPub\Activities\CreateHandler;
use ActivityPub\Activities\NonActivityHandler;
use ActivityPub\Activities\ValidationHandler;
use ActivityPub\Auth\AuthListener;
use ActivityPub\Auth\AuthService;
use ActivityPub\Auth\SignatureListener;
@ -104,6 +107,13 @@ class ActivityPubModule
$this->injector->register( Router::class, Router::class )
->addArgument( new Reference( GetController::class ) )
->addArgument( new Reference( PostController::class ) );
$this->injector->register( NonActivityHandler::class, NonActivityHandler::class );
$this->injector->register( ValidationHandler::class, ValidationHandler::class );
$this->injector->register( CreateHandler::class, CreateHandler::class )
->addArgument( new Reference( ObjectsService::class ) )
->addArgument( new Reference( IdProvider::class ) )
->addArgument( new Reference( CollectionsService::class ) );
}
/**