PluginProbe
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution / 1.8.0
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution v1.8.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 / Page_Cache / Meta / Meta_File.php

Meta_File.php in Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution 1.8.0, at src/Performance/Page_Cache/Meta/Meta_File.php

50 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The meta file provides a single object to access the meta file
4 * cache path for a URL.
5 *
6 * @package SolidWP\Performance
7 */
8
9 declare( strict_types=1 );
10
11 namespace SolidWP\Performance\Page_Cache\Meta;
12
13 use SolidWP\Performance\Page_Cache\Cache_Path;
14
15 /**
16 * The meta file provides a single object to access the meta file
17 * cache path for a URL.
18 *
19 * @package SolidWP\Performance
20 */
21 final class Meta_File {
22
23 public const EXT = '.meta.php';
24
25 /**
26 * @var Cache_Path
27 */
28 private Cache_Path $cache_path;
29
30 /**
31 * @param Cache_Path $cache_path The cache path.
32 */
33 public function __construct( Cache_Path $cache_path ) {
34 $this->cache_path = $cache_path;
35 }
36
37 /**
38 * Returns the full server path to a meta file associated with a URL.
39 *
40 * @param string $url The URL the meta is associated with.
41 *
42 * @throws \RuntimeException When URL does not have valid host.
43 *
44 * @return string e.g. /app/wp-content/cache/page/local.test.com/test-post.meta.php
45 */
46 public function get_path_from_url( string $url ): string {
47 return $this->cache_path->get_path_from_url( $url ) . self::EXT;
48 }
49 }
50