PluginProbe
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution / 1.9.0
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution v1.9.0
2.0.1 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.8.0 1.9.0 2.0.0
solid-performance / src / Performance / Cache_Delivery / Nginx / Bypass_Template_Loader.php

Bypass_Template_Loader.php in Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution 1.9.0, at src/Performance/Cache_Delivery/Nginx/Bypass_Template_Loader.php

49 lines 900 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Loads an nginx.conf that bypasses caching.
4 *
5 * @package SolidWP\Performance
6 */
7
8 declare( strict_types=1 );
9
10 namespace SolidWP\Performance\Cache_Delivery\Nginx;
11
12 use SolidWP\Performance\View\Contracts\View;
13 use SolidWP\Performance\View\Exceptions\FileNotFoundException;
14
15 /**
16 * Loads an nginx.conf that bypasses caching.
17 *
18 * @package SolidWP\Performance
19 */
20 final class Bypass_Template_Loader {
21
22 public const VIEW = 'cache/nginx-bypass';
23
24 /**
25 * @var View
26 */
27 private View $view;
28
29 /**
30 * @param View $view The view renderer.
31 */
32 public function __construct(
33 View $view
34 ) {
35 $this->view = $view;
36 }
37
38 /**
39 * Get our nginx-bypass config template, with the dynamic values replaced.
40 *
41 * @throws FileNotFoundException If we can't find the view file.
42 *
43 * @return string
44 */
45 public function get(): string {
46 return $this->view->render_to_string( self::VIEW );
47 }
48 }
49