@@ -62,6 +62,16 @@ abstract class DownloadCommand extends Command
62
62
*/
63
63
protected $ version = 'latest ' ;
64
64
65
+ /**
66
+ * @var string The latest installer version
67
+ */
68
+ private $ latestInstallerVersion ;
69
+
70
+ /**
71
+ * @var string The version of the local installer being executed
72
+ */
73
+ private $ localInstallerVersion ;
74
+
65
75
/**
66
76
* @var string The path to the downloaded file
67
77
*/
@@ -95,6 +105,9 @@ protected function initialize(InputInterface $input, OutputInterface $output)
95
105
$ this ->output = $ output ;
96
106
$ this ->fs = new Filesystem ();
97
107
108
+ $ this ->latestInstallerVersion = $ this ->getUrlContents (Application::VERSIONS_URL );
109
+ $ this ->localInstallerVersion = $ this ->getApplication ()->getVersion ();
110
+
98
111
$ this ->enableSignalHandler ();
99
112
}
100
113
@@ -558,7 +571,7 @@ protected function checkInstallerVersion()
558
571
$ this ->output ->writeln (sprintf (
559
572
"\n <bg=red> WARNING </> Your Symfony Installer version (%s) is outdated. \n" .
560
573
' Execute the command "%s selfupdate" to get the latest version (%s). ' ,
561
- $ installedVersion , $ _SERVER ['PHP_SELF ' ], $ latestVersion
574
+ $ this -> localInstallerVersion , $ _SERVER ['PHP_SELF ' ], $ this -> latestInstallerVersion
562
575
));
563
576
}
564
577
@@ -570,10 +583,7 @@ protected function checkInstallerVersion()
570
583
*/
571
584
protected function isInstallerUpdated ()
572
585
{
573
- $ installedVersion = $ this ->getApplication ()->getVersion ();
574
- $ latestVersion = $ this ->getUrlContents (Application::VERSIONS_URL );
575
-
576
- return version_compare ($ installedVersion , $ latestVersion , '>= ' );
586
+ return version_compare ($ this ->localInstallerVersion , $ this ->latestInstallerVersion , '>= ' );
577
587
}
578
588
579
589
/**
0 commit comments