-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathredis.admin.inc
71 lines (65 loc) · 2.53 KB
/
redis.admin.inc
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
<?php
/**
* @file
* Redis module administration pages.
*/
/**
* Main settings and review administration screen.
*/
function redis_settings_form($form, &$form_state) {
$config = config('redis.settings');
$form['#config'] = 'redis.settings';
$form['connection'] = array(
'#type' => 'fieldset',
'#title' => t("Connection information"),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['connection']['description'] = array(
'#markup' => t('These settings are used to setup the connection to the Redis server. They will be ignored if the settinsgs are overridden in settings.php.'),
);
$form['connection']['scheme'] = array(
'#type' => 'textfield',
'#title' => t("Scheme"),
'#default_value' => 'tcp',
'#disabled' => TRUE,
'#description' => t("Connection scheme.") . " " . t("Only <em>tcp</em> is currently supported. This is ignored when using a UNIX socket."),
);
$form['connection']['redis_client_host'] = array(
'#type' => 'textfield',
'#title' => t("Host"),
'#default_value' => $config->get('redis_client_host'),
'#description' => t("Redis server host. Default is <em>@default</em>.", array('@default' => Redis_Client_Manager::REDIS_DEFAULT_HOST)),
);
$form['connection']['redis_client_port'] = array(
'#type' => 'textfield',
'#title' => t("Port"),
'#default_value' => $config->get('redis_client_port'),
'#description' => t("Redis server port. Default is <em>@default</em>.", array('@default' => Redis_Client_Manager::REDIS_DEFAULT_PORT)),
);
$form['connection']['redis_client_socket'] = array(
'#type' => 'textfield',
'#title' => t("UNIX socket"),
'#default_value' => $config->get('redis_client_socket'),
'#description' => t("Redis UNIX socket for connection. If set remote server host and port will be ignored."),
);
$form['connection']['redis_client_base'] = array(
'#type' => 'textfield',
'#title' => t("Database"),
'#default_value' => $config->get('redis_client_base'),
'#description' => t("Redis server database. Default is none, Redis server will autoselect the database 0."),
);
$form['connection']['redis_client_interface'] = array(
'#type' => 'radios',
'#title' => t("Client"),
'#options' => array(
NULL => t("None or automatic"),
'PhpRedis' => t("PhpRedis PHP extension"),
'Predis' => t("Predis PHP library"),
),
'#default_value' => $config->get('redis_client_interface'),
'#description' => t("Redis low level backend."),
);
$form = system_settings_form($form);
return $form;
}