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

Change subject: Update to extension.json
......................................................................

Update to extension.json

* Add conventional GPL header
* Remove block comment that is duplicated in README.
* Use MediaWiki\Extensions… namespace

Change-Id: Ied913791c53da80841e50df670bd6c93184772bd
---
A extension.json
R src/Hook.php
2 files changed, 58 insertions(+), 56 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lockdown 
refs/changes/25/398525/1

diff --git a/extension.json b/extension.json
new file mode 100644
index 0000000..6fa24f1
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,36 @@
+{
+       "name": "Lockdown",
+       "author": [
+               "Daniel Kinzler",
+               "Platonides",
+               "Mark A. Hershberger",
+               "..."
+       ],
+       "url": "https://mediawiki.org/wiki/Extension:Lockdown";,
+       "descriptionmsg": "lockdown-desc",
+       "license-name": "GPL-2.0+",
+       "type": "other",
+       "MessagesDirs": {
+               "Lockdown": [
+                       "i18n"
+               ]
+       },
+       "Hooks": {
+               "getUserPermissionsErrors": 
"MediaWiki\\Extensions\\Lockdown\\Hook::onGetUserPermissionsErrors",
+               "MediaWikiPerformAction": 
"MediaWiki\\Extensions\\Lockdown\\Hook::onMediawikiPerformAction",
+               "SearchableNamespaces": 
"MediaWiki\\Extensions\\Lockdown\\Hook::onSearchableNamespaces",
+               "SearchGetNearMatchComplete": 
"MediaWiki\\Extensions\\Lockdown\\Hook::onSearchGetNearMatchComplete"
+       },
+       "config": {
+               "NamespacePermissionLockdown": {
+                       "value": []
+               },
+               "SpecialPageLockdown": {
+                       "value": []
+               },
+               "ActionLockdown": {
+                       "value": []
+               }
+       },
+       "manifest_version": 2
+}
diff --git a/Lockdown.php b/src/Hook.php
similarity index 74%
rename from Lockdown.php
rename to src/Hook.php
index 1db1a2a..397f3d3 100644
--- a/Lockdown.php
+++ b/src/Hook.php
@@ -1,72 +1,38 @@
 <?php
-
 /**
  * Lockdown extension - implements restrictions on individual
  * namespaces and special pages.
  *
+ * Copyright (C) 2007, 2012, 2016  Daniel Kinzler
+ * Copyright (C) 2017  NicheWork, LLC
+ *
+ * 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.
+ *
  * @file
  * @ingroup Extensions
  * @author Daniel Kinzler, brightbyte.de
- * @author Mark A. Hershberger, NicheWork, LLC
- * @copyright © 2007, 2016 Daniel Kinzler
- * @copyright © 2017 Mark A. Hershberger
+ * @author Mark A. Hershberger <[email protected]>
  * @license GNU General Public Licence 2.0 or later
  */
+namespace MediaWiki\Extensions\Lockdown;
 
 /**
- * WARNING: you can use this extension to deny read access to some
- * namespaces. Keep in mind that this may be circumvented in several
- * ways. This extension doesn't try to plug such holes. Also note that
- * pages that are not readable will still be shown in listings, such as
- * the search page, categories, etc.
- *
- * Known ways to access "hidden" pages:
- * - transcluding as template. can be avoided using $wgNonincludableNamespaces.
- *
- * - Some search messages may reveal the page existance by producing
- *   links to it (MediaWiki:searchsubtitle, MediaWiki:noexactmatch,
- *   MediaWiki:searchmenu-exists, MediaWiki:searchmenu-new...).
- *
- * - supplying oldid=<revisionfromhiddenpage> may work in some
- *   versions of mediawiki. Same with diff, etc.
- *
- * NOTE: you cannot GRANT access to things forbidden by
- * $wgGroupPermissions. You can only DENY access granted there.
+ * Holds the hooks for the Lockdown extension.
  */
-
-if ( !defined( 'MEDIAWIKI' ) ) {
-       echo( "This file is an extension to the MediaWiki software and cannot "
-                 . "be used standalone.\n" );
-       die( 1 );
-}
-
-$wgExtensionCredits['other'][] = [
-       'path' => __FILE__,
-       'name' => 'Lockdown',
-       'author' => [
-               'Daniel Kinzler',
-               'Mark A. Hershberger',
-               'Platonides',
-               '...'
-       ],
-       'url' => 'https://mediawiki.org/wiki/Extension:Lockdown',
-       'descriptionmsg' => 'lockdown-desc',
-       'license-name' => 'GPL-2.0+'
-];
-
-$wgMessagesDirs['Lockdown'] = __DIR__ . '/i18n';
-
-$wgNamespacePermissionLockdown = [];
-$wgSpecialPageLockdown = [];
-$wgActionLockdown = [];
-
-$wgHooks['getUserPermissionsErrors'][] = 
'Lockdown::onGetUserPermissionsErrors';
-$wgHooks['MediaWikiPerformAction'][] = 'Lockdown::onMediawikiPerformAction';
-$wgHooks['SearchableNamespaces'][] = 'Lockdown::onSearchableNamespaces';
-$wgHooks['SearchGetNearMatchComplete'][]
-       = 'Lockdown::onSearchGetNearMatchComplete';
-
-class Lockdown {
+class Hook {
 
        /**
         * Fetch an appropriate permission error (or none!)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied913791c53da80841e50df670bd6c93184772bd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lockdown
Gerrit-Branch: master
Gerrit-Owner: MarkAHershberger <[email protected]>

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

Reply via email to