-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathhosting_varnish.admin.inc
More file actions
32 lines (28 loc) · 992 Bytes
/
hosting_varnish.admin.inc
File metadata and controls
32 lines (28 loc) · 992 Bytes
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
<?php
/**
* @file
* Administrative functions.
*/
/**
* Builds a settings form for Varnish.
*/
function hosting_varnish_settings_form() {
$form = array();
if (hosting_feature('server')) {
$web_servers = hosting_get_servers('http');
$form['hosting_varnish_web_servers'] = array(
'#type' => 'checkboxes',
'#title' => t('Cached web servers'),
'#options' => $web_servers,
'#default_value' => variable_get('hosting_varnish_web_servers', array()),
'#description' => t('Specify which servers are served by Varnish. If none is selected, all are assumed to be.'),
);
}
$form['varnish_status'] = array(
'#type' => 'item',
'#title' => t('Status'),
'#value' => theme('varnish_status', varnish_get_status(), floatval(variable_get('varnish_version', 2.1))),
'#description' => t('Configure !settings_link.', array('!settings_link' => l(t('Varnish settings'), 'admin/settings/varnish'))),
);
return system_settings_form($form);
}