Is there a description somewhere of what the log_params mean in this query?
MariaDB [enwiki_p]> select log_params from logging_logindex where log_namespace = 2 and log_title = 'RoySmith-testing' and log_type = 'block' order by log_timestamp asc; +---------------------------------------------------------------------------------------------------------+ | log_params | +---------------------------------------------------------------------------------------------------------+ | a:3:{s:11:"5::duration";s:9:"5 minutes";s:8:"6::flags";s:11:"noautoblock";s:8:"sitewide";b:1;} | | a:3:{s:11:"5::duration";s:9:"5 minutes";s:8:"6::flags";s:20:"nocreate,noautoblock";s:8:"sitewide";b:1;} | | a:0:{} | +---------------------------------------------------------------------------------------------------------+ 3 rows in set (0.00 sec)
AFAIK, this kind of information is from serialize[1] and unserialize php functions. See the information from Mediawiki table documentation[2]
[1] https://www.php.net/manual/en/function.serialize.php [2] https://www.mediawiki.org/wiki/Manual:Logging_table#log_params
On Wed, Dec 4, 2019 at 9:50 PM Roy Smith roy@panix.com wrote:
Is there a description somewhere of what the log_params mean in this query?
MariaDB [enwiki_p]> select log_params from logging_logindex where log_namespace = 2 and log_title = 'RoySmith-testing' and log_type = 'block' order by log_timestamp asc;
+---------------------------------------------------------------------------------------------------------+ | log_params |
+---------------------------------------------------------------------------------------------------------+ | a:3:{s:11:"5::duration";s:9:"5 minutes";s:8:"6::flags";s:11:"noautoblock";s:8:"sitewide";b:1;} | | a:3:{s:11:"5::duration";s:9:"5 minutes";s:8:"6::flags";s:20:"nocreate,noautoblock";s:8:"sitewide";b:1;} | | a:0:{} |
+---------------------------------------------------------------------------------------------------------+ *3 rows in set (0.00 sec)*
Wikimedia Cloud Services mailing list Cloud@lists.wikimedia.org (formerly labs-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/cloud
Well, that answers the syntax of the encoding, but I'm also looking for the semantics, i.e. what the various fields mean, although I can guess at some of it.
I also need to figure out how to parse this in Python. I have much empathy for the anonymous author of this comment https://www.php.net/manual/en/function.serialize.php#107717.
On Dec 4, 2019, at 7:53 PM, Dennis Tobar dennis.tobar@gmail.com wrote:
AFAIK, this kind of information is from serialize[1] and unserialize php functions. See the information from Mediawiki table documentation[2]
[1] https://www.php.net/manual/en/function.serialize.php https://www.php.net/manual/en/function.serialize.php [2] https://www.mediawiki.org/wiki/Manual:Logging_table#log_params https://www.mediawiki.org/wiki/Manual:Logging_table#log_params On Wed, Dec 4, 2019 at 9:50 PM Roy Smith <roy@panix.com mailto:roy@panix.com> wrote: Is there a description somewhere of what the log_params mean in this query?
MariaDB [enwiki_p]> select log_params from logging_logindex where log_namespace = 2 and log_title = 'RoySmith-testing' and log_type = 'block' order by log_timestamp asc; +---------------------------------------------------------------------------------------------------------+ | log_params | +---------------------------------------------------------------------------------------------------------+ | a:3:{s:11:"5::duration";s:9:"5 minutes";s:8:"6::flags";s:11:"noautoblock";s:8:"sitewide";b:1;} | | a:3:{s:11:"5::duration";s:9:"5 minutes";s:8:"6::flags";s:20:"nocreate,noautoblock";s:8:"sitewide";b:1;} | | a:0:{} | +---------------------------------------------------------------------------------------------------------+ 3 rows in set (0.00 sec)
Wikimedia Cloud Services mailing list Cloud@lists.wikimedia.org mailto:Cloud@lists.wikimedia.org (formerly labs-l@lists.wikimedia.org mailto:labs-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/cloud https://lists.wikimedia.org/mailman/listinfo/cloud
-- Dennis Tobar Calderón Ingeniero en Informática UTEM _______________________________________________ Wikimedia Cloud Services mailing list Cloud@lists.wikimedia.org (formerly labs-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/cloud
On Dec 4, 2019, at 8:07 PM, Roy Smith roy@panix.com wrote:
I also need to figure out how to parse this in Python.
Oh, looks like https://pypi.org/project/phpserialize/ https://pypi.org/project/phpserialize/ can handle that part.
Yeah, phpserialize will handle these parameters. Keep in mind that this field is stored as a byte string in the database, so you might have to convert it to a string (using encode()) for phpserialize to parse it.
You can find information about some of the parameters in the Help:Blocking users https://www.mediawiki.org/wiki/Help:Blocking_users manual pages. If the "sitewide" flag is false (0), it's a partial block https://meta.wikimedia.org/wiki/Community_health_initiative/Partial_blocks and will have additional parameters for the pages and/or namespaces that are blocked. IIRC partial blocks aren't enabled on English Wikipedia yet, so it would only apply if you're working with wikis where it is.
Cheers, Morten
On Wed, 4 Dec 2019 at 17:09, Roy Smith roy@panix.com wrote:
On Dec 4, 2019, at 8:07 PM, Roy Smith roy@panix.com wrote:
I also need to figure out how to parse this in Python.
Oh, looks like https://pypi.org/project/phpserialize/ can handle that part. _______________________________________________ Wikimedia Cloud Services mailing list Cloud@lists.wikimedia.org (formerly labs-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/cloud
Roy:
Sorry if I was bit rude in my previous email.
The unparsed string has an array with the follow keys:
* duration (time calculated(?) in plain English) * flags (permissions restricted) * sitewide: 1 if it's a fully block; 0 partial block
See more in https://www.mediawiki.org/wiki/Manual:Log_actions
Kindly,
On Wed, Dec 4, 2019 at 10:09 PM Roy Smith roy@panix.com wrote:
On Dec 4, 2019, at 8:07 PM, Roy Smith roy@panix.com wrote:
I also need to figure out how to parse this in Python.
Oh, looks like https://pypi.org/project/phpserialize/ can handle that part. _______________________________________________ Wikimedia Cloud Services mailing list Cloud@lists.wikimedia.org (formerly labs-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/cloud
On Dec 4, 2019, at 9:51 PM, Dennis Tobar dennis.tobar@gmail.com wrote:
Roy:
Sorry if I was bit rude in my previous email.
Oh, not at all. I didn't think you were rude. You got me pointed in the right direction, which I appreciate, and I think I've got enough here (and from Morten Wang's additional help) to get where I need to go. Thanks.
The unparsed string has an array with the follow keys:
- duration (time calculated(?) in plain English)
- flags (permissions restricted)
- sitewide: 1 if it's a fully block; 0 partial block
See more in https://www.mediawiki.org/wiki/Manual:Log_actions https://www.mediawiki.org/wiki/Manual:Log_actions
Kindly,
On Wed, Dec 4, 2019 at 10:09 PM Roy Smith <roy@panix.com mailto:roy@panix.com> wrote:
On Dec 4, 2019, at 8:07 PM, Roy Smith <roy@panix.com mailto:roy@panix.com> wrote:
I also need to figure out how to parse this in Python.
Oh, looks like https://pypi.org/project/phpserialize/ https://pypi.org/project/phpserialize/ can handle that part. _______________________________________________ Wikimedia Cloud Services mailing list Cloud@lists.wikimedia.org mailto:Cloud@lists.wikimedia.org (formerly labs-l@lists.wikimedia.org mailto:labs-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/cloud https://lists.wikimedia.org/mailman/listinfo/cloud
-- Dennis Tobar Calderón Ingeniero en Informática UTEM _______________________________________________ Wikimedia Cloud Services mailing list Cloud@lists.wikimedia.org (formerly labs-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/cloud