Page MenuHomePhabricator

Reduce use of global and public variables
Open, LowPublic

Description

Author: sacolcor

Description:
This bug is intended to track background code-cleanup work aimed at reducing the use of global and public variables in the MediaWiki code base. The use of such variables is discouraged in software engineering, because as the software grows it becomes increasingly hard to ensure that they remain in a consistent state. It also makes the code more difficult to modularize, because different modules become dependent on each others' internal implementation details, instead of on clearly defined interfaces.

The most common practice to reduce these difficulties is to wrap the variables in get/set functions. Many of these functions are already present in the MW code base, but are not being used consistently. Progress on this bug will primarily consist of ensuring that access to the variables is properly routed through these functions, introducing new functions where they do not exist, and making the variables 'private' where possible, to ensure that that the accessors are not bypassed in the future.


Version: unspecified
Severity: enhancement

Details

Reference
bz9968

Related Objects

StatusAssignedTask
OpenNone
ResolvedNone
OpenNone
ResolvedCatrope
OpenNone
OpenNone
ResolvedNone
ResolvedNone
ResolvedLegoktm
Resolvedamritsreekumar
OpenNone
ResolvedLegoktm
Resolvedmatmarex
DeclinedNone
ResolvedNone
ResolvedNone
Resolved werdna
DeclinedNone
DeclinedNone
Resolved01tonythomas
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedD3r1ck01
OpenNone
ResolvedTgr
ResolvedAnomie
ResolvedJoe
ResolvedJoe
Resolvedhashar
Resolvedbd808
ResolvedAnomie
ResolvedKrinkle
OpenNone
ResolvedJanZerebecki
ResolvedKrinkle
ResolvedTgr
OpenNone
ResolvedNone
OpenNone
ResolvedFlorian
ResolvedFlorian
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenSimetrical
OpenNone
ResolvedLegoktm
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedSimetrical
OpenNone
ResolvedSimetrical
Resolvedhashar
ResolvedNone
OpenNone
OpenCenarium
OpenNone
OpenD3r1ck01

Event Timeline

bzimport raised the priority of this task from to Low.
bzimport set Reference to bz9968.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.May 19 2007, 8:12 PM

Blocks the tracking bug 700 (Code quality issues)

sacolcor wrote:

Encapsulate wgCanonicalNamespaceNames

My first patch; suggestions for improvement welcome.

attachment bug9968-1.diff ignored as obsolete

sacolcor wrote:

Comment on attachment 3654
Encapsulate wgCanonicalNamespaceNames

Attachment moved to child bug.

Adding 'tracking' keyword.

*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*

Krinkle set Security to None.
Krinkle removed a subscriber: Unknown Object (MLST).
hashar removed a subscriber: hashar.Dec 10 2014, 9:40 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 23 2015, 9:56 AM
Phabricator_maintenance renamed this task from Reduce use of global and public variables (tracking) to Reduce use of global and public variables.Aug 13 2016, 11:30 PM