Refactor of micropub request handling
Trying to organise the code better. It now temporarily doesn’t support update requests. Thought the spec defines them as SHOULD features and not MUST features. So safe for now :)
This commit is contained in:
parent
23c275945a
commit
83d10e1a70
26 changed files with 699 additions and 352 deletions
26
app/Providers/MicropubServiceProvider.php
Normal file
26
app/Providers/MicropubServiceProvider.php
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Services\Micropub\CardHandler;
|
||||
use App\Services\Micropub\EntryHandler;
|
||||
use App\Services\Micropub\MicropubHandlerRegistry;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class MicropubServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->singleton(MicropubHandlerRegistry::class, function () {
|
||||
$registry = new MicropubHandlerRegistry;
|
||||
|
||||
// Register handlers
|
||||
$registry->register('card', new CardHandler);
|
||||
$registry->register('entry', new EntryHandler);
|
||||
|
||||
return $registry;
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue