[MediaWiki-commits] [Gerrit] mediawiki...timeline[master]: Kill off TimelineSettings class
jenkins-bot has submitted this change and it was merged. Change subject: Kill off TimelineSettings class .. Kill off TimelineSettings class Change-Id: Ibe556adea897b7ef1c614bad7d02fafb0caba646 --- M Timeline.body.php D TimelineSettings.php M extension.json M install-ploticus.sh 4 files changed, 29 insertions(+), 39 deletions(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/Timeline.body.php b/Timeline.body.php index 0c539a9..0b811a8 100644 --- a/Timeline.body.php +++ b/Timeline.body.php @@ -31,7 +31,8 @@ */ public static function renderTimeline( $timelinesrc, array $args, $parser, $frame ) { global $wgUploadDirectory, $wgUploadPath, $wgArticlePath, $wgTmpDirectory, $wgRenderHashAppend; - global $wgTimelineSettings; + global $wgTimelineFileBackend, $wgTimelineEpochTimestamp, $wgTimelinePerlCommand, $wgTimelineFile; + global $wgtimelineFontFile; $parser->getOutput()->addModuleStyles( 'ext.timeline.styles' ); @@ -39,8 +40,8 @@ $svg2png = ( $method == 'svg2png' ); // Get the backend to store plot data and pngs - if ( $wgTimelineSettings->fileBackend != '' ) { - $backend = FileBackendGroup::singleton()->get( $wgTimelineSettings->fileBackend ); + if ( $wgTimelineFileBackend != '' ) { + $backend = FileBackendGroup::singleton()->get( $wgTimelineFileBackend ); } else { $backend = new FSFileBackend( [ @@ -67,7 +68,7 @@ $previouslyRendered = $backend->fileExists( [ 'src' => "{$fname}.png" ] ); if ( $previouslyRendered ) { $timestamp = $backend->getFileTimestamp( [ 'src' => "{$fname}.png" ] ); - $expired = ( $timestamp < $wgTimelineSettings->epochTimestamp ); + $expired = ( $timestamp < $wgTimelineEpochTimestamp ); } else { $expired = false; } @@ -91,16 +92,13 @@ // Get command for ploticus to read the user input and output an error, // map, and rendering (png or gif) file under the same dir as the temp file. - $cmdline = wfEscapeShellArg( - $wgTimelineSettings->perlCommand, - $wgTimelineSettings->timelineFile - ) + $cmdline = wfEscapeShellArg( $wgTimelinePerlCommand, $wgTimelineTimelineFile ) . ( $svg2png ? " -s " : "" ) . " -i " . wfEscapeShellArg( $tmpPath ) - . " -m -P " . wfEscapeShellArg( $wgTimelineSettings->ploticusCommand ) + . " -m -P " . wfEscapeShellArg( $wgTimelinePloticusCommand ) . " -T " . wfEscapeShellArg( $wgTmpDirectory ) . " -A " . wfEscapeShellArg( $wgArticlePath ) - . " -f " . wfEscapeShellArg( $wgTimelineSettings->fontFile ) + . " -f " . wfEscapeShellArg( $wgTimelineFontFile ) ; // Actually run the command... diff --git a/TimelineSettings.php b/TimelineSettings.php deleted file mode 100644 index ce6d393..000 --- a/TimelineSettings.php +++ /dev/null @@ -1,25 +0,0 @@ -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 index 7021180..f5049e8 100644 --- a/extension.json +++ b/extension.json @@ -5,15 +5,13 @@ "descriptionmsg": "timeline-desc", "license-name": "GPL-2.0", "type": "parserhook", - "callback": "Timeline::registerExtension", "MessagesDirs": { "Timeline": [ "i18n" ] },
[MediaWiki-commits] [Gerrit] mediawiki...timeline[master]: Kill off TimelineSettings class
Reedy has uploaded a new change for review. https://gerrit.wikimedia.org/r/303300 Change subject: Kill off TimelineSettings class .. Kill off TimelineSettings class Change-Id: Ibe556adea897b7ef1c614bad7d02fafb0caba646 --- M Timeline.body.php D TimelineSettings.php M extension.json M install-ploticus.sh 4 files changed, 29 insertions(+), 39 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/timeline refs/changes/00/303300/1 diff --git a/Timeline.body.php b/Timeline.body.php index 0c539a9..0b811a8 100644 --- a/Timeline.body.php +++ b/Timeline.body.php @@ -31,7 +31,8 @@ */ public static function renderTimeline( $timelinesrc, array $args, $parser, $frame ) { global $wgUploadDirectory, $wgUploadPath, $wgArticlePath, $wgTmpDirectory, $wgRenderHashAppend; - global $wgTimelineSettings; + global $wgTimelineFileBackend, $wgTimelineEpochTimestamp, $wgTimelinePerlCommand, $wgTimelineFile; + global $wgtimelineFontFile; $parser->getOutput()->addModuleStyles( 'ext.timeline.styles' ); @@ -39,8 +40,8 @@ $svg2png = ( $method == 'svg2png' ); // Get the backend to store plot data and pngs - if ( $wgTimelineSettings->fileBackend != '' ) { - $backend = FileBackendGroup::singleton()->get( $wgTimelineSettings->fileBackend ); + if ( $wgTimelineFileBackend != '' ) { + $backend = FileBackendGroup::singleton()->get( $wgTimelineFileBackend ); } else { $backend = new FSFileBackend( [ @@ -67,7 +68,7 @@ $previouslyRendered = $backend->fileExists( [ 'src' => "{$fname}.png" ] ); if ( $previouslyRendered ) { $timestamp = $backend->getFileTimestamp( [ 'src' => "{$fname}.png" ] ); - $expired = ( $timestamp < $wgTimelineSettings->epochTimestamp ); + $expired = ( $timestamp < $wgTimelineEpochTimestamp ); } else { $expired = false; } @@ -91,16 +92,13 @@ // Get command for ploticus to read the user input and output an error, // map, and rendering (png or gif) file under the same dir as the temp file. - $cmdline = wfEscapeShellArg( - $wgTimelineSettings->perlCommand, - $wgTimelineSettings->timelineFile - ) + $cmdline = wfEscapeShellArg( $wgTimelinePerlCommand, $wgTimelineTimelineFile ) . ( $svg2png ? " -s " : "" ) . " -i " . wfEscapeShellArg( $tmpPath ) - . " -m -P " . wfEscapeShellArg( $wgTimelineSettings->ploticusCommand ) + . " -m -P " . wfEscapeShellArg( $wgTimelinePloticusCommand ) . " -T " . wfEscapeShellArg( $wgTmpDirectory ) . " -A " . wfEscapeShellArg( $wgArticlePath ) - . " -f " . wfEscapeShellArg( $wgTimelineSettings->fontFile ) + . " -f " . wfEscapeShellArg( $wgTimelineFontFile ) ; // Actually run the command... diff --git a/TimelineSettings.php b/TimelineSettings.php deleted file mode 100644 index ce6d393..000 --- a/TimelineSettings.php +++ /dev/null @@ -1,25 +0,0 @@ -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 index 7021180..f5049e8 100644 --- a/extension.json +++ b/extension.json @@ -5,15 +5,13 @@ "descriptionmsg": "timeline-desc", "license-name": "GPL-2.0", "type": "parserhook", - "callback": "Timeline::registerExtension", "MessagesDirs": { "Timeline": [