Yurik has uploaded a new change for review.

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

Change subject: Migrated from Gather.php to extension.json
......................................................................

Migrated from Gather.php to extension.json

Notes:
- for some reason the migration script created
  ResourceFileModulePaths: "remoteExtPath": "Gather/resources"
  instead of "Gather".

- migration script added section
   "config": { "ResourceModuleSkinStyles": ... }

- Added myself to the authors list

- request "Gather.php" still works, but will now produce
  a warning. Instead, use wfLoadExtension( 'Gather' )
  from the LocalSettings.php file.

- Deleted resources.php file, as it duplicates extension.json

Change-Id: Iadd4a976f2f34211d69ee2add036ede6e234f256
---
M Gather.php
M extension.json
D resources/Resources.php
3 files changed, 31 insertions(+), 284 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gather 
refs/changes/17/197417/1

diff --git a/Gather.php b/Gather.php
index 50556d2..57da6ee 100644
--- a/Gather.php
+++ b/Gather.php
@@ -7,6 +7,7 @@
  * @author Jon Robson
  * @author Joaquin Hernandez
  * @author Rob Moen
+ * @author Yuri Astrakhan
  * @licence GNU General Public Licence 2.0 or later
  */
 
@@ -16,73 +17,8 @@
        die( -1 );
 }
 
-// Extension credits that will show up on Special:Version
-$wgExtensionCredits['other'][] = array(
-       'path' => __FILE__,
-       'name' => 'Gather',
-       'author' => array( 'Jon Robson', 'Joaquin Hernandez', 'Rob Moen' ),
-       'descriptionmsg' => 'gather-desc',
-       'url' => 'https://www.mediawiki.org/wiki/Gather',
-       'license-name' => 'GPL-2.0+',
+wfLoadExtension( 'Gather' );
+wfWarn(
+       'Deprecated PHP entry point used for FooBar extension. Please use 
wfLoadExtension instead, ' .
+       'see https://www.mediawiki.org/wiki/Extension_registration for more 
details.'
 );
-
-$wgMessagesDirs['Gather'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['GatherAlias'] = __DIR__ . "/Gather.alias.php";
-
-// autoload extension classes
-$autoloadClasses = array(
-       'Gather\Hooks' => 'Gather.hooks',
-       'Gather\UpdaterHooks' => '../schema/Updater.hooks',
-
-       'Gather\models\CollectionItem' => 'models/CollectionItem',
-       'Gather\models\CollectionBase' => 'models/CollectionBase',
-       'Gather\models\CollectionInfo' => 'models/CollectionInfo',
-       'Gather\models\Collection' => 'models/Collection',
-       'Gather\models\CollectionsList' => 'models/CollectionsList',
-       'Gather\models\WithImage' => 'models/WithImage',
-       'Gather\models\ArraySerializable' => 'models/ArraySerializable',
-
-       'Gather\views\View' => 'views/View',
-       'Gather\views\NotFound' => 'views/NotFound',
-       'Gather\views\NoPublic' => 'views/NoPublic',
-       'Gather\views\Collection' => 'views/Collection',
-       'Gather\views\CollectionItemCard' => 'views/CollectionItemCard',
-       'Gather\views\Image' => 'views/Image',
-       'Gather\views\CollectionsList' => 'views/CollectionsList',
-       'Gather\views\CollectionsListItemCard' => 
'views/CollectionsListItemCard',
-
-       'Gather\views\helpers\CSS' => 'views/helpers/CSS',
-
-       'Gather\SpecialGather' => 'specials/SpecialGather',
-
-       'Gather\api\ApiEditList' => 'api/ApiEditList',
-       'Gather\api\ApiQueryLists' => 'api/ApiQueryLists',
-       'Gather\api\ApiQueryListPages' => 'api/ApiQueryListPages',
-
-);
-
-foreach ( $autoloadClasses as $className => $classFilename ) {
-       $wgAutoloadClasses[$className] = __DIR__ . 
"/includes/$classFilename.php";
-}
-
-
-$wgSpecialPages['Gather'] = 'Gather\SpecialGather';
-
-// Hooks
-$wgExtensionFunctions[] = 'Gather\Hooks::onExtensionSetup';
-$wgHooks['MobilePersonalTools'][] = 'Gather\Hooks::onMobilePersonalTools';
-$wgHooks['UnitTestsList'][] = 'Gather\Hooks::onUnitTestsList';
-$wgHooks['SkinMinervaDefaultModules'][] = 
'Gather\Hooks::onSkinMinervaDefaultModules';
-$wgHooks['MakeGlobalVariablesScript'][] = 
'Gather\Hooks::onMakeGlobalVariablesScript';
-$wgHooks['ResourceLoaderTestModules'][] = 
'Gather\Hooks::onResourceLoaderTestModules';
-
-// Maintenance Hooks
-$wgHooks['LoadExtensionSchemaUpdates'][] = 
'Gather\UpdaterHooks::onLoadExtensionSchemaUpdates';
-
-// Api
-$wgAPIModules['editlist'] = 'Gather\api\ApiEditList';
-$wgAPIListModules['lists'] = 'Gather\api\ApiQueryLists';
-$wgAPIListModules['listpages'] = 'Gather\api\ApiQueryListPages';
-
-// ResourceLoader modules
-require_once __DIR__ . "/resources/Resources.php";
diff --git a/extension.json b/extension.json
index 50534a5..14995ad 100644
--- a/extension.json
+++ b/extension.json
@@ -3,7 +3,8 @@
        "author": [
                "Jon Robson",
                "Joaquin Hernandez",
-               "Rob Moen"
+               "Rob Moen",
+               "Yuri Astrakhan"
        ],
        "url": "https://www.mediawiki.org/wiki/Gather";,
        "descriptionmsg": "gather-desc",
@@ -14,6 +15,13 @@
        ],
        "SpecialPages": {
                "Gather": "Gather\\SpecialGather"
+       },
+       "APIModules": {
+               "editlist": "Gather\\api\\ApiEditList"
+       },
+       "APIListModules": {
+               "lists": "Gather\\api\\ApiQueryLists",
+               "listpages": "Gather\\api\\ApiQueryListPages"
        },
        "MessagesDirs": {
                "Gather": [
@@ -46,13 +54,6 @@
                "Gather\\api\\ApiEditList": "includes/api/ApiEditList.php",
                "Gather\\api\\ApiQueryLists": "includes/api/ApiQueryLists.php",
                "Gather\\api\\ApiQueryListPages": 
"includes/api/ApiQueryListPages.php"
-       },
-       "APIModules": {
-               "editlist": "Gather\\api\\ApiEditList"
-       },
-       "APIListModules": {
-               "lists": "Gather\\api\\ApiQueryLists",
-               "listpages": "Gather\\api\\ApiQueryListPages"
        },
        "ResourceModules": {
                "ext.gather.icons": {
@@ -229,7 +230,7 @@
        },
        "ResourceFileModulePaths": {
                "localBasePath": "resources",
-               "remoteExtPath": "Gather"
+               "remoteExtPath": "Gather/resources"
        },
        "Hooks": {
                "MobilePersonalTools": [
@@ -250,5 +251,21 @@
                "LoadExtensionSchemaUpdates": [
                        "Gather\\UpdaterHooks::onLoadExtensionSchemaUpdates"
                ]
+       },
+       "config": {
+               "ResourceModuleSkinStyles": {
+                       "vector": {
+                               "localBasePath": "resources",
+                               "remoteExtPath": "Gather/resources",
+                               "targets": [
+                                       "mobile",
+                                       "desktop"
+                               ],
+                               "group": "other",
+                               "ext.gather.styles": [
+                                       "ext.gather.styles/vector.less"
+                               ]
+                       }
+               }
        }
 }
diff --git a/resources/Resources.php b/resources/Resources.php
deleted file mode 100644
index 39e661a..0000000
--- a/resources/Resources.php
+++ /dev/null
@@ -1,206 +0,0 @@
-<?php
-/**
- * Definition of Gather's ResourceLoader modules.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- */
-
-if ( !defined( 'MEDIAWIKI' ) ) {
-       die( 'Not an entry point.' );
-}
-
-/**
- * A boilerplate for RL modules that do not support templates
- * Agnostic to whether desktop or mobile specific.
- */
-$wgGatherResourceBoilerplate = array(
-       'localBasePath' => __DIR__,
-       'remoteExtPath' => 'Gather/resources',
-);
-
-/**
- * A mobile enabled ResourceLoaderFileModule template
- */
-$wgGatherResourceFileModuleBoilerplate = $wgGatherResourceBoilerplate + array(
-       'targets' => array( 'mobile', 'desktop' ),
-);
-
-/**
- * A ResourceLoaderFileModule template for special pages
- */
-$wgGatherMobileSpecialPageResourceBoilerplate = 
$wgGatherResourceFileModuleBoilerplate + array(
-       'group' => 'other',
-);
-
-$wgResourceModules += array(
-
-       'ext.gather.icons' => $wgGatherResourceFileModuleBoilerplate + array(
-               'class' => 'ResourceLoaderImageModule',
-               'prefix' => 'mw-ui',
-               'images' => array(
-                       // FIXME: ':before' suffix should be configurable in 
image module.
-                       'icon' => array(
-                               'collections-read-more:before' => 
'ext.gather.icons/next.svg',
-                               'collection-owner:before' => 
'ext.gather.icons/user.svg',
-                       ),
-               ),
-       ),
-
-       'ext.gather.styles' => $wgGatherMobileSpecialPageResourceBoilerplate + 
array(
-               'styles' => array(
-                       'ext.gather.styles/collections.less',
-               ),
-       ),
-
-       'ext.gather.watchstar.icons' => $wgGatherResourceFileModuleBoilerplate 
+ array(
-               'class' => 'ResourceLoaderImageModule',
-               'prefix' => 'mw-ui',
-               'images' => array(
-                       // FIXME: ':before' suffix should be configurable in 
image module.
-                       'icon' => array(
-                               'tick-disabled:before' => 
'ext.gather.watchstar.icons/grey_check.svg',
-                               'tick:before' => 
'ext.gather.watchstar.icons/green_check.svg',
-                       ),
-               ),
-       ),
-
-       'ext.gather.api' => $wgGatherResourceFileModuleBoilerplate + array(
-               'dependencies' => array(
-                       'mobile.watchstar',
-                       'mobile.editor.api',
-               ),
-               'scripts' => array(
-                       'ext.gather.watchstar/CollectionsApi.js',
-               ),
-       ),
-
-       'ext.gather.collection.base' => $wgGatherResourceFileModuleBoilerplate 
+ array(
-               'dependencies' => array(
-                       'mobile.contentOverlays',
-                       'mobile.toast',
-                       'ext.gather.api',
-                       'mediawiki.util'
-               ),
-               'scripts' => array(
-                       
'ext.gather.collection.base/CollectionsContentOverlayBase.js',
-               ),
-       ),
-
-       'ext.gather.watchstar' => $wgGatherResourceFileModuleBoilerplate + 
array(
-               'dependencies' => array(
-                       'mobile.watchstar',
-                       'ext.gather.api',
-                       'ext.gather.collection.base',
-                       'ext.gather.watchstar.icons',
-               ),
-               'styles' => array(
-                       'ext.gather.watchstar/contentOverlay.less',
-               ),
-               'messages' => array(
-                       'gather-add-to-existing',
-                       'gather-watchlist-title',
-                       'gather-add-toast',
-                       'gather-remove-toast',
-                       'gather-anon-cta',
-                       'gather-collection-member',
-                       'gather-create-new-button-label',
-                       'gather-add-to-new',
-                       'gather-collection-non-member',
-               ),
-               'templates' => array(
-                       'content.hogan' => 'ext.gather.watchstar/content.hogan',
-               ),
-               'scripts' => array(
-                       'ext.gather.watchstar/CollectionsContentOverlay.js',
-                       'ext.gather.watchstar/CollectionsWatchstar.js',
-                       'ext.gather.watchstar/init.js',
-               ),
-       ),
-
-       'ext.gather.collection.editor' => 
$wgGatherResourceFileModuleBoilerplate + array(
-               'dependencies' => array(
-                       'mobile.overlays',
-                       'mobile.toast',
-                       'ext.gather.api',
-               ),
-               'messages' => array(
-                       'gather-edit-collection-label-name',
-                       'gather-edit-collection-label-description',
-                       'gather-edit-collection-label-privacy',
-                       'gather-edit-collection-save-label',
-                       'gather-error-unknown-collection',
-               ),
-               'templates' => array(
-                       'content.hogan' => 
'ext.gather.collection.editor/content.hogan',
-               ),
-               'scripts' => array(
-                       'ext.gather.collection.editor/CollectionEditOverlay.js',
-               ),
-               'styles' => array(
-                       'ext.gather.collection.editor/editOverlay.less',
-               ),
-       ),
-
-       'ext.gather.collection.delete' => 
$wgGatherResourceFileModuleBoilerplate + array(
-               'dependencies' => array(
-                       'ext.gather.collection.base',
-                       'mobile.toast',
-                       'ext.gather.api',
-                       'mediawiki.util'
-               ),
-               'messages' => array(
-                       'gather-delete-collection-confirm',
-                       'gather-delete-collection-heading',
-                       'gather-delete-collection-delete-label',
-                       'gather-delete-collection-cancel-label',
-                       'gather-delete-collection-success',
-                       'gather-delete-collection-failed-error',
-                       'gather-error-unknown-collection',
-               ),
-               'templates' => array(
-                       'content.hogan' => 
'ext.gather.collection.delete/content.hogan',
-               ),
-               'scripts' => array(
-                       
'ext.gather.collection.delete/CollectionDeleteOverlay.js',
-               ),
-               'styles' => array(
-                       'ext.gather.collection.delete/deleteOverlay.less',
-               ),
-       ),
-
-       'ext.gather.special' => $wgGatherMobileSpecialPageResourceBoilerplate + 
array(
-               'dependencies' => array(
-                       'ext.gather.collection.editor',
-                       'ext.gather.collection.delete',
-               ),
-               'scripts' => array(
-                       'ext.gather.special/init.js',
-               ),
-       ),
-
-);
-
-$wgResourceModuleSkinStyles['vector'] = 
$wgGatherMobileSpecialPageResourceBoilerplate + array(
-       'ext.gather.styles' => array(
-               'ext.gather.styles/vector.less',
-       ),
-);
-
-unset( $wgGatherResourceFileModuleBoilerplate );
-unset( $wgGatherResourceBoilerplate );
-unset( $wgGatherMobileSpecialPageResourceBoilerplate );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iadd4a976f2f34211d69ee2add036ede6e234f256
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Yurik <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to