PHP 8.2.30
Preview: CrawlerRobots.php Size: 1.14 KB
/proc/thread-self/root/home/byroehnu/easetack.com/vendor/spatie/crawler/src/CrawlerRobots.php

<?php

namespace Spatie\Crawler;

use Spatie\Robots\RobotsHeaders;
use Spatie\Robots\RobotsMeta;

class CrawlerRobots
{
    protected RobotsHeaders $robotsHeaders;

    protected RobotsMeta $robotsMeta;

    protected bool $mustRespectRobots;

    public function __construct(array $headers, string $body, bool $mustRespectRobots)
    {
        $this->robotsHeaders = RobotsHeaders::create($headers);

        $this->robotsMeta = RobotsMeta::create($body);

        $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;
    }
}

Directory Contents

Dirs: 6 × Files: 5

Name Size Perms Modified Actions
- drwxrwxrwx 2025-05-16 16:14:51
Edit Download
- drwxrwxrwx 2025-05-16 16:14:51
Edit Download
- drwxrwxrwx 2025-05-16 16:14:51
Edit Download
- drwxrwxrwx 2025-05-16 16:14:51
Edit Download
Handlers DIR
- drwxrwxrwx 2025-05-16 16:14:51
Edit Download
- drwxrwxrwx 2025-05-16 16:14:51
Edit Download
15.61 KB lrw-rw-rw- 2025-02-24 09:20:47
Edit Download
1.14 KB lrw-rw-rw- 2025-02-24 09:20:47
Edit Download
938 B lrw-rw-rw- 2025-02-24 09:20:47
Edit Download
734 B lrw-rw-rw- 2025-02-24 09:20:47
Edit Download
323 B lrw-rw-rw- 2025-02-24 09:20:47
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).