Skip to content

Commit 976a1c3

Browse files
committed
refactor: migrated sitemap.xml, robots.txt, llms.txt, and webauthn pages (#3834)
1 parent 47b7636 commit 976a1c3

File tree

11 files changed

+43
-164
lines changed

11 files changed

+43
-164
lines changed

phpmyfaq/llms.txt.php

Lines changed: 0 additions & 50 deletions
This file was deleted.

phpmyfaq/robots.txt.php

Lines changed: 0 additions & 50 deletions
This file was deleted.

phpmyfaq/sitemap.xml.php

Lines changed: 0 additions & 50 deletions
This file was deleted.

phpmyfaq/src/phpMyFAQ/Controller/ContactController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
namespace phpMyFAQ\Controller;
2121

22+
use Exception;
2223
use phpMyFAQ\Translation;
2324
use Symfony\Component\HttpFoundation\Request;
2425
use Symfony\Component\HttpFoundation\Response;
@@ -27,8 +28,9 @@ final class ContactController extends AbstractFrontController
2728
{
2829
/**
2930
* Handles both GET and POST requests for the contact form
30-
*@throws \Exception
31+
* @throws Exception
3132
*/
33+
#[Route(path: '/contact.html', name: 'public.contact')]
3234
public function index(Request $request): Response
3335
{
3436
$faqSession = $this->container->get('phpmyfaq.user.session');

phpmyfaq/src/phpMyFAQ/Controller/LlmsController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@
1919

2020
namespace phpMyFAQ\Controller;
2121

22+
use Exception;
2223
use Symfony\Component\HttpFoundation\Response;
24+
use Symfony\Component\Routing\Attribute\Route;
2325

2426
final class LlmsController extends AbstractController
2527
{
2628
/**
27-
* @throws \Exception
29+
* @throws Exception
2830
*/
31+
#[Route(path: '/llms.txt', name: 'public.llms.index')]
2932
public function index(): Response
3033
{
3134
$response = new Response();

phpmyfaq/src/phpMyFAQ/Controller/PageNotFoundController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,20 @@
1919

2020
namespace phpMyFAQ\Controller;
2121

22+
use Exception;
2223
use phpMyFAQ\Enums\SessionActionType;
2324
use phpMyFAQ\Translation;
2425
use Symfony\Component\HttpFoundation\Request;
2526
use Symfony\Component\HttpFoundation\Response;
27+
use Symfony\Component\Routing\Attribute\Route;
2628

2729
final class PageNotFoundController extends AbstractFrontController
2830
{
2931
/**
3032
* Handles the 404 Not Found page
31-
* @throws \Exception
33+
* @throws Exception
3234
*/
35+
#[Route(path: '/404.html', name: 'public.404')]
3336
public function index(Request $request): Response
3437
{
3538
$faqSession = $this->container->get('phpmyfaq.user.session');

phpmyfaq/src/phpMyFAQ/Controller/RobotsController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@
1919

2020
namespace phpMyFAQ\Controller;
2121

22+
use Exception;
2223
use Symfony\Component\HttpFoundation\Response;
24+
use Symfony\Component\Routing\Attribute\Route;
2325

2426
final class RobotsController extends AbstractController
2527
{
2628
/**
27-
* @throws \Exception
29+
* @throws Exception
2830
*/
31+
#[Route(path: '/robots.txt', name: 'public.robots.index')]
2932
public function index(): Response
3033
{
3134
$response = new Response();

phpmyfaq/src/phpMyFAQ/Controller/SitemapController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use phpMyFAQ\Core\Exception;
2323
use phpMyFAQ\Twig\TemplateException;
2424
use Symfony\Component\HttpFoundation\Response;
25+
use Symfony\Component\Routing\Attribute\Route;
2526

2627
final class SitemapController extends AbstractController
2728
{
@@ -30,6 +31,7 @@ final class SitemapController extends AbstractController
3031
/**
3132
* @throws TemplateException|Exception|\Exception
3233
*/
34+
#[Route(path: '/sitemap.xml', name: 'public.sitemap.xml')]
3335
public function index(): Response
3436
{
3537
$response = new Response();

phpmyfaq/src/phpMyFAQ/Controller/WebAuthnController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
use phpMyFAQ\Twig\TwigWrapper;
2828
use Symfony\Component\HttpFoundation\Request;
2929
use Symfony\Component\HttpFoundation\Response;
30-
use Symfony\Component\Routing\Annotation\Route;
30+
use Symfony\Component\Routing\Attribute\Route;
3131
use Twig\Error\LoaderError;
3232

3333
final class WebAuthnController extends AbstractController
3434
{
3535
/**
3636
* @throws Exception|LoaderError
3737
*/
38-
#[Route(path: '/', name: 'public.webauthn.index')]
38+
#[Route(path: '/services/webauthn', name: 'public.webauthn.index')]
3939
public function index(Request $request): Response
4040
{
4141
$system = new System();

phpmyfaq/src/phpMyFAQ/Link.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ class Link
183183
'thankyou' => 1,
184184
'twofactor' => 1,
185185
'ucp' => 1,
186-
'404' => 1,
187186
'bookmarks' => 1,
188187
];
189188

0 commit comments

Comments
 (0)