User:Skizzerz/Namespaces

Preliminary notes
Notes to myself for the upcoming Special:Namespaces (see MediaWiki roadmap). I'm planning on including most of the necessary schema changes for this as part of the configuration database RFC. Should that be accepted, another RFC will be created to further discuss the other changes detailed below.


 * Will meet all of the specifications set out in Extension:Namespace manager (page detailing the special page as it exists in the outdated wikidata branch)
 * Support all current namespace configuration variables
 * Manual:Configuration settings
 * Use a table in the database to hold these namespaces and their configuration, then parse them out on startup (before LocalSettings)
 * Start numbering custom namespaces at 300 so it doesn't conflict with extension-added namespaces
 * Register constants NS_* to correspond with the numbers
 * Improved UI
 * Allow deletion of namespaces with pages in it for those with the merge_pseudonamespaces right
 * This will automatically reassign all pages in that namespace to the main namespace, then delete that namespace
 * System namespaces still cannot be deleted
 * This will re-add the prefix to the page name and reassign the namespace to the main namespace
 * Reversible by re-creating the namespace (all the pages will be merged back in)
 * Allow adding new namespaces which conflict with existing pseudonamespaces for those with the merge_pseudonamespaces right
 * This will automatically strip the prefix from the page name and add in the correct namespace number
 * Reversible by deleting the new namespace (all the pages will be merged into the mainspace with proper prefix)
 * Pseudonamespace converter will automatically convert discussion pages into the appropriate talk namespace -- no checkbox option
 * Default link prefix detection should only detect actual namespaces, interwiki prefixes, or interlanguage prefixes. Pseudonamespace prefixes will still be prepended by the default link prefix
 * Related, but not really part of this feature per se: parser function to set a default link prefix on a per-page basis to override the namespace setting.
 * Talk namespace detection, either:
 * Hide discussion tab if respective talk namespace does not exist, or
 * Force creation of talk namespace

New database schema

 * New namespace table needed to hold namespace relational data
 * Cannot guarantee that a talk namespace number will directly follow the namespace it is tied to, so this change needs to be reflected in code.


 * Hold namespace names in a namespace_l10n table
 * For now just a wrapper for $wgExtraNamespaces and $wgNamespaceAliases (language all)
 * In the future might allow localized names for extra and built in namespaces


 * Index nl_namespace_name on nl_namespace and nl_name
 * Unique index nl_namespace_default on nl_namespace and nl_default

Special Page

 * Shown only to bureaucrats by default, requires 'namespaces' permission.
 * Form determines current namespaces from the namespaces table as well as namespaces added via $wgExtraNamespaces. Default namespaces and those present in wgExtraNamespaces but not in the database are marked as "protected"
 * A "protected" namespace is one that cannot be deleted, the default name cannot be changed, the namespace number cannot be changed, and the namespace constant cannot be changed. Canonical names and other options can still be modified on these namespaces (exception of "special" namespaces, which limit the number of options that can be set)
 * Form displays these namespaces in a table format, with [edit], [delete], etc. links provided to modify a specific namespace
 * We don't want to allow modification of all namespaces at once as that would cause very confusing log entries.

Current Progress/Milestones
Legend [ ] Not done [+] Partially done [x] Done [ ] Sub-item [ ] Sub-sub-item [ ] etc.

Milestone 1 (pre-alpha)
Upon completion of this milestone, the current progress so far will be committed to the special-namespaces branch of SVN. Until that point, code will be available upon request to my talk page. This milestone will feature the following:
 * Default namespaces are stored in the database instead of DefaultSettings.php
 * Custom extra namespaces defined in settings files will still work
 * Namespace variables defined in settings files will still work ($wgNamespacesWithSubpages, etc.)
 * No Special:Namespaces yet

[+] Schema (namespace and namespace_l10n tables) [x] MySQL [x] SQLite [ ] Postgres [ ] DB2 (?) [ ] Oracle (?) [x] Work into installer [x] Work into updater [ ] Populate namespace table with default namespaces [ ] Maintenance script to restore default namespaces in case they get deleted/corrupted [ ] Remove default namespace definitions from DefaultSettings.php [ ] Figure out some way of registering namespaces before LocalSettings.php gets loaded [ ] Maintain interoperability with $wgExtraNamespaces (for extensions) [ ] Maintain interoperability with configuration variables that affect namespaces ($wgNamespacesWithSubpages, etc.)

Milestone 2 (alpha) - TENTATIVE
Features completed in this milestone will be committed to the SVN branch as they are completed. This milestone will feature the basics described on this page, but nothing fancy quite yet. Features:
 * Special:Namespaces operational for adding/deleting custom namespaces and configuring namespace options for custom and default namespaces
 * Options set in LocalSettings or other config files currently override any options set in the database
 * No pseudonamespace support yet
 * No default link prefixes yet
 * No per-language namespace names yet
 * To be expanded...

[ ] Merge recent changes from trunk to ensure compatibility with existing pre-alpha code [ ] Special:Namespaces page [ ] Logging

To be expanded...

Milestone 3 (beta) - TENTATIVE
Features completed in this milestone will be committed to the SVN branch as they are completed. Features:
 * Pseudonamespace support
 * Default link prefixes (with DEFAULTPREFIX: parser function)
 * To be expanded...

[ ] Merge recent changes from trunk to ensure compatibility with existing alpha code [ ] Pseudonamespace support [ ] Default link prefixes

To be expanded...

Milestone 4 (v1) - TENTATIVE
Features completed in this milestone will be committed to the SVN branch as they are completed. Once totally finished, the current code will be merged back into trunk for the 1.17 release. Features:
 * To be expanded...

[ ] Merge recent changes from trunk to ensure compatibility with existing beta code [ ] Merge into trunk [ ] Merge recent changes from trunk first to ensure compatibility with code thus far [ ] Merge code thus far back into trunk for 1.17 release

To be expanded...