-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathFile.php
More file actions
69 lines (59 loc) · 1.21 KB
/
File.php
File metadata and controls
69 lines (59 loc) · 1.21 KB
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
<?php
namespace WP_CLI\Doctor\Check;
use WP_CLI\Doctor\Check;
/**
* Check files on the filesystem.
*/
abstract class File extends Check {
/**
* File checks are run as their own group.
*/
protected $_when = 'manual'; // Run manually via group
/**
* File extension to check.
*
* Separate multiple file extensions with a '|'.
*
* @var string
*/
protected $extension = 'php';
/**
* Check a specific file path.
*
* Value should be relative to ABSPATH (e.g. 'wp-content' or 'wp-config.php')
*
* @var string
*/
protected $path = '';
/**
* Only check the wp-content directory.
*
* @var boolean
*/
protected $only_wp_content = false;
/**
* Any files matching the check.
*
* @var array<string|\SplFileInfo>
*/
protected $_matches = array();
/**
* Get the options for this check
*
* @return array<string, bool|string>
*/
public function get_options() {
return array(
'extension' => $this->extension,
'only_wp_content' => $this->only_wp_content,
'path' => $this->path,
);
}
/**
* Check a specific file.
*
* @param \SplFileInfo $file File to check.
* @return void
*/
abstract public function check_file( \SplFileInfo $file );
}