Files
rspade_system/vendor/spatie/crawler/src/CrawlProfiles/CrawlInternalUrls.php
root f6fac6c4bc Fix bin/publish: copy docs.dist from project root
Fix bin/publish: use correct .env path for rspade_system
Fix bin/publish script: prevent grep exit code 1 from terminating script

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 02:08:33 +00:00

26 lines
513 B
PHP
Executable File

<?php
namespace Spatie\Crawler\CrawlProfiles;
use GuzzleHttp\Psr7\Uri;
use Psr\Http\Message\UriInterface;
class CrawlInternalUrls extends CrawlProfile
{
protected mixed $baseUrl;
public function __construct($baseUrl)
{
if (! $baseUrl instanceof UriInterface) {
$baseUrl = new Uri($baseUrl);
}
$this->baseUrl = $baseUrl;
}
public function shouldCrawl(UriInterface $url): bool
{
return $this->baseUrl->getHost() === $url->getHost();
}
}