MaxSem has uploaded a new change for review.

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

Change subject: Revert "Convert to extension registration"
......................................................................

Revert "Convert to extension registration"

Broke prod.

This reverts commit 04642b4ef19432aada645af16f0503b1770cf54a.

Change-Id: I60de0b17f1dc00c4a5ae8d675c82ebde282b62a1
---
M Timeline.body.php
M Timeline.php
D TimelineSettings.php
D extension.json
4 files changed, 65 insertions(+), 88 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/timeline 
refs/changes/35/303935/1

diff --git a/Timeline.body.php b/Timeline.body.php
index 0c539a9..1491590 100644
--- a/Timeline.body.php
+++ b/Timeline.body.php
@@ -3,14 +3,6 @@
 
 class Timeline {
 
-       public static function registerExtension() {
-               global $wgTimelineSettings;
-               $wgTimelineSettings = new TimelineSettings;
-               $wgTimelineSettings->ploticusCommand = "/usr/bin/ploticus";
-               $wgTimelineSettings->perlCommand = "/usr/bin/perl";
-               $wgTimelineSettings->timelineFile = __DIR__ . 
"/EasyTimeline.pl";
-       }
-
        /**
         * @param $parser Parser
         * @return bool
diff --git a/Timeline.php b/Timeline.php
index bc0e649..303ca2d 100644
--- a/Timeline.php
+++ b/Timeline.php
@@ -1,16 +1,69 @@
 <?php
+/**
+ * EasyTimeline - Timeline extension
+ * To use, include this file from your LocalSettings.php
+ * To configure, set members of $wgTimelineSettings after the inclusion
+ *
+ * @file
+ * @ingroup Extensions
+ * @author Erik Zachte <x...@chello.nl (nospam: xxx=epzachte)>
+ * @license GNU General Public License version 2
+ * @link http://www.mediawiki.org/wiki/Extension:EasyTimeline Documentation
+ */
 
-if ( function_exists( 'wfLoadExtension' ) ) {
-       wfLoadExtension( 'Timeline' );
-       // Keep i18n globals so mergeMessageFileList.php doesn't break
-       $wgMessagesDirs['Timeline'] = __DIR__ . '/i18n';
-/*     wfWarn(
-               'Deprecated PHP entry point used for Timeline extension. Please 
use wfLoadExtension instead, ' .
-               'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
-       );
-*/
-       return;
-} else {
-       die( 'This version of the Timeline extension requires MediaWiki 1.28+' 
);
+$wgExtensionCredits['parserhook'][] = array(
+       'path' => __FILE__,
+       'name' => 'EasyTimeline',
+       'author' => 'Erik Zachte',
+       'url' => 'https://www.mediawiki.org/wiki/Extension:EasyTimeline',
+       'descriptionmsg' => 'timeline-desc',
+       'license-name' => 'GPL-2.0',
+);
+
+class TimelineSettings {
+       public $ploticusCommand, $perlCommand;
+
+       // Update this timestamp to force older rendered timelines
+       // to be generated when the page next gets rendered.
+       // Can help to resolve old image-generation bugs.
+       public $epochTimestamp = '20120101000000';
+
+       // Path to the EasyTimeline.pl perl file, which is used to actually 
generate the timelines.
+       public $timelineFile;
+
+       // Font name.
+       // Documentation on how Ploticus handles fonts is available at
+       // http://ploticus.sourceforge.net/doc/fonts.html section "What fonts 
are available?"
+       // and below. If using a TrueType font, the file with .ttf extension
+       // must be available in path specified by environment variable 
$GDFONTPATH;
+       // some other font types are available (see the docs linked above).
+       //
+       // Use the fontname 'ascii' to use the internal Ploticus font that does 
not require
+       // an external font file. Defaults to FreeSans for backwards 
compatibility.
+       //
+       // Note: according to Ploticus docs, font names with a space may be 
problematic.
+       public $fontFile = 'FreeSans';
+
+       // The name of the FileBackend to use for timeline (see $wgFileBackends)
+       public $fileBackend = '';
 }
+$wgTimelineSettings = new TimelineSettings;
+$wgTimelineSettings->ploticusCommand = "/usr/bin/ploticus";
+$wgTimelineSettings->perlCommand = "/usr/bin/perl";
+$wgTimelineSettings->timelineFile = __DIR__ . "/EasyTimeline.pl";
+
+$wgHooks['ParserFirstCallInit'][] = 'Timeline::onParserFirstCallInit';
+$wgMessagesDirs['Timeline'] = __DIR__ . '/i18n';
+$wgExtensionMessagesFiles['Timeline'] = __DIR__ . '/Timeline.i18n.php';
+$wgAutoloadClasses['Timeline'] = __DIR__ . '/Timeline.body.php';
+
+$wgResourceModules['ext.timeline.styles'] = array(
+       'localBasePath' => __DIR__,
+       'remoteExtPath' => 'timeline',
+       'styles' => array(
+               'resources/ext.timeline.styles/timeline.css',
+       ),
+       'position' => 'top',
+       'targets' => array( 'mobile', 'desktop' ),
+);
 
diff --git a/TimelineSettings.php b/TimelineSettings.php
deleted file mode 100644
index ce6d393..0000000
--- a/TimelineSettings.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-class TimelineSettings {
-       public $ploticusCommand, $perlCommand;
-       // Update this timestamp to force older rendered timelines
-       // to be generated when the page next gets rendered.
-       // Can help to resolve old image-generation bugs.
-       public $epochTimestamp = '20120101000000';
-       // Path to the EasyTimeline.pl perl file, which is used to actually 
generate the timelines.
-       public $timelineFile;
-       // Font name.
-       // Documentation on how Ploticus handles fonts is available at
-       // http://ploticus.sourceforge.net/doc/fonts.html section "What fonts 
are available?"
-       // and below. If using a TrueType font, the file with .ttf extension
-       // must be available in path specified by environment variable 
$GDFONTPATH;
-       // some other font types are available (see the docs linked above).
-       //
-       // Use the fontname 'ascii' to use the internal Ploticus font that does 
not require
-       // an external font file. Defaults to FreeSans for backwards 
compatibility.
-       //
-       // Note: according to Ploticus docs, font names with a space may be 
problematic.
-       public $fontFile = 'FreeSans';
-       // The name of the FileBackend to use for timeline (see $wgFileBackends)
-       public $fileBackend = '';
-}
diff --git a/extension.json b/extension.json
deleted file mode 100644
index 7021180..0000000
--- a/extension.json
+++ /dev/null
@@ -1,43 +0,0 @@
-{
-       "name": "EasyTimeline",
-       "author": "Erik Zachte",
-       "url": "https://www.mediawiki.org/wiki/Extension:EasyTimeline";,
-       "descriptionmsg": "timeline-desc",
-       "license-name": "GPL-2.0",
-       "type": "parserhook",
-       "callback": "Timeline::registerExtension",
-       "MessagesDirs": {
-               "Timeline": [
-                       "i18n"
-               ]
-       },
-       "AutoloadClasses": {
-               "Timeline": "Timeline.body.php",
-               "TimelineSettings": "TimelineSettings.php"
-       },
-       "ResourceModules": {
-               "ext.timeline.styles": {
-                       "styles": [
-                               "resources/ext.timeline.styles/timeline.css"
-                       ],
-                       "position": "top",
-                       "targets": [
-                               "mobile",
-                               "desktop"
-                       ]
-               }
-       },
-       "ResourceFileModulePaths": {
-               "localBasePath": "",
-               "remoteExtPath": "timeline"
-       },
-       "Hooks": {
-               "ParserFirstCallInit": "Timeline::onParserFirstCallInit"
-       },
-       "config": {
-               "TimelineSettings": {
-                       "value": null
-               }
-       },
-       "manifest_version": 2
-}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I60de0b17f1dc00c4a5ae8d675c82ebde282b62a1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/timeline
Gerrit-Branch: master
Gerrit-Owner: MaxSem <maxsem.w...@gmail.com>

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

Reply via email to