[MediaWiki-l] extension to get Mediawiki version in copy/paste text form for support

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[MediaWiki-l] extension to get Mediawiki version in copy/paste text form for support

rkevans
Hi,

I was wondering if anyone knows of a nice clever way to get a simple non-html, text-only listing of the core MW version info and the extensions installed and their versions (no parser hooks, libraries, etc..) just the  installed elements and versions of them.

The goal is to have a nice simple way to attach that info to a support thread without having to craft it by hand and update it each time manually.

Thanks!
-Rich
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: extension to get Mediawiki version in copy/paste text form for support

John Doe-27
API via siteinfo should give you what you need

On Fri, Sep 15, 2017 at 9:33 AM Evans, Richard K. (GRC-H000) <
[hidden email]> wrote:

> Hi,
>
> I was wondering if anyone knows of a nice clever way to get a simple
> non-html, text-only listing of the core MW version info and the extensions
> installed and their versions (no parser hooks, libraries, etc..) just the
> installed elements and versions of them.
>
> The goal is to have a nice simple way to attach that info to a support
> thread without having to craft it by hand and update it each time manually.
>
> Thanks!
> -Rich
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: extension to get Mediawiki version in copy/paste text form for support

rkevans
W00t! Thanks (y)

-----Original Message-----
From: MediaWiki-l [mailto:[hidden email]] On Behalf Of John
Sent: Friday, September 15, 2017 9:53 AM
To: MediaWiki announcements and site admin list
Subject: Re: [MediaWiki-l] extension to get Mediawiki version in copy/paste text form for support

API via siteinfo should give you what you need

On Fri, Sep 15, 2017 at 9:33 AM Evans, Richard K. (GRC-H000) < [hidden email]> wrote:

> Hi,
>
> I was wondering if anyone knows of a nice clever way to get a simple
> non-html, text-only listing of the core MW version info and the
> extensions installed and their versions (no parser hooks, libraries,
> etc..) just the installed elements and versions of them.
>
> The goal is to have a nice simple way to attach that info to a support
> thread without having to craft it by hand and update it each time manually.
>
> Thanks!
> -Rich
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: extension to get Mediawiki version in copy/paste text form for support

rkevans
Hmm...
https://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=extensions|name
responds with:
...
"*": "Unrecognized value for parameter \"siprop\": name."
...

Which contradicts the documentation at:
https://www.mediawiki.org/wiki/API:Siteinfo#Extensions

thoughts?
-Rich
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: extension to get Mediawiki version in copy/paste text form for support

יגאל חיטרון-3
"Name" is not siprop subparameter.
Igal


2017-09-15 17:48 GMT+03:00 Evans, Richard K. (GRC-H000) <
[hidden email]>:

> Hmm...
> https://en.wikipedia.org/w/api.php?action=query&meta=
> siteinfo&siprop=extensions|name
> responds with:
> ...
> "*": "Unrecognized value for parameter \"siprop\": name."
> ...
>
> Which contradicts the documentation at:
> https://www.mediawiki.org/wiki/API:Siteinfo#Extensions
>
> thoughts?
> -Rich
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
>
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: extension to get Mediawiki version in copy/paste text form for support

rkevans
Ok.. forgive me for being slow in understanding this. This API interface is new to me.
Are you saying I can't get *just* a list of extension names and corresponding versions from the API?
If so, is it easy to show me how? (sorry to have to ask)
Ty
-Rich

-----Original Message-----
From: MediaWiki-l [mailto:[hidden email]] On Behalf Of ???? ??????
Sent: Friday, September 15, 2017 11:07 AM
To: MediaWiki announcements and site admin list
Subject: Re: [MediaWiki-l] extension to get Mediawiki version in copy/paste text form for support

"Name" is not siprop subparameter.
Igal


2017-09-15 17:48 GMT+03:00 Evans, Richard K. (GRC-H000) <
[hidden email]>:

> Hmm...
> https://en.wikipedia.org/w/api.php?action=query&meta=
> siteinfo&siprop=extensions|name
> responds with:
> ...
> "*": "Unrecognized value for parameter \"siprop\": name."
> ...
>
> Which contradicts the documentation at:
> https://www.mediawiki.org/wiki/API:Siteinfo#Extensions
>
> thoughts?
> -Rich
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
>
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: extension to get Mediawiki version in copy/paste text form for support

Bartosz Dziewoński
On 2017-09-15 17:11, Evans, Richard K. (GRC-H000) wrote:
> Ok.. forgive me for being slow in understanding this. This API interface is new to me.
> Are you saying I can't get*just*  a list of extension names and corresponding versions from the API?
> If so, is it easy to show me how? (sorry to have to ask)

No, you can only get the entire JSON structure.

If the goal is to "to have a nice simple way to attach that info to a
support thread", then you can probably just copypaste the entire thing?
Otherwise, you'll have to extract extensions' names from it.

--
Bartosz Dziewoński

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: extension to get Mediawiki version in copy/paste text form for support

kghbln
I see the usecase and I thing issue and bug reports could very much
benefit from that. Wouldn't this be something for MediaWiki core to
provide via a special page or some action raw to special Version that
just emits the raw data in a copy paste way except for the descriptions?

Cheers Karsten

Am 15.09.2017 um 17:44 schrieb Bartosz Dziewoński:

> On 2017-09-15 17:11, Evans, Richard K. (GRC-H000) wrote:
>> Ok.. forgive me for being slow in understanding this. This API
>> interface is new to me.
>> Are you saying I can't get*just*  a list of extension names and
>> corresponding versions from the API?
>> If so, is it easy to show me how? (sorry to have to ask)
>
> No, you can only get the entire JSON structure.
>
> If the goal is to "to have a nice simple way to attach that info to a
> support thread", then you can probably just copypaste the entire thing?
> Otherwise, you'll have to extract extensions' names from it.
>


_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: extension to get Mediawiki version in copy/paste text form for support

יגאל חיטרון-3
There are some (maybe many) special pages that can't returm raw information
(compare Special:Randompage with Special:RandomInCategory for example).
Maybe it's better to think how to make all them same, in place of creation
a raw version one by one.
Igal


2017-09-15 18:51 GMT+03:00 [[kgh]] <[hidden email]>:

> I see the usecase and I thing issue and bug reports could very much
> benefit from that. Wouldn't this be something for MediaWiki core to
> provide via a special page or some action raw to special Version that
> just emits the raw data in a copy paste way except for the descriptions?
>
> Cheers Karsten
>
> Am 15.09.2017 um 17:44 schrieb Bartosz Dziewoński:
> > On 2017-09-15 17:11, Evans, Richard K. (GRC-H000) wrote:
> >> Ok.. forgive me for being slow in understanding this. This API
> >> interface is new to me.
> >> Are you saying I can't get*just*  a list of extension names and
> >> corresponding versions from the API?
> >> If so, is it easy to show me how? (sorry to have to ask)
> >
> > No, you can only get the entire JSON structure.
> >
> > If the goal is to "to have a nice simple way to attach that info to a
> > support thread", then you can probably just copypaste the entire thing?
> > Otherwise, you'll have to extract extensions' names from it.
> >
>
>
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
>
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: extension to get Mediawiki version in copy/paste text form for support

James Hare-4
Several special pages in MediaWiki (I am thinking of the “pager” class in
particular) do this frustrating thing where they combine data and
presentation logic, meaning you can’t get access to the underlying data
except as an HTML table. This means you either get the table and transform
it how you wish, or you do a raw database query to get the same data
anyway. Maybe one day I will fix this.


On September 15, 2017 at 8:56:01 AM, יגאל חיטרון ([hidden email])
wrote:

There are some (maybe many) special pages that can't returm raw information
(compare Special:Randompage with Special:RandomInCategory for example).
Maybe it's better to think how to make all them same, in place of creation
a raw version one by one.
Igal


2017-09-15 18:51 GMT+03:00 [[kgh]] <[hidden email]>:

> I see the usecase and I thing issue and bug reports could very much
> benefit from that. Wouldn't this be something for MediaWiki core to
> provide via a special page or some action raw to special Version that
> just emits the raw data in a copy paste way except for the descriptions?
>
> Cheers Karsten
>
> Am 15.09.2017 um 17:44 schrieb Bartosz Dziewoński:
> > On 2017-09-15 17:11, Evans, Richard K. (GRC-H000) wrote:
> >> Ok.. forgive me for being slow in understanding this. This API
> >> interface is new to me.
> >> Are you saying I can't get*just* a list of extension names and
> >> corresponding versions from the API?
> >> If so, is it easy to show me how? (sorry to have to ask)
> >
> > No, you can only get the entire JSON structure.
> >
> > If the goal is to "to have a nice simple way to attach that info to a
> > support thread", then you can probably just copypaste the entire thing?
> > Otherwise, you'll have to extract extensions' names from it.
> >
>
>
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
>
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: extension to get Mediawiki version in copy/paste text form for support

rkevans
In reply to this post by rkevans
Gotcha..

I made a file called “mw-version.php file in /var/www/html/ with the following php:
<?php
$url = "https://en.wikipedia.org/w";
$p = xml_parser_create();
xml_parse_into_struct($p, file_get_contents($url."/api.php?action=query&meta=siteinfo&siprop=extensions&format=xml"), $vals, $index);
xml_parser_free($p);
$i=0;
foreach($vals as $item) {
foreach(explode(",", var_export($item, true)) as $mytext) {
  if( (strstr($mytext,"'NAME'")) || (strstr($mytext,"'VERSION'")) ) {
   $mytext = str_replace("'","",$mytext);
   $mytext = str_replace("\n","",$mytext);
   $mytext = str_replace("NAME => ","",$mytext);
   $mytext = str_replace("    VERSION => "," = ",$mytext);
   print($mytext);
  }
}
$i++;print("<br/>\n".$i." - ");
}
?>


And it did essentially what I wanted

Thanks!



-Rich

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: extension to get Mediawiki version in copy/paste text form for support

kghbln
Thanks for sharing your script Rich, however it still does not appear to
be the easiest solution to me.

Anyways judging from the numerous reactions we got so far nobody coding
for MediaWiki core thinks that an easier way to provide somewhat decent
setup information to issue reports is desired. So let's just coninue as
always.

Cheers Karsten

Am 15.09.2017 um 19:55 schrieb Evans, Richard K. (GRC-H000):

> Gotcha..
>
> I made a file called “mw-version.php file in /var/www/html/ with the following php:
> <?php
> $url = "https://en.wikipedia.org/w";
> $p = xml_parser_create();
> xml_parse_into_struct($p, file_get_contents($url."/api.php?action=query&meta=siteinfo&siprop=extensions&format=xml"), $vals, $index);
> xml_parser_free($p);
> $i=0;
> foreach($vals as $item) {
> foreach(explode(",", var_export($item, true)) as $mytext) {
>   if( (strstr($mytext,"'NAME'")) || (strstr($mytext,"'VERSION'")) ) {
>    $mytext = str_replace("'","",$mytext);
>    $mytext = str_replace("\n","",$mytext);
>    $mytext = str_replace("NAME => ","",$mytext);
>    $mytext = str_replace("    VERSION => "," = ",$mytext);
>    print($mytext);
>   }
> }
> $i++;print("<br/>\n".$i." - ");
> }
> ?>
>
>
> And it did essentially what I wanted
>
> Thanks!
>
>
>
> -Rich
>
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: extension to get Mediawiki version in copy/paste text form for support

Legoktm
Hi,

On 09/16/2017 03:32 AM, [[kgh]] wrote:
> Anyways judging from the numerous reactions we got so far nobody coding
> for MediaWiki core thinks that an easier way to provide somewhat decent
> setup information to issue reports is desired. So let's just coninue as
> always.

I think the request here is a good one. I would be in favor of adding a
maintenance script that output a plain text copy of version information
to input into bug reports (something similar to `php -i` maybe). I'm not
sure if it makes sense to have it accessible via the web.

-- Legoktm

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: extension to get Mediawiki version in copy/paste text form for support

kghbln
Heiya Legoktm,

thanks for your input on this. Now I think it is worth creating a
respective task on phabricator and so I did: [0].

Cheers Karsten

[0] https://phabricator.wikimedia.org/T176643


Am 19.09.2017 um 03:16 schrieb Legoktm:

> Hi,
>
> On 09/16/2017 03:32 AM, [[kgh]] wrote:
>> Anyways judging from the numerous reactions we got so far nobody coding
>> for MediaWiki core thinks that an easier way to provide somewhat decent
>> setup information to issue reports is desired. So let's just coninue as
>> always.
> I think the request here is a good one. I would be in favor of adding a
> maintenance script that output a plain text copy of version information
> to input into bug reports (something similar to `php -i` maybe). I'm not
> sure if it makes sense to have it accessible via the web.
>
> -- Legoktm
>
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l