Something went wrong. Try again.
A barebones implementation of an atproto PDS in PHP and Slim Framework 4.
pds php atproto
Something went wrong. Try again.
2.3 kB · 89 lines
PHP
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990<?php
declare(strict_types=1);
namespace App\Domain\ActorStore;
use App\Domain\Blob\BlobRepository;use App\Domain\Blob\BlobStore;use App\Domain\Crypto\SigningKeyRepository;use App\Domain\Preference\AccountPrefRepository;use App\Domain\Record\BacklinkRepository;use App\Domain\Record\RecordBlobRepository;use App\Domain\Record\RecordRepository;use App\Domain\Repo\RepoBlockRepository;use App\Domain\Repo\RepoRootRepository;
/** * Encapsulates all per-actor data stores for a single DID. * * Mirrors the reference TS actor-store, which uses one SQLite database per DID. * Each ActorStore instance is exclusively scoped to $did; and the contained * repositories are isolated by the ActorStore's DID. */class ActorStore{ public function __construct( private readonly string $did, private readonly RecordRepository $records, private readonly RecordBlobRepository $recordBlobs, private readonly BacklinkRepository $backlinks, private readonly BlobRepository $blobs, private readonly BlobStore $blobStore, private readonly RepoBlockRepository $repoBlocks, private readonly AccountPrefRepository $prefs, private readonly RepoRootRepository $repoRoot, private readonly SigningKeyRepository $signingKeys, ) { }
public function getDid(): string { return $this->did; }
public function getRecords(): RecordRepository { return $this->records; }
public function getRecordBlobs(): RecordBlobRepository { return $this->recordBlobs; }
public function getBacklinks(): BacklinkRepository { return $this->backlinks; }
public function getBlobs(): BlobRepository { return $this->blobs; }
public function getBlobStore(): BlobStore { return $this->blobStore; }
public function getRepoBlocks(): RepoBlockRepository { return $this->repoBlocks; }
public function getPrefs(): AccountPrefRepository { return $this->prefs; }
public function getRepoRoot(): RepoRootRepository { return $this->repoRoot; }
public function getSigningKeys(): SigningKeyRepository { return $this->signingKeys; }}