File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed
Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change 44
55class CodeigniterVite
66{
7+
8+ /**
9+ * @var string manifest path.
10+ */
11+ private static $ manifest ;
12+
13+ public function __construct ()
14+ {
15+ static ::$ manifest = is_file (FCPATH . 'manifest.json ' ) ? FCPATH . 'manifest.json ' : null ;
16+ }
17+
718 /**
819 * Get vite entry file on running or bundled files instead.
920 *
@@ -23,10 +34,10 @@ public static function tags()
2334 }
2435
2536 # If vite isn't running, then return the compiled resources.
26- if (empty ($ result ) && static ::manifest () )
37+ if (empty ($ result ) && static ::$ manifest )
2738 {
2839 # Get the manifest content.
29- $ manifest = file_get_contents (static ::manifest () );
40+ $ manifest = file_get_contents (static ::$ manifest );
3041 # You look much pretty as an php object =).
3142 $ manifest = json_decode ($ manifest );
3243
@@ -67,12 +78,4 @@ public static function getReactTag()
6778
6879 return null ;
6980 }
70-
71- /**
72- * @return string manifest path
73- */
74- private static function manifest ()
75- {
76- return is_file (FCPATH . 'manifest.json ' ) ? FCPATH . 'manifest.json ' : null ;
77- }
7881}
You can’t perform that action at this time.
0 commit comments