mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 17:23:12 +08:00
Add option to customize user agents in robots.txt
This commit is contained in:
22
module/Core/src/Options/RobotsOptions.php
Normal file
22
module/Core/src/Options/RobotsOptions.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Shlinkio\Shlink\Core\Options;
|
||||
|
||||
use function count;
|
||||
|
||||
final readonly class RobotsOptions
|
||||
{
|
||||
public function __construct(
|
||||
public bool $allowAllShortUrls = false,
|
||||
/** @var string[] */
|
||||
public array $userAgents = [],
|
||||
) {
|
||||
}
|
||||
|
||||
public function hasUserAgents(): bool
|
||||
{
|
||||
return count($this->userAgents) > 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user