Skip to content

Commit 55495d1

Browse files
committed
Cache value of crawledSitePath option
1 parent bde3d21 commit 55495d1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/StaticSite.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
class StaticSite {
1616

17+
private static string $crawled_site_path;
18+
1719
/**
1820
* Add crawled resource to static site
1921
*/
@@ -34,7 +36,10 @@ public static function add( string $path, string $contents ): void {
3436
}
3537

3638
public static function getPath(): string {
37-
return SiteInfo::getPath( 'uploads' ) . CoreOptions::getValue( 'crawledSitePath' );
39+
if ( ! isset( self::$crawled_site_path ) ) {
40+
self::$crawled_site_path = CoreOptions::getValue( 'crawledSitePath' );
41+
}
42+
return SiteInfo::getPath( 'uploads' ) . self::$crawled_site_path;
3843
}
3944

4045
/**

0 commit comments

Comments
 (0)