ok

Mini Shell

Direktori : /home2/selectio/www/3idiotsgadgetstore.in/vendor/spatie/crawler/src/
Upload File :
Current File : /home2/selectio/www/3idiotsgadgetstore.in/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;
    }
}

Zerion Mini Shell 1.0