Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Nov 14, 2019. It is now read-only.

#266 Self update is not detecting the installed version #269

Merged
merged 1 commit into from
Jul 22, 2016

Conversation

asvinours
Copy link

When the self-update command is initialized, the current version and latest version of the installer are not initialized.
The code is currently comparing NULL with NULL, which returns true.

By adding the parent::initialize() call, the DownloadCommand set the current and latest version of the installer, and then the version_compare function is actually really comparing the real versions.

@Archmonster
Copy link

Was about to post a reply to the bug report, but since you've already submitted a pull request i'm going to reply to you.

While it is true that the issue is version_compare not receiving the correct values, it does not solve the underlying issue, which is storing version numbers in private properties of DownloadCommand, and then trying to use / override them from a subclass. Both $latestInstallerVersion and $localInstallerVersion should be made protected instead of private and if you rely on parent::initialize() to set their values you should remove the duplicated code from SelfUpdateCommand::initialize().

@asvinours
Copy link
Author

I have updated my pull request to remove duplicated code and change the scope of the attributes of the DownloadCommand.

@javiereguiluz
Copy link
Member

Fabrice, thank you very much for reporting this error in the first place and then, for providing the pull request to fix it. Thanks!

@javiereguiluz javiereguiluz merged commit 0640667 into symfony:master Jul 22, 2016
javiereguiluz added a commit that referenced this pull request Jul 22, 2016
…rice Baumann)

This PR was merged into the 1.0-dev branch.

Discussion
----------

#266 Self update is not detecting the installed version

When the self-update command is initialized, the current version and latest version of the installer are not initialized.
The code is currently comparing NULL with NULL, which returns true.

By adding the parent::initialize() call, the DownloadCommand set the current and latest version of the installer, and then the version_compare function is actually really comparing the real versions.

Commits
-------

0640667 #266 Self update is not detecting the installed version
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.