|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
class Mandrill_Urls |
|
4
|
|
|
{ |
|
5
|
|
|
|
|
6
|
|
|
private $master; |
|
7
|
|
|
|
|
8
|
|
|
public function __construct(Mandrill $master) |
|
9
|
|
|
{ |
|
10
|
|
|
$this->master = $master; |
|
11
|
|
|
} |
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* Get the 100 most clicked URLs |
|
15
|
|
|
* @return array the 100 most clicked URLs and their stats |
|
16
|
|
|
* - return[] struct the individual URL stats |
|
17
|
|
|
* - url string the URL to be tracked |
|
18
|
|
|
* - sent integer the number of emails that contained the URL |
|
19
|
|
|
* - clicks integer the number of times the URL has been clicked from a tracked email |
|
20
|
|
|
* - unique_clicks integer the number of unique emails that have generated clicks for this URL |
|
21
|
|
|
*/ |
|
22
|
|
|
public function getList() |
|
23
|
|
|
{ |
|
24
|
|
|
$_params = array(); |
|
25
|
|
|
return $this->master->call('urls/list', $_params); |
|
26
|
|
|
} |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* Return the 100 most clicked URLs that match the search query given |
|
30
|
|
|
* @param string $q a search query |
|
31
|
|
|
* @return array the 100 most clicked URLs matching the search query |
|
32
|
|
|
* - return[] struct the URL matching the query |
|
33
|
|
|
* - url string the URL to be tracked |
|
34
|
|
|
* - sent integer the number of emails that contained the URL |
|
35
|
|
|
* - clicks integer the number of times the URL has been clicked from a tracked email |
|
36
|
|
|
* - unique_clicks integer the number of unique emails that have generated clicks for this URL |
|
37
|
|
|
*/ |
|
38
|
|
|
public function search($q) |
|
39
|
|
|
{ |
|
40
|
|
|
$_params = array("q" => $q); |
|
41
|
|
|
return $this->master->call('urls/search', $_params); |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* Return the recent history (hourly stats for the last 30 days) for a url |
|
46
|
|
|
* @param string $url an existing URL |
|
47
|
|
|
* @return array the array of history information |
|
48
|
|
|
* - return[] struct the information for a single hour |
|
49
|
|
|
* - time string the hour as a UTC date string in YYYY-MM-DD HH:MM:SS format |
|
50
|
|
|
* - sent integer the number of emails that were sent with the URL during the hour |
|
51
|
|
|
* - clicks integer the number of times the URL was clicked during the hour |
|
52
|
|
|
* - unique_clicks integer the number of unique clicks generated for emails sent with this URL during the hour |
|
53
|
|
|
*/ |
|
54
|
|
|
public function timeSeries($url) |
|
55
|
|
|
{ |
|
56
|
|
|
$_params = array("url" => $url); |
|
57
|
|
|
return $this->master->call('urls/time-series', $_params); |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* Get the list of tracking domains set up for this account |
|
62
|
|
|
* @return array the tracking domains and their status |
|
63
|
|
|
* - return[] struct the individual tracking domain |
|
64
|
|
|
* - domain string the tracking domain name |
|
65
|
|
|
* - created_at string the date and time that the tracking domain was added as a UTC string in YYYY-MM-DD HH:MM:SS format |
|
66
|
|
|
* - last_tested_at string when the domain's DNS settings were last tested as a UTC string in YYYY-MM-DD HH:MM:SS format |
|
67
|
|
|
* - cname struct details about the domain's CNAME record |
|
68
|
|
|
* - valid boolean whether the domain's CNAME record is valid for use with Mandrill |
|
69
|
|
|
* - valid_after string when the domain's CNAME record will be considered valid for use with Mandrill as a UTC string in YYYY-MM-DD HH:MM:SS format. If set, this indicates that the record is valid now, but was previously invalid, and Mandrill will wait until the record's TTL elapses to start using it. |
|
70
|
|
|
* - error string an error describing the CNAME record, or null if the record is correct |
|
71
|
|
|
* - valid_tracking boolean whether this domain can be used as a tracking domain for email. |
|
72
|
|
|
*/ |
|
73
|
|
|
public function trackingDomains() |
|
74
|
|
|
{ |
|
75
|
|
|
$_params = array(); |
|
76
|
|
|
return $this->master->call('urls/tracking-domains', $_params); |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
/** |
|
80
|
|
|
* Add a tracking domain to your account |
|
81
|
|
|
* @param string $domain a domain name |
|
82
|
|
|
* @return struct information about the domain |
|
|
|
|
|
|
83
|
|
|
* - domain string the tracking domain name |
|
84
|
|
|
* - created_at string the date and time that the tracking domain was added as a UTC string in YYYY-MM-DD HH:MM:SS format |
|
85
|
|
|
* - last_tested_at string when the domain's DNS settings were last tested as a UTC string in YYYY-MM-DD HH:MM:SS format |
|
86
|
|
|
* - cname struct details about the domain's CNAME record |
|
87
|
|
|
* - valid boolean whether the domain's CNAME record is valid for use with Mandrill |
|
88
|
|
|
* - valid_after string when the domain's CNAME record will be considered valid for use with Mandrill as a UTC string in YYYY-MM-DD HH:MM:SS format. If set, this indicates that the record is valid now, but was previously invalid, and Mandrill will wait until the record's TTL elapses to start using it. |
|
89
|
|
|
* - error string an error describing the CNAME record, or null if the record is correct |
|
90
|
|
|
* - valid_tracking boolean whether this domain can be used as a tracking domain for email. |
|
91
|
|
|
*/ |
|
92
|
|
|
public function addTrackingDomain($domain) |
|
93
|
|
|
{ |
|
94
|
|
|
$_params = array("domain" => $domain); |
|
95
|
|
|
return $this->master->call('urls/add-tracking-domain', $_params); |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
/** |
|
99
|
|
|
* Checks the CNAME settings for a tracking domain. The domain must have been added already with the add-tracking-domain call |
|
100
|
|
|
* @param string $domain an existing tracking domain name |
|
101
|
|
|
* @return struct information about the tracking domain |
|
102
|
|
|
* - domain string the tracking domain name |
|
103
|
|
|
* - created_at string the date and time that the tracking domain was added as a UTC string in YYYY-MM-DD HH:MM:SS format |
|
104
|
|
|
* - last_tested_at string when the domain's DNS settings were last tested as a UTC string in YYYY-MM-DD HH:MM:SS format |
|
105
|
|
|
* - cname struct details about the domain's CNAME record |
|
106
|
|
|
* - valid boolean whether the domain's CNAME record is valid for use with Mandrill |
|
107
|
|
|
* - valid_after string when the domain's CNAME record will be considered valid for use with Mandrill as a UTC string in YYYY-MM-DD HH:MM:SS format. If set, this indicates that the record is valid now, but was previously invalid, and Mandrill will wait until the record's TTL elapses to start using it. |
|
108
|
|
|
* - error string an error describing the CNAME record, or null if the record is correct |
|
109
|
|
|
* - valid_tracking boolean whether this domain can be used as a tracking domain for email. |
|
110
|
|
|
*/ |
|
111
|
|
|
public function checkTrackingDomain($domain) |
|
112
|
|
|
{ |
|
113
|
|
|
$_params = array("domain" => $domain); |
|
114
|
|
|
return $this->master->call('urls/check-tracking-domain', $_params); |
|
115
|
|
|
} |
|
116
|
|
|
} |
|
117
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths