Newer
Older
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
<?php
namespace Automattic\WP\WP_CLI_Cron_Control_Offload;
/**
* Check if subcommand is allowed
*
* @param string $subcommand
* @return bool
*/
function is_subcommand_allowed( $subcommand ) {
return in_array( $subcommand, get_subcommand_whitelist(), true ) && ! in_array( $subcommand, get_subcommand_blacklist(), true );
}
/**
* Most commands must be whitelisted
*
* @return array
*/
function get_subcommand_whitelist() {
return array();
}
/**
* Certain commands should never be supported
*
* @return array
*/
function get_subcommand_blacklist() {
return array(
'cli',
'config',
'core',
'cron',
'db',
'eval',
'eval-file',
'scaffold',
'server',
);
}