1 | <?php |
||
13 | class CrawlDelay implements DirectiveInterface, RobotsTxtInterface |
||
14 | { |
||
15 | use Toolbox; |
||
16 | |||
17 | /** |
||
18 | * Directive alternatives |
||
19 | */ |
||
20 | const DIRECTIVE = [ |
||
21 | self::DIRECTIVE_CACHE_DELAY, |
||
22 | self::DIRECTIVE_CRAWL_DELAY, |
||
23 | ]; |
||
24 | |||
25 | /** |
||
26 | * Directive |
||
27 | */ |
||
28 | protected $directive = self::DIRECTIVE_CRAWL_DELAY; |
||
29 | |||
30 | /** |
||
31 | * Delay |
||
32 | * @var float|int |
||
33 | */ |
||
34 | protected $value; |
||
35 | |||
36 | /** |
||
37 | * CrawlDelay constructor. |
||
38 | * @param string $directive |
||
39 | * @throws ParserException |
||
40 | */ |
||
41 | public function __construct($directive = self::DIRECTIVE_CRAWL_DELAY) |
||
45 | |||
46 | /** |
||
47 | * Add |
||
48 | * |
||
49 | * @param float|int|string $line |
||
50 | * @return bool |
||
51 | */ |
||
52 | public function add($line) |
||
63 | |||
64 | /** |
||
65 | * Export |
||
66 | * |
||
67 | * @return array |
||
68 | */ |
||
69 | public function export() |
||
73 | } |
||
74 |