Skip to content
This repository was archived by the owner on Nov 14, 2019. It is now read-only.

Commit 9c98140

Browse files
committed
bug #262 Fixed some "undefined variables" error in checkInstallerVersion() (javiereguiluz)
This PR was merged into the 1.0-dev branch. Discussion ---------- Fixed some "undefined variables" error in checkInstallerVersion() This fixes this error: ![installer_issues](https://cloud.githubusercontent.com/assets/73419/16358153/daf401d8-3b0b-11e6-8be1-8d2126564926.png) Commits ------- 3258bf7 Fixed some "undefined variables" error in checkInstallerVersion()
2 parents b6350e5 + 3258bf7 commit 9c98140

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/Symfony/Installer/DownloadCommand.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ abstract class DownloadCommand extends Command
6262
*/
6363
protected $version = 'latest';
6464

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+
6575
/**
6676
* @var string The path to the downloaded file
6777
*/
@@ -95,6 +105,9 @@ protected function initialize(InputInterface $input, OutputInterface $output)
95105
$this->output = $output;
96106
$this->fs = new Filesystem();
97107

108+
$this->latestInstallerVersion = $this->getUrlContents(Application::VERSIONS_URL);
109+
$this->localInstallerVersion = $this->getApplication()->getVersion();
110+
98111
$this->enableSignalHandler();
99112
}
100113

@@ -558,7 +571,7 @@ protected function checkInstallerVersion()
558571
$this->output->writeln(sprintf(
559572
"\n <bg=red> WARNING </> Your Symfony Installer version (%s) is outdated.\n".
560573
' 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
562575
));
563576
}
564577

@@ -570,10 +583,7 @@ protected function checkInstallerVersion()
570583
*/
571584
protected function isInstallerUpdated()
572585
{
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, '>=');
577587
}
578588

579589
/**

0 commit comments

Comments
 (0)