PluginProbe
JCH Optimize / trunk
JCH Optimize vtrunk
6.0.2 6.0.1 trunk 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.2.1 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.1.0 2.10.0 2.2.0 2.2.1 All 58 releases
jch-optimize / src / Service / PlatformProvider.php

PlatformProvider.php in JCH Optimize trunk, at src/Service/PlatformProvider.php

83 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * JCH Optimize - Performs several front-end optimizations for fast downloads
5 *
6 * @package jchoptimize/wordpress-platform
7 * @author Samuel Marshall <samuel@jch-optimize.net>
8 * @copyright Copyright (c) 2025 Samuel Marshall / JCH Optimize
9 * @license GNU/GPLv3, or later. See LICENSE file
10 *
11 * If LICENSE file missing, see <http://www.gnu.org/licenses/>.
12 */
13
14 namespace JchOptimize\WordPress\Service;
15
16 use _JchOptimizeVendor\V91\Joomla\DI\Container;
17 use _JchOptimizeVendor\V91\Joomla\DI\ServiceProviderInterface;
18 use _JchOptimizeVendor\V91\Psr\Http\Client\ClientInterface;
19 use _JchOptimizeVendor\V91\Psr\Log\LoggerInterface;
20 use JchOptimize\Core\Platform\CacheInterface;
21 use JchOptimize\Core\Platform\ExcludesInterface;
22 use JchOptimize\Core\Platform\HooksInterface;
23 use JchOptimize\Core\Platform\HtmlInterface;
24 use JchOptimize\Core\Platform\PathsInterface;
25 use JchOptimize\Core\Platform\PluginInterface;
26 use JchOptimize\Core\Platform\ProfilerInterface;
27 use JchOptimize\Core\Platform\UtilityInterface;
28 use JchOptimize\WordPress\Platform\Cache;
29 use JchOptimize\WordPress\Platform\Excludes;
30 use JchOptimize\WordPress\Platform\Hooks;
31 use JchOptimize\WordPress\Platform\Html;
32 use JchOptimize\WordPress\Platform\Paths;
33 use JchOptimize\WordPress\Platform\Plugin;
34 use JchOptimize\WordPress\Platform\Profiler;
35 use JchOptimize\WordPress\Platform\Utility;
36
37 class PlatformProvider implements ServiceProviderInterface
38 {
39 public function register(Container $container): void
40 {
41 $container->share(CacheInterface::class, function (): CacheInterface {
42 return new Cache();
43 });
44
45 $container->share(ExcludesInterface::class, function (Container $container): ExcludesInterface {
46 return new Excludes(
47 $container->get(PathsInterface::class)
48 );
49 });
50
51 $container->share(HooksInterface::class, function (): HooksInterface {
52 return new Hooks();
53 });
54
55 $container->share(PathsInterface::class, function (): PathsInterface {
56 return new Paths();
57 });
58
59 $container->share(PluginInterface::class, function (): PluginInterface {
60 return new Plugin();
61 });
62
63 $container->share(UtilityInterface::class, function (): UtilityInterface {
64 return new Utility();
65 });
66
67 $container->share(HtmlInterface::class, function (Container $container): HtmlInterface {
68 $html = new Html(
69 $container->get(ClientInterface::class),
70 $container->get(ProfilerInterface::class),
71 $container->get(UtilityInterface::class)
72 );
73 $html->setLogger($container->get(LoggerInterface::class));
74
75 return $html;
76 });
77
78 $container->share(ProfilerInterface::class, function (Container $container): ProfilerInterface {
79 return new Profiler();
80 });
81 }
82 }
83