Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
50.00% |
3 / 6 |
|
75.00% |
3 / 4 |
CRAP | |
0.00% |
0 / 1 |
| Migration410Alpha | |
50.00% |
3 / 6 |
|
75.00% |
3 / 4 |
6.00 | |
0.00% |
0 / 1 |
| getVersion | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getDependencies | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getDescription | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| up | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Migration for phpMyFAQ 4.1.0-alpha. |
| 5 | * |
| 6 | * This Source Code Form is subject to the terms of the Mozilla Public License, |
| 7 | * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
| 8 | * obtain one at https://mozilla.org/MPL/2.0/. |
| 9 | * |
| 10 | * @package phpMyFAQ |
| 11 | * @author Thorsten Rinne <thorsten@phpmyfaq.de> |
| 12 | * @copyright 2023-2026 phpMyFAQ Team |
| 13 | * @license https://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
| 14 | * @link https://www.phpmyfaq.de |
| 15 | * @since 2026-01-25 |
| 16 | */ |
| 17 | |
| 18 | declare(strict_types=1); |
| 19 | |
| 20 | namespace phpMyFAQ\Setup\Migration\Versions; |
| 21 | |
| 22 | use phpMyFAQ\Setup\Migration\AbstractMigration; |
| 23 | use phpMyFAQ\Setup\Migration\Operations\OperationRecorder; |
| 24 | |
| 25 | readonly class Migration410Alpha extends AbstractMigration |
| 26 | { |
| 27 | public function getVersion(): string |
| 28 | { |
| 29 | return '4.1.0-alpha'; |
| 30 | } |
| 31 | |
| 32 | public function getDependencies(): array |
| 33 | { |
| 34 | return ['4.0.9']; |
| 35 | } |
| 36 | |
| 37 | public function getDescription(): string |
| 38 | { |
| 39 | return 'robots.txt content configuration for AI crawlers'; |
| 40 | } |
| 41 | |
| 42 | public function up(OperationRecorder $recorder): void |
| 43 | { |
| 44 | $robotsText = <<<EOT |
| 45 | User-agent: Amazonbot |
| 46 | User-agent: anthropic-ai |
| 47 | User-agent: Applebot-Extended |
| 48 | User-agent: Bytespider |
| 49 | User-agent: CCBot |
| 50 | User-agent: ChatGPT-User |
| 51 | User-agent: ClaudeBot |
| 52 | User-agent: Claude-Web |
| 53 | User-agent: cohere-ai |
| 54 | User-agent: Diffbot |
| 55 | User-agent: FacebookBot |
| 56 | User-agent: facebookexternalhit |
| 57 | User-agent: FriendlyCrawler |
| 58 | User-agent: Google-Extended |
| 59 | User-agent: GoogleOther |
| 60 | User-agent: GoogleOther-Image |
| 61 | User-agent: GoogleOther-Video |
| 62 | User-agent: GPTBot |
| 63 | User-agent: ICC-Crawler |
| 64 | User-agent: ImagesiftBot |
| 65 | User-agent: img2dataset |
| 66 | User-agent: Meta-ExternalAgent |
| 67 | User-agent: OAI-SearchBot |
| 68 | User-agent: omgili |
| 69 | User-agent: omgilibot |
| 70 | User-agent: PerplexityBot |
| 71 | User-agent: PetalBot |
| 72 | User-agent: Scrapy |
| 73 | User-agent: Timpibot |
| 74 | User-agent: VelenPublicWebCrawler |
| 75 | User-agent: YouBot |
| 76 | User-agent: Meta-ExternalFetcher |
| 77 | User-agent: Applebot |
| 78 | Disallow: / |
| 79 | |
| 80 | User-agent: * |
| 81 | Disallow: /admin/ |
| 82 | |
| 83 | Sitemap: /sitemap.xml |
| 84 | EOT; |
| 85 | |
| 86 | $recorder->addConfig('seo.contentRobotsText', $robotsText); |
| 87 | } |
| 88 | } |