jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/403914 )

Change subject: Using the extension registration
......................................................................


Using the extension registration

Bug: T184773
Change-Id: I2584f9fc81a570451295b1266dd796e9a358b3e2
---
M EtherpadLite.php
A README.md
A extension.json
3 files changed, 149 insertions(+), 108 deletions(-)

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



diff --git a/EtherpadLite.php b/EtherpadLite.php
index 1d19065..9405082 100644
--- a/EtherpadLite.php
+++ b/EtherpadLite.php
@@ -1,109 +1,14 @@
 <?php
-/**
- * EtherpadLite extension
- *
- * @file
- * @ingroup Extensions
- *
- * The extension adds a tag "eplite" to the MediaWiki parser and
- * provides a method to embed Etherpad Lite pads on MediaWiki pages.
- * An Etherpad Lite server is not part of the extension.
- *
- * Usage:
- *
- * <eplite id="padid" />
- * <eplite id="myPseudoSecretPadHash-7ujHvhq06g" />
- * <eplite id="padid" height="200px" width="600px" />
- * <eplite id="padid" src="http://www.another-pad-server.org/p/"; />
- *
- * Installation:
- *
- * Add the following lines in LocalSettings.php:
- *
- * require_once( "$IP/extensions/EtherpadLite/EtherpadLite.php" );
- * Etherpad Lite host server Url.
- * The shown one is a test server: it is not meant for production.
- * $wgEtherpadLiteDefaultPadUrl    = "http://beta.etherpad.org/p/";;
- * $wgEtherpadLiteDefaultWidth     = "600px";
- * $wgEtherpadLiteDefaultHeigth    = "400px";
- *
- * Prerequisite:
- *
- * You need at least one Etherpad Lite host server
- * The shown one is a test server: it is not meant for production.
- * $wgEtherpadLiteDefaultPadUrl = "http://beta.etherpad.org/p/";;
- *
- * For setting up your own Etherpad Lite server (based on node.js) see
- * Etherpad Lite homepage https://github.com/Pita/etherpad-lite
- *
- * This extension is based on:
- *
- * https://github.com/johnyma22/etherpad-lite-jquery-plugin
- * https://github.com/Pita/etherpad-lite/wiki/Embed-Parameters
- *
- * The present MediaWiki extension does not require jquery. It adds an iframe.
- *
- * @author Thomas Gries
- * @license GPL v2
- * @license MIT
- *
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- *
- */
-
-# Check environment
-if ( !defined( 'MEDIAWIKI' ) ) {
-       echo( "This is an extension to MediaWiki and cannot be run 
standalone.\n" );
-       die( - 1 );
-}
-
-# Credits
-$wgExtensionCredits['parserhook'][] = array(
-       'path' => __FILE__,
-       'name' => 'EtherpadLite',
-       'author' => array( 'Thomas Gries' ),
-       'version' => '1.14.0 20140331',
-       'url' => 'https://www.mediawiki.org/wiki/Extension:EtherpadLite',
-       'descriptionmsg' => 'etherpadlite-desc',
-);
-
-$dir = dirname( __FILE__ ) . '/';
-$wgMessagesDirs['EtherpadLite'] = __DIR__ . '/i18n';
-$wgAutoloadClasses['EtherpadLite'] = $dir . 'EtherpadLite_body.php';
-$wgHooks['ParserFirstCallInit'][] = 'EtherpadLite::EtherpadLiteParserInit';
-
-# for Special:TrackingCategories
-$wgTrackingCategories[] = 'etherpadlite-tracking-category';
-
-# Define a default Etherpad Lite server Url and base path
-# unless a different server is defined with the src= attribute
-$wgEtherpadLiteDefaultPadUrl    = "http://beta.etherpad.org/p/";;
-
-$wgEtherpadLiteDefaultWidth     = "300px";
-$wgEtherpadLiteDefaultHeight    = "200px";
-$wgEtherpadLiteMonospacedFont   = false;
-$wgEtherpadLiteShowControls     = true;
-$wgEtherpadLiteShowLineNumbers  = true;
-$wgEtherpadLiteShowChat         = true;
-$wgEtherpadLiteShowAuthorColors = true;
-
-# Whitelist of allowed Etherpad Lite server Urls
-#
-# If there are items in the array, and the user supplied URL is not in the 
array,
-# the url will not be allowed
-#
-# Urls are case-sensitively tested against values in the array.
-# They must exactly match including any trailing "/" character.
-#
-# Warning: Allowing all urls (not setting a whitelist)
-# may be a security concern.
-#
-# an empty or non-existent array means: no whitelist defined
-# this is the default: an empty whitelist. No servers are allowed by default.
-
-$wgEtherpadLiteUrlWhitelist = array();
-
-# include "*" if you expressly want to allow all urls (you should not do this)
-# $wgEtherpadLiteUrlWhitelist = array( "*" );
+if ( function_exists( 'wfLoadExtension' ) ) {
+       wfLoadExtension( 'EtherpadLite' );
+       // Keep i18n globals so mergeMessageFileList.php doesn't break
+       $wgMessagesDirs['EtherpadLite'] = __DIR__ . '/i18n';
+       wfWarn(
+               'Deprecated PHP entry point used for the EtherpadLite 
extension. ' .
+               'Please use wfLoadExtension instead, ' .
+               'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
+       );
+       return;
+} else {
+       die( 'This version of the EtherpadLite extension requires MediaWiki 
1.25+' );
+}
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..5576659
--- /dev/null
+++ b/README.md
@@ -0,0 +1,81 @@
+#EtherpadLite
+
+[View on mediawiki.org](https://www.mediawiki.org/wiki/Extension:EtherpadLite)
+
+The extension adds a tag "eplite" to the MediaWiki parser and
+provides a method to embed Etherpad Lite pads on MediaWiki pages.
+An Etherpad Lite server is not part of the extension.
+
+It's written by Thomas Gries and dual licensed under the
+[MIT](http://www.opensource.org/licenses/mit-license.php) and
+[GPL v2](http://www.gnu.org/licenses/gpl-2.0) license.
+
+## Prerequisite
+
+You need at least one Etherpad Lite host server
+The shown one is a test server: it is not meant for production.
+
+``$wgEtherpadLiteDefaultPadUrl = "http://beta.etherpad.org/p/";``
+
+For setting up your own Etherpad Lite server (based on node.js) see
+Etherpad Lite homepage:
+https://github.com/Pita/etherpad-lite
+
+This extension is based on:
+
+https://github.com/johnyma22/etherpad-lite-jquery-plugin
+
+https://github.com/Pita/etherpad-lite/wiki/Embed-Parameters
+
+The present MediaWiki extension does not require jquery. It adds an iframe.
+
+## Installation
+
+To install this extension to your Wikimedia instance append
+```php
+wfLoadExtensions( 'EtherpadLite' );
+
+// The shown one is a test server: it is not meant for production.
+$wgEtherpadLiteDefaultPadUrl    = "http://beta.etherpad.org/p/";;
+$wgEtherpadLiteDefaultWidth     = "600px";
+$wgEtherpadLiteDefaultHeigth    = "400px";
+```
+to your *LocalSettings.php* and check if everything works at
+the *Special:Version* page
+
+## Usage
+
+```html
+<eplite id="padid" />
+<eplite id="myPseudoSecretPadHash-7ujHvhq06g" />
+<eplite id="padid" height="200px" width="600px" />
+<eplite id="padid" src="http://www.another-pad-server.org/p/"; />
+```
+
+## Configuration
+
+**$wgEtherpadLiteDefaultPadUrl**
+
+Define a default Etherpad Lite server Url and base path
+
+**$wgEtherpadLiteUrlWhitelist**
+
+Whitelist of allowed Etherpad Lite server Urls
+
+If there are items in the array, and the user supplied URL is not in the array,
+the url will not be allowed.
+
+Urls are case-sensitively tested against values in the array.
+They must exactly match including any trailing "/" character.
+
+**Warning:** Allowing all urls (not setting a whitelist)
+may be a security concern.
+
+An empty or non-existent array means: no whitelist defined
+this is the default: an empty whitelist. No servers are allowed by default.
+
+``$wgEtherpadLiteUrlWhitelist = array();``
+
+Include "*" if you expressly want to allow all urls (you should not do this)!
+
+``$wgEtherpadLiteUrlWhitelist = array( "*" );``
\ No newline at end of file
diff --git a/extension.json b/extension.json
new file mode 100644
index 0000000..790fbf4
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,55 @@
+{
+       "name": "EtherpadLite",
+       "version": "1.14.0 20140331",
+       "author": [
+               "Thomas Gries"
+       ],
+       "url": "https://www.mediawiki.org/wiki/Extension:EtherpadLite";,
+       "descriptionmsg": "etherpadlite-desc",
+       "type": "parserhook",
+       "license-name": "MIT AND GPL-2.0-only",
+       "TrackingCategories": [
+               "etherpadlite-tracking-category"
+       ],
+       "MessagesDirs": {
+               "EtherpadLite": [
+                       "i18n"
+               ]
+       },
+       "AutoloadClasses": {
+               "EtherpadLite": "EtherpadLite_body.php"
+       },
+       "Hooks": {
+               "ParserFirstCallInit": "EtherpadLite::EtherpadLiteParserInit"
+       },
+       "config": {
+               "EtherpadLiteDefaultPadUrl": {
+                       "value": "http://beta.etherpad.org/p/";
+               },
+               "EtherpadLiteDefaultWidth": {
+                       "value": "300px"
+               },
+               "EtherpadLiteDefaultHeight": {
+                       "value": "200px"
+               },
+               "EtherpadLiteMonospacedFont": {
+                       "value": false
+               },
+               "EtherpadLiteShowControls": {
+                       "value": true
+               },
+               "EtherpadLiteShowLineNumbers": {
+                       "value": true
+               },
+               "EtherpadLiteShowChat": {
+                       "value": true
+               },
+               "EtherpadLiteShowAuthorColors": {
+                       "value": true
+               },
+               "EtherpadLiteUrlWhitelist": {
+                       "value": []
+               }
+       },
+       "manifest_version": 2
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2584f9fc81a570451295b1266dd796e9a358b3e2
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/EtherpadLite
Gerrit-Branch: master
Gerrit-Owner: LukBukkit <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: LukBukkit <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to