Topic on Extension talk:HeadScript

Maintenance of this extension

6
Seb35 (talkcontribs)

Given the number of comments on this talk page and on WikiApiary, it seems this extension is quite useful, the problem is that it is not really maintained and there will be probably more bugs over the years.

I’m wondering if it worth to put it in the common Wikimedia platform (Git+Gerrit+Phabricator), where maintenance will be easier. I will wait still a bit if the original author answers, else I will perhaps do the transfer. Any thought?

80.110.121.222 (talkcontribs)

I think it's a good idea!

Kghbln (talkcontribs)

I just changed the status to unmaintained. I guess it is time to transfer since the original author has not replied yet.

Cory (talkcontribs)

I make a pache of it with MediaWiki 1.34.1 and PHP 7.4.6 on FreeBSD.

Have fun!

--- HeadScript.php.org  2015-08-06 22:13:56.000000000 +0900
+++ HeadScript.php      2020-06-07 04:13:36.000000000 +0900
@@ -1,28 +1,31 @@
 <?php

-$wgExtensionCredits[$type][] = array(
+if( !defined( 'MEDIAWIKI' ) ) {
+       echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" );
+       die( 1 );
+}
+
+$wgExtensionCredits['parserhook'][] = array(
        'path' => __FILE__,
        'name' => "HeadScript",
        'description' => "Allows Scripts to be added just before </head> to the wiki as configured in the LocalSettings.php file.",
 //     'descriptionmsg' => "",
-       'version' => 1.0,
+       'version' => '1.0.1',
        'author' => "JinRyuu",
        'url' => "http://www.mediawiki.org/wiki/Extension:HeadScript",
+       'license-name'   => 'MIT'
 );


-//Explicitly defining global variables
-
-$wgHeadScriptCode = '<!-- No Head Script -->';
-$wgHeadScriptName = '<!-- No Script Name -->';
-
 //Code for adding the head script to the wiki
-
 $wgHooks['BeforePageDisplay'][] = 'HeadScript';
+
 function HeadScript( OutputPage &$out, Skin &$skin ) {
-       global $wgHeadScriptCode, $wgHeadScriptName;
-
-       $out->addHeadItem($wgHeadScriptName, $wgHeadScriptCode );
+       global $wgHeadScriptCode;
+
+       if( !empty( $wgHeadScriptCode ) ) {
+               $out->addHeadItem('HeadScript', $wgHeadScriptCode );
+       }

        return TRUE;
 }
SamiWey (talkcontribs)

Muchas gracias puedo tener tu correo electronico?


StarHeartHunt (talkcontribs)

Since there are lots of work should be done to adapt new version of MediaWiki, I think it is necessary to do the transfer now.

Reply to "Maintenance of this extension"