[MediaWiki-commits] [Gerrit] registration: Fix namespaces added through the ExtensionProc... - change (mediawiki/core)

2015-09-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: registration: Fix namespaces added through the 
ExtensionProcessor
..


registration: Fix namespaces added through the ExtensionProcessor

Using $wgExtraNamespaces overrides any localized namespaces with the
canonical form, which is not ideal.

Namespaces added through extension.json will now store the canonical
form and numerical id in a 'ExtensionNamespaces' attribute that is read
by MWNamespace::getCanonicalNamespaces().

Also fix the documentation on $wgExtraNamespaces, as using
$wgCanonicalNamespaceNames has not been possible since r85327.

Bug: T110389
Change-Id: I5bd9a7258f59d8c4a7ad0543d2115960fbea9b3a
---
M includes/DefaultSettings.php
M includes/MWNamespace.php
M includes/registration/ExtensionProcessor.php
3 files changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Gilles: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 75ed529..ff32ccf 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -3636,8 +3636,8 @@
  * Additional namespaces. If the namespaces defined in Language.php and
  * Namespace.php are insufficient, you can create new ones here, for example,
  * to import Help files in other languages. You can also override the namespace
- * names of existing namespaces. Extensions developers should use
- * $wgCanonicalNamespaceNames.
+ * names of existing namespaces. Extensions should use the CanonicalNamespaces
+ * hook or extension.json.
  *
  * @warning Once you delete a namespace, the pages in that namespace will
  * no longer be accessible. If you rename it, then you can access them through
diff --git a/includes/MWNamespace.php b/includes/MWNamespace.php
index bd68551..e370bf1 100644
--- a/includes/MWNamespace.php
+++ b/includes/MWNamespace.php
@@ -210,6 +210,8 @@
if ( $namespaces === null || $rebuild ) {
global $wgExtraNamespaces, $wgCanonicalNamespaceNames;
$namespaces = array( NS_MAIN => '' ) + 
$wgCanonicalNamespaceNames;
+   // Add extension namespaces
+   $namespaces += 
ExtensionRegistry::getInstance()->getAttribute( 'ExtensionNamespaces' );
if ( is_array( $wgExtraNamespaces ) ) {
$namespaces += $wgExtraNamespaces;
}
diff --git a/includes/registration/ExtensionProcessor.php 
b/includes/registration/ExtensionProcessor.php
index 3564c71..093ffbc 100644
--- a/includes/registration/ExtensionProcessor.php
+++ b/includes/registration/ExtensionProcessor.php
@@ -210,7 +210,7 @@
foreach ( $info['namespaces'] as $ns ) {
$id = $ns['id'];
$this->defines[$ns['constant']] = $id;
-   $this->globals['wgExtraNamespaces'][$id] = 
$ns['name'];
+   $this->attributes['ExtensionNamespaces'][$id] = 
$ns['name'];
if ( isset( $ns['gender'] ) ) {

$this->globals['wgExtraGenderNamespaces'][$id] = $ns['gender'];
}

-- 
To view, visit https://gerrit.wikimedia.org/r/237973
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5bd9a7258f59d8c4a7ad0543d2115960fbea9b3a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_25
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Gilles 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] registration: Fix namespaces added through the ExtensionProc... - change (mediawiki/core)

2015-09-13 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: registration: Fix namespaces added through the 
ExtensionProcessor
..

registration: Fix namespaces added through the ExtensionProcessor

Using $wgExtraNamespaces overrides any localized namespaces with the
canonical form, which is not ideal.

Namespaces added through extension.json will now store the canonical
form and numerical id in a 'ExtensionNamespaces' attribute that is read
by MWNamespace::getCanonicalNamespaces().

Also fix the documentation on $wgExtraNamespaces, as using
$wgCanonicalNamespaceNames has not been possible since r85327.

Bug: T110389
Change-Id: I5bd9a7258f59d8c4a7ad0543d2115960fbea9b3a
---
M includes/DefaultSettings.php
M includes/MWNamespace.php
M includes/registration/ExtensionProcessor.php
3 files changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/73/237973/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 75ed529..ff32ccf 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -3636,8 +3636,8 @@
  * Additional namespaces. If the namespaces defined in Language.php and
  * Namespace.php are insufficient, you can create new ones here, for example,
  * to import Help files in other languages. You can also override the namespace
- * names of existing namespaces. Extensions developers should use
- * $wgCanonicalNamespaceNames.
+ * names of existing namespaces. Extensions should use the CanonicalNamespaces
+ * hook or extension.json.
  *
  * @warning Once you delete a namespace, the pages in that namespace will
  * no longer be accessible. If you rename it, then you can access them through
diff --git a/includes/MWNamespace.php b/includes/MWNamespace.php
index bd68551..e370bf1 100644
--- a/includes/MWNamespace.php
+++ b/includes/MWNamespace.php
@@ -210,6 +210,8 @@
if ( $namespaces === null || $rebuild ) {
global $wgExtraNamespaces, $wgCanonicalNamespaceNames;
$namespaces = array( NS_MAIN => '' ) + 
$wgCanonicalNamespaceNames;
+   // Add extension namespaces
+   $namespaces += 
ExtensionRegistry::getInstance()->getAttribute( 'ExtensionNamespaces' );
if ( is_array( $wgExtraNamespaces ) ) {
$namespaces += $wgExtraNamespaces;
}
diff --git a/includes/registration/ExtensionProcessor.php 
b/includes/registration/ExtensionProcessor.php
index 3564c71..093ffbc 100644
--- a/includes/registration/ExtensionProcessor.php
+++ b/includes/registration/ExtensionProcessor.php
@@ -210,7 +210,7 @@
foreach ( $info['namespaces'] as $ns ) {
$id = $ns['id'];
$this->defines[$ns['constant']] = $id;
-   $this->globals['wgExtraNamespaces'][$id] = 
$ns['name'];
+   $this->attributes['ExtensionNamespaces'][$id] = 
$ns['name'];
if ( isset( $ns['gender'] ) ) {

$this->globals['wgExtraGenderNamespaces'][$id] = $ns['gender'];
}

-- 
To view, visit https://gerrit.wikimedia.org/r/237973
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5bd9a7258f59d8c4a7ad0543d2115960fbea9b3a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_25
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] registration: Fix namespaces added through the ExtensionProc... - change (mediawiki/core)

2015-08-27 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: registration: Fix namespaces added through the 
ExtensionProcessor
..


registration: Fix namespaces added through the ExtensionProcessor

Using $wgExtraNamespaces overrides any localized namespaces with the
canonical form, which is not ideal.

Namespaces added through extension.json will now store the canonical
form and numerical id in a 'ExtensionNamespaces' attribute that is read
by MWNamespace::getCanonicalNamespaces().

Also fix the documentation on $wgExtraNamespaces, as using
$wgCanonicalNamespaceNames has not been possible since r85327.

Bug: T110389
Change-Id: I5bd9a7258f59d8c4a7ad0543d2115960fbea9b3a
(cherry picked from commit 9df0672255afd255ce0af34f18b8ad596f3c3e35)
---
M includes/DefaultSettings.php
M includes/MWNamespace.php
M includes/registration/ExtensionProcessor.php
3 files changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 8d7dbc8..64e075d 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -3726,8 +3726,8 @@
  * Additional namespaces. If the namespaces defined in Language.php and
  * Namespace.php are insufficient, you can create new ones here, for example,
  * to import Help files in other languages. You can also override the namespace
- * names of existing namespaces. Extensions developers should use
- * $wgCanonicalNamespaceNames.
+ * names of existing namespaces. Extensions should use the CanonicalNamespaces
+ * hook or extension.json.
  *
  * @warning Once you delete a namespace, the pages in that namespace will
  * no longer be accessible. If you rename it, then you can access them through
diff --git a/includes/MWNamespace.php b/includes/MWNamespace.php
index 731b62e..8ca205a 100644
--- a/includes/MWNamespace.php
+++ b/includes/MWNamespace.php
@@ -210,6 +210,8 @@
if ( $namespaces === null || $rebuild ) {
global $wgExtraNamespaces, $wgCanonicalNamespaceNames;
$namespaces = array( NS_MAIN => '' ) + 
$wgCanonicalNamespaceNames;
+   // Add extension namespaces
+   $namespaces += 
ExtensionRegistry::getInstance()->getAttribute( 'ExtensionNamespaces' );
if ( is_array( $wgExtraNamespaces ) ) {
$namespaces += $wgExtraNamespaces;
}
diff --git a/includes/registration/ExtensionProcessor.php 
b/includes/registration/ExtensionProcessor.php
index 68e5a17..2c792da 100644
--- a/includes/registration/ExtensionProcessor.php
+++ b/includes/registration/ExtensionProcessor.php
@@ -213,7 +213,7 @@
foreach ( $info['namespaces'] as $ns ) {
$id = $ns['id'];
$this->defines[$ns['constant']] = $id;
-   $this->globals['wgExtraNamespaces'][$id] = 
$ns['name'];
+   $this->attributes['ExtensionNamespaces'][$id] = 
$ns['name'];
if ( isset( $ns['gender'] ) ) {

$this->globals['wgExtraGenderNamespaces'][$id] = $ns['gender'];
}

-- 
To view, visit https://gerrit.wikimedia.org/r/234328
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5bd9a7258f59d8c4a7ad0543d2115960fbea9b3a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf20
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] registration: Fix namespaces added through the ExtensionProc... - change (mediawiki/core)

2015-08-27 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: registration: Fix namespaces added through the 
ExtensionProcessor
..

registration: Fix namespaces added through the ExtensionProcessor

Using $wgExtraNamespaces overrides any localized namespaces with the
canonical form, which is not ideal.

Namespaces added through extension.json will now store the canonical
form and numerical id in a 'ExtensionNamespaces' attribute that is read
by MWNamespace::getCanonicalNamespaces().

Also fix the documentation on $wgExtraNamespaces, as using
$wgCanonicalNamespaceNames has not been possible since r85327.

Bug: T110389
Change-Id: I5bd9a7258f59d8c4a7ad0543d2115960fbea9b3a
(cherry picked from commit 9df0672255afd255ce0af34f18b8ad596f3c3e35)
---
M includes/DefaultSettings.php
M includes/MWNamespace.php
M includes/registration/ExtensionProcessor.php
3 files changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/28/234328/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 8d7dbc8..64e075d 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -3726,8 +3726,8 @@
  * Additional namespaces. If the namespaces defined in Language.php and
  * Namespace.php are insufficient, you can create new ones here, for example,
  * to import Help files in other languages. You can also override the namespace
- * names of existing namespaces. Extensions developers should use
- * $wgCanonicalNamespaceNames.
+ * names of existing namespaces. Extensions should use the CanonicalNamespaces
+ * hook or extension.json.
  *
  * @warning Once you delete a namespace, the pages in that namespace will
  * no longer be accessible. If you rename it, then you can access them through
diff --git a/includes/MWNamespace.php b/includes/MWNamespace.php
index 731b62e..8ca205a 100644
--- a/includes/MWNamespace.php
+++ b/includes/MWNamespace.php
@@ -210,6 +210,8 @@
if ( $namespaces === null || $rebuild ) {
global $wgExtraNamespaces, $wgCanonicalNamespaceNames;
$namespaces = array( NS_MAIN => '' ) + 
$wgCanonicalNamespaceNames;
+   // Add extension namespaces
+   $namespaces += 
ExtensionRegistry::getInstance()->getAttribute( 'ExtensionNamespaces' );
if ( is_array( $wgExtraNamespaces ) ) {
$namespaces += $wgExtraNamespaces;
}
diff --git a/includes/registration/ExtensionProcessor.php 
b/includes/registration/ExtensionProcessor.php
index 68e5a17..2c792da 100644
--- a/includes/registration/ExtensionProcessor.php
+++ b/includes/registration/ExtensionProcessor.php
@@ -213,7 +213,7 @@
foreach ( $info['namespaces'] as $ns ) {
$id = $ns['id'];
$this->defines[$ns['constant']] = $id;
-   $this->globals['wgExtraNamespaces'][$id] = 
$ns['name'];
+   $this->attributes['ExtensionNamespaces'][$id] = 
$ns['name'];
if ( isset( $ns['gender'] ) ) {

$this->globals['wgExtraGenderNamespaces'][$id] = $ns['gender'];
}

-- 
To view, visit https://gerrit.wikimedia.org/r/234328
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5bd9a7258f59d8c4a7ad0543d2115960fbea9b3a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf20
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] registration: Fix namespaces added through the ExtensionProc... - change (mediawiki/core)

2015-08-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: registration: Fix namespaces added through the 
ExtensionProcessor
..


registration: Fix namespaces added through the ExtensionProcessor

Using $wgExtraNamespaces overrides any localized namespaces with the
canonical form, which is not ideal.

Namespaces added through extension.json will now store the canonical
form and numerical id in a 'ExtensionNamespaces' attribute that is read
by MWNamespace::getCanonicalNamespaces().

Also fix the documentation on $wgExtraNamespaces, as using
$wgCanonicalNamespaceNames has not been possible since r85327.

Bug: T110389
Change-Id: I5bd9a7258f59d8c4a7ad0543d2115960fbea9b3a
---
M includes/DefaultSettings.php
M includes/MWNamespace.php
M includes/registration/ExtensionProcessor.php
3 files changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Tim Starling: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index de356ad..bcf7e14 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -3720,8 +3720,8 @@
  * Additional namespaces. If the namespaces defined in Language.php and
  * Namespace.php are insufficient, you can create new ones here, for example,
  * to import Help files in other languages. You can also override the namespace
- * names of existing namespaces. Extensions developers should use
- * $wgCanonicalNamespaceNames.
+ * names of existing namespaces. Extensions should use the CanonicalNamespaces
+ * hook or extension.json.
  *
  * @warning Once you delete a namespace, the pages in that namespace will
  * no longer be accessible. If you rename it, then you can access them through
diff --git a/includes/MWNamespace.php b/includes/MWNamespace.php
index 731b62e..8ca205a 100644
--- a/includes/MWNamespace.php
+++ b/includes/MWNamespace.php
@@ -210,6 +210,8 @@
if ( $namespaces === null || $rebuild ) {
global $wgExtraNamespaces, $wgCanonicalNamespaceNames;
$namespaces = array( NS_MAIN => '' ) + 
$wgCanonicalNamespaceNames;
+   // Add extension namespaces
+   $namespaces += 
ExtensionRegistry::getInstance()->getAttribute( 'ExtensionNamespaces' );
if ( is_array( $wgExtraNamespaces ) ) {
$namespaces += $wgExtraNamespaces;
}
diff --git a/includes/registration/ExtensionProcessor.php 
b/includes/registration/ExtensionProcessor.php
index 68e5a17..2c792da 100644
--- a/includes/registration/ExtensionProcessor.php
+++ b/includes/registration/ExtensionProcessor.php
@@ -213,7 +213,7 @@
foreach ( $info['namespaces'] as $ns ) {
$id = $ns['id'];
$this->defines[$ns['constant']] = $id;
-   $this->globals['wgExtraNamespaces'][$id] = 
$ns['name'];
+   $this->attributes['ExtensionNamespaces'][$id] = 
$ns['name'];
if ( isset( $ns['gender'] ) ) {

$this->globals['wgExtraGenderNamespaces'][$id] = $ns['gender'];
}

-- 
To view, visit https://gerrit.wikimedia.org/r/234146
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5bd9a7258f59d8c4a7ad0543d2115960fbea9b3a
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: Tim Starling 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits