1 | <?php |
||
7 | class Plugins_Handler { |
||
8 | |||
9 | /** |
||
10 | * Returns an array containing all active plugins and all known activating |
||
11 | * plugins. |
||
12 | * |
||
13 | * @param bool $skip_single_file_plugins If true, plugins with no dedicated directories will be skipped. |
||
14 | * |
||
15 | * @return Array An array of plugin names as strings. |
||
16 | */ |
||
17 | public function get_all_active_plugins( $skip_single_file_plugins = true ) { |
||
33 | |||
34 | /** |
||
35 | * Ensure the plugin has its own directory and not a single-file plugin. |
||
36 | * |
||
37 | * @param string $plugin Plugin name, may be prefixed with "/". |
||
38 | * |
||
39 | * @return bool |
||
40 | */ |
||
41 | public function is_directory_plugin( $plugin ) { |
||
44 | |||
45 | /** |
||
46 | * Creates an array containing the paths to the classmap and filemap for the given plugin. |
||
47 | * The classmap and filemap filenames are the names of the files generated by Jetpack |
||
48 | * Autoloader with versions >=2.0. |
||
49 | * |
||
50 | * @param String $plugin The plugin string. |
||
51 | * @return Array An array containing the paths to the plugin's classmap and filemap. |
||
52 | */ |
||
53 | public function create_map_path_array( $plugin ) { |
||
61 | |||
62 | /** |
||
63 | * Returns an array containing the paths to the classmap and filemap for the active plugins. |
||
64 | */ |
||
65 | public function get_active_plugins_paths() { |
||
69 | |||
70 | /** |
||
71 | * Checks whether the autoloader should be reset. The autoloader should be reset |
||
72 | * when a plugin is activating via a method other than a request, for example |
||
73 | * using WP-CLI. When this occurs, the activating plugin was not known when |
||
74 | * the autoloader selected the package versions for the classmap and filemap |
||
75 | * globals, so the autoloader must reselect the versions. |
||
76 | * |
||
77 | * If the current plugin is not already known, this method will add it to the |
||
78 | * $jetpack_autoloader_activating_plugins global. |
||
79 | * |
||
80 | * @return Boolean True if the autoloder must be reset, else false. |
||
81 | */ |
||
82 | public function should_autoloader_reset() { |
||
96 | |||
97 | /** |
||
98 | * Returns the names of activating plugins if the plugins are activating via a request. |
||
99 | * |
||
100 | * @return Array The array of the activating plugins or empty array. |
||
101 | */ |
||
102 | private function get_plugins_activating_via_request() { |
||
134 | |||
135 | /** |
||
136 | * Returns an array of the names of all known activating plugins. This includes |
||
137 | * plugins activating via a request and plugins that are activating via other |
||
138 | * methods. |
||
139 | * |
||
140 | * @return Array The array of all activating plugins or empty array. |
||
141 | */ |
||
142 | private function get_all_activating_plugins() { |
||
148 | |||
149 | /** |
||
150 | * Returns the name of the current plugin. |
||
151 | * |
||
152 | * @return String The name of the current plugin. |
||
153 | */ |
||
154 | public function get_current_plugin() { |
||
163 | } |
||
164 |