@@ -50,9 +50,9 @@ public static function page_header($page_title = '')
5050 'S_USER_LANG ' => $ user ->lang ['USER_LANG ' ],
5151
5252 'TRANSLATION_INFO ' => $ user ->lang ['TRANSLATION_INFO ' ],
53- 'QI_VERSION ' => QI_VERSION ,
53+ 'QI_VERSION ' => self :: current_version () ,
5454
55- 'VERSION_CHECK_TITLE ' => !empty ($ update ) ? sprintf ($ user ->lang ['VERSION_CHECK_TITLE ' ], $ update ['current ' ], QI_VERSION ) : '' ,
55+ 'VERSION_CHECK_TITLE ' => !empty ($ update ) ? sprintf ($ user ->lang ['VERSION_CHECK_TITLE ' ], $ update ['current ' ], self :: current_version () ) : '' ,
5656 'VERSION_CHECK_CURRENT ' => !empty ($ update ) ? $ update ['current ' ] : '' ,
5757 'U_VERSION_CHECK_URL ' => !empty ($ update ) ? $ update ['download ' ] : '' ,
5858 ));
@@ -345,7 +345,7 @@ public static function msg_handler($errno, $msg_text, $errfile, $errline)
345345 'MSG_EXPLAIN ' => '' ,
346346 'SETTINGS_FORM ' => '' ,
347347 'RETURN_LINKS ' => $ l_return_index ,
348- 'QI_VERSION ' => QI_VERSION ,
348+ 'QI_VERSION ' => self :: current_version () ,
349349 'L_QUICKINSTALL ' => $ user ->lang ['QUICKINSTALL ' ],
350350 'L_PHPBB_QI_TEXT ' => $ user ->lang ['PHPBB_QI_TEXT ' ],
351351 'L_FOR_PHPBB_VERSIONS ' => $ user ->lang ['FOR_PHPBB_VERSIONS ' ],
@@ -405,9 +405,28 @@ public static function get_update()
405405 $ version_helper = new qi_version_helper ();
406406
407407 return $ version_helper
408- ->set_current_version (QI_VERSION )
408+ ->set_current_version (self :: current_version () )
409409 ->force_stability ('stable ' )
410410 ->set_file_location ('www.phpbb.com ' , '/customise/db/official_tool/phpbb3_quickinstall ' , 'version_check ' )
411411 ->get_update ();
412412 }
413+
414+ /**
415+ * Get the current version of QuickInstall from composer.json
416+ *
417+ * @return string
418+ */
419+ public static function current_version ()
420+ {
421+ global $ quickinstall_path ;
422+
423+ static $ composerJson = null ;
424+
425+ if ($ composerJson === null ) {
426+ $ composerJson = file_get_contents ("{$ quickinstall_path }composer.json " );
427+ $ composerJson = json_decode ($ composerJson , true );
428+ }
429+
430+ return $ composerJson ["version " ];
431+ }
413432}
0 commit comments