PluginsProviderInterface.php
42 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Interface for a provider for getting access to plugin queries, |
| 4 | * designed to be mockable for unit tests. |
| 5 | */ |
| 6 | |
| 7 | namespace Automattic\WooCommerce\Admin\PluginsProvider; |
| 8 | |
| 9 | defined( 'ABSPATH' ) || exit; |
| 10 | |
| 11 | /** |
| 12 | * Plugins Provider Interface |
| 13 | */ |
| 14 | interface PluginsProviderInterface { |
| 15 | /** |
| 16 | * Get an array of active plugin slugs. |
| 17 | * |
| 18 | * @return array |
| 19 | */ |
| 20 | public function get_active_plugin_slugs(); |
| 21 | |
| 22 | /** |
| 23 | * Get plugin data. |
| 24 | * |
| 25 | * @param string $plugin Path to the plugin file relative to the plugins directory or the plugin directory name. |
| 26 | * |
| 27 | * @return array|false |
| 28 | */ |
| 29 | public function get_plugin_data( $plugin ); |
| 30 | |
| 31 | /** |
| 32 | * Get the path to the plugin file relative to the plugins directory from the plugin slug. |
| 33 | * |
| 34 | * E.g. 'woocommerce' returns 'woocommerce/woocommerce.php' |
| 35 | * |
| 36 | * @param string $slug Plugin slug to get path for. |
| 37 | * |
| 38 | * @return string|false |
| 39 | */ |
| 40 | public function get_plugin_path_from_slug( $slug ); |
| 41 | } |
| 42 |