-
Notifications
You must be signed in to change notification settings - Fork 2
/
HealthCheckPlugin.php
executable file
·73 lines (60 loc) · 1.6 KB
/
HealthCheckPlugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
/**
* Health Check plugin for Craft CMS
*
* Adds a health check route to your site to indicate that Craft is health
* and ready to accept web traffic from a load balancer.
*
* @author Benjamin Smith
* @copyright Copyright (c) 2016 Benjamin Smith
* @link https://www.benjaminsmith.com/
* @package HealthCheck
* @since 1.0.0
*/
namespace Craft;
class HealthCheckPlugin extends BasePlugin
{
public function getName()
{
return Craft::t('Health Check');
}
public function getDescription()
{
return Craft::t('Adds a health check route to your site to indicate that Craft is health and ready to accept web traffic from a load balancer.');
}
public function getDocumentationUrl()
{
return 'https://github.com/benjamin-smith/craft-healthcheck/blob/master/README.md';
}
public function getReleaseFeedUrl()
{
return 'https://raw.githubusercontent.com/benjamin-smith/craft-healthcheck/master/releases.json';
}
public function getVersion()
{
return '1.0.0';
}
public function getSchemaVersion()
{
return '1.0.0';
}
public function getDeveloper()
{
return 'Benjamin Smith';
}
public function getDeveloperUrl()
{
return 'https://www.benjaminsmith.com/';
}
public function hasCpSection()
{
return false;
}
public function registerSiteRoutes()
{
$route = craft()->config->get('url', 'healthcheck');
return array(
$route => array('action' => 'healthCheck/renderHealthCheck'),
);
}
}