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.
PHP
at main
12345678910111213141516171819202122232425262728293031323334353637383940<?php
declare(strict_types=1);
namespace App\Application\Actions\Pds\Atproto\Server;
use App\Application\Actions\Pds\PdsAction;use App\Application\Settings\SettingsInterface;use App\Domain\Pds\Atproto\Server\DescribeServerResponse;use Psr\Http\Message\ResponseInterface as Response;use Psr\Log\LoggerInterface;
class DescribeServerAction extends PdsAction{ public function __construct(LoggerInterface $logger, SettingsInterface $settings) { parent::__construct($logger, $settings, 'com.atproto.server.describeServer'); }
/** * {@inheritdoc} */ protected function action(): Response { /** @var array{hostname: string, termsOfServiceUrl: ?string, privacyPolicyUrl: ?string, email: ?string, bskyAppViewUrl: ?string} $pdsSettings */ $pdsSettings = $this->settings->get('pds'); $hostname = $pdsSettings['hostname'];
return $this->respondWithData(new DescribeServerResponse( did: "did:web:$hostname", inviteCodeRequired: true, availableUserDomains: [".{$hostname}"], termsOfServiceUrl: $pdsSettings['termsOfServiceUrl'], privacyPolicyUrl: $pdsSettings['privacyPolicyUrl'], email: $pdsSettings['email'], phoneVerificationRequired: null )); }}