Ok, new issue...
I've changed usage inside of User.php from getText and getPrefixedText
to getDBkey and getPrefixedDBkey.
However I notice an issue with the User functions themselves:
We have a getName function, and additionally for awhile we've had a
getTitleKey, but other than a single occurrence inside of Article.php,
it's widely unused.
That means that getName is used for both uniqueness testing, and display.
Obviously, because usernames are now stored in key form rather than text
form we are going to need to separate the functional use of functions
inside the User class for backend and display use.
We've got a few options here:
A) Create a new function getTitle which returns the title object which
the User matches, and make use of it's functions for the standard
displays and other things. Of course this is bascialy the same as
getUserPage.
B) Change getName's definition to be the display form of a user's name,
and getTitleKey to be the key form of the user's name. And change the
large number of comparison functions inside of MediaWiki to use
getTitleKey instead of getName.
C) Create a new function getDisplayName, and have getName's definition
changed to the key form of the user's name, and getDisplayName as the
display form of the user's name. Depreciate the use of getTitleKey
because of it's lack of use or need anymore (changing a single reference
to it). And change the uses of getName as a display value inside of
MediaWiki to use getDisplayName instead.
D) Create two new functions for the key and display forms of the user's
name. And depreciate the old functions, slowly changing use of them to
the new functions in MW to keep compatibility.
I'm probably in favor of C, as if it's definition is changed to key
form, all the backend testing and stuff will still work fine, and we
then will only need to worry about changing the areas that the username
is used for display. Which won't really be a problem if we miss
anything, because if we end up missing one conversion, the system will
simply be displaying a semi-ugly form with underscores inside of it and
none of the case stuff picked by the user. And it'll still be likable
and won't break anything in the backend.
Oh, ^_^ an interesting new ability due to switching to key form:
SELECT user_editcount FROM `user`, `page` WHERE user_name=page_title AND
page_namespace=2 AND page_id=3
In this example, page_id 3 is the userpage of my user's userpage.
What does it do? Well, if you were on the userpage of a user and just
had the page ID, you could now easily grab any information from the
database on that user himself because page_name and user_name are stored
in the same format instead of different formats.
^_^ Of course, this example isn't to useful, but I'm sure someone will
find some use for the two being a match now.
Though it looks like I'm also going to have to add some more database stuff.
* archives is going to need a ar_real field so that deleting a page
doesn't break it's titling.
* rev_user_text is going to need the same conversion that user_name
underwent, and I'll also need to do some stuff inside the backend to
change how the name of the user is displayed.
* same goes for image_user_text, ipb_by_text, oi_user_text,
rc_user_text, and ar_user_text
Oh, minor off topic. But what about putting a log_user_text in at some
point. Honnestly I know of a few extensions which intended to allow
certain things to be done by anons in addition to normal users, but
which broke when anons were allowed use of them because anon users were
not properly logged.
~Daniel Friesen(Dantman) of:
-The Gaiapedia (
http://gaia.wikia.com)
-Wikia ACG on
Wikia.com (
http://wikia.com/wiki/Wikia_ACG)
-and
Wiki-Tools.com (
http://wiki-tools.com)
DanTMan wrote:
Ok, B it is. I'll add another entry to
updaters.inc when I get home and
start by first converting all uses of getText in User.php to getDBkey.
After the actual title stuff is built, we can track down all the places
which use a displayable version of the name and make them use the
displayname instead.
...
~Daniel Friesen(Dantman) of:
-The Gaiapedia (
http://gaia.wikia.com)
-Wikia ACG on
Wikia.com (
http://wikia.com/wiki/Wikia_ACG)
-and
Wiki-Tools.com (
http://wiki-tools.com)
Simetrical wrote:
On Thu, Mar 6, 2008 at 2:43 AM, DanTMan
<dan_the_man(a)telus.net> wrote:
B) Make use of getDBkey for identification of
the user and have the
update script refactor the users table to use underscores like it should
instead of spaces.
The idea of having separate normalized/display names makes as much
sense for users as for titles, certainly. This seems like the more
logical option. It's not like we aren't going to have be doing
rebuilding and repopulating of the page table to do this anyway, so
why not the user table too?
_______________________________________________
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