You should not do that. Mediawiki reserves the right to delete values out
of links tables that do not correspond to a valid page id (probably would
only happen if maintenance script was run, but dont rely on that).
Putting it in objectcache table (via CACHE_DB) is safer than what you
suggest, but still not "safe". If you really want to be hacky, i suppose
you could create some page with a well known name and store it there, which
would be safe.
Why are you so reluctant to create a table? If you need to store arbitrary
information permenently, then you're going to need a table "owned" by your
extension, or it's going to be extremely hacky.
--
Bawolff
On Monday, January 27, 2020, Jeroen De Dauw <jeroendedauw(a)gmail.com> wrote:
Hey Kosta,
The values in my extension are not user specific. It is really just a
handful of values for the entire wiki.
One approach I'm considering is to abuse the page props table and have the
values "linked to page" with ID 1 billion (or -1) or so. I'm not sure how
safe that is though. The data would only be stored in the database, so not
losing it due to the running of some maintenance process is important.
Cheers
--
Jeroen De Dauw |
www.EntropyWins.wtf <https://EntropyWins.wtf>
Professional wiki hosting and services:
www.Professional.Wiki
<https://Professional.Wiki>
Software Crafter | Speaker | Entrepreneur | Open Source and Wikimedia
contributor ~=[,,_,,]:3
On Mon, 27 Jan 2020 at 12:30, Kosta Harlan <kharlan(a)wikimedia.org> wrote:
Hi,
On 1/27/20 12:13 PM, Jeroen De Dauw wrote:
> Hey,
>
> I have a MediaWiki extension in which I'd like to store a handful of
> values. Example:
>
> * Cats 42
> * Ravens 23
> * Goats 0
>
> The most obvious thing to do would be to add a new database table with
a
string
and an integer column. However I'd like to avoid the need to run
update.php to install this extension. Is there some place in the
MediaWiki
> DB schema where I can put a few values like these? They could even be
in
a
single serialized blob (though preferably can be
looked up by string
key).
You want to store these values per-user, I'm assuming? This is probably
of interest then:
https://phabricator.wikimedia.org/T128602
In GrowthExperiments extension we store small bits of data like that as
serialized blobs in hidden user preferences, but this isn't great, among
other reasons because the values are delivered on on each page load
whether you want them or not.
Kosta
Cheers
--
Jeroen De Dauw |
www.EntropyWins.wtf <https://EntropyWins.wtf>
Professional wiki hosting and services:
www.Professional.Wiki
<https://Professional.Wiki>
Software Crafter | Speaker | Entrepreneur | Open Source and Wikimedia
contributor ~=[,,_,,]:3
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l