⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.45
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
chip
/
@core
/
vendor
/
spatie
/
robots-txt
/
src
/
Edit File: Robots.php
<?php namespace Spatie\Robots; class Robots { /** @var string|null */ protected $userAgent; /** @var \Spatie\Robots\RobotsTxt|null */ protected $robotsTxt; public function __construct(string $userAgent = null, string $source = null) { $this->userAgent = $userAgent; $this->robotsTxt = $source ? RobotsTxt::readFrom($source) : null; } public function withTxt(string $source): self { $this->robotsTxt = RobotsTxt::readFrom($source); return $this; } public static function create(string $userAgent = null, string $source = null): self { return new self($userAgent, $source); } public function mayIndex(string $url, string $userAgent = null): bool { $userAgent = $userAgent ?? $this->userAgent; $robotsTxt = $this->robotsTxt ?? RobotsTxt::create($this->createRobotsUrl($url)); return $robotsTxt->allows($url, $userAgent) && RobotsMeta::readFrom($url)->mayIndex() && RobotsHeaders::readFrom($url)->mayIndex(); } public function mayFollowOn(string $url): bool { return RobotsMeta::readFrom($url)->mayFollow() && RobotsHeaders::readFrom($url)->mayFollow(); } protected function createRobotsUrl(string $url): string { $robotsUrl = parse_url($url, PHP_URL_SCHEME).'://'.parse_url($url, PHP_URL_HOST); if ($port = parse_url($url, PHP_URL_PORT)) { $robotsUrl .= ":{$port}"; } return "{$robotsUrl}/robots.txt"; } }
Simpan