SpiderEvents
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 49
c 0
b 0
f 0
wmc 0
1
<?php
2
namespace VDB\Spider\Event;
3
4
/**
5
 * @author Matthijs van den Bos
6
 * @copyright 2013 Matthijs van den Bos
7
 */
8
final class SpiderEvents
9
{
10
    /**
11
     * The spider.crawl.filter.prefetch event fires when the URI is not yet fetched and filtered
12
     *
13
     * Note: any listener for this event could stop propagation when its filter matches the event information
14
     * This means you can't assume your listener will be called
15
     *
16
     * @var string
17
     */
18
    const SPIDER_CRAWL_FILTER_PREFETCH = 'spider.crawl.filter.prefetch';
19
20
    /**
21
     * The spider.crawl.filter.postfetch event fires when the Resource is already fetched and filtered
22
     *
23
     * Note: any listener for this event could stop propagation when its filter matches the event information
24
     * This means you can't assume your listener will be called
25
     *
26
     * @var string
27
     */
28
    const SPIDER_CRAWL_FILTER_POSTFETCH = 'spider.crawl.filter.postfetch';
29
30
    const SPIDER_CRAWL_PRE_REQUEST = 'spider.crawl.pre_request';
31
32
    const SPIDER_CRAWL_POST_REQUEST = 'spider.crawl.post_request';
33
34
    /**
35
     * The spider.crawl.pre_enqueue event fires after the URI was added to the queue
36
     *
37
     * The event contains an instance of the Resource being enqueued.
38
     * An example use case for this event would be to change the Resources queue priority based on certain rules
39
     *
40
     * Note: any listener for this event could stop propagation when its filter matches the event information
41
     * This means you can't assume your listener will be called
42
     *
43
     * @var string
44
     */
45
    const SPIDER_CRAWL_POST_ENQUEUE = 'spider.crawl.post.enqueue';
46
47
    const SPIDER_CRAWL_ERROR_REQUEST = 'spider.error.request';
48
49
    const SPIDER_CRAWL_RESOURCE_PERSISTED = 'spider.crawl.resource.persisted';
50
51
    /**
52
     * The spider.crawl.user.stopped event fires when the spider was stopped by a user action
53
     *
54
     * @var string
55
     */
56
    const SPIDER_CRAWL_USER_STOPPED = 'spider.crawl.user.stopped';
57
}
58