| 1 |
<?php |
| 2 |
/** |
| 3 |
* Global functions that provide access to the plugin configuration. |
| 4 |
* |
| 5 |
* @since 0.1.0 |
| 6 |
* |
| 7 |
* @package SolidWP\Performance |
| 8 |
*/ |
| 9 |
|
| 10 |
use SolidWP\Performance\Config\Config; |
| 11 |
|
| 12 |
if ( ! defined( 'ABSPATH' ) ) { |
| 13 |
exit; |
| 14 |
} |
| 15 |
|
| 16 |
/** |
| 17 |
* Returns the config that is created from a set of defaults, site settings, and network settings. |
| 18 |
* |
| 19 |
* @since 0.1.0 |
| 20 |
* |
| 21 |
* @param string $key The key to retrieve from the config in dot notation. |
| 22 |
* |
| 23 |
* @return mixed |
| 24 |
*/ |
| 25 |
function swpsp_config_get( string $key ) { |
| 26 |
// In versions < 1.1.0, advanced-cache.php does not have the app.php require and fatal errors. |
| 27 |
if ( ! function_exists( 'swpsp_plugin' ) ) { |
| 28 |
require_once __DIR__ . '/app.php'; |
| 29 |
} |
| 30 |
|
| 31 |
return swpsp_plugin()->container()->get( Config::class )->get( $key ); |
| 32 |
} |
| 33 |
|