-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremote-backstop.php
50 lines (43 loc) · 1.44 KB
/
remote-backstop.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
<?php
/**
* Plugin Name: Remote Backstop
* Plugin URI: https://github.com/alleyinteractive/remote-backstop
* Description: Safety net for sites depending on remote requests
* Author: Matthew Boynes
* Author URI: https://www.alley.co/
* Text Domain: remote-backstop
* Domain Path: /languages
* Version: 0.1.0
*
* @package Remote_Backstop
*/
namespace Remote_Backstop;
require_once __DIR__ . '/inc/compat.php';
require_once __DIR__ . '/inc/interface-request-cache.php';
require_once __DIR__ . '/inc/class-cache.php';
require_once __DIR__ . '/inc/class-cache-factory.php';
require_once __DIR__ . '/inc/class-request-manager.php';
require_once __DIR__ . '/inc/interface-loggable.php';
require_once __DIR__ . '/inc/class-event-log.php';
/**
* Create and return the request manager. If the request manager has already
* been registered, this simply returns the operating manager.
*
* @return Request_Manager
*/
function remote_backstop_request_manager(): Request_Manager {
static $request_manager;
if ( ! isset( $request_manager ) ) {
// Register the request manager and add the hooks.
$request_manager = new Request_Manager( new Cache_Factory(), new Event_Log() );
}
return $request_manager;
}
/**
* Filters whether Remote Backstop is enabled.
*
* @param bool Whether to enable Remote Backstop.
*/
if ( apply_filters( 'remote_backstop_enabled', true ) ) {
remote_backstop_request_manager();
}