-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathenvironment.php
More file actions
109 lines (94 loc) · 2.23 KB
/
Copy pathenvironment.php
File metadata and controls
109 lines (94 loc) · 2.23 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
class Prompt_Environment {
/** @var string */
protected $prompt_version;
/** @var array */
protected $prompt_options;
/** @var string */
protected $php_version;
/** @var array */
protected $php_extensions;
/** @var string */
protected $wp_version;
/** @var string */
protected $db_version;
/** @var string */
protected $siteurl;
/** @var boolean */
protected $is_multisite;
/** @var array */
protected $active_plugins;
/** @var array */
protected $active_sitewide_plugins;
/** @var array */
protected $plugins;
/** @var array */
protected $theme;
public function __construct() {
$this->prompt_version = Prompt_Core::version( $full = true );
$this->prompt_options = array_diff_key( Prompt_Core::$options->get(), array( 'prompt_key' => '' ) );
$this->php_version = phpversion();
$this->php_extensions = get_loaded_extensions();
$this->wp_version = $GLOBALS['wp_version'];
$this->db_version = $GLOBALS['wpdb']->db_version();
$this->siteurl = get_option( 'siteurl' );
$this->is_multisite = is_multisite();
$this->active_plugins = get_option( 'active_plugins' );
$this->active_sitewide_plugins = get_option( 'active_sitewide_plugins' );
$this->plugins = get_plugins();
$this->theme = array();
$theme = wp_get_theme();
$theme_fields = array( 'Name', 'ThemeURI', 'Author', 'AuthorURI', 'Version', 'Template' );
foreach ( $theme_fields as $field ) {
$this->theme[$field] = $theme->get( $field );
}
}
/**
* @return array
*/
public function get_active_plugins() {
return $this->active_plugins;
}
/**
* @return array
*/
public function get_active_sitewide_plugins() {
return $this->active_sitewide_plugins;
}
/**
* @return string
*/
public function get_db_version() {
return $this->db_version;
}
/**
* @return string
*/
public function get_php_version() {
return $this->php_version;
}
/**
* @return boolean
*/
public function get_is_multsite() {
return $this->is_multisite;
}
/**
* @return array
*/
public function get_plugins() {
return $this->plugins;
}
/**
* @return string
*/
public function get_wp_version() {
return $this->wp_version;
}
/**
* @return array
*/
public function to_array() {
return get_object_vars( $this );
}
}