File Manager Lite
Dir:
/home/u540325668/domains/mccsociety.org/public_html/vendor/spatie/crawler/src
Upload
[..]
CrawlAllUrls.php (204 B)
Edit
Rename
Del
CrawlInternalUrls.php (493 B)
Edit
Rename
Del
CrawlObserver.php (1.3 KB)
Edit
Rename
Del
CrawlQueue/
Rename
Del
CrawlSubdomains.php (658 B)
Edit
Rename
Del
CrawlUrl.php (858 B)
Edit
Rename
Del
Crawler.php (12.28 KB)
Edit
Rename
Del
CrawlerRobots.php (1.29 KB)
Edit
Rename
Del
Exception/
Rename
Del
Handlers/
Rename
Del
LinkAdder.php (3.05 KB)
Edit
Rename
Del
Edit: CrawlerRobots.php
<?php namespace Spatie\Crawler; use Psr\Http\Message\ResponseInterface; use Spatie\Robots\RobotsHeaders; use Spatie\Robots\RobotsMeta; class CrawlerRobots { /** @var \Spatie\Robots\RobotsHeaders */ protected $robotsHeaders; /** @var \Spatie\Robots\RobotsMeta */ protected $robotsMeta; /** @var bool */ protected $mustRespectRobots; public function __construct(ResponseInterface $response, bool $mustRespectRobots) { $this->robotsHeaders = RobotsHeaders::create($response->getHeaders()); $this->robotsMeta = RobotsMeta::create((string) $response->getBody()); $this->mustRespectRobots = $mustRespectRobots; } public function mayIndex(): bool { if (! $this->mustRespectRobots) { return true; } if (! $this->robotsHeaders->mayIndex()) { return false; } if (! $this->robotsMeta->mayIndex()) { return false; } return true; } public function mayFollow(): bool { if (! $this->mustRespectRobots) { return true; } if (! $this->robotsHeaders->mayFollow()) { return false; } if (! $this->robotsMeta->mayFollow()) { return false; } return true; } }
Simpan