Topic on Extension talk:Lingo

Cavila (talkcontribs)

I just tried installing this extension through Composer, but every attempt fails with "UnexpectedValueException" ("Could not parse version constraint *", likewise for dev-master).

Some alternative syntax I tried

  • Putting a double colon between package and version (per instructions for the Chameleon skin), but no luck: [Invalid Argument Exception] ("could not find package * with any version for your minimum stability (stable)").
  • Likewise, ":~". No luck.
  • replacing single quotes with double quotes. To no avail.
  • Using quotes around the package as well. Again, no luck.

I'm at a loss here. Could there be something wrong with the download location?

F.trott (talkcontribs)

Does the following work: composer require "mediawiki/lingo:*"?

Cavila (talkcontribs)

That was quick, and yes, it does! Many thanks for that!

F.trott (talkcontribs)

Thanks for the report! I changed the installation instructions.

Cavila (talkcontribs)
F.trott (talkcontribs)

Thanks!

Kghbln (talkcontribs)

Besides, this seems to be an breaking change in Composer or is this just another way to use it. Something like "mediawiki/semantic-media-wiki": "dev-uri-output" still works for me on SMW. If it is not Composer but extension specific I would rather prefer to keep things consistent to other exensions, i.e. as it was before. I guess it is a bit confusing for people to figure out which syntax to use for what extension. I am not saying that I do not like this shorter syntax, in contrary.

Kghbln (talkcontribs)

Ah, there is probably a difference now between using the json file and the require command?! This I do not like at all. :( Still like the new syntax :)

Kghbln (talkcontribs)

That's a complete mess, isn't it? Does that mean that all instructions on how to install via Composer on command line have to be changed?

MWJames (talkcontribs)

There has been no breaking change in how Composer uses boundary operators, the usage of @dev or dev-master has the same meaning as before.

F.trott (talkcontribs)

"mediawiki/semantic-media-wiki": "dev-uri-output" should also still work.

This is basically a problem of the shell you use. It will transform strings with quotation marks and hand the result down to the program. So, in essence, Composer has never seen and will never see any of your quotation marks, regardless of which form you use. There are other transformations done by the shell, e.g. * is replaced by a list of files in the current directory if not correctly escaped.

I am still not completely sure why the old form did not work for cavila. Just tried it and it worked like a charm. Could be that it depends on the shell you use, e.g. Windows CLI might work different than Bash.

Kghbln (talkcontribs)

Thank you so much for explaining the details! I am somewhat reassured. However I still see a risk in having the "new" syntax in the docu since it differs to the json. Rather have a note that if this does not work on shell do that. I think this will confuse people like it confused me for a moment.

F.trott (talkcontribs)

It's only confusing if you assume the shell to understand JSON syntax? Uhm, JSON fragment syntax, that is. :) Ideally it should not be necessary for a user to ever open composer.json.

Kghbln (talkcontribs)

True, but I personally think it much more convenient to edit composer.json and to have a copy of this. MW 1.24 is dreading. ;)

MWJames (talkcontribs)

That's right the "normal" user should not nned to edit the composer.json has sh(he) can introduce syntax errors without realizing it.

As for MW 1.24, users have to be aware that an existing composer.json is being overridden and therefore can possibly delete all existing installed extensions if `composer update` is immediately execute after a MW update (because the new composer.json does not contain the extension information and has to be copied by hand or re-added via `composer require`).

Cavila (talkcontribs)

It's an AMPPS installation of MediaWiki on a local computer with Windows 8.1. Perhaps it's Windows that's behaving differently here. The version of Composer that I'm using is fairly recent (less than two months old).

MWJames (talkcontribs)

> Could be that it depends on the shell you use, e.g. Windows CLI might work different than Bash.

I'm using Win and the provided git/bash CLI works in the same way as it does on Linux/Unix.

F.trott (talkcontribs)

When I use composer require "mediawiki/lingo" "*" the Win Git Bash will expand the "*" with a list of files in the current directory, resulting in the UnexpectedValueException. composer require "mediawiki/lingo:*" seems to work , so I'll use that for installation instructions.

MWJames (talkcontribs)

> When I use composer require "mediawiki/lingo" "*"

I think the documentation [0] clearly states on how to use boundary indicators such as `php composer.phar global require fabpot/php-cs-fixer:dev-master` or `php composer.phar require vendor/package:2.* vendor/package2:dev-master`. I'm not sure who introduced the `"mediawiki/lingo" "*"` notion.

Of course the json content is being described by something like `"composer/installers": "1.*,>=1.0.1",` but this relates to the json an not to the CLI usage.

[0] https://getcomposer.org/doc/03-cli.md