File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -67,10 +67,16 @@ public static function getTrk()
6767 public static function getProjectVersion ()
6868 {
6969 if (is_null (self ::$ cacheVersion )) {
70- $ pathToComposer = realpath (dirname (__FILE__ ) . '/../../../composer.json ' );
71- $ content = file_get_contents ($ pathToComposer );
72- $ content = json_decode ($ content , true );
73- self ::$ cacheVersion = $ content ['version ' ];
70+ self ::$ cacheVersion = 'unknown ' ;
71+ $ pathToComposer = dirname (__FILE__ ) . '/../../../composer.json ' ;
72+
73+ if (is_readable ($ pathToComposer )) {
74+ $ content = file_get_contents ($ pathToComposer );
75+ $ content = json_decode ($ content , true );
76+ if (is_array ($ content ) && !empty ($ content ['version ' ])) {
77+ self ::$ cacheVersion = $ content ['version ' ];
78+ }
79+ }
7480 }
7581
7682 return self ::$ cacheVersion ;
You can’t perform that action at this time.
0 commit comments