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

Checking that symfony installer is up-to-date #221

Closed
wants to merge 6 commits into from

Conversation

jzawadzki
Copy link
Contributor

Hi,

regarding our discussion in #220 and #136 I'm sending first draft of checking if installer is up-to-date.
I have based my solution of how and when composer is checking it.
Please comment and tell if this solution is ok and what should I change to make it better!

Thanks,
JZ

@Pierstoval
Copy link
Contributor

Hehe, we proposed the same feature at the same time 😆 (#221)

*/
class Application extends ConsoleApplication
{
const VERSIONS_URL = 'http://get.sensiolabs.org/symfony.version';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest using get.symfony.com instead (this is the Symfony installer after all), as it also works (and even with https)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will change to get.symfony.com but we still don't use https here
https://github.com/symfony/symfony-installer/blob/master/src/Symfony/Installer/SelfUpdateCommand.php#L125 ?
Is there any reason

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly because the last time we worked on the SelfUpdateCommand, SSL was not yet available

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to https - thanks for claryifing

@jzawadzki
Copy link
Contributor Author

@Pierstoval yes - minutes away! :D 2 solutions are still better then no solution!
Good we have @javiereguiluz to decide ;)

@stof stof mentioned this pull request Dec 5, 2015
{
$commandName = $this->getCommandName($input);

if ($this->isInPharMode() && $commandName != 'self-update' && $commandName != 'selfupdate') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- if ($this->isInPharMode() && $commandName != 'self-update' && $commandName != 'selfupdate') {
+ if ($this->isInPharMode() && !in_array($commandName, array('self-update', 'selfupdate'), true) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed - thx for review

{
$commandName = $this->getCommandName($input);

if ($this->isInPharMode() && !in_array($commandName, array('self-update', 'selfupdate'), true)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just asking: shouldn't we also avoid to call this command for list, help and the other common actions? Maybe we could replace the !in_array($commandName, array(...)) by in_array($commandName, array('new', 'demo')) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first I was 👍 You are right that those are mostly needed on new and demo, but after some considerations:

What if we change some command names/parameters and user will get old version on help (different than e.g. on symfony.com site) - that could make some problems I think?

Maybe we should still check version there and set notification but not show it as warning?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, commands' arguments and options are not likely to change very often, and the help command will still be valid for the current installed version. If someone does not have a new option, I think he'll figure out his installer is outdated.

So 👍 about Javier's suggestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok - updated!

@javiereguiluz
Copy link
Member

@jzawadzki thanks for this feature! (and thanks to @Pierstoval too for working on this feature in another pull request!)

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.

5 participants