Page MenuHomePhabricator

Store Commons path in a variable/constant in InitialiseSettings.php instead of duplicating it
Closed, InvalidPublic

Description

The text "//upload.wikimedia.org/wikipedia/commons/" in InitialiseSettings.php is currently duplicated a lot (over 350 times; cf. https://noc.wikimedia.org/conf/InitialiseSettings.php.txt). I'm wondering whether it makes sense to store this string in a reusable variable (e.g., $commonsPath).

Pro: it would reduce the overall file size and make certain sections (particularly the logo section) easier to read.

Con: it would slightly obfuscate the path to (for example) a logo. Rather than being a mostly complete string as it is now, it would become "$commonsPath . /1/d/whatever.png".


Version: wmf-deployment
Severity: enhancement

Details

Reference
bz48618

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:17 AM
bzimport set Reference to bz48618.
bzimport added a subscriber: Unknown Object (MLST).
Reedy added a comment.May 19 2013, 4:39 PM

Or even a constant could make sense at the top of the file (it's really not going to be changing any time soon etc)

Change 131914 had a related patch set uploaded by Withoutaname:
Reduce string URLs to defined constant

https://gerrit.wikimedia.org/r/131914

Krenair added a subscriber: Krenair.
Krenair closed this task as Invalid.Aug 13 2015, 10:26 AM

After https://gerrit.wikimedia.org/r/#/c/209616/ there are only two occurrences left, one of which will be dealt with in T49662 and the other is wgUploadPath.

Restricted Application added subscribers: Steinsplitter, Matanya. · View Herald TranscriptAug 13 2015, 10:26 AM