Florianschmidtwelzow has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401197 )

Change subject: Use PSR-4 autoloader of extension registration for class loading
......................................................................

Use PSR-4 autoloader of extension registration for class loading

This became available in MediaWiki 1.31 and removes the requirement of
maintaining a class names to file map in extension.json, as long as the
classes are placed according to their name and namespace.

Change-Id: I1a50eb8e24e7253ad31b7e0962186707431ddf6e
---
M extension.json
R includes/AllowedDomains/AllowedDomainsStore.php
R includes/AllowedDomains/ArrayAllowedDomainsStore.php
R includes/AllowedDomains/CachedAllowedDomainsStore.php
R includes/AllowedDomains/DBAllowedDomainsStore.php
R includes/AllowedDomains/EmailDomain.php
R includes/AllowedDomains/MutableAllowedDomainsStore.php
R includes/Api/ApiGoogleLoginInfo.php
R includes/Api/ApiGoogleLoginManageAllowedDomains.php
R includes/Auth/GoogleAuthenticationRequest.php
R includes/Auth/GooglePrimaryAuthenticationProvider.php
R includes/Auth/GoogleRemoveAuthenticationRequest.php
R includes/Auth/GoogleServerAuthenticationRequest.php
R includes/Auth/GoogleUserInfoAuthenticationRequest.php
M includes/Constants.php
M includes/EchoGoogleLoginPresentationModel.php
R includes/GoogleLogin.php
R includes/GoogleLoginHooks.php
R includes/HtmlForm/HTMLGoogleLoginButtonField.php
R includes/Specials/SpecialGoogleLogin.php
R includes/Specials/SpecialGoogleLoginAllowedDomains.php
R includes/Specials/SpecialGoogleLoginReturn.php
R includes/Specials/SpecialManageGoogleLogin.php
23 files changed, 13 insertions(+), 34 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GoogleLogin 
refs/changes/97/401197/1

diff --git a/extension.json b/extension.json
index f23cbdd..c1a6ddb 100644
--- a/extension.json
+++ b/extension.json
@@ -12,7 +12,7 @@
                }
        },
        "requires": {
-               "MediaWiki": ">= 1.28.0"
+               "MediaWiki": ">= 1.31.0"
        },
        "AvailableRights": [
                "managegooglelogin",
@@ -32,7 +32,7 @@
                "echo-subscriptions-email-change-googlelogin": true
        },
        "APIModules": {
-               "googleplusprofileinfo": "ApiGoogleLoginInfo",
+               "googleplusprofileinfo": "GoogleLogin\\Api\\ApiGoogleLoginInfo",
                "googleloginmanagealloweddomain": 
"GoogleLogin\\Api\\ApiGoogleLoginManageAllowedDomains"
        },
        "MessagesDirs": {
@@ -43,30 +43,8 @@
        "ExtensionMessagesFiles": {
                "GoogleLoginAlias": "GoogleLogin.alias.php"
        },
-       "AutoloadClasses": {
-               "GoogleLogin\\GoogleLogin": "includes/GoogleLogin.body.php",
-               "GoogleLogin\\EchoGoogleLoginPresentationModel": 
"includes/EchoGoogleLoginPresentationModel.php",
-               "GoogleLogin\\HTMLGoogleLoginButtonField": 
"includes/htmlform/HTMLGoogleLoginButtonField.php",
-               "GoogleLogin\\Specials\\SpecialGoogleLogin": 
"includes/specials/SpecialGoogleLogin.php",
-               "GoogleLogin\\Specials\\SpecialGoogleLoginReturn": 
"includes/specials/SpecialGoogleLoginReturn.php",
-               "GoogleLogin\\Specials\\SpecialManageGoogleLogin": 
"includes/specials/SpecialManageGoogleLogin.php",
-               "GoogleLogin\\Specials\\SpecialGoogleLoginAllowedDomains": 
"includes/specials/SpecialGoogleLoginAllowedDomains.php",
-               "GoogleLogin\\GoogleLoginHooks": 
"includes/GoogleLogin.hooks.php",
-               "GoogleLogin\\GoogleUser": "includes/GoogleUser.php",
-               "GoogleLogin\\Constants": "includes/Constants.php",
-               "GoogleLogin\\Auth\\GooglePrimaryAuthenticationProvider": 
"includes/auth/GooglePrimaryAuthenticationProvider.php",
-               "GoogleLogin\\Auth\\GoogleServerAuthenticationRequest": 
"includes/auth/GoogleServerAuthenticationRequest.php",
-               "GoogleLogin\\Auth\\GoogleAuthenticationRequest": 
"includes/auth/GoogleAuthenticationRequest.php",
-               "GoogleLogin\\Auth\\GoogleRemoveAuthenticationRequest": 
"includes/auth/GoogleRemoveAuthenticationRequest.php",
-               "GoogleLogin\\Auth\\GoogleUserInfoAuthenticationRequest": 
"includes/auth/GoogleUserInfoAuthenticationRequest.php",
-               "GoogleLogin\\AllowedDomains\\AllowedDomainsStore": 
"includes/alloweddomains/AllowedDomainsStore.php",
-               "GoogleLogin\\AllowedDomains\\MutableAllowedDomainsStore": 
"includes/alloweddomains/MutableAllowedDomainsStore.php",
-               "GoogleLogin\\AllowedDomains\\ArrayAllowedDomainsStore": 
"includes/alloweddomains/ArrayAllowedDomainsStore.php",
-               "GoogleLogin\\AllowedDomains\\DBAllowedDomainsStore": 
"includes/alloweddomains/DBAllowedDomainsStore.php",
-               "GoogleLogin\\AllowedDomains\\CachedAllowedDomainsStore": 
"includes/alloweddomains/CachedAllowedDomainsStore.php",
-               "GoogleLogin\\AllowedDomains\\EmailDomain": 
"includes/alloweddomains/EmailDomain.php",
-               "GoogleLogin\\Api\\ApiGoogleLoginManageAllowedDomains": 
"includes/api/ApiGoogleLoginManageAllowedDomains.php",
-               "ApiGoogleLoginInfo": "includes/api/ApiGoogleLoginInfo.php"
+       "AutoloadNamespaces": {
+               "GoogleLogin\\": "includes/"
        },
        "AuthManagerAutoConfig": {
                "primaryauth": {
diff --git a/includes/alloweddomains/AllowedDomainsStore.php 
b/includes/AllowedDomains/AllowedDomainsStore.php
similarity index 100%
rename from includes/alloweddomains/AllowedDomainsStore.php
rename to includes/AllowedDomains/AllowedDomainsStore.php
diff --git a/includes/alloweddomains/ArrayAllowedDomainsStore.php 
b/includes/AllowedDomains/ArrayAllowedDomainsStore.php
similarity index 100%
rename from includes/alloweddomains/ArrayAllowedDomainsStore.php
rename to includes/AllowedDomains/ArrayAllowedDomainsStore.php
diff --git a/includes/alloweddomains/CachedAllowedDomainsStore.php 
b/includes/AllowedDomains/CachedAllowedDomainsStore.php
similarity index 100%
rename from includes/alloweddomains/CachedAllowedDomainsStore.php
rename to includes/AllowedDomains/CachedAllowedDomainsStore.php
diff --git a/includes/alloweddomains/DBAllowedDomainsStore.php 
b/includes/AllowedDomains/DBAllowedDomainsStore.php
similarity index 100%
rename from includes/alloweddomains/DBAllowedDomainsStore.php
rename to includes/AllowedDomains/DBAllowedDomainsStore.php
diff --git a/includes/alloweddomains/EmailDomain.php 
b/includes/AllowedDomains/EmailDomain.php
similarity index 100%
rename from includes/alloweddomains/EmailDomain.php
rename to includes/AllowedDomains/EmailDomain.php
diff --git a/includes/alloweddomains/MutableAllowedDomainsStore.php 
b/includes/AllowedDomains/MutableAllowedDomainsStore.php
similarity index 100%
rename from includes/alloweddomains/MutableAllowedDomainsStore.php
rename to includes/AllowedDomains/MutableAllowedDomainsStore.php
diff --git a/includes/api/ApiGoogleLoginInfo.php 
b/includes/Api/ApiGoogleLoginInfo.php
similarity index 95%
rename from includes/api/ApiGoogleLoginInfo.php
rename to includes/Api/ApiGoogleLoginInfo.php
index 3c984fc..5011e20 100644
--- a/includes/api/ApiGoogleLoginInfo.php
+++ b/includes/Api/ApiGoogleLoginInfo.php
@@ -1,9 +1,13 @@
 <?php
+
+namespace GoogleLogin\Api;
+
+use ApiBase;
+
 class ApiGoogleLoginInfo extends ApiBase {
        public function execute() {
                $apiResult = $this->getResult();
                $params = $this->extractRequestParams();
-               $glConfig = ConfigFactory::getDefaultInstance()->makeConfig( 
'googlelogin' );
                $user = $this->getUser();
 
                if ( !isset( $params['googleid'] ) ) {
diff --git a/includes/api/ApiGoogleLoginManageAllowedDomains.php 
b/includes/Api/ApiGoogleLoginManageAllowedDomains.php
similarity index 100%
rename from includes/api/ApiGoogleLoginManageAllowedDomains.php
rename to includes/Api/ApiGoogleLoginManageAllowedDomains.php
diff --git a/includes/auth/GoogleAuthenticationRequest.php 
b/includes/Auth/GoogleAuthenticationRequest.php
similarity index 100%
rename from includes/auth/GoogleAuthenticationRequest.php
rename to includes/Auth/GoogleAuthenticationRequest.php
diff --git a/includes/auth/GooglePrimaryAuthenticationProvider.php 
b/includes/Auth/GooglePrimaryAuthenticationProvider.php
similarity index 100%
rename from includes/auth/GooglePrimaryAuthenticationProvider.php
rename to includes/Auth/GooglePrimaryAuthenticationProvider.php
diff --git a/includes/auth/GoogleRemoveAuthenticationRequest.php 
b/includes/Auth/GoogleRemoveAuthenticationRequest.php
similarity index 100%
rename from includes/auth/GoogleRemoveAuthenticationRequest.php
rename to includes/Auth/GoogleRemoveAuthenticationRequest.php
diff --git a/includes/auth/GoogleServerAuthenticationRequest.php 
b/includes/Auth/GoogleServerAuthenticationRequest.php
similarity index 100%
rename from includes/auth/GoogleServerAuthenticationRequest.php
rename to includes/Auth/GoogleServerAuthenticationRequest.php
diff --git a/includes/auth/GoogleUserInfoAuthenticationRequest.php 
b/includes/Auth/GoogleUserInfoAuthenticationRequest.php
similarity index 100%
rename from includes/auth/GoogleUserInfoAuthenticationRequest.php
rename to includes/Auth/GoogleUserInfoAuthenticationRequest.php
diff --git a/includes/Constants.php b/includes/Constants.php
index 710b7e8..1cdbb98 100644
--- a/includes/Constants.php
+++ b/includes/Constants.php
@@ -1,10 +1,4 @@
 <?php
-/**
- * Created by PhpStorm.
- * User: florian
- * Date: 09.06.17
- * Time: 19:40
- */
 
 namespace GoogleLogin;
 
diff --git a/includes/EchoGoogleLoginPresentationModel.php 
b/includes/EchoGoogleLoginPresentationModel.php
index fdb87f4..1af27e5 100644
--- a/includes/EchoGoogleLoginPresentationModel.php
+++ b/includes/EchoGoogleLoginPresentationModel.php
@@ -1,4 +1,5 @@
 <?php
+
 namespace GoogleLogin;
 
 class EchoGoogleLoginPresentationModel extends \EchoEventPresentationModel {
diff --git a/includes/GoogleLogin.body.php b/includes/GoogleLogin.php
similarity index 100%
rename from includes/GoogleLogin.body.php
rename to includes/GoogleLogin.php
diff --git a/includes/GoogleLogin.hooks.php b/includes/GoogleLoginHooks.php
similarity index 98%
rename from includes/GoogleLogin.hooks.php
rename to includes/GoogleLoginHooks.php
index 1e34238..d9a3ac1 100644
--- a/includes/GoogleLogin.hooks.php
+++ b/includes/GoogleLoginHooks.php
@@ -3,6 +3,7 @@
 namespace GoogleLogin;
 
 use ConfigFactory;
+use GoogleLogin\HtmlForm\HTMLGoogleLoginButtonField;
 
 class GoogleLoginHooks {
        public static function onUserLogoutComplete() {
diff --git a/includes/htmlform/HTMLGoogleLoginButtonField.php 
b/includes/HtmlForm/HTMLGoogleLoginButtonField.php
similarity index 96%
rename from includes/htmlform/HTMLGoogleLoginButtonField.php
rename to includes/HtmlForm/HTMLGoogleLoginButtonField.php
index b5b346d..12eedd3 100644
--- a/includes/htmlform/HTMLGoogleLoginButtonField.php
+++ b/includes/HtmlForm/HTMLGoogleLoginButtonField.php
@@ -1,5 +1,6 @@
 <?php
-namespace GoogleLogin;
+
+namespace GoogleLogin\HtmlForm;
 
 /**
  * Same as HTMLSubmitField, the only difference is, that the style module to
diff --git a/includes/specials/SpecialGoogleLogin.php 
b/includes/Specials/SpecialGoogleLogin.php
similarity index 100%
rename from includes/specials/SpecialGoogleLogin.php
rename to includes/Specials/SpecialGoogleLogin.php
diff --git a/includes/specials/SpecialGoogleLoginAllowedDomains.php 
b/includes/Specials/SpecialGoogleLoginAllowedDomains.php
similarity index 100%
rename from includes/specials/SpecialGoogleLoginAllowedDomains.php
rename to includes/Specials/SpecialGoogleLoginAllowedDomains.php
diff --git a/includes/specials/SpecialGoogleLoginReturn.php 
b/includes/Specials/SpecialGoogleLoginReturn.php
similarity index 100%
rename from includes/specials/SpecialGoogleLoginReturn.php
rename to includes/Specials/SpecialGoogleLoginReturn.php
diff --git a/includes/specials/SpecialManageGoogleLogin.php 
b/includes/Specials/SpecialManageGoogleLogin.php
similarity index 100%
rename from includes/specials/SpecialManageGoogleLogin.php
rename to includes/Specials/SpecialManageGoogleLogin.php

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a50eb8e24e7253ad31b7e0962186707431ddf6e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GoogleLogin
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>

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

Reply via email to