Page MenuHomePhabricator

Echo has multiple namespaces
Closed, ResolvedPublic

Description

	"AutoloadNamespaces": {
		"EchoOOUI\\": "includes/ooui/",
		"EchoPush\\": "includes/Push/",
		"EchoPush\\Api\\": "includes/api/Push/"
	},

As per https://www.mediawiki.org/wiki/Best_practices_for_extensions

SHOULD: Classes in MediaWiki\Extension\<ExtensionName> namespace. MediaWiki\<ExtensionName> is permissible if the extension name is a sufficiently unique word and not something generic (e.g. not a verb or noun).

I don't think Echo is necessarily something sufficiently unique... But having EchoOOUI and EchoPush doesn't seem right.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 778368 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/Echo@master] Move EchoOOUI namespace to MediaWiki\Extension\Notifications\Echo\OOUI

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

Change 778369 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/Echo@master] Move EchoPush namespace to MediaWiki\Extension\Notifications\Push

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

Change 778370 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/Echo@master] Move EchoPush\Api namespace to MediaWiki\Extension\Notifications\Push\Api

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

Nit: seems like a bad idea to have the extension name and the extension root namespace name be different.

Nit: seems like a bad idea to have the extension name and the extension root namespace name be different.

+1 I'd prefer MediaWiki\Extension\Echo.

We're in a weird situation with Echo and Flow...

https://www.mediawiki.org/wiki/Notifications

Notifications (formerly known as Echo) is an...

vs https://www.mediawiki.org/wiki/Extension:Echo

The Echo extension provides an in-wiki notification system...

And we never seem to fully manage to rename anything.

Flow started using MediaWiki\Extension\StructuredDiscussions\ (rather than just Flow\) since rEFLW25f2ee09ad35: Generate AbuseFilter variables for edits in recent_changes.

I'm happy to update the patches to use MediaWiki\Extension\Echo. We should probably similarly "cleanup" Flow too though.

Oh yeah, that reminds me.. We can't use Echo.

12:50:10 Parse error: ./tests/phpunit/EchoHooksTest.php:3
12:50:10     1| <?php
12:50:10     2| 
12:50:10   > 3| use MediaWiki\Extension\Echo\Hooks as EchoHooks;
12:50:10     4| 
12:50:10     5| class EchoHooksTest extends MediaWikiIntegrationTestCase {
12:50:10 Unexpected 'Echo' (T_ECHO), expecting identifier (T_STRING) or '{' in ./tests/phpunit/EchoHooksTest.php on line 3
12:50:10 ------------------------------------------------------------
12:50:10 Parse error: ./includes/special/SpecialDisplayNotificationsConfiguration.php:3
12:50:10     1| <?php
12:50:10     2| 
12:50:10   > 3| use MediaWiki\Extension\Echo\Hooks as EchoHooks;
12:50:10     4| use MediaWiki\User\UserOptionsManager;
12:50:10     5| 
12:50:10 Unexpected 'Echo' (T_ECHO), expecting identifier (T_STRING) or '{' in ./includes/special/SpecialDisplayNotificationsConfiguration.php on line 3

IIRC, this isn't an issue when we bump to PHP 8.0 or so.

Change 778368 merged by jenkins-bot:

[mediawiki/extensions/Echo@master] Move EchoOOUI namespace to MediaWiki\Extension\Notifications\OOUI

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

Change 778369 merged by jenkins-bot:

[mediawiki/extensions/Echo@master] Move EchoPush namespace to MediaWiki\Extension\Notifications\Push

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

Change 778370 merged by jenkins-bot:

[mediawiki/extensions/Echo@master] Move EchoPush\Api namespace to MediaWiki\Extension\Notifications\Push\Api

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

Tgr claimed this task.

Thanks for fixing!