PluginProbe
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments / 4.3.3
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments v4.3.3
4.7.2 4.7.1 4.7.0 4.6.6 4.6.5 4.6.4 4.6.3 4.6.2 4.6.1 4.6.0 4.5.1 4.5.0 4.4.2 4.4.1 4.4.0 4.3.3 4.3.2 4.3.1 4.3.0 4.2.3 4.2.2 4.2.1 1.0.3 1.0.4 1.0.5 All 281 releases
surecart / app / src / WordPress / Cache / CacheServiceProvider.php
CacheServiceProvider.php
54 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace SureCart\WordPress\Cache;
4
5 use SureCartCore\ServiceProviders\ServiceProviderInterface;
6
7 /**
8 * Cache Service Provider.
9 */
10 class CacheServiceProvider implements ServiceProviderInterface {
11 /**
12 * Holds the service container.
13 *
14 * @var \Pimple\Container
15 */
16 protected $container;
17
18 /**
19 * Register all dependencies in the container.
20 *
21 * @param \Pimple\Container $container Service Container.
22 */
23 public function register( $container ) {
24 $container['surecart.litespeed_cache'] = function () {
25 return new LiteSpeedCacheService();
26 };
27 $container['surecart.wpfastest_cache'] = function () {
28 return new WpFastestCacheService();
29 };
30 $container['surecart.w3total_cache'] = function () {
31 return new W3TotalCacheService();
32 };
33 }
34
35 /**
36 * Bootstrap any services if needed.
37 *
38 * @param \Pimple\Container $container Service Container.
39 */
40 public function bootstrap( $container ) {
41 // Bootstrap cache services on 'plugins_loaded' to ensure all plugins
42 // are loaded before we check for active cache plugins.
43 add_action(
44 'plugins_loaded',
45 function () use ( $container ) {
46 $container['surecart.litespeed_cache']->bootstrap();
47 $container['surecart.wpfastest_cache']->bootstrap();
48 $container['surecart.w3total_cache']->bootstrap();
49 },
50 999 // Late priority to ensure it runs after most plugins have loaded.
51 );
52 }
53 }
54