xref: /webtrees/app/Http/RequestHandlers/AdsTxt.php (revision d11be7027e34e3121be11cc025421873364403f9)
1225b5f81SGreg Roach<?php
2225b5f81SGreg Roach
3225b5f81SGreg Roach/**
4225b5f81SGreg Roach * webtrees: online genealogy
5*d11be702SGreg Roach * Copyright (C) 2023 webtrees development team
6225b5f81SGreg Roach * This program is free software: you can redistribute it and/or modify
7225b5f81SGreg Roach * it under the terms of the GNU General Public License as published by
8225b5f81SGreg Roach * the Free Software Foundation, either version 3 of the License, or
9225b5f81SGreg Roach * (at your option) any later version.
10225b5f81SGreg Roach * This program is distributed in the hope that it will be useful,
11225b5f81SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
12225b5f81SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13225b5f81SGreg Roach * GNU General Public License for more details.
14225b5f81SGreg Roach * You should have received a copy of the GNU General Public License
15225b5f81SGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>.
16225b5f81SGreg Roach */
17225b5f81SGreg Roach
18225b5f81SGreg Roachdeclare(strict_types=1);
19225b5f81SGreg Roach
20225b5f81SGreg Roachnamespace Fisharebest\Webtrees\Http\RequestHandlers;
21225b5f81SGreg Roach
22225b5f81SGreg Roachuse Psr\Http\Message\ResponseInterface;
23225b5f81SGreg Roachuse Psr\Http\Message\ServerRequestInterface;
24225b5f81SGreg Roachuse Psr\Http\Server\RequestHandlerInterface;
25225b5f81SGreg Roach
26225b5f81SGreg Roachuse function response;
27225b5f81SGreg Roach
28225b5f81SGreg Roach/**
29225b5f81SGreg Roach * Respond to /ads.txt.
30225b5f81SGreg Roach */
31225b5f81SGreg Roachclass AdsTxt implements RequestHandlerInterface
32225b5f81SGreg Roach{
33225b5f81SGreg Roach    /**
34225b5f81SGreg Roach     * @param ServerRequestInterface $request
35225b5f81SGreg Roach     *
36225b5f81SGreg Roach     * @return ResponseInterface
37225b5f81SGreg Roach     */
38225b5f81SGreg Roach    public function handle(ServerRequestInterface $request): ResponseInterface
39225b5f81SGreg Roach    {
40225b5f81SGreg Roach        return response('#No pesky ads here')
416172e7f6SGreg Roach            ->withHeader('content-type', 'text/plain');
42225b5f81SGreg Roach    }
43225b5f81SGreg Roach}
44