-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathprobe.module
38 lines (33 loc) · 978 Bytes
/
probe.module
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
<?php
/**
* @file
* Hook implementations for this module.
*/
use Drupal\probe\Controller\ProbeController;
/**
* Implements hook_xmlrpc().
*/
function probe_xmlrpc() {
$methods[] = [
// First argument is the method name.
'probe',
// Callback to execute when this method is requested.
'probe_xml_request',
// An array defines the types of output and input values for this method.
[
// The first value is the return type, an array in this case.
'array',
// An array with requested variables.
'array',
],
t("Exposes this website's internal details for monitoring updates, logs and other metadata. Access is only granted if the requester's IP is whitelisted or has sent a valid 'probe_key'."),
];
return $methods;
}
/**
* Callback for probe_xmlrpc().
*/
function probe_xml_request($variables = []) {
$controller = ProbeController::create(\Drupal::getContainer());
return $controller->probe($variables);
}